From 867a28787e7e1faec33a23169d69f600579dd578 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Wed, 3 Aug 2016 20:11:30 -0400 Subject: [PATCH 001/513] Allow individually publishable API client libraries. --- packages/google-cloud-translate/package.json | 72 ++++ packages/google-cloud-translate/src/index.js | 360 ++++++++++++++++ .../system-test/translate.js | 110 +++++ packages/google-cloud-translate/test/index.js | 394 ++++++++++++++++++ 4 files changed, 936 insertions(+) create mode 100644 packages/google-cloud-translate/package.json create mode 100644 packages/google-cloud-translate/src/index.js create mode 100644 packages/google-cloud-translate/system-test/translate.js create mode 100644 packages/google-cloud-translate/test/index.js diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json new file mode 100644 index 00000000000..94886c35451 --- /dev/null +++ b/packages/google-cloud-translate/package.json @@ -0,0 +1,72 @@ +{ + "name": "@google-cloud/translate", + "version": "0.0.0", + "author": "Google Inc.", + "description": "Google Cloud Translate Client Library for Node.js", + "contributors": [ + { + "name": "Burcu Dogan", + "email": "jbd@google.com" + }, + { + "name": "Johan Euphrosine", + "email": "proppy@google.com" + }, + { + "name": "Patrick Costello", + "email": "pcostell@google.com" + }, + { + "name": "Ryan Seys", + "email": "ryan@ryanseys.com" + }, + { + "name": "Silvano Luciani", + "email": "silvano@google.com" + }, + { + "name": "Stephen Sawchuk", + "email": "sawchuk@gmail.com" + } + ], + "main": "./src/index.js", + "files": [ + "./src/*", + "AUTHORS", + "CONTRIBUTORS", + "COPYING" + ], + "repository": "googlecloudplatform/gcloud-node", + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google translate", + "translate" + ], + "dependencies": { + "arrify": "^1.0.0", + "extend": "^3.0.0", + "@google-cloud/common": "^0.1.0", + "is": "^3.0.1", + "propprop": "^0.3.0" + }, + "devDependencies": { + "mocha": "^2.1.0", + "proxyquire": "^1.7.10" + }, + "scripts": { + "publish": "../../scripts/publish", + "test": "mocha test/*.js", + "system-test": "mocha system-test/*.js --no-timeouts --bail" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=0.12.0" + } +} diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js new file mode 100644 index 00000000000..7b6acfff3fd --- /dev/null +++ b/packages/google-cloud-translate/src/index.js @@ -0,0 +1,360 @@ +/*! + * Copyright 2015 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*! + * @module translate + */ + +'use strict'; + +var arrify = require('arrify'); +var common = require('@google-cloud/common'); +var extend = require('extend'); +var is = require('is'); +var prop = require('propprop'); +var PKG = require('../package.json'); +var USER_AGENT = PKG.name + '/' + PKG.version; + +/** + * @type {module:common/util} + * @private + */ +var util = common.util; + +/** + * With [Google Translate](https://cloud.google.com/translate), you can + * dynamically translate text between thousands of language pairs. + * + * The Google Translate API lets websites and programs integrate with Google + * Translate programmatically. + * + * Google Translate API is available as a paid service. See the + * [Pricing](https://cloud.google.com/translate/v2/pricing.html) and + * [FAQ](https://cloud.google.com/translate/v2/faq.html) pages for details. + * + * **An API key is required for Translate.** See + * [Identifying your application to Google](https://cloud.google.com/translate/v2/using_rest#auth). + * + * @constructor + * @alias module:translate + * + * @classdesc + * The object returned from `gcloud.translate` lets you translate arbitrary + * string input into thousands of other languages. + * + * To learn more about the Translate API, see + * [Getting Started](https://cloud.google.com/translate/v2/getting_started). + * + * @resource [Getting Started]{@link https://cloud.google.com/translate/v2/getting_started} + * @resource [Identifying your application to Google]{@link https://cloud.google.com/translate/v2/using_rest#auth} + * + * @throws {Error} If an API key is not provided. + * + * @param {object} options - [Configuration object](#/docs). + * @param {string} options.key - An API key. + * + * @example + * var gcloud = require('google-cloud')({ + * keyFilename: '/path/to/keyfile.json', + * projectId: 'grape-spaceship-123' + * }); + * + * var translate = gcloud.translate({ + * key: 'API Key' + * }); + */ +function Translate(options) { + if (!(this instanceof Translate)) { + options = util.normalizeArguments(this, options, { + projectIdRequired: false + }); + return new Translate(options); + } + + if (!options.key) { + throw new Error('An API key is required to use the Translate API.'); + } + + this.options = options; + this.key = options.key; +} + +/** + * Detect the language used in a string or multiple strings. + * + * @resource [Detect Language]{@link https://cloud.google.com/translate/v2/using_rest#detect-language} + * + * @param {string|string[]} input - The source string input. + * @param {function} callback - The callback function. + * @param {?error} callback.err - An error returned while making this request. + * @param {object|object[]} callback.results - If a single string input was + * given, a single result object is given. Otherwise, it is an array of + * result objects. + * @param {string} callback.results[].language - The language code matched from + * the input. + * @param {number=} callback.results[].confidence - A float 0 - 1. The higher + * the number, the higher the confidence in language detection. Note, this + * is not always returned from the API. + * @param {string} callback.input - The original input that this was result was + * based on. + * @param {object} callback.apiResponse - Raw API response. + * + * @example + * //- + * // Detect the language from a single string input. + * //- + * translate.detect('Hello', function(err, results) { + * if (!err) { + * // results = { + * // language: 'en', + * // confidence: 1, + * // input: 'Hello' + * // } + * } + * }); + * + * //- + * // Detect the languages used in multiple strings. Note that the results are + * // now provied as an array. + * //- + * translate.detect([ + * 'Hello', + * 'Hola' + * ], function(err, results) { + * if (!err) { + * // results = [ + * // { + * // language: 'en', + * // confidence: 1, + * // input: 'Hello' + * // }, + * // { + * // language: 'es', + * // confidence: 1, + * // input: 'Hola' + * // } + * // ] + * } + * }); + */ +Translate.prototype.detect = function(input, callback) { + input = arrify(input); + + this.request({ + uri: '/detect', + useQuerystring: true, + qs: { + q: input + } + }, function(err, resp) { + if (err) { + callback(err, null, resp); + return; + } + + var results = resp.data.detections.map(function(detection, index) { + var result = extend({}, detection[0], { + input: input[index] + }); + + // Deprecated. + delete result.isReliable; + + return result; + }); + + if (input.length === 1) { + results = results[0]; + } + + callback(null, results, resp); + }); +}; + +/** + * Get an array of all supported languages. + * + * @resource [Discover Supported Languages]{@link https://cloud.google.com/translate/v2/using_rest#supported-languages} + * + * @param {function} callback - The callback function. + * @param {?error} callback.err - An error returned while making this request. + * @param {string[]} callback.languages - The supported ISO 639-1 language + * codes. + * @param {object} callback.apiResponse - Raw API response. + * + * @example + * translate.getLanguages(function(err, languages) { + * if (!err) { + * // languages = [ + * // 'af', + * // 'ar', + * // 'az', + * // ... + * // ] + * } + * }); + */ +Translate.prototype.getLanguages = function(callback) { + this.request({ + uri: '/languages' + }, function(err, resp) { + if (err) { + callback(err, null, resp); + return; + } + + var languages = resp.data.languages.map(prop('language')); + callback(null, languages, resp); + }); +}; + +/** + * Translate a string or multiple strings into another language. + * + * @resource [Translate Text](https://cloud.google.com/translate/v2/using_rest#Translate) + * + * @throws {Error} If `options` is provided as an object without a `to` + * property. + * + * @param {string|string[]} input - The source string input. + * @param {string|object=} options - If a string, it is interpreted as the + * target ISO 639-1 language code to translate the source input to. (e.g. + * `en` for English). If an object, you may also specify the source + * language. + * @param {string} options.from - The ISO 639-1 language code the source input + * is written in. + * @param {string} options.to - The ISO 639-1 language code to translate the + * input to. + * @param {function} callback - The callback function. + * @param {?error} callback.err - An error returned while making this request. + * @param {object|object[]} callback.translations - If a single string input was + * given, a single translation is given. Otherwise, it is an array of + * translations. + * @param {object} callback.apiResponse - Raw API response. + * + * @example + * //- + * // Pass a string and a language code to get the translation. + * //- + * translate.translate('Hello', 'es', function(err, translation) { + * if (!err) { + * // translation = 'Hola' + * } + * }); + * + * //- + * // The source language is auto-detected by default. To manually set it, + * // provide an object. + * //- + * var options = { + * from: 'en', + * to: 'es' + * }; + * + * translate.translate('Hello', options, function(err, translation) { + * if (!err) { + * // translation = 'Hola' + * } + * }); + * + * //- + * // Translate multiple strings of input. Note that the results are + * // now provied as an array. + * //- + * var input = [ + * 'Hello', + * 'How are you today?' + * ]; + * + * translate.translate(input, 'es', function(err, translations) { + * if (!err) { + * // translations = [ + * // 'Hola', + * // 'Como estas hoy?' + * // ] + * } + * }); + */ +Translate.prototype.translate = function(input, options, callback) { + var query = { + q: arrify(input) + }; + + if (is.string(options)) { + query.target = options; + } else { + if (options.from) { + query.source = options.from; + } + + if (options.to) { + query.target = options.to; + } + } + + if (!query.target) { + throw new Error('A target language is required to perform a translation.'); + } + + this.request({ + uri: '', + useQuerystring: true, + qs: query + }, function(err, resp) { + if (err) { + callback(err, null, resp); + return; + } + + var translations = resp.data.translations.map(prop('translatedText')); + + if (query.q.length === 1) { + translations = translations[0]; + } + + callback(err, translations, resp); + }); +}; + +/** + * A custom request implementation. Requests to this API use an API key for an + * application, not a bearer token from a service account. This means we skip + * the `makeAuthenticatedRequest` portion of the typical request lifecycle, and + * manually authenticate the request here. + * + * @private + * + * @param {object} reqOpts - Request options that are passed to `request`. + * @param {function} callback - The callback function passed to `request`. + */ +Translate.prototype.request = function(reqOpts, callback) { + var BASE_URL = 'https://www.googleapis.com/language/translate/v2'; + + reqOpts.uri = BASE_URL + reqOpts.uri; + + reqOpts = extend(true, {}, reqOpts, { + qs: { + key: this.key + }, + headers: { + 'User-Agent': USER_AGENT + } + }); + + util.makeRequest(reqOpts, this.options, callback); +}; + +module.exports = Translate; diff --git a/packages/google-cloud-translate/system-test/translate.js b/packages/google-cloud-translate/system-test/translate.js new file mode 100644 index 00000000000..7824f65a838 --- /dev/null +++ b/packages/google-cloud-translate/system-test/translate.js @@ -0,0 +1,110 @@ +/*! + * Copyright 2015 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +var assert = require('assert'); +var extend = require('extend'); +var prop = require('propprop'); + +var env = require('../../../system-test/env.js'); +var Translate = require('../').Translate; + +var API_KEY = process.env.GCLOUD_TESTS_API_KEY; + +// Only run the tests if there is an API key to test with. +(API_KEY ? describe : describe.skip)('translate', function() { + if (!API_KEY) { + // The test runner still executes this function, even if it is skipped. + return; + } + + var translate = new Translate(extend({}, env, { key: API_KEY })); + + describe('detecting language from input', function() { + var INPUT = [ + { + input: 'Hello', + expectedLanguage: 'en' + }, + { + input: 'Hola', + expectedLanguage: 'es' + } + ]; + + it('should detect a langauge', function(done) { + var input = INPUT.map(prop('input')); + + translate.detect(input, function(err, results) { + assert.ifError(err); + assert.strictEqual(results[0].language, INPUT[0].expectedLanguage); + assert.strictEqual(results[1].language, INPUT[1].expectedLanguage); + done(); + }); + }); + }); + + describe('translations', function() { + var INPUT = [ + { + input: 'Hello', + expectedTranslation: 'Hola' + }, + { + input: 'How are you today?', + expectedTranslation: 'Como estas hoy?' + } + ]; + + it('should translate input', function(done) { + var input = INPUT.map(prop('input')); + + translate.translate(input, 'es', function(err, results) { + assert.ifError(err); + assert.strictEqual(results[0], INPUT[0].expectedTranslation); + assert.strictEqual(results[1], INPUT[1].expectedTranslation); + done(); + }); + }); + + it('should translate input with from and to options', function(done) { + var input = INPUT.map(prop('input')); + + var opts = { + from: 'en', + to: 'es' + }; + + translate.translate(input, opts, function(err, results) { + assert.ifError(err); + assert.strictEqual(results[0], INPUT[0].expectedTranslation); + assert.strictEqual(results[1], INPUT[1].expectedTranslation); + done(); + }); + }); + }); + + describe('supported languages', function() { + it('should get a list of supported languages', function(done) { + translate.getLanguages(function(err, languages) { + assert.ifError(err); + assert(languages.length > 0); + done(); + }); + }); + }); +}); diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js new file mode 100644 index 00000000000..d7267f0857f --- /dev/null +++ b/packages/google-cloud-translate/test/index.js @@ -0,0 +1,394 @@ +/*! + * Copyright 2015 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +var assert = require('assert'); +var extend = require('extend'); +var prop = require('propprop'); +var proxyquire = require('proxyquire'); + +var util = require('@google-cloud/common').util; +var PKG = require('../package.json'); + +var makeRequestOverride; +var fakeUtil = extend({}, util, { + makeRequest: function() { + if (makeRequestOverride) { + return makeRequestOverride.apply(null, arguments); + } + + return util.makeRequest.apply(null, arguments); + } +}); + +describe('Translate', function() { + var API_KEY = 'api-key'; + + var Translate; + var translate; + + before(function() { + Translate = proxyquire('../', { + '@google-cloud/common': { + util: fakeUtil + } + }); + }); + + beforeEach(function() { + makeRequestOverride = null; + + translate = new Translate({ + key: API_KEY + }); + }); + + describe('instantiation', function() { + it('should normalize the arguments', function() { + var normalizeArguments = fakeUtil.normalizeArguments; + var normalizeArgumentsCalled = false; + var fakeOptions = { key: API_KEY }; + var fakeContext = {}; + + fakeUtil.normalizeArguments = function(context, options, cfg) { + normalizeArgumentsCalled = true; + assert.strictEqual(context, fakeContext); + assert.strictEqual(options, fakeOptions); + assert.strictEqual(cfg.projectIdRequired, false); + return options; + }; + + Translate.call(fakeContext, fakeOptions); + assert(normalizeArgumentsCalled); + + fakeUtil.normalizeArguments = normalizeArguments; + }); + + it('should throw if an API key is not provided', function() { + assert.throws(function() { + new Translate({}); + }, 'An API key is required to use the Translate API.'); + }); + + it('should localize the options', function() { + var options = { key: API_KEY }; + var translate = new Translate(options); + assert.strictEqual(translate.options, options); + }); + + it('should localize the api key', function() { + assert.equal(translate.key, API_KEY); + }); + }); + + describe('detect', function() { + var INPUT = 'input'; + + it('should make the correct API request', function(done) { + translate.request = function(reqOpts) { + assert.strictEqual(reqOpts.uri, '/detect'); + assert.strictEqual(reqOpts.useQuerystring, true); + assert.deepEqual(reqOpts.qs.q, [INPUT]); + done(); + }; + + translate.detect(INPUT, assert.ifError); + }); + + describe('error', function() { + var error = new Error('Error.'); + var apiResponse = {}; + + beforeEach(function() { + translate.request = function(reqOpts, callback) { + callback(error, apiResponse); + }; + }); + + it('should execute callback with error & API resp', function(done) { + translate.detect(INPUT, function(err, results, apiResponse_) { + assert.strictEqual(err, error); + assert.strictEqual(results, null); + assert.strictEqual(apiResponse_, apiResponse); + done(); + }); + }); + }); + + describe('success', function() { + var apiResponse = { + data: { + detections: [ + [ + { + isReliable: true, + a: 'b', + c: 'd' + } + ] + ] + } + }; + + var originalApiResponse = extend({}, apiResponse); + + var expectedResults = { + a: 'b', + c: 'd', + input: INPUT + }; + + beforeEach(function() { + translate.request = function(reqOpts, callback) { + callback(null, apiResponse); + }; + }); + + it('should execute callback with results & API response', function(done) { + translate.detect(INPUT, function(err, results, apiResponse_) { + assert.ifError(err); + assert.deepEqual(results, expectedResults); + assert.strictEqual(apiResponse_, apiResponse); + assert.deepEqual(apiResponse_, originalApiResponse); + done(); + }); + }); + + it('should execute callback with multiple results', function(done) { + translate.detect([INPUT, INPUT], function(err, results) { + assert.ifError(err); + assert.deepEqual(results, [expectedResults]); + done(); + }); + }); + }); + }); + + describe('getLanguages', function() { + it('should make the correct API request', function(done) { + translate.request = function(reqOpts) { + assert.strictEqual(reqOpts.uri, '/languages'); + done(); + }; + + translate.getLanguages(assert.ifError); + }); + + describe('error', function() { + var error = new Error('Error.'); + var apiResponse = {}; + + beforeEach(function() { + translate.request = function(reqOpts, callback) { + callback(error, apiResponse); + }; + }); + + it('should exec callback with error & API response', function(done) { + translate.getLanguages(function(err, languages, apiResponse_) { + assert.strictEqual(err, error); + assert.strictEqual(languages, null); + assert.strictEqual(apiResponse_, apiResponse); + done(); + }); + }); + }); + + describe('success', function() { + var apiResponse = { + data: { + languages: [ + { + language: 'en' + }, + { + language: 'es' + } + ] + } + }; + + var expectedResults = apiResponse.data.languages.map(prop('language')); + + beforeEach(function() { + translate.request = function(reqOpts, callback) { + callback(null, apiResponse); + }; + }); + + it('should exec callback with languages', function(done) { + translate.getLanguages(function(err, languages, apiResponse_) { + assert.ifError(err); + assert.deepEqual(languages, expectedResults); + assert.strictEqual(apiResponse_, apiResponse); + done(); + }); + }); + }); + }); + + describe('translate', function() { + var INPUT = 'Hello'; + var SOURCE_LANG_CODE = 'en'; + var TARGET_LANG_CODE = 'es'; + + var OPTIONS = { + from: SOURCE_LANG_CODE, + to: TARGET_LANG_CODE + }; + + describe('options = target langauge', function() { + it('should make the correct API request', function(done) { + translate.request = function(reqOpts) { + assert.strictEqual(reqOpts.qs.target, TARGET_LANG_CODE); + done(); + }; + + translate.translate(INPUT, TARGET_LANG_CODE, assert.ifError); + }); + }); + + describe('options = { source & target }', function() { + it('should throw if `to` is not provided', function() { + assert.throws(function() { + translate.translate(INPUT, { from: SOURCE_LANG_CODE }, util.noop); + }, 'A target language is required to perform a translation.'); + }); + + it('should make the correct API request', function(done) { + translate.request = function(reqOpts) { + assert.strictEqual(reqOpts.qs.source, SOURCE_LANG_CODE); + assert.strictEqual(reqOpts.qs.target, TARGET_LANG_CODE); + done(); + }; + + translate.translate(INPUT, { + from: SOURCE_LANG_CODE, + to: TARGET_LANG_CODE + }, assert.ifError); + }); + }); + + it('should make the correct API request', function(done) { + translate.request = function(reqOpts) { + assert.strictEqual(reqOpts.uri, ''); + assert.strictEqual(reqOpts.useQuerystring, true); + assert.deepEqual(reqOpts.qs, { + q: [INPUT], + source: SOURCE_LANG_CODE, + target: TARGET_LANG_CODE + }); + done(); + }; + + translate.translate(INPUT, OPTIONS, assert.ifError); + }); + + describe('error', function() { + var error = new Error('Error.'); + var apiResponse = {}; + + beforeEach(function() { + translate.request = function(reqOpts, callback) { + callback(error, apiResponse); + }; + }); + + it('should exec callback with error & API response', function(done) { + translate.translate(INPUT, OPTIONS, function(err, translations, resp) { + assert.strictEqual(err, error); + assert.strictEqual(translations, null); + assert.strictEqual(resp, apiResponse); + done(); + }); + }); + }); + + describe('success', function() { + var apiResponse = { + data: { + translations: [ + { + translatedText: 'text', + a: 'b', + c: 'd' + } + ] + } + }; + + var expectedResults = apiResponse.data.translations[0].translatedText; + + beforeEach(function() { + translate.request = function(reqOpts, callback) { + callback(null, apiResponse); + }; + }); + + it('should execute callback with results & API response', function(done) { + translate.translate(INPUT, OPTIONS, function(err, translations, resp) { + assert.ifError(err); + assert.deepEqual(translations, expectedResults); + assert.strictEqual(resp, apiResponse); + done(); + }); + }); + + it('should execute callback with multiple results', function(done) { + var input = [INPUT, INPUT]; + translate.translate(input, OPTIONS, function(err, translations) { + assert.ifError(err); + assert.deepEqual(translations, [expectedResults]); + done(); + }); + }); + }); + }); + + describe('request', function() { + it('should make the correct request', function(done) { + var reqOpts = { + uri: '/test', + a: 'b', + c: 'd', + qs: { + a: 'b', + c: 'd' + } + }; + + var expectedReqOpts = extend(true, {}, reqOpts, { + qs: { + key: translate.key + }, + headers: { + 'User-Agent': PKG.name + '/' + PKG.version + } + }); + var BASE_URL = 'https://www.googleapis.com/language/translate/v2'; + expectedReqOpts.uri = BASE_URL + reqOpts.uri; + + makeRequestOverride = function(reqOpts, options, callback) { + assert.deepEqual(reqOpts, expectedReqOpts); + assert.strictEqual(options, translate.options); + callback(); // done() + }; + + translate.request(reqOpts, done); + }); + }); +}); From 7d0631560a26c2623cee74d3fd31203117e792a7 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Wed, 3 Aug 2016 20:26:08 -0400 Subject: [PATCH 002/513] set starting version points --- packages/google-cloud-translate/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 94886c35451..bc5174d872e 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.0.0", + "version": "0.1.0", "author": "Google Inc.", "description": "Google Cloud Translate Client Library for Node.js", "contributors": [ @@ -69,4 +69,4 @@ "engines": { "node": ">=0.12.0" } -} +} \ No newline at end of file From 3247aadc94dd6283e107e69a5a38c8bc33e2e476 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Wed, 3 Aug 2016 21:12:01 -0400 Subject: [PATCH 003/513] translate: system tests: fix broken import --- packages/google-cloud-translate/system-test/translate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/system-test/translate.js b/packages/google-cloud-translate/system-test/translate.js index 7824f65a838..0b3ef5fa4d2 100644 --- a/packages/google-cloud-translate/system-test/translate.js +++ b/packages/google-cloud-translate/system-test/translate.js @@ -21,7 +21,7 @@ var extend = require('extend'); var prop = require('propprop'); var env = require('../../../system-test/env.js'); -var Translate = require('../').Translate; +var Translate = require('../'); var API_KEY = process.env.GCLOUD_TESTS_API_KEY; From 8dcc140bdc37493512d18c4d2566843fda330a27 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Thu, 4 Aug 2016 15:21:59 -0400 Subject: [PATCH 004/513] modular code style --- packages/google-cloud-translate/package.json | 4 ++-- packages/google-cloud-translate/src/index.js | 14 ++++---------- packages/google-cloud-translate/test/index.js | 2 +- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index bc5174d872e..93f91130ab9 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -57,7 +57,7 @@ "propprop": "^0.3.0" }, "devDependencies": { - "mocha": "^2.1.0", + "mocha": "^3.0.1", "proxyquire": "^1.7.10" }, "scripts": { @@ -69,4 +69,4 @@ "engines": { "node": ">=0.12.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index 7b6acfff3fd..5d066812c3e 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -25,14 +25,8 @@ var common = require('@google-cloud/common'); var extend = require('extend'); var is = require('is'); var prop = require('propprop'); -var PKG = require('../package.json'); -var USER_AGENT = PKG.name + '/' + PKG.version; -/** - * @type {module:common/util} - * @private - */ -var util = common.util; +var PKG = require('../package.json'); /** * With [Google Translate](https://cloud.google.com/translate), you can @@ -78,7 +72,7 @@ var util = common.util; */ function Translate(options) { if (!(this instanceof Translate)) { - options = util.normalizeArguments(this, options, { + options = common.util.normalizeArguments(this, options, { projectIdRequired: false }); return new Translate(options); @@ -350,11 +344,11 @@ Translate.prototype.request = function(reqOpts, callback) { key: this.key }, headers: { - 'User-Agent': USER_AGENT + 'User-Agent': PKG.name + '/' + PKG.version } }); - util.makeRequest(reqOpts, this.options, callback); + common.util.makeRequest(reqOpts, this.options, callback); }; module.exports = Translate; diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index d7267f0857f..89ed0abe370 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -20,8 +20,8 @@ var assert = require('assert'); var extend = require('extend'); var prop = require('propprop'); var proxyquire = require('proxyquire'); - var util = require('@google-cloud/common').util; + var PKG = require('../package.json'); var makeRequestOverride; From a8f85340b491320a3c117646bd4c3691d30a872f Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Thu, 4 Aug 2016 15:46:09 -0400 Subject: [PATCH 005/513] more code style fixes --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 93f91130ab9..dddacb796b9 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -61,7 +61,7 @@ "proxyquire": "^1.7.10" }, "scripts": { - "publish": "../../scripts/publish", + "publish": "node ../../scripts/publish.js", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, From 09c9e3b4fecb8e0519a201cc7b04e9cafcb9932c Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Thu, 11 Aug 2016 15:03:40 -0400 Subject: [PATCH 006/513] docs: individual package support (#1479) docs: refactor doc scripts for modularization --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index dddacb796b9..9b1659a3380 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -61,7 +61,7 @@ "proxyquire": "^1.7.10" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js translate", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, From 32429030bdc5fbd6bb43252ae77416e761baa984 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Thu, 11 Aug 2016 17:18:30 -0400 Subject: [PATCH 007/513] translate: fix system test translation (#1482) --- packages/google-cloud-translate/system-test/translate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/system-test/translate.js b/packages/google-cloud-translate/system-test/translate.js index 0b3ef5fa4d2..97615cfef60 100644 --- a/packages/google-cloud-translate/system-test/translate.js +++ b/packages/google-cloud-translate/system-test/translate.js @@ -66,7 +66,7 @@ var API_KEY = process.env.GCLOUD_TESTS_API_KEY; }, { input: 'How are you today?', - expectedTranslation: 'Como estas hoy?' + expectedTranslation: '¿Cómo estás hoy?' } ]; From 1e10b7e3818d3aae2c8552bd69b2f23a0e794b4d Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Thu, 11 Aug 2016 20:32:57 -0400 Subject: [PATCH 008/513] fix publish script (#1480) --- packages/google-cloud-translate/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 9b1659a3380..365064c9b93 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.1.0", + "version": "0.1.1", "author": "Google Inc.", "description": "Google Cloud Translate Client Library for Node.js", "contributors": [ @@ -31,7 +31,7 @@ ], "main": "./src/index.js", "files": [ - "./src/*", + "src", "AUTHORS", "CONTRIBUTORS", "COPYING" @@ -61,7 +61,7 @@ "proxyquire": "^1.7.10" }, "scripts": { - "publish": "node ../../scripts/publish.js translate", + "publish-module": "node ../../scripts/publish.js translate", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, From b62cc29ca92630d7aa2d4603bb9bc731361fb8c9 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Mon, 15 Aug 2016 08:21:22 -0700 Subject: [PATCH 009/513] docs: generate uniform service overviews (#1475) --- packages/google-cloud-translate/src/index.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index 5d066812c3e..695a649711a 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -45,13 +45,6 @@ var PKG = require('../package.json'); * @constructor * @alias module:translate * - * @classdesc - * The object returned from `gcloud.translate` lets you translate arbitrary - * string input into thousands of other languages. - * - * To learn more about the Translate API, see - * [Getting Started](https://cloud.google.com/translate/v2/getting_started). - * * @resource [Getting Started]{@link https://cloud.google.com/translate/v2/getting_started} * @resource [Identifying your application to Google]{@link https://cloud.google.com/translate/v2/using_rest#auth} * @@ -59,16 +52,6 @@ var PKG = require('../package.json'); * * @param {object} options - [Configuration object](#/docs). * @param {string} options.key - An API key. - * - * @example - * var gcloud = require('google-cloud')({ - * keyFilename: '/path/to/keyfile.json', - * projectId: 'grape-spaceship-123' - * }); - * - * var translate = gcloud.translate({ - * key: 'API Key' - * }); */ function Translate(options) { if (!(this instanceof Translate)) { From a4ce70240b47860ce716f6bcb5ad9b5436bd3ac0 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Tue, 16 Aug 2016 13:47:46 -0400 Subject: [PATCH 010/513] tests: fix assert.throws() usage (#1468) --- packages/google-cloud-translate/test/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index 89ed0abe370..00804e026e5 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -81,7 +81,7 @@ describe('Translate', function() { it('should throw if an API key is not provided', function() { assert.throws(function() { new Translate({}); - }, 'An API key is required to use the Translate API.'); + }, /An API key is required to use the Translate API\./); }); it('should localize the options', function() { @@ -266,7 +266,7 @@ describe('Translate', function() { it('should throw if `to` is not provided', function() { assert.throws(function() { translate.translate(INPUT, { from: SOURCE_LANG_CODE }, util.noop); - }, 'A target language is required to perform a translation.'); + }, /A target language is required to perform a translation\./); }); it('should make the correct API request', function(done) { From 0262821429ab0106160c0b3dd3aacaaac7c3ebe7 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Sat, 20 Aug 2016 18:10:57 -0700 Subject: [PATCH 011/513] Add Translate API samples. Fixes #176. (#184) * Add Translate API samples. Fixes #176. * Fix build. * Add comment. * Address comments --- .../google-cloud-translate/samples/README.md | 57 +++++++++++++++++++ .../samples/package.json | 19 +++++++ 2 files changed, 76 insertions(+) create mode 100644 packages/google-cloud-translate/samples/README.md create mode 100644 packages/google-cloud-translate/samples/package.json diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md new file mode 100644 index 00000000000..173ff49046b --- /dev/null +++ b/packages/google-cloud-translate/samples/README.md @@ -0,0 +1,57 @@ +Google Cloud Platform logo + +# Google Translate API Node.js Samples + +With the [Google Translate API][translate_docs], you can dynamically translate +text between thousands of language pairs. + +[translate_docs]: https://cloud.google.com/translate/docs/ + +## Table of Contents + +* [Setup](#setup) +* [Samples](#samples) + * [Translate](#translate) + +## Setup + +1. Read [Prerequisites][prereq] and [How to run a sample][run] first. +1. Install dependencies: + + npm install + +[prereq]: ../README.md#prerequisities +[run]: ../README.md#how-to-run-a-sample + +## Samples + +### Translate + +View the [documentation][translate_docs] or the [source code][translate_code]. + +__Usage:__ `node translate --help` + +``` +Commands: + detect Detect the language of the provided text + list List available translation languages. + translate Translate the provided text to the target language. + +Options: + --apiKey, -k Your Translate API key. Defaults to the value of the TRANSLATE_API_KEY environment + variable. [string] + --help Show help [boolean] + +Examples: + node translate detect -k your-key "Hello world!" Detect the language of "Hello world!". + node translate list -k your-key List available translation languages. + node translate translate -k your-key --to ru "Good Translate "Good morning!" to Russian, + morning!" auto-detecting English. + node translate translate -k your-key --to ru Translate "Good morning!" to Russian from + --from en "Good morning!" English. + +For more information, see https://cloud.google.com/translate/docs +``` + +[translate_docs]: https://cloud.google.com/translate/docs +[translate_code]: translate.js diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json new file mode 100644 index 00000000000..79251cdc1e7 --- /dev/null +++ b/packages/google-cloud-translate/samples/package.json @@ -0,0 +1,19 @@ +{ + "name": "nodejs-docs-samples-translate", + "version": "0.0.1", + "private": true, + "license": "Apache Version 2.0", + "author": "Google Inc.", + "scripts": { + "test": "mocha -R spec -t 120000 --require intelli-espower-loader ../test/_setup.js test/*.test.js", + "system-test": "mocha -R spec -t 120000 --require intelli-espower-loader ../system-test/_setup.js system-test/*.test.js" + }, + "dependencies": { + "@google-cloud/translate": "^0.1.1", + "iso-639-1": "^1.2.1", + "yargs": "^5.0.0" + }, + "devDependencies": { + "mocha": "^3.0.2" + } +} From 589d52573496ee436131423a072a5f4f92249906 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Tue, 23 Aug 2016 14:38:50 -0400 Subject: [PATCH 012/513] gcloud-node -> google-cloud-node (#1521) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 365064c9b93..4ebdbf60728 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -36,7 +36,7 @@ "CONTRIBUTORS", "COPYING" ], - "repository": "googlecloudplatform/gcloud-node", + "repository": "googlecloudplatform/google-cloud-node", "keywords": [ "google apis client", "google api client", From fb215897d7f1abf52a4cd7a6e0980aac6f5c2bfb Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Fri, 26 Aug 2016 13:25:29 -0400 Subject: [PATCH 013/513] add readmes for all packages (#1495) * add bigquery readme * add all readmes * copy readme as part of release script * gcloud-node -> google-cloud-node * fix youre good to gos * add resource manager scope * exclude unecessary files --- packages/google-cloud-translate/README.md | 55 ++++++++++++++++++++ packages/google-cloud-translate/package.json | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 packages/google-cloud-translate/README.md diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md new file mode 100644 index 00000000000..759c8c55f58 --- /dev/null +++ b/packages/google-cloud-translate/README.md @@ -0,0 +1,55 @@ +# @google-cloud/translate +> Google Translate API Client Library for Node.js + +*Looking for more Google APIs than just Translate? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-translate-docs] +- [Official Documentation][cloud-translate-docs] + +**An API key is required for Translate.** See [Identifying your application to Google][api-key-howto]. + + +```sh +$ npm install --save @google-cloud/translate +``` +```js +var translate = require('@google-cloud/translate')({ + key: 'API Key' +}); + +// Translate a string of text. +translate.translate('Hello', 'es', function(err, translation) { + if (!err) { + // translation = 'Hola' + } +}); + +// Detect a language from a string of text. +translate.detect('Hello', function(err, results) { + if (!err) { + // results = { + // language: 'en', + // confidence: 1, + // input: 'Hello' + // } + } +}); + +// Get a list of supported languages. +translate.getLanguages(function(err, languages) { + if (!err) { + // languages = [ + // 'af', + // 'ar', + // 'az', + // ... + // ] + } +}); +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node/ +[api-key-howto]: https://cloud.google.com/translate/v2/using_rest#auth +[gcloud-translate-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/translate +[cloud-translate-docs]: https://cloud.google.com/translate/docs diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 4ebdbf60728..f5c25beca9e 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -2,7 +2,7 @@ "name": "@google-cloud/translate", "version": "0.1.1", "author": "Google Inc.", - "description": "Google Cloud Translate Client Library for Node.js", + "description": "Google Translate API Client Library for Node.js", "contributors": [ { "name": "Burcu Dogan", From 09d6611844f16b5912cbe7d566006ae391019f01 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Fri, 26 Aug 2016 17:47:55 -0400 Subject: [PATCH 014/513] bigquery/language/logging/prediction/vision: decouple packages (#1531) * bigquery/language/logging/prediction/vision: decouple packages * tests: allow more time for docs tests to run * add vision test * resort dependencies like npm does --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index f5c25beca9e..34941792c3b 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -50,9 +50,9 @@ "translate" ], "dependencies": { + "@google-cloud/common": "^0.1.0", "arrify": "^1.0.0", "extend": "^3.0.0", - "@google-cloud/common": "^0.1.0", "is": "^3.0.1", "propprop": "^0.3.0" }, From 1479021c60c242eb48bc8013b62db1832f4d231b Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Tue, 23 Aug 2016 14:20:49 -0700 Subject: [PATCH 015/513] Add support for target option to translate.getLanguages. --- packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/src/index.js | 79 ++++++++++++++++--- .../system-test/translate.js | 28 ++++++- packages/google-cloud-translate/test/index.js | 33 +++++++- 4 files changed, 125 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 34941792c3b..9d675de1a22 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -50,7 +50,7 @@ "translate" ], "dependencies": { - "@google-cloud/common": "^0.1.0", + "@google-cloud/common": "^0.2.0", "arrify": "^1.0.0", "extend": "^3.0.0", "is": "^3.0.1", diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index 695a649711a..c05be0e6bf4 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -164,36 +164,93 @@ Translate.prototype.detect = function(input, callback) { /** * Get an array of all supported languages. * - * @resource [Discover Supported Languages]{@link https://cloud.google.com/translate/v2/using_rest#supported-languages} + * @resource [Discovering Supported Languages]{@link https://cloud.google.com/translate/v2/discovering-supported-languages-with-rest} * + * @param {string=} target - Get the language names in a language other than + * English. * @param {function} callback - The callback function. * @param {?error} callback.err - An error returned while making this request. - * @param {string[]} callback.languages - The supported ISO 639-1 language - * codes. + * @param {object[]} callback.languages - The languages supported by the API. + * @param {string} callback.languages[].code - The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * language code. + * @param {string} callback.languages[].name - The language name. This can be + * translated into your preferred language with the `target` option + * described above. * @param {object} callback.apiResponse - Raw API response. * * @example * translate.getLanguages(function(err, languages) { * if (!err) { * // languages = [ - * // 'af', - * // 'ar', - * // 'az', + * // { + * // code: 'af', + * // name: 'Afrikaans' + * // }, + * // { + * // code: 'ar', + * // name: 'Arabic' + * // }, + * // { + * // code: 'az', + * // name: 'Azerbaijani' + * // }, + * // ... + * // ] + * } + * }); + * + * //- + * // Get the language names in a language other than English. + * //- + * translate.getLanguages('es', function(err, languages) { + * if (!err) { + * // languages = [ + * // { + * // code: 'af', + * // name: 'afrikáans' + * // }, + * // { + * // code: 'ar', + * // name: 'árabe' + * // }, + * // { + * // code: 'az', + * // name: 'azerí' + * // }, * // ... * // ] * } * }); */ -Translate.prototype.getLanguages = function(callback) { - this.request({ - uri: '/languages' - }, function(err, resp) { +Translate.prototype.getLanguages = function(target, callback) { + if (is.fn(target)) { + callback = target; + target = 'en'; + } + + var reqOpts = { + uri: '/languages', + useQuerystring: true, + qs: {} + }; + + if (target && is.string(target)) { + reqOpts.qs.target = target; + } + + this.request(reqOpts, function(err, resp) { if (err) { callback(err, null, resp); return; } - var languages = resp.data.languages.map(prop('language')); + var languages = resp.data.languages.map(function(language) { + return { + code: language.language, + name: language.name + }; + }); + callback(null, languages, resp); }); }; diff --git a/packages/google-cloud-translate/system-test/translate.js b/packages/google-cloud-translate/system-test/translate.js index 97615cfef60..f0d87307fe8 100644 --- a/packages/google-cloud-translate/system-test/translate.js +++ b/packages/google-cloud-translate/system-test/translate.js @@ -102,7 +102,33 @@ var API_KEY = process.env.GCLOUD_TESTS_API_KEY; it('should get a list of supported languages', function(done) { translate.getLanguages(function(err, languages) { assert.ifError(err); - assert(languages.length > 0); + + var englishResult = languages.filter(function(language) { + return language.code === 'en'; + })[0]; + + assert.deepEqual(englishResult, { + code: 'en', + name: 'English' + }); + + done(); + }); + }); + + it('should accept a target language', function(done) { + translate.getLanguages('es', function(err, languages) { + assert.ifError(err); + + var englishResult = languages.filter(function(language) { + return language.code === 'en'; + })[0]; + + assert.deepEqual(englishResult, { + code: 'en', + name: 'inglés' + }); + done(); }); }); diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index 00804e026e5..b6969c9ff7f 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -18,7 +18,6 @@ var assert = require('assert'); var extend = require('extend'); -var prop = require('propprop'); var proxyquire = require('proxyquire'); var util = require('@google-cloud/common').util; @@ -182,12 +181,27 @@ describe('Translate', function() { it('should make the correct API request', function(done) { translate.request = function(reqOpts) { assert.strictEqual(reqOpts.uri, '/languages'); + assert.deepEqual(reqOpts.qs, { + target: 'en' + }); done(); }; translate.getLanguages(assert.ifError); }); + it('should make the correct API request with target', function(done) { + translate.request = function(reqOpts) { + assert.strictEqual(reqOpts.uri, '/languages'); + assert.deepEqual(reqOpts.qs, { + target: 'es' + }); + done(); + }; + + translate.getLanguages('es', assert.ifError); + }); + describe('error', function() { var error = new Error('Error.'); var apiResponse = {}; @@ -213,16 +227,27 @@ describe('Translate', function() { data: { languages: [ { - language: 'en' + language: 'en', + name: 'English' }, { - language: 'es' + language: 'es', + name: 'Spanish' } ] } }; - var expectedResults = apiResponse.data.languages.map(prop('language')); + var expectedResults = [ + { + code: 'en', + name: 'English' + }, + { + code: 'es', + name: 'Spanish' + } + ]; beforeEach(function() { translate.request = function(reqOpts, callback) { From 1a14c892aaabd4f1ac8743eeaf8fdc5433cce95e Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Tue, 30 Aug 2016 11:11:36 -0400 Subject: [PATCH 016/513] translate @ 0.2.0 tagged. --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 9d675de1a22..397f548e6e7 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.1.1", + "version": "0.2.0", "author": "Google Inc.", "description": "Google Translate API Client Library for Node.js", "contributors": [ From 3e62941c2c0a462b02f968cf0d225b2363f098b4 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Thu, 1 Sep 2016 13:53:41 -0700 Subject: [PATCH 017/513] Add remaining Translate samples. (#197) --- .../google-cloud-translate/samples/README.md | 30 +++++++++++-------- .../samples/package.json | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 173ff49046b..feb5dc35b3a 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -33,22 +33,28 @@ __Usage:__ `node translate --help` ``` Commands: - detect Detect the language of the provided text - list List available translation languages. - translate Translate the provided text to the target language. + detect Detect the language of the provided text or texts + list [target] List available translation languages. To return language names in a language other than + English, specify a target language. + translate Translate the provided text or texts to the target language, optionally specifying the + source language. Options: - --apiKey, -k Your Translate API key. Defaults to the value of the TRANSLATE_API_KEY environment - variable. [string] - --help Show help [boolean] + --apiKey, -k Your Translate API key. Defaults to the value of the TRANSLATE_API_KEY environment variable. [string] + --help Show help [boolean] Examples: - node translate detect -k your-key "Hello world!" Detect the language of "Hello world!". - node translate list -k your-key List available translation languages. - node translate translate -k your-key --to ru "Good Translate "Good morning!" to Russian, - morning!" auto-detecting English. - node translate translate -k your-key --to ru Translate "Good morning!" to Russian from - --from en "Good morning!" English. + node translate detect "Hello world!" Detect the language of "Hello world!". + node translate detect -k your-api-key "Hello world!" Detect the language of "Hello world!" and "Goodbye", + "Goodbye" supplying the API key inline.. + node translate list -k your-api-key List available translation languages with names in + English, supplying the API key inline.. + node translate list es List available translation languages with names in + Spanish. + node translate translate ru "Good morning!" Translate "Good morning!" to Russian, auto-detecting the + source language. + node translate translate ru "Good morning!" -f en -k Translate "Good morning!" to Russian from English, + your-api-key supplying the API key inline. For more information, see https://cloud.google.com/translate/docs ``` diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 79251cdc1e7..53120d7e1c5 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -9,7 +9,7 @@ "system-test": "mocha -R spec -t 120000 --require intelli-espower-loader ../system-test/_setup.js system-test/*.test.js" }, "dependencies": { - "@google-cloud/translate": "^0.1.1", + "@google-cloud/translate": "^0.2.0", "iso-639-1": "^1.2.1", "yargs": "^5.0.0" }, From 8d55ddefb07c8942f82379ceb66be250d9083474 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Fri, 9 Sep 2016 15:19:15 -0400 Subject: [PATCH 018/513] all modules: ensure all User-Agents are set (#1568) --- packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/src/index.js | 2 +- packages/google-cloud-translate/test/index.js | 13 ++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 397f548e6e7..9de7d3b72dc 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -50,7 +50,7 @@ "translate" ], "dependencies": { - "@google-cloud/common": "^0.2.0", + "@google-cloud/common": "^0.5.0", "arrify": "^1.0.0", "extend": "^3.0.0", "is": "^3.0.1", diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index c05be0e6bf4..1db4ca5cbdb 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -384,7 +384,7 @@ Translate.prototype.request = function(reqOpts, callback) { key: this.key }, headers: { - 'User-Agent': PKG.name + '/' + PKG.version + 'User-Agent': common.util.getUserAgentFromPackageJson(PKG) } }); diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index b6969c9ff7f..bcd05f90ceb 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -21,8 +21,6 @@ var extend = require('extend'); var proxyquire = require('proxyquire'); var util = require('@google-cloud/common').util; -var PKG = require('../package.json'); - var makeRequestOverride; var fakeUtil = extend({}, util, { makeRequest: function() { @@ -386,6 +384,15 @@ describe('Translate', function() { describe('request', function() { it('should make the correct request', function(done) { + var userAgent = 'user-agent/0.0.0'; + + var getUserAgentFn = fakeUtil.getUserAgentFromPackageJson; + fakeUtil.getUserAgentFromPackageJson = function(packageJson) { + fakeUtil.getUserAgentFromPackageJson = getUserAgentFn; + assert.deepEqual(packageJson, require('../package.json')); + return userAgent; + }; + var reqOpts = { uri: '/test', a: 'b', @@ -401,7 +408,7 @@ describe('Translate', function() { key: translate.key }, headers: { - 'User-Agent': PKG.name + '/' + PKG.version + 'User-Agent': userAgent } }); var BASE_URL = 'https://www.googleapis.com/language/translate/v2'; From 8d028c4fb0045e8f6f40e9e90fed199410d43f64 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Mon, 26 Sep 2016 18:55:38 -0400 Subject: [PATCH 019/513] all: update @google-cloud/common dependency --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 9de7d3b72dc..c993a3780e1 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -50,7 +50,7 @@ "translate" ], "dependencies": { - "@google-cloud/common": "^0.5.0", + "@google-cloud/common": "^0.6.0", "arrify": "^1.0.0", "extend": "^3.0.0", "is": "^3.0.1", From 8ffed64a65d145db0e460deaf68279b407d7549a Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Mon, 26 Sep 2016 18:59:40 -0400 Subject: [PATCH 020/513] translate @ 0.3.0 tagged. --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c993a3780e1..04096f7bbd0 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.2.0", + "version": "0.3.0", "author": "Google Inc.", "description": "Google Translate API Client Library for Node.js", "contributors": [ From 76ad3deaf7997e5067b771b9c99936bdcaccf8aa Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Tue, 27 Sep 2016 22:02:05 -0700 Subject: [PATCH 021/513] Adds 6 quickstart examples (#218) * Add some simple "quickstart" samples. * Add quickstart tests (#215) * First draft of new tests * Fix failing tests * Fix comments * Add comments. * Update comments. * Add another comment. * Cleanup. * Fix region tags. * Fix comments. --- .../samples/quickstart.js | 29 ++++++++++++++ .../samples/test/quickstart.test.js | 38 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 packages/google-cloud-translate/samples/quickstart.js create mode 100644 packages/google-cloud-translate/samples/test/quickstart.test.js diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js new file mode 100644 index 00000000000..46ce2607ca7 --- /dev/null +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -0,0 +1,29 @@ +// Copyright 2015-2016, Google, Inc. +// 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. + +'use strict'; + +// [START translate_quickstart] +// Imports and instantiates the Google Cloud client library +// for the Google Translate API +const translate = require('@google-cloud/translate')({ + key: 'YOUR_API_KEY' +}); + +// Translates some text into Russian +translate.translate('Hello, world!', 'ru', (err, translation, apiResponse) => { + if (!err) { + // The text was translated successfully + } +}); +// [END translate_quickstart] diff --git a/packages/google-cloud-translate/samples/test/quickstart.test.js b/packages/google-cloud-translate/samples/test/quickstart.test.js new file mode 100644 index 00000000000..85c20267b68 --- /dev/null +++ b/packages/google-cloud-translate/samples/test/quickstart.test.js @@ -0,0 +1,38 @@ +// Copyright 2016, Google, Inc. +// 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. + +'use strict'; + +const proxyquire = require(`proxyquire`).noCallThru(); + +describe(`translate:quickstart`, () => { + let translateMock, TranslateMock; + + before(() => { + translateMock = { + translate: sinon.stub().yields(null, `Привет мир!`, {}) + }; + TranslateMock = sinon.stub().returns(translateMock); + }); + + it(`should translate a string`, () => { + proxyquire(`../quickstart`, { + '@google-cloud/translate': TranslateMock + }); + + assert.equal(TranslateMock.calledOnce, true); + assert.deepEqual(TranslateMock.firstCall.args, [{ key: 'YOUR_API_KEY' }]); + assert.equal(translateMock.translate.calledOnce, true); + assert.deepEqual(translateMock.translate.firstCall.args.slice(0, -1), ['Hello, world!', 'ru']); + }); +}); From 5254e99b7f4c7e7475f889ee2dbe9956b87190ff Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Wed, 28 Sep 2016 14:39:47 -0700 Subject: [PATCH 022/513] Add message ordering samples (#220) * Initial commit. * Add unit test. * Add message ordering sample. * Rename a sample. * Address comments. --- packages/google-cloud-translate/samples/quickstart.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index 46ce2607ca7..59c34f52482 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -15,13 +15,12 @@ // [START translate_quickstart] // Imports and instantiates the Google Cloud client library -// for the Google Translate API const translate = require('@google-cloud/translate')({ key: 'YOUR_API_KEY' }); // Translates some text into Russian -translate.translate('Hello, world!', 'ru', (err, translation, apiResponse) => { +translate.translate('Hello, world!', 'ru', (err, translation) => { if (!err) { // The text was translated successfully } From a67e6885003372b56a863684ea9c61a25ac867b8 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Thu, 29 Sep 2016 10:22:14 -0700 Subject: [PATCH 023/513] Change quickstart style. (#221) * Change quickstart style. * Fix test. --- .../samples/quickstart.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index 59c34f52482..e3f49aedf66 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -14,13 +14,24 @@ 'use strict'; // [START translate_quickstart] -// Imports and instantiates the Google Cloud client library -const translate = require('@google-cloud/translate')({ - key: 'YOUR_API_KEY' +// Imports the Google Cloud client library +const Translate = require('@google-cloud/translate'); + +// Your Translate API key +const apiKey = 'YOUR_API_KEY'; + +// Instantiates a client +const translateClient = Translate({ + key: apiKey }); +// The text to translate +const text = 'Hello, world!'; +// The target language +const target = 'ru'; + // Translates some text into Russian -translate.translate('Hello, world!', 'ru', (err, translation) => { +translateClient.translate(text, target, (err, translation) => { if (!err) { // The text was translated successfully } From 500df6afb2ec28c3651d0133efd90e8492fe5aea Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Mon, 3 Oct 2016 14:47:54 -0400 Subject: [PATCH 024/513] translate: allow setting format of text (#1647) --- packages/google-cloud-translate/package.json | 1 + packages/google-cloud-translate/src/index.js | 9 ++++- .../system-test/translate.js | 20 +++++++++++ packages/google-cloud-translate/test/index.js | 35 +++++++++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 04096f7bbd0..88b48402079 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -54,6 +54,7 @@ "arrify": "^1.0.0", "extend": "^3.0.0", "is": "^3.0.1", + "is-html": "^1.0.0", "propprop": "^0.3.0" }, "devDependencies": { diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index 1db4ca5cbdb..6c58cb730ff 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -24,6 +24,7 @@ var arrify = require('arrify'); var common = require('@google-cloud/common'); var extend = require('extend'); var is = require('is'); +var isHtml = require('is-html'); var prop = require('propprop'); var PKG = require('../package.json'); @@ -268,6 +269,9 @@ Translate.prototype.getLanguages = function(target, callback) { * target ISO 639-1 language code to translate the source input to. (e.g. * `en` for English). If an object, you may also specify the source * language. + * @param {string} options.format - Set the text's format as `html` or `text`. + * If not provided, we will try to auto-detect if the text given is HTML. If + * not, we set the format as `text`. * @param {string} options.from - The ISO 639-1 language code the source input * is written in. * @param {string} options.to - The ISO 639-1 language code to translate the @@ -323,8 +327,11 @@ Translate.prototype.getLanguages = function(target, callback) { * }); */ Translate.prototype.translate = function(input, options, callback) { + input = arrify(input); + var query = { - q: arrify(input) + q: input, + format: options.format || (isHtml(input[0]) ? 'html' : 'text') }; if (is.string(options)) { diff --git a/packages/google-cloud-translate/system-test/translate.js b/packages/google-cloud-translate/system-test/translate.js index f0d87307fe8..fef07883d45 100644 --- a/packages/google-cloud-translate/system-test/translate.js +++ b/packages/google-cloud-translate/system-test/translate.js @@ -96,6 +96,26 @@ var API_KEY = process.env.GCLOUD_TESTS_API_KEY; done(); }); }); + + it('should autodetect HTML', function(done) { + var input = '' + INPUT[0].input + ''; + var expectedTranslation = [ + '', + INPUT[0].expectedTranslation, + '' + ].join(' '); + + var opts = { + from: 'en', + to: 'es' + }; + + translate.translate(input, opts, function(err, results) { + assert.ifError(err); + assert.strictEqual(results, expectedTranslation); + done(); + }); + }); }); describe('supported languages', function() { diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index bcd05f90ceb..c4f0d814bf9 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -266,6 +266,7 @@ describe('Translate', function() { describe('translate', function() { var INPUT = 'Hello'; + var INPUT_HTML = 'Hello'; var SOURCE_LANG_CODE = 'en'; var TARGET_LANG_CODE = 'es'; @@ -306,12 +307,46 @@ describe('Translate', function() { }); }); + describe('options.format', function() { + it('should default to text', function(done) { + translate.request = function(reqOpts) { + assert.strictEqual(reqOpts.qs.format, 'text'); + done(); + }; + + translate.translate(INPUT, OPTIONS, assert.ifError); + }); + + it('should recognize HTML', function(done) { + translate.request = function(reqOpts) { + assert.strictEqual(reqOpts.qs.format, 'html'); + done(); + }; + + translate.translate(INPUT_HTML, OPTIONS, assert.ifError); + }); + + it('should allow overriding the format', function(done) { + var options = extend({}, OPTIONS, { + format: 'custom format' + }); + + translate.request = function(reqOpts) { + assert.strictEqual(reqOpts.qs.format, options.format); + done(); + }; + + translate.translate(INPUT_HTML, options, assert.ifError); + }); + }); + it('should make the correct API request', function(done) { translate.request = function(reqOpts) { assert.strictEqual(reqOpts.uri, ''); assert.strictEqual(reqOpts.useQuerystring, true); assert.deepEqual(reqOpts.qs, { q: [INPUT], + format: 'text', source: SOURCE_LANG_CODE, target: TARGET_LANG_CODE }); From 2ddb03791dd7e694ed4c099e4f70a0cdf3263cdf Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Mon, 3 Oct 2016 14:44:10 -0700 Subject: [PATCH 025/513] New quickstarts. (#226) * New quickstarts. * Address comments. --- .../samples/package.json | 7 ++-- .../samples/quickstart.js | 34 +++++++++++-------- .../samples/test/quickstart.test.js | 33 ++++++++++-------- 3 files changed, 44 insertions(+), 30 deletions(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 53120d7e1c5..8c7dca14199 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -11,9 +11,12 @@ "dependencies": { "@google-cloud/translate": "^0.2.0", "iso-639-1": "^1.2.1", - "yargs": "^5.0.0" + "yargs": "^6.0.0" }, "devDependencies": { - "mocha": "^3.0.2" + "mocha": "^3.1.0" + }, + "engines": { + "node": ">=4.3.2" } } diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index e3f49aedf66..2ed38c9ba57 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -1,15 +1,17 @@ -// Copyright 2015-2016, Google, Inc. -// 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. +/** + * Copyright 2016, Google, Inc. + * 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. + */ 'use strict'; @@ -32,8 +34,12 @@ const target = 'ru'; // Translates some text into Russian translateClient.translate(text, target, (err, translation) => { - if (!err) { - // The text was translated successfully + if (err) { + console.error(err); + return; } + + console.log(`Text: ${text}`); + console.log(`Translation: ${translation}`); }); // [END translate_quickstart] diff --git a/packages/google-cloud-translate/samples/test/quickstart.test.js b/packages/google-cloud-translate/samples/test/quickstart.test.js index 85c20267b68..e9c3dd683d2 100644 --- a/packages/google-cloud-translate/samples/test/quickstart.test.js +++ b/packages/google-cloud-translate/samples/test/quickstart.test.js @@ -1,15 +1,17 @@ -// Copyright 2016, Google, Inc. -// 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. +/** + * Copyright 2016, Google, Inc. + * 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. + */ 'use strict'; @@ -17,15 +19,16 @@ const proxyquire = require(`proxyquire`).noCallThru(); describe(`translate:quickstart`, () => { let translateMock, TranslateMock; + const error = new Error(`error`); before(() => { translateMock = { - translate: sinon.stub().yields(null, `Привет мир!`, {}) + translate: sinon.stub().yields(error) }; TranslateMock = sinon.stub().returns(translateMock); }); - it(`should translate a string`, () => { + it(`should handle error`, () => { proxyquire(`../quickstart`, { '@google-cloud/translate': TranslateMock }); @@ -34,5 +37,7 @@ describe(`translate:quickstart`, () => { assert.deepEqual(TranslateMock.firstCall.args, [{ key: 'YOUR_API_KEY' }]); assert.equal(translateMock.translate.calledOnce, true); assert.deepEqual(translateMock.translate.firstCall.args.slice(0, -1), ['Hello, world!', 'ru']); + assert.equal(console.error.calledOnce, true); + assert.deepEqual(console.error.firstCall.args, [error]); }); }); From 466e58965cf925cb27a770006f7a4930c657a687 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Tue, 4 Oct 2016 12:08:35 -0400 Subject: [PATCH 026/513] translate: fix system tests --- packages/google-cloud-translate/system-test/translate.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/system-test/translate.js b/packages/google-cloud-translate/system-test/translate.js index fef07883d45..7f530426d15 100644 --- a/packages/google-cloud-translate/system-test/translate.js +++ b/packages/google-cloud-translate/system-test/translate.js @@ -37,11 +37,11 @@ var API_KEY = process.env.GCLOUD_TESTS_API_KEY; describe('detecting language from input', function() { var INPUT = [ { - input: 'Hello', + input: 'Hello!', expectedLanguage: 'en' }, { - input: 'Hola', + input: '¡Hola!', expectedLanguage: 'es' } ]; @@ -61,8 +61,8 @@ var API_KEY = process.env.GCLOUD_TESTS_API_KEY; describe('translations', function() { var INPUT = [ { - input: 'Hello', - expectedTranslation: 'Hola' + input: 'Hello!', + expectedTranslation: '¡Hola!' }, { input: 'How are you today?', From c679b6923464d78b15671ec272d6d6d66a29728a Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Sun, 9 Oct 2016 16:24:23 -0400 Subject: [PATCH 027/513] translate: support GOOGLE_CLOUD_TRANSLATE_ENDPOINT env var (#1674) --- packages/google-cloud-translate/src/index.js | 19 +++++-- packages/google-cloud-translate/test/index.js | 52 +++++++++++++++---- 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index 6c58cb730ff..03259af202b 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -53,6 +53,14 @@ var PKG = require('../package.json'); * * @param {object} options - [Configuration object](#/docs). * @param {string} options.key - An API key. + * + * @example + * //- + * //

Custom Translate API

+ * // + * // The environment variable, `GOOGLE_CLOUD_TRANSLATE_ENDPOINT`, is honored as + * // a custom backend which our library will send requests to. + * //- */ function Translate(options) { if (!(this instanceof Translate)) { @@ -66,6 +74,13 @@ function Translate(options) { throw new Error('An API key is required to use the Translate API.'); } + this.baseUrl = 'https://www.googleapis.com/language/translate/v2'; + + if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { + this.baseUrl = process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT + .replace(/\/+$/, ''); + } + this.options = options; this.key = options.key; } @@ -382,9 +397,7 @@ Translate.prototype.translate = function(input, options, callback) { * @param {function} callback - The callback function passed to `request`. */ Translate.prototype.request = function(reqOpts, callback) { - var BASE_URL = 'https://www.googleapis.com/language/translate/v2'; - - reqOpts.uri = BASE_URL + reqOpts.uri; + reqOpts.uri = this.baseUrl + reqOpts.uri; reqOpts = extend(true, {}, reqOpts, { qs: { diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index c4f0d814bf9..b0a3470211e 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -33,7 +33,9 @@ var fakeUtil = extend({}, util, { }); describe('Translate', function() { - var API_KEY = 'api-key'; + var OPTIONS = { + key: 'api-key' + }; var Translate; var translate; @@ -49,16 +51,14 @@ describe('Translate', function() { beforeEach(function() { makeRequestOverride = null; - translate = new Translate({ - key: API_KEY - }); + translate = new Translate(OPTIONS); }); describe('instantiation', function() { it('should normalize the arguments', function() { var normalizeArguments = fakeUtil.normalizeArguments; var normalizeArgumentsCalled = false; - var fakeOptions = { key: API_KEY }; + var fakeOptions = extend({}, OPTIONS); var fakeContext = {}; fakeUtil.normalizeArguments = function(context, options, cfg) { @@ -81,14 +81,48 @@ describe('Translate', function() { }, /An API key is required to use the Translate API\./); }); + it('should default baseUrl correctly', function() { + assert.strictEqual( + translate.baseUrl, + 'https://www.googleapis.com/language/translate/v2' + ); + }); + it('should localize the options', function() { - var options = { key: API_KEY }; + var options = { key: '...' }; var translate = new Translate(options); assert.strictEqual(translate.options, options); }); it('should localize the api key', function() { - assert.equal(translate.key, API_KEY); + assert.equal(translate.key, OPTIONS.key); + }); + + describe('GOOGLE_CLOUD_TRANSLATE_ENDPOINT', function() { + var CUSTOM_ENDPOINT = '...'; + var translate; + + before(function() { + process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT = CUSTOM_ENDPOINT; + translate = new Translate(OPTIONS); + }); + + after(function() { + delete process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT; + }); + + it('should correctly set the baseUrl', function() { + assert.strictEqual(translate.baseUrl, CUSTOM_ENDPOINT); + }); + + it('should remove trailing slashes', function() { + var expectedBaseUrl = 'http://localhost:8080'; + + process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT = 'http://localhost:8080//'; + + var translate = new Translate(OPTIONS); + assert.strictEqual(translate.baseUrl, expectedBaseUrl); + }); }); }); @@ -446,8 +480,8 @@ describe('Translate', function() { 'User-Agent': userAgent } }); - var BASE_URL = 'https://www.googleapis.com/language/translate/v2'; - expectedReqOpts.uri = BASE_URL + reqOpts.uri; + + expectedReqOpts.uri = translate.baseUrl + reqOpts.uri; makeRequestOverride = function(reqOpts, options, callback) { assert.deepEqual(reqOpts, expectedReqOpts); From f46acf98390611f49a580a655f7706c1a4be4495 Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Mon, 17 Oct 2016 19:44:23 -0400 Subject: [PATCH 028/513] translate: add promise support (#1711) --- packages/google-cloud-translate/README.md | 10 ++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/src/index.js | 33 +++++++++++++++++-- packages/google-cloud-translate/test/index.js | 10 ++++++ 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 759c8c55f58..1dd0bd1f568 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -46,6 +46,16 @@ translate.getLanguages(function(err, languages) { // ] } }); + +// Promises are also supported by omitting callbacks. +translate.getLanguages().then(function(data) { + var languages = data[0]; +}); + +// It's also possible to integrate with third-party Promise libraries. +var translate = require('@google-cloud/translate')({ + promise: require('bluebird') +}); ``` diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 88b48402079..125d8f6d17f 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -50,7 +50,7 @@ "translate" ], "dependencies": { - "@google-cloud/common": "^0.6.0", + "@google-cloud/common": "^0.7.0", "arrify": "^1.0.0", "extend": "^3.0.0", "is": "^3.0.1", diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index 03259af202b..457a18540fb 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -101,8 +101,6 @@ function Translate(options) { * @param {number=} callback.results[].confidence - A float 0 - 1. The higher * the number, the higher the confidence in language detection. Note, this * is not always returned from the API. - * @param {string} callback.input - The original input that this was result was - * based on. * @param {object} callback.apiResponse - Raw API response. * * @example @@ -142,6 +140,14 @@ function Translate(options) { * // ] * } * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * translate.detect('Hello').then(function(data) { + * var results = data[0]; + * var apiResponse = data[2]; + * }); */ Translate.prototype.detect = function(input, callback) { input = arrify(input); @@ -237,6 +243,14 @@ Translate.prototype.detect = function(input, callback) { * // ] * } * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * translate.getLanguages().then(function(data) { + * var languages = data[0]; + * var apiResponse = data[1]; + * }); */ Translate.prototype.getLanguages = function(target, callback) { if (is.fn(target)) { @@ -340,6 +354,14 @@ Translate.prototype.getLanguages = function(target, callback) { * // ] * } * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * translate.translate('Hello', 'es').then(function(data) { + * var translation = data[0]; + * var apiResponse = data[1]; + * }); */ Translate.prototype.translate = function(input, options, callback) { input = arrify(input); @@ -411,4 +433,11 @@ Translate.prototype.request = function(reqOpts, callback) { common.util.makeRequest(reqOpts, this.options, callback); }; +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +common.util.promisifyAll(Translate); + module.exports = Translate; diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index b0a3470211e..76223bdf6cb 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -22,6 +22,7 @@ var proxyquire = require('proxyquire'); var util = require('@google-cloud/common').util; var makeRequestOverride; +var promisified = false; var fakeUtil = extend({}, util, { makeRequest: function() { if (makeRequestOverride) { @@ -29,6 +30,11 @@ var fakeUtil = extend({}, util, { } return util.makeRequest.apply(null, arguments); + }, + promisifyAll: function(Class) { + if (Class.name === 'Translate') { + promisified = true; + } } }); @@ -55,6 +61,10 @@ describe('Translate', function() { }); describe('instantiation', function() { + it('should promisify all the things', function() { + assert(promisified); + }); + it('should normalize the arguments', function() { var normalizeArguments = fakeUtil.normalizeArguments; var normalizeArgumentsCalled = false; From c9738f21420513c1f72c9fc45427d4ae65452317 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Mon, 17 Oct 2016 19:46:22 -0400 Subject: [PATCH 029/513] translate @ 0.4.0 tagged. --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 125d8f6d17f..86bdb73e7e1 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.3.0", + "version": "0.4.0", "author": "Google Inc.", "description": "Google Translate API Client Library for Node.js", "contributors": [ From 8f0987dbd5c8309e626f1441995c2110d5e56b62 Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Mon, 14 Nov 2016 16:46:02 -0500 Subject: [PATCH 030/513] translate: api updates (#1781) --- packages/google-cloud-translate/README.md | 70 ++++++- packages/google-cloud-translate/src/index.js | 71 ++++--- .../system-test/translate.js | 20 +- packages/google-cloud-translate/test/index.js | 197 ++++++++++++------ 4 files changed, 260 insertions(+), 98 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 1dd0bd1f568..04c94742fe7 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -6,15 +6,14 @@ - [API Documentation][gcloud-translate-docs] - [Official Documentation][cloud-translate-docs] -**An API key is required for Translate.** See [Identifying your application to Google][api-key-howto]. - ```sh $ npm install --save @google-cloud/translate ``` ```js var translate = require('@google-cloud/translate')({ - key: 'API Key' + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' }); // Translate a string of text. @@ -59,6 +58,71 @@ var translate = require('@google-cloud/translate')({ ``` +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var translate = require('@google-cloud/translate')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### With a Google Developers Service Account + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Google Translate API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var translate = require('@google-cloud/translate')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + +### With an API key + +It's also possible to authenticate with an API key. To create an API key: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Google Translate API +4. Navigate to **APIs & auth** > **Credentials** and then click on **Create new Client ID** and select **API key**. You should then be presented with a pop-up containing your newly created key. + +```js +var translate = require('@google-cloud/translate')({ + key: 'API Key' +}); + +// ...you're good to go! +``` + [google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node/ [api-key-howto]: https://cloud.google.com/translate/v2/using_rest#auth [gcloud-translate-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/translate diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index 457a18540fb..e4cac3bec34 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -26,6 +26,7 @@ var extend = require('extend'); var is = require('is'); var isHtml = require('is-html'); var prop = require('propprop'); +var util = require('util'); var PKG = require('../package.json'); @@ -40,9 +41,6 @@ var PKG = require('../package.json'); * [Pricing](https://cloud.google.com/translate/v2/pricing.html) and * [FAQ](https://cloud.google.com/translate/v2/faq.html) pages for details. * - * **An API key is required for Translate.** See - * [Identifying your application to Google](https://cloud.google.com/translate/v2/using_rest#auth). - * * @constructor * @alias module:translate * @@ -52,7 +50,7 @@ var PKG = require('../package.json'); * @throws {Error} If an API key is not provided. * * @param {object} options - [Configuration object](#/docs). - * @param {string} options.key - An API key. + * @param {string=} options.key - An API key. * * @example * //- @@ -70,21 +68,30 @@ function Translate(options) { return new Translate(options); } - if (!options.key) { - throw new Error('An API key is required to use the Translate API.'); - } - - this.baseUrl = 'https://www.googleapis.com/language/translate/v2'; + var baseUrl = 'https://translation.googleapis.com/language/translate/v2'; if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { - this.baseUrl = process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT + baseUrl = process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT .replace(/\/+$/, ''); } - this.options = options; - this.key = options.key; + if (options.key) { + this.options = options; + this.key = options.key; + } + + var config = { + baseUrl: baseUrl, + scopes: ['https://www.googleapis.com/auth/cloud-platform'], + packageJson: require('../package.json'), + projectIdRequired: false + }; + + common.Service.call(this, config, options); } +util.inherits(Translate, common.Service); + /** * Detect the language used in a string or multiple strings. * @@ -153,9 +160,9 @@ Translate.prototype.detect = function(input, callback) { input = arrify(input); this.request({ + method: 'POST', uri: '/detect', - useQuerystring: true, - qs: { + json: { q: input } }, function(err, resp) { @@ -303,6 +310,9 @@ Translate.prototype.getLanguages = function(target, callback) { * not, we set the format as `text`. * @param {string} options.from - The ISO 639-1 language code the source input * is written in. + * @param {string} options.model - **Note:** Users must be whitelisted to use + * this parameter. Set the model type requested for this translation. Please + * refer to the upstream documentation for possible values. * @param {string} options.to - The ISO 639-1 language code to translate the * input to. * @param {function} callback - The callback function. @@ -366,31 +376,35 @@ Translate.prototype.getLanguages = function(target, callback) { Translate.prototype.translate = function(input, options, callback) { input = arrify(input); - var query = { + var body = { q: input, format: options.format || (isHtml(input[0]) ? 'html' : 'text') }; if (is.string(options)) { - query.target = options; + body.target = options; } else { if (options.from) { - query.source = options.from; + body.source = options.from; } if (options.to) { - query.target = options.to; + body.target = options.to; + } + + if (options.model) { + body.model = options.model; } } - if (!query.target) { + if (!body.target) { throw new Error('A target language is required to perform a translation.'); } this.request({ + method: 'POST', uri: '', - useQuerystring: true, - qs: query + json: body }, function(err, resp) { if (err) { callback(err, null, resp); @@ -399,7 +413,7 @@ Translate.prototype.translate = function(input, options, callback) { var translations = resp.data.translations.map(prop('translatedText')); - if (query.q.length === 1) { + if (body.q.length === 1) { translations = translations[0]; } @@ -408,10 +422,10 @@ Translate.prototype.translate = function(input, options, callback) { }; /** - * A custom request implementation. Requests to this API use an API key for an - * application, not a bearer token from a service account. This means we skip - * the `makeAuthenticatedRequest` portion of the typical request lifecycle, and - * manually authenticate the request here. + * A custom request implementation. Requests to this API may optionally use an + * API key for an application, not a bearer token from a service account. This + * means it is possible to skip the `makeAuthenticatedRequest` portion of the + * typical request lifecycle, and manually authenticate the request here. * * @private * @@ -419,6 +433,11 @@ Translate.prototype.translate = function(input, options, callback) { * @param {function} callback - The callback function passed to `request`. */ Translate.prototype.request = function(reqOpts, callback) { + if (!this.key) { + common.Service.prototype.request.call(this, reqOpts, callback); + return; + } + reqOpts.uri = this.baseUrl + reqOpts.uri; reqOpts = extend(true, {}, reqOpts, { diff --git a/packages/google-cloud-translate/system-test/translate.js b/packages/google-cloud-translate/system-test/translate.js index 7f530426d15..817f714038d 100644 --- a/packages/google-cloud-translate/system-test/translate.js +++ b/packages/google-cloud-translate/system-test/translate.js @@ -25,14 +25,8 @@ var Translate = require('../'); var API_KEY = process.env.GCLOUD_TESTS_API_KEY; -// Only run the tests if there is an API key to test with. -(API_KEY ? describe : describe.skip)('translate', function() { - if (!API_KEY) { - // The test runner still executes this function, even if it is skipped. - return; - } - - var translate = new Translate(extend({}, env, { key: API_KEY })); +describe('translate', function() { + var translate = new Translate(extend({}, env)); describe('detecting language from input', function() { var INPUT = [ @@ -153,4 +147,14 @@ var API_KEY = process.env.GCLOUD_TESTS_API_KEY; }); }); }); + + (API_KEY ? describe : describe.skip)('authentication', function() { + beforeEach(function() { + translate = new Translate({ key: API_KEY }); + }); + + it('should use an API key to authenticate', function(done) { + translate.getLanguages(done); + }); + }); }); diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index 76223bdf6cb..5d4c60bbca1 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -38,9 +38,13 @@ var fakeUtil = extend({}, util, { } }); +function FakeService() { + this.calledWith_ = arguments; +} + describe('Translate', function() { var OPTIONS = { - key: 'api-key' + projectId: 'test-project' }; var Translate; @@ -49,7 +53,8 @@ describe('Translate', function() { before(function() { Translate = proxyquire('../', { '@google-cloud/common': { - util: fakeUtil + util: fakeUtil, + Service: FakeService } }); }); @@ -85,27 +90,38 @@ describe('Translate', function() { fakeUtil.normalizeArguments = normalizeArguments; }); - it('should throw if an API key is not provided', function() { - assert.throws(function() { - new Translate({}); - }, /An API key is required to use the Translate API\./); - }); + it('should inherit from Service', function() { + assert(translate instanceof FakeService); - it('should default baseUrl correctly', function() { - assert.strictEqual( - translate.baseUrl, - 'https://www.googleapis.com/language/translate/v2' - ); - }); + var calledWith = translate.calledWith_[0]; + var baseUrl = 'https://translation.googleapis.com/language/translate/v2'; - it('should localize the options', function() { - var options = { key: '...' }; - var translate = new Translate(options); - assert.strictEqual(translate.options, options); + assert.strictEqual(calledWith.baseUrl, baseUrl); + assert.deepEqual(calledWith.scopes, [ + 'https://www.googleapis.com/auth/cloud-platform' + ]); + assert.deepEqual(calledWith.packageJson, require('../package.json')); + assert.strictEqual(calledWith.projectIdRequired, false); }); - it('should localize the api key', function() { - assert.equal(translate.key, OPTIONS.key); + describe('Using an API Key', function() { + var KEY_OPTIONS = { + key: 'api-key' + }; + + beforeEach(function() { + translate = new Translate(KEY_OPTIONS); + }); + + it('should localize the options', function() { + var options = { key: '...' }; + var translate = new Translate(options); + assert.strictEqual(translate.options, options); + }); + + it('should localize the api key', function() { + assert.strictEqual(translate.key, KEY_OPTIONS.key); + }); }); describe('GOOGLE_CLOUD_TRANSLATE_ENDPOINT', function() { @@ -122,7 +138,9 @@ describe('Translate', function() { }); it('should correctly set the baseUrl', function() { - assert.strictEqual(translate.baseUrl, CUSTOM_ENDPOINT); + var baseUrl = translate.calledWith_[0].baseUrl; + + assert.strictEqual(baseUrl, CUSTOM_ENDPOINT); }); it('should remove trailing slashes', function() { @@ -131,7 +149,9 @@ describe('Translate', function() { process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT = 'http://localhost:8080//'; var translate = new Translate(OPTIONS); - assert.strictEqual(translate.baseUrl, expectedBaseUrl); + var baseUrl = translate.calledWith_[0].baseUrl; + + assert.strictEqual(baseUrl, expectedBaseUrl); }); }); }); @@ -142,8 +162,8 @@ describe('Translate', function() { it('should make the correct API request', function(done) { translate.request = function(reqOpts) { assert.strictEqual(reqOpts.uri, '/detect'); - assert.strictEqual(reqOpts.useQuerystring, true); - assert.deepEqual(reqOpts.qs.q, [INPUT]); + assert.strictEqual(reqOpts.method, 'POST'); + assert.deepEqual(reqOpts.json, { q: [INPUT] }); done(); }; @@ -322,7 +342,7 @@ describe('Translate', function() { describe('options = target langauge', function() { it('should make the correct API request', function(done) { translate.request = function(reqOpts) { - assert.strictEqual(reqOpts.qs.target, TARGET_LANG_CODE); + assert.strictEqual(reqOpts.json.target, TARGET_LANG_CODE); done(); }; @@ -339,8 +359,8 @@ describe('Translate', function() { it('should make the correct API request', function(done) { translate.request = function(reqOpts) { - assert.strictEqual(reqOpts.qs.source, SOURCE_LANG_CODE); - assert.strictEqual(reqOpts.qs.target, TARGET_LANG_CODE); + assert.strictEqual(reqOpts.json.source, SOURCE_LANG_CODE); + assert.strictEqual(reqOpts.json.target, TARGET_LANG_CODE); done(); }; @@ -354,7 +374,7 @@ describe('Translate', function() { describe('options.format', function() { it('should default to text', function(done) { translate.request = function(reqOpts) { - assert.strictEqual(reqOpts.qs.format, 'text'); + assert.strictEqual(reqOpts.json.format, 'text'); done(); }; @@ -363,7 +383,7 @@ describe('Translate', function() { it('should recognize HTML', function(done) { translate.request = function(reqOpts) { - assert.strictEqual(reqOpts.qs.format, 'html'); + assert.strictEqual(reqOpts.json.format, 'html'); done(); }; @@ -376,7 +396,7 @@ describe('Translate', function() { }); translate.request = function(reqOpts) { - assert.strictEqual(reqOpts.qs.format, options.format); + assert.strictEqual(reqOpts.json.format, options.format); done(); }; @@ -384,11 +404,27 @@ describe('Translate', function() { }); }); + describe('options.model', function() { + it('should set the model option when available', function(done) { + var fakeOptions = { + model: 'nmt', + to: 'es' + }; + + translate.request = function(reqOpts) { + assert.strictEqual(reqOpts.json.model, 'nmt'); + done(); + }; + + translate.translate(INPUT, fakeOptions, assert.ifError); + }); + }); + it('should make the correct API request', function(done) { translate.request = function(reqOpts) { assert.strictEqual(reqOpts.uri, ''); - assert.strictEqual(reqOpts.useQuerystring, true); - assert.deepEqual(reqOpts.qs, { + assert.strictEqual(reqOpts.method, 'POST'); + assert.deepEqual(reqOpts.json, { q: [INPUT], format: 'text', source: SOURCE_LANG_CODE, @@ -462,44 +498,83 @@ describe('Translate', function() { }); describe('request', function() { - it('should make the correct request', function(done) { - var userAgent = 'user-agent/0.0.0'; - - var getUserAgentFn = fakeUtil.getUserAgentFromPackageJson; - fakeUtil.getUserAgentFromPackageJson = function(packageJson) { - fakeUtil.getUserAgentFromPackageJson = getUserAgentFn; - assert.deepEqual(packageJson, require('../package.json')); - return userAgent; - }; + describe('OAuth mode', function() { + var request; - var reqOpts = { - uri: '/test', - a: 'b', - c: 'd', - qs: { + beforeEach(function() { + request = FakeService.prototype.request; + }); + + afterEach(function() { + FakeService.prototype.request = request; + }); + + it('should make the correct request', function(done) { + var fakeOptions = { + uri: '/test', a: 'b', - c: 'd' - } + json: { + a: 'b' + } + }; + + FakeService.prototype.request = function(reqOpts, callback) { + assert.strictEqual(reqOpts, fakeOptions); + callback(); + }; + + translate.request(fakeOptions, done); + }); + }); + + describe('API key mode', function() { + var KEY_OPTIONS = { + key: 'api-key' }; - var expectedReqOpts = extend(true, {}, reqOpts, { - qs: { - key: translate.key - }, - headers: { - 'User-Agent': userAgent - } + beforeEach(function() { + translate = new Translate(KEY_OPTIONS); }); - expectedReqOpts.uri = translate.baseUrl + reqOpts.uri; + it('should make the correct request', function(done) { + var userAgent = 'user-agent/0.0.0'; - makeRequestOverride = function(reqOpts, options, callback) { - assert.deepEqual(reqOpts, expectedReqOpts); - assert.strictEqual(options, translate.options); - callback(); // done() - }; + var getUserAgentFn = fakeUtil.getUserAgentFromPackageJson; + fakeUtil.getUserAgentFromPackageJson = function(packageJson) { + fakeUtil.getUserAgentFromPackageJson = getUserAgentFn; + assert.deepEqual(packageJson, require('../package.json')); + return userAgent; + }; + + var reqOpts = { + uri: '/test', + a: 'b', + c: 'd', + qs: { + a: 'b', + c: 'd' + } + }; - translate.request(reqOpts, done); + var expectedReqOpts = extend(true, {}, reqOpts, { + qs: { + key: translate.key + }, + headers: { + 'User-Agent': userAgent + } + }); + + expectedReqOpts.uri = translate.baseUrl + reqOpts.uri; + + makeRequestOverride = function(reqOpts, options, callback) { + assert.deepEqual(reqOpts, expectedReqOpts); + assert.strictEqual(options, translate.options); + callback(); // done() + }; + + translate.request(reqOpts, done); + }); }); }); }); From 70bc03f53e8ac70a12969d38d283cbe7a87e3243 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Mon, 14 Nov 2016 13:55:26 -0800 Subject: [PATCH 031/513] Updated copyright headers and dependencies. --- packages/google-cloud-translate/samples/package.json | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 8c7dca14199..b7b1f938050 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -5,16 +5,15 @@ "license": "Apache Version 2.0", "author": "Google Inc.", "scripts": { - "test": "mocha -R spec -t 120000 --require intelli-espower-loader ../test/_setup.js test/*.test.js", - "system-test": "mocha -R spec -t 120000 --require intelli-espower-loader ../system-test/_setup.js system-test/*.test.js" + "test": "mocha -R spec --require intelli-espower-loader ../test/_setup.js test/*.test.js", + "system-test": "mocha -R spec --require intelli-espower-loader ../system-test/_setup.js system-test/*.test.js" }, "dependencies": { - "@google-cloud/translate": "^0.2.0", - "iso-639-1": "^1.2.1", - "yargs": "^6.0.0" + "@google-cloud/translate": "^0.4.0", + "yargs": "^6.4.0" }, "devDependencies": { - "mocha": "^3.1.0" + "mocha": "^3.1.2" }, "engines": { "node": ">=4.3.2" From 4c46c126489313daa49bc365ec1615b62c433afd Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Mon, 14 Nov 2016 19:55:30 -0500 Subject: [PATCH 032/513] translate: updating common version (#1792) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 86bdb73e7e1..724c8ecff33 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -50,7 +50,7 @@ "translate" ], "dependencies": { - "@google-cloud/common": "^0.7.0", + "@google-cloud/common": "^0.8.0", "arrify": "^1.0.0", "extend": "^3.0.0", "is": "^3.0.1", From d6d9590bc5b523b1135098b94fab44f4ffd65e47 Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Mon, 14 Nov 2016 20:01:32 -0500 Subject: [PATCH 033/513] translate @ 0.5.0 tagged. --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 724c8ecff33..25beaf7ab93 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.4.0", + "version": "0.5.0", "author": "Google Inc.", "description": "Google Translate API Client Library for Node.js", "contributors": [ From bd9aecadeb0ca84a14c5f06ab7e7a59d8fe75740 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Wed, 16 Nov 2016 11:16:08 -0500 Subject: [PATCH 034/513] docs: update API key generation steps (#1791) --- packages/google-cloud-translate/README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 04c94742fe7..62eae7cc405 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -86,8 +86,10 @@ If you are not running this client on Google Compute Engine, you need a Google D 3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): * Google Translate API 4. Navigate to **APIs & auth** > **Credentials** and then: - * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. - * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + * If you want to use a new service account key, click on **Create credentials** and select **Service account key**. After the account key is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new service account key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + * If you want to use an API key, click on **Create credentials** and select **API key**. After the API key is created, you will see a newly opened modal with the API key in a field named **Your API key** that the library uses to authenticate your requests. + * If you want to generate a new API key for an existing API key, click on an existing API key and click **Regenerate key**. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' @@ -100,6 +102,9 @@ var translate = require('@google-cloud/translate')({ // Or the contents of the key file: credentials: require('./path/to/keyfile.json') + + // Your API key (if not using a service account JSON file): + key: '...' }); // ...you're good to go! From 6122cca5649b61d104bd1f3f53692982c6964870 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Wed, 16 Nov 2016 16:24:15 -0500 Subject: [PATCH 035/513] translate @ 0.5.1 tagged. --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 25beaf7ab93..02c1241ed0b 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.5.0", + "version": "0.5.1", "author": "Google Inc.", "description": "Google Translate API Client Library for Node.js", "contributors": [ From 8fe95178a06ddb019c42576663011dbed512401d Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Mon, 21 Nov 2016 12:57:41 -0800 Subject: [PATCH 036/513] Update Translate samples, with some minor tweaks to Language samples. (#255) --- .../google-cloud-translate/samples/README.md | 33 +++++++------- .../samples/package.json | 8 +--- .../samples/quickstart.js | 20 ++++----- .../samples/test/quickstart.test.js | 43 ------------------- 4 files changed, 26 insertions(+), 78 deletions(-) delete mode 100644 packages/google-cloud-translate/samples/test/quickstart.test.js diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index feb5dc35b3a..2f2e32de72c 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -29,32 +29,29 @@ text between thousands of language pairs. View the [documentation][translate_docs] or the [source code][translate_code]. -__Usage:__ `node translate --help` +__Usage:__ `node translate.js --help` ``` Commands: - detect Detect the language of the provided text or texts - list [target] List available translation languages. To return language names in a language other than - English, specify a target language. - translate Translate the provided text or texts to the target language, optionally specifying the - source language. + detect Detects the language of one or more strings. + list [target] Lists available translation languages. To return + language names in a language other thanEnglish, + specify a target language. + translate Translates one or more strings into the target + language. Options: - --apiKey, -k Your Translate API key. Defaults to the value of the TRANSLATE_API_KEY environment variable. [string] - --help Show help [boolean] + --help Show help [boolean] Examples: - node translate detect "Hello world!" Detect the language of "Hello world!". - node translate detect -k your-api-key "Hello world!" Detect the language of "Hello world!" and "Goodbye", - "Goodbye" supplying the API key inline.. - node translate list -k your-api-key List available translation languages with names in - English, supplying the API key inline.. - node translate list es List available translation languages with names in + node translate.js detect "Hello world!" Detects the language of a string. + node translate.js detect "Hello world!" "Goodbye" Detects the languages of multiple strings. + node translate.js list Lists available translation languages with names in + English. + node translate.js list es Lists available translation languages with names in Spanish. - node translate translate ru "Good morning!" Translate "Good morning!" to Russian, auto-detecting the - source language. - node translate translate ru "Good morning!" -f en -k Translate "Good morning!" to Russian from English, - your-api-key supplying the API key inline. + node translate.js translate ru "Good morning!" Translates a string into Russian. + node translate.js translate ru "Good morning!" "Good night!" Translates multiple strings into Russian. For more information, see https://cloud.google.com/translate/docs ``` diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index b7b1f938050..ef36037b91b 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -5,16 +5,12 @@ "license": "Apache Version 2.0", "author": "Google Inc.", "scripts": { - "test": "mocha -R spec --require intelli-espower-loader ../test/_setup.js test/*.test.js", - "system-test": "mocha -R spec --require intelli-espower-loader ../system-test/_setup.js system-test/*.test.js" + "test": "cd ..; npm run st -- translate/system-test/*.test.js" }, "dependencies": { - "@google-cloud/translate": "^0.4.0", + "@google-cloud/translate": "^0.5.0", "yargs": "^6.4.0" }, - "devDependencies": { - "mocha": "^3.1.2" - }, "engines": { "node": ">=4.3.2" } diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index 2ed38c9ba57..7bb0715b24b 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -19,12 +19,12 @@ // Imports the Google Cloud client library const Translate = require('@google-cloud/translate'); -// Your Translate API key -const apiKey = 'YOUR_API_KEY'; +// Your Google Cloud Platform project ID +const projectId = 'YOUR_PROJECT_ID'; // Instantiates a client const translateClient = Translate({ - key: apiKey + projectId: projectId }); // The text to translate @@ -33,13 +33,11 @@ const text = 'Hello, world!'; const target = 'ru'; // Translates some text into Russian -translateClient.translate(text, target, (err, translation) => { - if (err) { - console.error(err); - return; - } +translateClient.translate(text, target) + .then((results) => { + const translation = results[0]; - console.log(`Text: ${text}`); - console.log(`Translation: ${translation}`); -}); + console.log(`Text: ${text}`); + console.log(`Translation: ${translation}`); + }); // [END translate_quickstart] diff --git a/packages/google-cloud-translate/samples/test/quickstart.test.js b/packages/google-cloud-translate/samples/test/quickstart.test.js deleted file mode 100644 index e9c3dd683d2..00000000000 --- a/packages/google-cloud-translate/samples/test/quickstart.test.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright 2016, Google, Inc. - * 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. - */ - -'use strict'; - -const proxyquire = require(`proxyquire`).noCallThru(); - -describe(`translate:quickstart`, () => { - let translateMock, TranslateMock; - const error = new Error(`error`); - - before(() => { - translateMock = { - translate: sinon.stub().yields(error) - }; - TranslateMock = sinon.stub().returns(translateMock); - }); - - it(`should handle error`, () => { - proxyquire(`../quickstart`, { - '@google-cloud/translate': TranslateMock - }); - - assert.equal(TranslateMock.calledOnce, true); - assert.deepEqual(TranslateMock.firstCall.args, [{ key: 'YOUR_API_KEY' }]); - assert.equal(translateMock.translate.calledOnce, true); - assert.deepEqual(translateMock.translate.firstCall.args.slice(0, -1), ['Hello, world!', 'ru']); - assert.equal(console.error.calledOnce, true); - assert.deepEqual(console.error.firstCall.args, [error]); - }); -}); From 1f4d7349ba736e18d03e1e5a8abf282606d3ee44 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Thu, 8 Dec 2016 18:34:53 -0500 Subject: [PATCH 037/513] prepare READMEs for beta release (#1864) --- packages/google-cloud-translate/README.md | 18 +++++++----------- packages/google-cloud-translate/src/index.js | 6 ------ 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 62eae7cc405..04a7bf8ce91 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -1,4 +1,4 @@ -# @google-cloud/translate +# @google-cloud/translate ([Alpha][versioning]) > Google Translate API Client Library for Node.js *Looking for more Google APIs than just Translate? You might want to check out [`google-cloud`][google-cloud].* @@ -62,24 +62,18 @@ var translate = require('@google-cloud/translate')({ It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. -### On Google Compute Engine +### On Google Cloud Platform -If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. +If you are running this client on Google Cloud Platform, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. ``` js -// Authenticating on a global basis. -var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' - -var translate = require('@google-cloud/translate')({ - projectId: projectId -}); - +var translate = require('@google-cloud/translate')(); // ...you're good to go! ``` ### With a Google Developers Service Account -If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: +If you are not running this client on Google Cloud Platform, you need a Google Developers service account. To create a service account: 1. Visit the [Google Developers Console][dev-console]. 2. Create a new project or click on an existing project. @@ -128,6 +122,8 @@ var translate = require('@google-cloud/translate')({ // ...you're good to go! ``` + +[versioning]: https://github.com/GoogleCloudPlatform/google-cloud-node#versioning [google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node/ [api-key-howto]: https://cloud.google.com/translate/v2/using_rest#auth [gcloud-translate-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/translate diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index e4cac3bec34..f178a01ae04 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -37,18 +37,12 @@ var PKG = require('../package.json'); * The Google Translate API lets websites and programs integrate with Google * Translate programmatically. * - * Google Translate API is available as a paid service. See the - * [Pricing](https://cloud.google.com/translate/v2/pricing.html) and - * [FAQ](https://cloud.google.com/translate/v2/faq.html) pages for details. - * * @constructor * @alias module:translate * * @resource [Getting Started]{@link https://cloud.google.com/translate/v2/getting_started} * @resource [Identifying your application to Google]{@link https://cloud.google.com/translate/v2/using_rest#auth} * - * @throws {Error} If an API key is not provided. - * * @param {object} options - [Configuration object](#/docs). * @param {string=} options.key - An API key. * From 0bc6e7eaa4a052ad3b894cd1cd14801d2a4c32d5 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Thu, 8 Dec 2016 19:43:39 -0500 Subject: [PATCH 038/513] all: update dependencies --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 02c1241ed0b..c81f7b9c259 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -50,7 +50,7 @@ "translate" ], "dependencies": { - "@google-cloud/common": "^0.8.0", + "@google-cloud/common": "^0.9.0", "arrify": "^1.0.0", "extend": "^3.0.0", "is": "^3.0.1", From a7a8ba6e24b4ebbc555b5da03c0ed7e00f276f25 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Thu, 8 Dec 2016 19:50:57 -0500 Subject: [PATCH 039/513] translate @ 0.6.0 tagged. --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c81f7b9c259..e68bc223ade 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.5.1", + "version": "0.6.0", "author": "Google Inc.", "description": "Google Translate API Client Library for Node.js", "contributors": [ From 8cf19a63dfcdebecb0756b7f91e4e888d26488ce Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Fri, 9 Dec 2016 15:16:00 -0800 Subject: [PATCH 040/513] Update storage samples. (#263) * Update storage samples. * Update dependencies. --- packages/google-cloud-translate/samples/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index ef36037b91b..aea880afd95 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -8,8 +8,8 @@ "test": "cd ..; npm run st -- translate/system-test/*.test.js" }, "dependencies": { - "@google-cloud/translate": "^0.5.0", - "yargs": "^6.4.0" + "@google-cloud/translate": "0.6.0", + "yargs": "6.5.0" }, "engines": { "node": ">=4.3.2" From 9b988ee517e32c123007c623931166c1a2d83b91 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Thu, 15 Dec 2016 13:55:43 -0800 Subject: [PATCH 041/513] Add Premium translation sample (#274) --- .../google-cloud-translate/samples/README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 2f2e32de72c..86cf21bff01 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -33,15 +33,15 @@ __Usage:__ `node translate.js --help` ``` Commands: - detect Detects the language of one or more strings. - list [target] Lists available translation languages. To return - language names in a language other thanEnglish, - specify a target language. - translate Translates one or more strings into the target - language. + detect Detects the language of one or more strings. + list [target] Lists available translation languages. To return language names in a + language other than English, specify a target language. + translate Translates one or more strings into the target language. + translate-with-model Translates one or more strings into the target language using the + specified model. Options: - --help Show help [boolean] + --help Show help [boolean] Examples: node translate.js detect "Hello world!" Detects the language of a string. @@ -52,6 +52,8 @@ Examples: Spanish. node translate.js translate ru "Good morning!" Translates a string into Russian. node translate.js translate ru "Good morning!" "Good night!" Translates multiple strings into Russian. + node translate.js translate-with-model ru nmt "Good Translates multiple strings into Russian using the + morning!" "Good night!" Premium model. For more information, see https://cloud.google.com/translate/docs ``` From 10b06c5e34a06b8f6774c0fbba9239b78c9a2284 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Tue, 27 Dec 2016 08:29:10 -0500 Subject: [PATCH 042/513] translate: rebrand (#1885) --- packages/google-cloud-translate/README.md | 6 +++--- packages/google-cloud-translate/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 04a7bf8ce91..598598eba20 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -1,7 +1,7 @@ # @google-cloud/translate ([Alpha][versioning]) -> Google Translate API Client Library for Node.js +> Google Cloud Translation API Client Library for Node.js -*Looking for more Google APIs than just Translate? You might want to check out [`google-cloud`][google-cloud].* +*Looking for more Google APIs than just Translation? You might want to check out [`google-cloud`][google-cloud].* - [API Documentation][gcloud-translate-docs] - [Official Documentation][cloud-translate-docs] @@ -78,7 +78,7 @@ If you are not running this client on Google Cloud Platform, you need a Google D 1. Visit the [Google Developers Console][dev-console]. 2. Create a new project or click on an existing project. 3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): - * Google Translate API + * Google Cloud Translation API 4. Navigate to **APIs & auth** > **Credentials** and then: * If you want to use a new service account key, click on **Create credentials** and select **Service account key**. After the account key is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. * If you want to generate a new service account key for an existing service account, click on **Generate new JSON key** and download the JSON key file. diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index e68bc223ade..8fb1652bad3 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -2,7 +2,7 @@ "name": "@google-cloud/translate", "version": "0.6.0", "author": "Google Inc.", - "description": "Google Translate API Client Library for Node.js", + "description": "Google Cloud Translation API Client Library for Node.js", "contributors": [ { "name": "Burcu Dogan", From e1e570a962c89218ab0cbec83137e343fdefa9bd Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Mon, 9 Jan 2017 14:02:52 -0800 Subject: [PATCH 043/513] Switch to Yarn for CI build. (#290) --- packages/google-cloud-translate/samples/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index aea880afd95..d6ef94cf65e 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -5,11 +5,11 @@ "license": "Apache Version 2.0", "author": "Google Inc.", "scripts": { - "test": "cd ..; npm run st -- translate/system-test/*.test.js" + "test": "cd ..; npm run st -- --verbose translate/system-test/*.test.js" }, "dependencies": { "@google-cloud/translate": "0.6.0", - "yargs": "6.5.0" + "yargs": "6.6.0" }, "engines": { "node": ">=4.3.2" From 77f912b92d91d0d442a363defd9ef4fa1c0b2d27 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Mon, 9 Jan 2017 20:44:57 -0500 Subject: [PATCH 044/513] update dependencies --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 8fb1652bad3..681f886ff57 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -50,7 +50,7 @@ "translate" ], "dependencies": { - "@google-cloud/common": "^0.9.0", + "@google-cloud/common": "^0.11.0", "arrify": "^1.0.0", "extend": "^3.0.0", "is": "^3.0.1", From f30dece6a727339e8e200129508033d0593a58eb Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Mon, 9 Jan 2017 20:49:04 -0500 Subject: [PATCH 045/513] translate: allow API response to vary (#1912) --- .../system-test/translate.js | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-translate/system-test/translate.js b/packages/google-cloud-translate/system-test/translate.js index 817f714038d..8f29cffd77b 100644 --- a/packages/google-cloud-translate/system-test/translate.js +++ b/packages/google-cloud-translate/system-test/translate.js @@ -56,19 +56,27 @@ describe('translate', function() { var INPUT = [ { input: 'Hello!', - expectedTranslation: '¡Hola!' + expectedTranslation: 'Hola' }, { input: 'How are you today?', - expectedTranslation: '¿Cómo estás hoy?' + expectedTranslation: 'Cómo estás hoy' } ]; + function removeSymbols(input) { + // Remove the leading and trailing ! or ? symbols. The API has been known + // to switch back and forth between returning "Cómo estás hoy" and + // "¿Cómo estás hoy?", so let's just not depend on that. + return input.replace(/^\W|\W*$/g, ''); + } + it('should translate input', function(done) { var input = INPUT.map(prop('input')); translate.translate(input, 'es', function(err, results) { assert.ifError(err); + results = results.map(removeSymbols); assert.strictEqual(results[0], INPUT[0].expectedTranslation); assert.strictEqual(results[1], INPUT[1].expectedTranslation); done(); @@ -85,6 +93,7 @@ describe('translate', function() { translate.translate(input, opts, function(err, results) { assert.ifError(err); + results = results.map(removeSymbols); assert.strictEqual(results[0], INPUT[0].expectedTranslation); assert.strictEqual(results[1], INPUT[1].expectedTranslation); done(); @@ -93,11 +102,6 @@ describe('translate', function() { it('should autodetect HTML', function(done) { var input = '' + INPUT[0].input + ''; - var expectedTranslation = [ - '', - INPUT[0].expectedTranslation, - '' - ].join(' '); var opts = { from: 'en', @@ -106,7 +110,14 @@ describe('translate', function() { translate.translate(input, opts, function(err, results) { assert.ifError(err); - assert.strictEqual(results, expectedTranslation); + + var translation = results.split(/<\/*body>/g)[1].trim(); + + assert.strictEqual( + removeSymbols(translation), + INPUT[0].expectedTranslation + ); + done(); }); }); From 3e41db3b3b997e26c67503004d46536ac970d5a5 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Thu, 2 Feb 2017 13:36:19 -0500 Subject: [PATCH 046/513] update deps --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 681f886ff57..bb6281e6788 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -50,7 +50,7 @@ "translate" ], "dependencies": { - "@google-cloud/common": "^0.11.0", + "@google-cloud/common": "^0.12.0", "arrify": "^1.0.0", "extend": "^3.0.0", "is": "^3.0.1", From 78112adb8575574d35ee0dba359ec7e4d01af5eb Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Thu, 2 Feb 2017 13:49:44 -0500 Subject: [PATCH 047/513] translate @ 0.7.0 tagged. --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index bb6281e6788..4af74e3df28 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.6.0", + "version": "0.7.0", "author": "Google Inc.", "description": "Google Cloud Translation API Client Library for Node.js", "contributors": [ From 2c1c605082e2d6f7bc882fe04ff72301f6a01a48 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Mon, 6 Feb 2017 14:59:32 -0800 Subject: [PATCH 048/513] Update dependencies. --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index d6ef94cf65e..2e176edcf37 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -8,7 +8,7 @@ "test": "cd ..; npm run st -- --verbose translate/system-test/*.test.js" }, "dependencies": { - "@google-cloud/translate": "0.6.0", + "@google-cloud/translate": "0.7.0", "yargs": "6.6.0" }, "engines": { From fa3bf489e60df42edaa4470754ebf0f35fa8aa31 Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Thu, 2 Mar 2017 20:27:44 -0500 Subject: [PATCH 049/513] docs: change Google Cloud to Cloud (#1995) --- packages/google-cloud-translate/README.md | 4 ++-- packages/google-cloud-translate/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 598598eba20..042af369176 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -1,5 +1,5 @@ # @google-cloud/translate ([Alpha][versioning]) -> Google Cloud Translation API Client Library for Node.js +> Cloud Translation API Client Library for Node.js *Looking for more Google APIs than just Translation? You might want to check out [`google-cloud`][google-cloud].* @@ -60,7 +60,7 @@ var translate = require('@google-cloud/translate')({ ## Authentication -It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Cloud services. ### On Google Cloud Platform diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 4af74e3df28..44a8be43317 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -2,7 +2,7 @@ "name": "@google-cloud/translate", "version": "0.7.0", "author": "Google Inc.", - "description": "Google Cloud Translation API Client Library for Node.js", + "description": "Cloud Translation API Client Library for Node.js", "contributors": [ { "name": "Burcu Dogan", From a368b3a742e76bc44b57691f70b12144c49879b3 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Fri, 31 Mar 2017 09:38:43 -0700 Subject: [PATCH 050/513] stability guarantee promotions (#2165) --- packages/google-cloud-translate/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 042af369176..bd42fc19f3d 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -1,4 +1,4 @@ -# @google-cloud/translate ([Alpha][versioning]) +# @google-cloud/translate ([Beta][versioning]) > Cloud Translation API Client Library for Node.js *Looking for more Google APIs than just Translation? You might want to check out [`google-cloud`][google-cloud].* From cb4895f4a75d8e20fc91417d9d79fa22888be7ee Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Fri, 31 Mar 2017 13:50:44 -0400 Subject: [PATCH 051/513] drop support for 0.12 (#2171) * all: drop support for 0.12 [ci skip] * scripts: add more modules to blacklist for now * update common deps for service modules --- packages/google-cloud-translate/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 44a8be43317..0ba5a5c91f5 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -50,7 +50,7 @@ "translate" ], "dependencies": { - "@google-cloud/common": "^0.12.0", + "@google-cloud/common": "^0.13.0", "arrify": "^1.0.0", "extend": "^3.0.0", "is": "^3.0.1", @@ -68,6 +68,6 @@ }, "license": "Apache-2.0", "engines": { - "node": ">=0.12.0" + "node": ">=4.0.0" } } From c72fbe394a798129cdb070ffa5f934b3f4f593fd Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Fri, 31 Mar 2017 15:00:19 -0400 Subject: [PATCH 052/513] translate @ 0.8.0 tagged. --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 0ba5a5c91f5..761d3c49229 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.7.0", + "version": "0.8.0", "author": "Google Inc.", "description": "Cloud Translation API Client Library for Node.js", "contributors": [ From 729b8a4a2c0eb5b8e144975d12bc65c7b1b02dde Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Wed, 5 Apr 2017 16:56:45 -0500 Subject: [PATCH 053/513] Update translate dependency (#340) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 2e176edcf37..2e4d71f0817 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -8,7 +8,7 @@ "test": "cd ..; npm run st -- --verbose translate/system-test/*.test.js" }, "dependencies": { - "@google-cloud/translate": "0.7.0", + "@google-cloud/translate": "0.8.0", "yargs": "6.6.0" }, "engines": { From 75a1028ee92ced727b34a9d23c12d5f7440aaab4 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Wed, 12 Apr 2017 14:33:06 -0700 Subject: [PATCH 054/513] Bring ML APIs up to standard. (#346) --- packages/google-cloud-translate/samples/README.md | 12 ++++++------ packages/google-cloud-translate/samples/package.json | 2 +- .../google-cloud-translate/samples/quickstart.js | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 86cf21bff01..76d2af6fba3 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -33,12 +33,12 @@ __Usage:__ `node translate.js --help` ``` Commands: - detect Detects the language of one or more strings. - list [target] Lists available translation languages. To return language names in a - language other than English, specify a target language. - translate Translates one or more strings into the target language. - translate-with-model Translates one or more strings into the target language using the - specified model. + detect Detects the language of one or more strings. + list [target] Lists available translation languages. To language names in a language + other than English, specify a target language. + translate Translates one or more strings into the target language. + translate-with-model Translates one or more strings into the target language using the + specified model. Options: --help Show help [boolean] diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 2e4d71f0817..2ebf1cb4971 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@google-cloud/translate": "0.8.0", - "yargs": "6.6.0" + "yargs": "7.0.2" }, "engines": { "node": ">=4.3.2" diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index 7bb0715b24b..394326427ce 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -39,5 +39,8 @@ translateClient.translate(text, target) console.log(`Text: ${text}`); console.log(`Translation: ${translation}`); + }) + .catch((err) => { + console.error('ERROR:', err); }); // [END translate_quickstart] From 12cd0c6ae02a5e4afc12d8524913af7c0737d29b Mon Sep 17 00:00:00 2001 From: Eric Uldall Date: Fri, 14 Apr 2017 09:19:55 -0700 Subject: [PATCH 055/513] updated FQDN's to googleapis.com with a trailing dot (#2214) --- packages/google-cloud-translate/src/index.js | 2 +- packages/google-cloud-translate/test/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index f178a01ae04..1b226eae823 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -62,7 +62,7 @@ function Translate(options) { return new Translate(options); } - var baseUrl = 'https://translation.googleapis.com/language/translate/v2'; + var baseUrl = 'https://translation.googleapis.com./language/translate/v2'; if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { baseUrl = process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index 5d4c60bbca1..8a176607f72 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -94,7 +94,7 @@ describe('Translate', function() { assert(translate instanceof FakeService); var calledWith = translate.calledWith_[0]; - var baseUrl = 'https://translation.googleapis.com/language/translate/v2'; + var baseUrl = 'https://translation.googleapis.com./language/translate/v2'; assert.strictEqual(calledWith.baseUrl, baseUrl); assert.deepEqual(calledWith.scopes, [ From 74cc09f56c9bd553027cdf504e3ac1851f07b6ad Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Fri, 14 Apr 2017 12:38:18 -0400 Subject: [PATCH 056/513] translate @ 0.8.1 tagged. --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 761d3c49229..139c0514161 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.8.0", + "version": "0.8.1", "author": "Google Inc.", "description": "Cloud Translation API Client Library for Node.js", "contributors": [ From b76c7a05d088850fdf93664ccaaf10003fd20092 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Mon, 24 Apr 2017 14:40:11 -0700 Subject: [PATCH 057/513] Cleanup App Engine samples and re-work tests. (#354) --- .../google-cloud-translate/samples/README.md | 26 +++++++++++++++-- .../samples/package.json | 29 +++++++++++++++---- .../samples/quickstart.js | 2 +- 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 76d2af6fba3..6b4bece5d97 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -12,14 +12,21 @@ text between thousands of language pairs. * [Setup](#setup) * [Samples](#samples) * [Translate](#translate) +* [Running the tests](#running-the-tests) ## Setup -1. Read [Prerequisites][prereq] and [How to run a sample][run] first. -1. Install dependencies: +1. Read [Prerequisites][prereq] and [How to run a sample][run] first. +1. Install dependencies: + + With `npm`: npm install + With `yarn`: + + yarn install + [prereq]: ../README.md#prerequisities [run]: ../README.md#how-to-run-a-sample @@ -60,3 +67,18 @@ For more information, see https://cloud.google.com/translate/docs [translate_docs]: https://cloud.google.com/translate/docs [translate_code]: translate.js + +## Running the tests + +1. Set the `GCLOUD_PROJECT` and `GOOGLE_APPLICATION_CREDENTIALS` environment + variables. + +1. Run the tests: + + With `npm`: + + npm test + + With `yarn`: + + yarn test diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 2ebf1cb4971..9aa819b873f 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -2,16 +2,33 @@ "name": "nodejs-docs-samples-translate", "version": "0.0.1", "private": true, - "license": "Apache Version 2.0", + "license": "Apache-2.0", "author": "Google Inc.", - "scripts": { - "test": "cd ..; npm run st -- --verbose translate/system-test/*.test.js" + "repository": { + "type": "git", + "url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git" }, - "dependencies": { - "@google-cloud/translate": "0.8.0", - "yargs": "7.0.2" + "cloud": { + "requiresKeyFile": true, + "requiresProjectId": true }, "engines": { "node": ">=4.3.2" + }, + "scripts": { + "lint": "samples lint", + "pretest": "npm run lint", + "system-test": "ava -T 20s --verbose system-test/*.test.js", + "test": "npm run system-test" + }, + "dependencies": { + "@google-cloud/translate": "0.8.1", + "yargs": "7.1.0" + }, + "devDependencies": { + "@google-cloud/nodejs-repo-tools": "1.3.1", + "ava": "0.19.1", + "proxyquire": "1.7.11", + "sinon": "2.1.0" } } diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index 394326427ce..473201dc215 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -1,5 +1,5 @@ /** - * Copyright 2016, Google, Inc. + * Copyright 2017, Google, Inc. * 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 From 14ce7bd09f6276137b7d863ac4eba332e4a8177e Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Tue, 2 May 2017 08:54:19 -0700 Subject: [PATCH 058/513] Upgrade to repo tools v1.4.7 (#370) --- .../google-cloud-translate/samples/README.md | 12 +++++------ .../samples/package.json | 20 ++++++++++++++----- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 6b4bece5d97..121b9f23cfd 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -2,10 +2,9 @@ # Google Translate API Node.js Samples -With the [Google Translate API][translate_docs], you can dynamically translate -text between thousands of language pairs. +[![Build](https://storage.googleapis.com/cloud-docs-samples-badges/GoogleCloudPlatform/nodejs-docs-samples/nodejs-docs-samples-translate.svg)]() -[translate_docs]: https://cloud.google.com/translate/docs/ +With the [Google Translate API](https://cloud.google.com/translate/docs), you can dynamically translate text between thousands of language pairs. ## Table of Contents @@ -34,7 +33,8 @@ text between thousands of language pairs. ### Translate -View the [documentation][translate_docs] or the [source code][translate_code]. + +View the [documentation][translate_0_docs] or the [source code][translate_0_code]. __Usage:__ `node translate.js --help` @@ -65,8 +65,8 @@ Examples: For more information, see https://cloud.google.com/translate/docs ``` -[translate_docs]: https://cloud.google.com/translate/docs -[translate_code]: translate.js +[translate_0_docs]: https://cloud.google.com/translate/docs +[translate_0_code]: translate.js ## Running the tests diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 9aa819b873f..c2a8c3395e2 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -8,10 +8,6 @@ "type": "git", "url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git" }, - "cloud": { - "requiresKeyFile": true, - "requiresProjectId": true - }, "engines": { "node": ">=4.3.2" }, @@ -26,9 +22,23 @@ "yargs": "7.1.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "1.3.1", + "@google-cloud/nodejs-repo-tools": "1.4.7", "ava": "0.19.1", "proxyquire": "1.7.11", "sinon": "2.1.0" + }, + "cloud-repo-tools": { + "requiresKeyFile": true, + "requiresProjectId": true, + "product": "translate", + "samples": [ + { + "id": "translate", + "name": "Translate", + "file": "translate.js", + "docs_link": "https://cloud.google.com/translate/docs", + "usage": "node translate.js --help" + } + ] } } From a25ab06029be7373461e9a8f7b2f9dc5abdfb6a5 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Tue, 9 May 2017 11:25:42 -0400 Subject: [PATCH 059/513] Revert "updated FQDN's to googleapis.com with a trailing dot (#2214)" (#2283) This reverts commit 13d4ed52402bfb4394aea505b4bab8e6caace989. --- packages/google-cloud-translate/src/index.js | 2 +- packages/google-cloud-translate/test/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index 1b226eae823..f178a01ae04 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -62,7 +62,7 @@ function Translate(options) { return new Translate(options); } - var baseUrl = 'https://translation.googleapis.com./language/translate/v2'; + var baseUrl = 'https://translation.googleapis.com/language/translate/v2'; if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { baseUrl = process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index 8a176607f72..5d4c60bbca1 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -94,7 +94,7 @@ describe('Translate', function() { assert(translate instanceof FakeService); var calledWith = translate.calledWith_[0]; - var baseUrl = 'https://translation.googleapis.com./language/translate/v2'; + var baseUrl = 'https://translation.googleapis.com/language/translate/v2'; assert.strictEqual(calledWith.baseUrl, baseUrl); assert.deepEqual(calledWith.scopes, [ From 5dd4636e011b299eccd1acfecac8e42e880517a5 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Wed, 10 May 2017 16:47:18 -0700 Subject: [PATCH 060/513] Upgrade repo tools and regenerate READMEs. (#384) --- .../google-cloud-translate/samples/README.md | 16 +++++++--------- .../google-cloud-translate/samples/package.json | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 121b9f23cfd..663b88310e4 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -1,10 +1,10 @@ Google Cloud Platform logo -# Google Translate API Node.js Samples +# Google Cloud Translation API Node.js Samples [![Build](https://storage.googleapis.com/cloud-docs-samples-badges/GoogleCloudPlatform/nodejs-docs-samples/nodejs-docs-samples-translate.svg)]() -With the [Google Translate API](https://cloud.google.com/translate/docs), you can dynamically translate text between thousands of language pairs. +The [Cloud Translation API](https://cloud.google.com/translate/docs), can dynamically translate text between thousands of language pairs. The Cloud Translation API lets websites and programs integrate with the translation service programmatically. The Cloud Translation API is part of the larger Cloud Machine Learning API family. ## Table of Contents @@ -18,11 +18,11 @@ With the [Google Translate API](https://cloud.google.com/translate/docs), you ca 1. Read [Prerequisites][prereq] and [How to run a sample][run] first. 1. Install dependencies: - With `npm`: + With **npm**: npm install - With `yarn`: + With **yarn**: yarn install @@ -33,7 +33,6 @@ With the [Google Translate API](https://cloud.google.com/translate/docs), you ca ### Translate - View the [documentation][translate_0_docs] or the [source code][translate_0_code]. __Usage:__ `node translate.js --help` @@ -70,15 +69,14 @@ For more information, see https://cloud.google.com/translate/docs ## Running the tests -1. Set the `GCLOUD_PROJECT` and `GOOGLE_APPLICATION_CREDENTIALS` environment - variables. +1. Set the **GCLOUD_PROJECT** and **GOOGLE_APPLICATION_CREDENTIALS** environment variables. 1. Run the tests: - With `npm`: + With **npm**: npm test - With `yarn`: + With **yarn**: yarn test diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index c2a8c3395e2..75d1daf1b20 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -22,7 +22,7 @@ "yargs": "7.1.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "1.4.7", + "@google-cloud/nodejs-repo-tools": "1.4.13", "ava": "0.19.1", "proxyquire": "1.7.11", "sinon": "2.1.0" From b6dfcb5243dde450489d7e6e990f5ff605bb209f Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Sat, 13 May 2017 15:20:04 -0400 Subject: [PATCH 061/513] translate @ 0.8.2 tagged. --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 139c0514161..830ccff5178 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.8.1", + "version": "0.8.2", "author": "Google Inc.", "description": "Cloud Translation API Client Library for Node.js", "contributors": [ From c651e4d0047ba777788371a342ca138b60434084 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Tue, 16 May 2017 09:33:07 -0700 Subject: [PATCH 062/513] Upgrade repo tools and regenerate READMEs. --- packages/google-cloud-translate/samples/README.md | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 663b88310e4..eb94019b151 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -26,7 +26,7 @@ The [Cloud Translation API](https://cloud.google.com/translate/docs), can dynami yarn install -[prereq]: ../README.md#prerequisities +[prereq]: ../README.md#prerequisites [run]: ../README.md#how-to-run-a-sample ## Samples diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 75d1daf1b20..99df0278f46 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -22,7 +22,7 @@ "yargs": "7.1.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "1.4.13", + "@google-cloud/nodejs-repo-tools": "1.4.14", "ava": "0.19.1", "proxyquire": "1.7.11", "sinon": "2.1.0" From 912348ca9452d8ee515d4cfb098a66fc0f1b13f6 Mon Sep 17 00:00:00 2001 From: florencep Date: Tue, 13 Jun 2017 12:30:50 -0700 Subject: [PATCH 063/513] model is not whitelisted anymore (#2384) --- packages/google-cloud-translate/src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index f178a01ae04..911b003bfc4 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -304,9 +304,9 @@ Translate.prototype.getLanguages = function(target, callback) { * not, we set the format as `text`. * @param {string} options.from - The ISO 639-1 language code the source input * is written in. - * @param {string} options.model - **Note:** Users must be whitelisted to use - * this parameter. Set the model type requested for this translation. Please - * refer to the upstream documentation for possible values. + * @param {string} options.model - Set the model type requested for this + * translation. Please refer to the upstream documentation for possible + * values. * @param {string} options.to - The ISO 639-1 language code to translate the * input to. * @param {function} callback - The callback function. From 1c147f4ec6362ef3e5908a6c919d3f11e1b770be Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Mon, 19 Jun 2017 16:59:32 -0700 Subject: [PATCH 064/513] Add + run dependency updating (bash) script (#401) * Add + run dependency updating script * Address comments Change-Id: I67af9d3ab9e461b579dbaee92274b6163d73c23e * Run dependency script again Change-Id: Icbec4acb2cc6bcfa40e0a3a705c5a1059d64efa5 * Update license Change-Id: Ic1dd0a1bd34356e415bdbf005b81a71a8d2695c2 * Update (more) dependencies Change-Id: Idaed95b9cfe486797fa75946b6f55e7e702217b8 --- packages/google-cloud-translate/samples/package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 99df0278f46..5143eec71b8 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -18,14 +18,14 @@ "test": "npm run system-test" }, "dependencies": { - "@google-cloud/translate": "0.8.1", - "yargs": "7.1.0" + "@google-cloud/translate": "0.8.2", + "yargs": "8.0.2" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "1.4.14", + "@google-cloud/nodejs-repo-tools": "1.4.15", "ava": "0.19.1", - "proxyquire": "1.7.11", - "sinon": "2.1.0" + "proxyquire": "1.8.0", + "sinon": "2.3.4" }, "cloud-repo-tools": { "requiresKeyFile": true, From 66d80e535bdc2e02b76117b4a585e1c93b81faf2 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Fri, 30 Jun 2017 16:22:23 -0400 Subject: [PATCH 065/513] translate: promote to GA (#2420) --- packages/google-cloud-translate/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index bd42fc19f3d..f9f96add1a9 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -1,4 +1,4 @@ -# @google-cloud/translate ([Beta][versioning]) +# @google-cloud/translate ([GA][versioning]) > Cloud Translation API Client Library for Node.js *Looking for more Google APIs than just Translation? You might want to check out [`google-cloud`][google-cloud].* From 789cd77048410f45983704592d462baccc489397 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Wed, 5 Jul 2017 17:18:18 -0400 Subject: [PATCH 066/513] translate @ 1.0.0 tagged. --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 830ccff5178..be3fd652c13 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/translate", - "version": "0.8.2", + "version": "1.0.0", "author": "Google Inc.", "description": "Cloud Translation API Client Library for Node.js", "contributors": [ From 413925086589201874752615322d13c0695997b5 Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Fri, 4 Aug 2017 17:29:41 -0700 Subject: [PATCH 067/513] Update dependencies + fix a few tests (#448) * Add semistandard as a devDependency * Fix storage tests * Fix language tests * Update (some) dependencies * Fix language slackbot tests --- packages/google-cloud-translate/samples/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 5143eec71b8..762f4ab175c 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -18,14 +18,14 @@ "test": "npm run system-test" }, "dependencies": { - "@google-cloud/translate": "0.8.2", + "@google-cloud/translate": "1.0.0", "yargs": "8.0.2" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "1.4.15", - "ava": "0.19.1", + "@google-cloud/nodejs-repo-tools": "1.4.16", + "ava": "0.21.0", "proxyquire": "1.8.0", - "sinon": "2.3.4" + "sinon": "3.0.0" }, "cloud-repo-tools": { "requiresKeyFile": true, From de69e93d98b396a6ba9e2abd0d5734b881b50f2d Mon Sep 17 00:00:00 2001 From: Ernest Landrito Date: Tue, 8 Aug 2017 11:25:04 -0700 Subject: [PATCH 068/513] Translate: Detect if array was used as input (#2514) --- packages/google-cloud-translate/src/index.js | 6 ++++-- packages/google-cloud-translate/test/index.js | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index 911b003bfc4..c901c381602 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -151,6 +151,7 @@ util.inherits(Translate, common.Service); * }); */ Translate.prototype.detect = function(input, callback) { + var inputIsArray = Array.isArray(input); input = arrify(input); this.request({ @@ -176,7 +177,7 @@ Translate.prototype.detect = function(input, callback) { return result; }); - if (input.length === 1) { + if (input.length === 1 && !inputIsArray) { results = results[0]; } @@ -368,6 +369,7 @@ Translate.prototype.getLanguages = function(target, callback) { * }); */ Translate.prototype.translate = function(input, options, callback) { + var inputIsArray = Array.isArray(input); input = arrify(input); var body = { @@ -407,7 +409,7 @@ Translate.prototype.translate = function(input, options, callback) { var translations = resp.data.translations.map(prop('translatedText')); - if (body.q.length === 1) { + if (body.q.length === 1 && !inputIsArray) { translations = translations[0]; } diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index 5d4c60bbca1..00c034065ff 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -236,6 +236,16 @@ describe('Translate', function() { done(); }); }); + + it('should return an array if input was an array', function(done) { + translate.detect([INPUT], function(err, results, apiResponse_) { + assert.ifError(err); + assert.deepEqual(results, [expectedResults]); + assert.strictEqual(apiResponse_, apiResponse); + assert.deepEqual(apiResponse_, originalApiResponse); + done(); + }); + }); }); }); @@ -494,6 +504,14 @@ describe('Translate', function() { done(); }); }); + + it('should return an array if input was an array', function(done) { + translate.translate([INPUT], OPTIONS, function(err, translations) { + assert.ifError(err); + assert.deepEqual(translations, [expectedResults]); + done(); + }); + }); }); }); From cd72a713d62aefc89b8e187da95b25d6a84c0264 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Wed, 23 Aug 2017 14:19:35 -0700 Subject: [PATCH 069/513] Build updates. (#462) --- packages/google-cloud-translate/samples/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 762f4ab175c..073205e665a 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -14,8 +14,7 @@ "scripts": { "lint": "samples lint", "pretest": "npm run lint", - "system-test": "ava -T 20s --verbose system-test/*.test.js", - "test": "npm run system-test" + "test": "samples test run --cmd ava -- -T 20s --verbose system-test/*.test.js" }, "dependencies": { "@google-cloud/translate": "1.0.0", From b9991784c61fa458907a637bee0b5d478623862e Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Thu, 31 Aug 2017 15:21:55 -0700 Subject: [PATCH 070/513] Update dependencies (#468) * Fix docs-samples tests, round 1 * Fix circle.yml * Add RUN_ALL_BUILDS flag * More container builder bugfixes * Tweak env vars + remove manual proxy install * Env vars in bashrc don't evaluate dynamically, so avoid them * Add semicolons for command ordering * Add appengine/static-files test to circle.yaml * Fix failing container builder tests * Address comments --- packages/google-cloud-translate/samples/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 073205e665a..3cd11dc889e 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -21,10 +21,10 @@ "yargs": "8.0.2" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "1.4.16", + "@google-cloud/nodejs-repo-tools": "1.4.17", "ava": "0.21.0", "proxyquire": "1.8.0", - "sinon": "3.0.0" + "sinon": "3.2.0" }, "cloud-repo-tools": { "requiresKeyFile": true, From f60a3fde972c881573d97cdcff1cc9e93e5e182b Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Tue, 12 Sep 2017 16:53:41 -0700 Subject: [PATCH 071/513] Rename COPYING to LICENSE. (#2605) * Rename COPYING to LICENSE. The open source team is asking that we use LICENSE for the license filename consistently across our repos. * Fix references of COPYING to LICENSE. --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index be3fd652c13..dd297c48bfd 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -34,7 +34,7 @@ "src", "AUTHORS", "CONTRIBUTORS", - "COPYING" + "LICENSE" ], "repository": "googlecloudplatform/google-cloud-node", "keywords": [ From da36d663b5003e2870f79a2998ffbcbf06e80963 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Tue, 24 Oct 2017 16:17:05 -0700 Subject: [PATCH 072/513] Repo Migration (#6) --- packages/google-cloud-translate/.appveyor.yml | 23 ++ .../.circleci/config.yml | 215 ++++++++++ .../.circleci/key.json.enc | Bin 0 -> 2368 bytes .../.cloud-repo-tools.json | 16 + packages/google-cloud-translate/.eslintignore | 3 + packages/google-cloud-translate/.eslintrc.yml | 13 + packages/google-cloud-translate/.gitignore | 10 + packages/google-cloud-translate/.jsdoc.js | 45 +++ packages/google-cloud-translate/.nycrc | 26 ++ .../google-cloud-translate/.prettierignore | 3 + packages/google-cloud-translate/.prettierrc | 8 + .../google-cloud-translate/CODE_OF_CONDUCT.md | 43 ++ packages/google-cloud-translate/CONTRIBUTORS | 18 + packages/google-cloud-translate/LICENSE | 202 ++++++++++ packages/google-cloud-translate/README.md | 195 ++++----- packages/google-cloud-translate/package.json | 87 +++-- .../samples/.eslintrc.yml | 3 + .../google-cloud-translate/samples/README.md | 59 +-- .../samples/package.json | 33 +- .../samples/quickstart.js | 11 +- packages/google-cloud-translate/src/index.js | 369 +++++++++++------- .../system-test/.eslintrc.yml | 6 + .../system-test/translate.js | 28 +- .../google-cloud-translate/test/.eslintrc.yml | 5 + packages/google-cloud-translate/test/index.js | 94 ++--- 25 files changed, 1098 insertions(+), 417 deletions(-) create mode 100644 packages/google-cloud-translate/.appveyor.yml create mode 100644 packages/google-cloud-translate/.circleci/config.yml create mode 100644 packages/google-cloud-translate/.circleci/key.json.enc create mode 100644 packages/google-cloud-translate/.cloud-repo-tools.json create mode 100644 packages/google-cloud-translate/.eslintignore create mode 100644 packages/google-cloud-translate/.eslintrc.yml create mode 100644 packages/google-cloud-translate/.gitignore create mode 100644 packages/google-cloud-translate/.jsdoc.js create mode 100644 packages/google-cloud-translate/.nycrc create mode 100644 packages/google-cloud-translate/.prettierignore create mode 100644 packages/google-cloud-translate/.prettierrc create mode 100644 packages/google-cloud-translate/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-translate/CONTRIBUTORS create mode 100644 packages/google-cloud-translate/LICENSE create mode 100644 packages/google-cloud-translate/samples/.eslintrc.yml create mode 100644 packages/google-cloud-translate/system-test/.eslintrc.yml create mode 100644 packages/google-cloud-translate/test/.eslintrc.yml diff --git a/packages/google-cloud-translate/.appveyor.yml b/packages/google-cloud-translate/.appveyor.yml new file mode 100644 index 00000000000..babe1d587f4 --- /dev/null +++ b/packages/google-cloud-translate/.appveyor.yml @@ -0,0 +1,23 @@ +environment: + matrix: + - nodejs_version: 4 + - nodejs_version: 6 + - nodejs_version: 7 + - nodejs_version: 8 + +install: + - ps: Install-Product node $env:nodejs_version + - npm install -g npm # Force using the latest npm to get dedupe during install + - set PATH=%APPDATA%\npm;%PATH% + - npm install --force --ignore-scripts + +test_script: + - node --version + - npm --version + - npm rebuild + - npm test + +build: off + +matrix: + fast_finish: true diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml new file mode 100644 index 00000000000..82ddc90f379 --- /dev/null +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -0,0 +1,215 @@ +--- +# "Include" for unit tests definition. +unit_tests: &unit_tests + steps: + - checkout + - run: + name: Install modules and dependencies. + command: npm install + - run: + name: Run unit tests. + command: npm test + - run: + name: Submit coverage data to codecov. + command: node_modules/.bin/codecov + when: always + +version: 2.0 +workflows: + version: 2 + tests: + jobs: + - node4: + filters: + tags: + only: /.*/ + - node6: + filters: + tags: + only: /.*/ + - node7: + filters: + tags: + only: /.*/ + - node8: + filters: + tags: + only: /.*/ + - lint: + requires: + - node4 + - node6 + - node7 + - node8 + filters: + tags: + only: /.*/ + - docs: + requires: + - node4 + - node6 + - node7 + - node8 + filters: + tags: + only: /.*/ + - system_tests: + requires: + - lint + - docs + filters: + branches: + only: master + tags: + only: /^v[\d.]+$/ + - sample_tests: + requires: + - lint + - docs + filters: + branches: + only: master + tags: + only: /^v[\d.]+$/ + - publish_npm: + requires: + - system_tests + - sample_tests + filters: + branches: + ignore: /.*/ + tags: + only: /^v[\d.]+$/ + +jobs: + node4: + docker: + - image: node:4 + steps: + - checkout + - run: + name: Install modules and dependencies. + command: npm install --unsafe-perm + - run: + name: Run unit tests. + command: npm test + - run: + name: Submit coverage data to codecov. + command: node_modules/.bin/codecov + when: always + node6: + docker: + - image: node:6 + <<: *unit_tests + node7: + docker: + - image: node:7 + <<: *unit_tests + node8: + docker: + - image: node:8 + <<: *unit_tests + + lint: + docker: + - image: node:8 + steps: + - checkout + - run: + name: Install modules and dependencies. + command: | + npm install + npm link + - run: + name: Link the module being tested to the samples. + command: | + cd samples/ + npm link @google-cloud/translate + npm install + cd .. + - run: + name: Run linting. + command: npm run lint + + docs: + docker: + - image: node:8 + steps: + - checkout + - run: + name: Install modules and dependencies. + command: npm install + - run: + name: Build documentation. + command: npm run docs + + sample_tests: + docker: + - image: node:8 + steps: + - checkout + - run: + name: Decrypt credentials. + command: | + openssl aes-256-cbc -d -in .circleci/key.json.enc \ + -out .circleci/key.json \ + -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + - run: + name: Install and link the module. + command: | + npm install + npm link + - run: + name: Link the module being tested to the samples. + command: | + cd samples/ + npm link @google-cloud/translate + npm install + cd .. + - run: + name: Run sample tests. + command: npm run samples-test + environment: + GCLOUD_PROJECT: long-door-651 + GOOGLE_APPLICATION_CREDENTIALS: /var/translate/.circleci/key.json + - run: + name: Remove unencrypted key. + command: rm .circleci/key.json + when: always + working_directory: /var/translate/ + + system_tests: + docker: + - image: node:8 + steps: + - checkout + - run: + name: Decrypt credentials. + command: | + openssl aes-256-cbc -d -in .circleci/key.json.enc \ + -out .circleci/key.json \ + -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + - run: + name: Install modules and dependencies. + command: npm install + - run: + name: Run system tests. + command: npm run system-test + environment: + GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json + - run: + name: Remove unencrypted key. + command: rm .circleci/key.json + when: always + + publish_npm: + docker: + - image: node:8 + steps: + - checkout + - run: + name: Set NPM authentication. + command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc + - run: + name: Publish the module to npm. + command: npm publish diff --git a/packages/google-cloud-translate/.circleci/key.json.enc b/packages/google-cloud-translate/.circleci/key.json.enc new file mode 100644 index 0000000000000000000000000000000000000000..0de23fb2182c10cbe02c3e57ecace392c7015552 GIT binary patch literal 2368 zcmV-G3BUGJVQh3|WM5xQt<`oVSbY)HVQpG6zWZ|x7N$0BFw(WTVt`Ke2;vlbc~kai zIhY1t`LA}Qe$q%)u`NH_>>BBn)@Vu#EMC(7?GI5=TbOR&xXGwg3bf5FI(7C~PXPz>63jKB0zXU3Ym?^`01pXpPVt+fFSZexL{1lkH7KktgKG*bF=kmq$&K_%mQ@)zgLS)Ql+2@&TTf(&d}0#s)CZPI+(7^|Cs&;XjP z6!-EjMc?u#w!Js!Ll|X3I%6tOQRpu{P2mSP015k5$yu zk{7Qz_0e8nXt~7XRJ)6j*CNl=@$5I8x1jeb6e%+LSg%;LLas2mpG#R(dTB(=7r{Av zt}bwYGL}ZJ{qfq(c1z_*$tE_F#A!=q1g5InWYrUNYFOi!ZM5^x0q;uD*8}U;T?=%{ zK6a+MtEg{2r1HjwthSyV@ZY;%H7PD{UWx%bBiKM|P9@G-fkGC%QL7?P=7V8H>PDsD z^H9N#!X`l7?5P_$hq%F#SK^k$-u%hUU8bj6>qfHWwK@V)(K~-+0^WN(#lOGAIa4C? z2Z_2@rilxyRFu*WA%|y+6o$hjMEu}j{Cca4qXs+D)auF2SGZowyQQ*5z>-VWy(QLKZH~Dr<-h7&o1|?D7t&Meo~u!AR~}HTmFY zngb>FH?P{9H@)AJDBZ#ki3s-;63Ej^PlTe$H8hQ@GvtEI>>#V{+Wi>5Z8~@{x@P~s zP-XTLxiVs_Rw>ga^|Ki;z8-Jcqhf|j#_xM|r59y^Rv}0?GeRqimiWp<*4qwn$<=Ve z`!~X_xp5wq4kQ-}5%03<0E)j~Ynd^I0y*jyR!Gkntw=2X!(}8keH2QYMo}p=53CN0 zZ*1E!=*eIGXBP|@%GwPr2VeK)a_}~#Pmkm%A}B8wtyjRL!FiJU%gPVwNqQD;MXhB% zpCiu8u?F!RB9nd8`;z~wfqu}&0}wY@PONZcL3RbxV7O2@(BNA0o5e#>$`Mo|L4oNK z`o_>UcSt}Fa#!|ZdR1MFw?mH2@(9icsR6<*>TVz7?|cXf{~u|s?A1y7v*dbfg2}AV z@8BK*vF95k^n=Sht%e+g);|_C2IWg&-swm!rIO!r^ zNA1jyCGckK!qfsYH#WRN?UbCzF+s7V;(lsGgZE=^fQN~~jqKW^N9f)nEm|tKPZS+9 zBcA_0(aGv&0Ptd+Fr1uE$Q!DOfxD4 z;+ZkqJ6ALDU$odrAt{|7)oN+!TyXDkGPN;Tw{2=_a?=Sqii8$xz;IO~HEp1=Y;n9C zI)+l-FDN@0r)G+?)48@?x!efS3G0;5{W-gyw%Pspe6EnGw$FGOsuYsac>pSzSX1O| zf=cq|6kr9%VawNjKi0Z9WZu_&MZ7Zh5ebZ3w3CfR zn=V7r8>SMu$Y5#LL=D$KbK1oTU~IqLXsvC#vNWalq#lKrfQoFv1j+#qYPA~Adj0xV zsjG1&N@+EtHuRsxXtKMWLgSHz#h;gnxF9%1p&70Z}M@|A2#5 z7z^=~Ac*K|9A#Y0UnIfXuGGrjTdv{=-QIzh9yI%7t{hLz?AX_$1J#U z`$*<22|cc!J0yDte5|&~e1eK4*b^A6*SJCG^-1^&xtiPqOUc=RdC3ThW5C0$v%6r9SUcD&B#5avAAV zUcV20Rjj+9B^M!O`G0acl0Sj)b4_YnLeF+i2vj*_&024IEBq3_I(H(~t9yrDg{_Vf zb~d3z)}K%za0N+;Q)V;27c}U)E`z=^T;f5)Kn!s^^8`q|HW z{4)of)Yf@VlzB}ro;C$l>M1F2fBqV8l=ep literal 0 HcmV?d00001 diff --git a/packages/google-cloud-translate/.cloud-repo-tools.json b/packages/google-cloud-translate/.cloud-repo-tools.json new file mode 100644 index 00000000000..65049e6bfe3 --- /dev/null +++ b/packages/google-cloud-translate/.cloud-repo-tools.json @@ -0,0 +1,16 @@ +{ + "requiresKeyFile": true, + "requiresProjectId": true, + "product": "translate", + "client_reference_url": "https://cloud.google.com/nodejs/docs/reference/translate/latest/", + "release_quality": "ga", + "samples": [ + { + "id": "translate", + "name": "Translate", + "file": "translate.js", + "docs_link": "https://cloud.google.com/translate/docs", + "usage": "node translate.js --help" + } + ] +} diff --git a/packages/google-cloud-translate/.eslintignore b/packages/google-cloud-translate/.eslintignore new file mode 100644 index 00000000000..f6fac98b0a8 --- /dev/null +++ b/packages/google-cloud-translate/.eslintignore @@ -0,0 +1,3 @@ +node_modules/* +samples/node_modules/* +src/**/doc/* diff --git a/packages/google-cloud-translate/.eslintrc.yml b/packages/google-cloud-translate/.eslintrc.yml new file mode 100644 index 00000000000..bed57fbc42c --- /dev/null +++ b/packages/google-cloud-translate/.eslintrc.yml @@ -0,0 +1,13 @@ +--- +extends: + - 'eslint:recommended' + - 'plugin:node/recommended' + - prettier +plugins: + - node + - prettier +rules: + prettier/prettier: error + block-scoped-var: error + eqeqeq: error + no-warning-comments: warn diff --git a/packages/google-cloud-translate/.gitignore b/packages/google-cloud-translate/.gitignore new file mode 100644 index 00000000000..6b80718f261 --- /dev/null +++ b/packages/google-cloud-translate/.gitignore @@ -0,0 +1,10 @@ +**/*.log +**/node_modules +.coverage +.nyc_output +docs/ +out/ +system-test/secrets.js +system-test/*key.json +*.lock +*-lock.js* diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js new file mode 100644 index 00000000000..258a304c207 --- /dev/null +++ b/packages/google-cloud-translate/.jsdoc.js @@ -0,0 +1,45 @@ +/*! + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/ink-docstrap/template', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'src' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2017 Google, Inc.', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/translate', + theme: 'lumen' + } +}; diff --git a/packages/google-cloud-translate/.nycrc b/packages/google-cloud-translate/.nycrc new file mode 100644 index 00000000000..a1a8e6920ce --- /dev/null +++ b/packages/google-cloud-translate/.nycrc @@ -0,0 +1,26 @@ +{ + "report-dir": "./.coverage", + "exclude": [ + "src/*{/*,/**/*}.js", + "src/*/v*/*.js", + "test/**/*.js" + ], + "watermarks": { + "branches": [ + 95, + 100 + ], + "functions": [ + 95, + 100 + ], + "lines": [ + 95, + 100 + ], + "statements": [ + 95, + 100 + ] + } +} diff --git a/packages/google-cloud-translate/.prettierignore b/packages/google-cloud-translate/.prettierignore new file mode 100644 index 00000000000..f6fac98b0a8 --- /dev/null +++ b/packages/google-cloud-translate/.prettierignore @@ -0,0 +1,3 @@ +node_modules/* +samples/node_modules/* +src/**/doc/* diff --git a/packages/google-cloud-translate/.prettierrc b/packages/google-cloud-translate/.prettierrc new file mode 100644 index 00000000000..df6eac07446 --- /dev/null +++ b/packages/google-cloud-translate/.prettierrc @@ -0,0 +1,8 @@ +--- +bracketSpacing: false +printWidth: 80 +semi: true +singleQuote: true +tabWidth: 2 +trailingComma: es5 +useTabs: false diff --git a/packages/google-cloud-translate/CODE_OF_CONDUCT.md b/packages/google-cloud-translate/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..46b2a08ea6d --- /dev/null +++ b/packages/google-cloud-translate/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/packages/google-cloud-translate/CONTRIBUTORS b/packages/google-cloud-translate/CONTRIBUTORS new file mode 100644 index 00000000000..f2a60a03135 --- /dev/null +++ b/packages/google-cloud-translate/CONTRIBUTORS @@ -0,0 +1,18 @@ +# The names of individuals who have contributed to this project. +# +# Names are formatted as: +# name +# +Ace Nassri +Dave Gramlich +Eric Uldall +Ernest Landrito +Jason Dobry +Jason Dobry +Luke Sneeringer +Luke Sneeringer +Stephen Sawchuk +Stephen Sawchuk +Tim Swast +florencep +greenkeeper[bot] diff --git a/packages/google-cloud-translate/LICENSE b/packages/google-cloud-translate/LICENSE new file mode 100644 index 00000000000..7a4a3ea2424 --- /dev/null +++ b/packages/google-cloud-translate/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. \ No newline at end of file diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index f9f96add1a9..67a2995d9cc 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -1,130 +1,131 @@ -# @google-cloud/translate ([GA][versioning]) -> Cloud Translation API Client Library for Node.js +Google Cloud Platform logo -*Looking for more Google APIs than just Translation? You might want to check out [`google-cloud`][google-cloud].* +# Google Cloud Translation API: Node.js Client -- [API Documentation][gcloud-translate-docs] -- [Official Documentation][cloud-translate-docs] +[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![CircleCI](https://img.shields.io/circleci/project/github/googleapis/nodejs-translate.svg?style=flat)](https://circleci.com/gh/googleapis/nodejs-translate) +[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/googleapis/nodejs-translate?branch=master&svg=true)](https://ci.appveyor.com/project/googleapis/nodejs-translate) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-translate/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-translate) +> Node.js idiomatic client for [Cloud Translation API][product-docs]. -```sh -$ npm install --save @google-cloud/translate -``` -```js -var translate = require('@google-cloud/translate')({ - projectId: 'grape-spaceship-123', - keyFilename: '/path/to/keyfile.json' -}); +The [Cloud Translation API](https://cloud.google.com/translate/docs), can dynamically translate text between thousands of language pairs. The Cloud Translation API lets websites and programs integrate with the translation service programmatically. The Cloud Translation API is part of the larger Cloud Machine Learning API family. -// Translate a string of text. -translate.translate('Hello', 'es', function(err, translation) { - if (!err) { - // translation = 'Hola' - } -}); +* [Cloud Translation API Node.js Client API Reference][client-docs] +* [Cloud Translation API Documentation][product-docs] -// Detect a language from a string of text. -translate.detect('Hello', function(err, results) { - if (!err) { - // results = { - // language: 'en', - // confidence: 1, - // input: 'Hello' - // } - } -}); +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. -// Get a list of supported languages. -translate.getLanguages(function(err, languages) { - if (!err) { - // languages = [ - // 'af', - // 'ar', - // 'az', - // ... - // ] - } -}); +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained -// Promises are also supported by omitting callbacks. -translate.getLanguages().then(function(data) { - var languages = data[0]; -}); +**Table of contents:** -// It's also possible to integrate with third-party Promise libraries. -var translate = require('@google-cloud/translate')({ - promise: require('bluebird') -}); -``` +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) +## Quickstart -## Authentication +### Before you begin -It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Cloud services. +1. Select or create a Cloud Platform project. -### On Google Cloud Platform + [Go to the projects page][projects] -If you are running this client on Google Cloud Platform, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. +1. Enable billing for your project. -``` js -var translate = require('@google-cloud/translate')(); -// ...you're good to go! -``` + [Enable billing][billing] -### With a Google Developers Service Account +1. Enable the Google Cloud Translation API API. -If you are not running this client on Google Cloud Platform, you need a Google Developers service account. To create a service account: + [Enable the API][enable_api] -1. Visit the [Google Developers Console][dev-console]. -2. Create a new project or click on an existing project. -3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): - * Google Cloud Translation API -4. Navigate to **APIs & auth** > **Credentials** and then: - * If you want to use a new service account key, click on **Create credentials** and select **Service account key**. After the account key is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. - * If you want to generate a new service account key for an existing service account, click on **Generate new JSON key** and download the JSON key file. - * If you want to use an API key, click on **Create credentials** and select **API key**. After the API key is created, you will see a newly opened modal with the API key in a field named **Your API key** that the library uses to authenticate your requests. - * If you want to generate a new API key for an existing API key, click on an existing API key and click **Regenerate key**. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. -``` js -var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=translate.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started -var translate = require('@google-cloud/translate')({ - projectId: projectId, +### Installing the client library + + npm install --save @google-cloud/translate + +### Using the client library - // The path to your key file: - keyFilename: '/path/to/keyfile.json' +```javascript +// Imports the Google Cloud client library +const Translate = require('@google-cloud/translate'); - // Or the contents of the key file: - credentials: require('./path/to/keyfile.json') +// Your Google Cloud Platform project ID +const projectId = 'YOUR_PROJECT_ID'; - // Your API key (if not using a service account JSON file): - key: '...' +// Instantiates a client +const translate = new Translate({ + projectId: projectId, }); -// ...you're good to go! +// The text to translate +const text = 'Hello, world!'; +// The target language +const target = 'ru'; + +// Translates some text into Russian +translate + .translate(text, target) + .then(results => { + const translation = results[0]; + + console.log(`Text: ${text}`); + console.log(`Translation: ${translation}`); + }) + .catch(err => { + console.error('ERROR:', err); + }); ``` -### With an API key +## Samples -It's also possible to authenticate with an API key. To create an API key: +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-translate/blob/master/samples) directory. The samples' `README.md` +has instructions for running the samples. -1. Visit the [Google Developers Console][dev-console]. -2. Create a new project or click on an existing project. -3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): - * Google Translate API -4. Navigate to **APIs & auth** > **Credentials** and then click on **Create new Client ID** and select **API key**. You should then be presented with a pop-up containing your newly created key. +| Sample | Source Code | +| --------------------------- | --------------------------------- | +| Translate | [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/translate.js) | -```js -var translate = require('@google-cloud/translate')({ - key: 'API Key' -}); +The [Cloud Translation API Node.js Client API Reference][client-docs] documentation +also contains samples. -// ...you're good to go! -``` +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +This library is considered to be **General Availability (GA)**. This means it +is stable; the code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **GA** libraries +are addressed with the highest priority. + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](.github/CONTRIBUTING.md). + +## License + +Apache Version 2.0 +See [LICENSE](LICENSE) -[versioning]: https://github.com/GoogleCloudPlatform/google-cloud-node#versioning -[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node/ -[api-key-howto]: https://cloud.google.com/translate/v2/using_rest#auth -[gcloud-translate-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/translate -[cloud-translate-docs]: https://cloud.google.com/translate/docs +[client-docs]: https://cloud.google.com/nodejs/docs/reference/translate/latest/ +[product-docs]: https://cloud.google.com/translate/docs diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index dd297c48bfd..2d7cdabf522 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,34 +1,13 @@ { "name": "@google-cloud/translate", + "description": "Cloud Translation API Client Library for Node.js", "version": "1.0.0", + "license": "Apache-2.0", "author": "Google Inc.", - "description": "Cloud Translation API Client Library for Node.js", - "contributors": [ - { - "name": "Burcu Dogan", - "email": "jbd@google.com" - }, - { - "name": "Johan Euphrosine", - "email": "proppy@google.com" - }, - { - "name": "Patrick Costello", - "email": "pcostell@google.com" - }, - { - "name": "Ryan Seys", - "email": "ryan@ryanseys.com" - }, - { - "name": "Silvano Luciani", - "email": "silvano@google.com" - }, - { - "name": "Stephen Sawchuk", - "email": "sawchuk@gmail.com" - } - ], + "engines": { + "node": ">=4.0.0" + }, + "repository": "googleapis/nodejs-translate", "main": "./src/index.js", "files": [ "src", @@ -36,7 +15,6 @@ "CONTRIBUTORS", "LICENSE" ], - "repository": "googlecloudplatform/google-cloud-node", "keywords": [ "google apis client", "google api client", @@ -49,25 +27,56 @@ "google translate", "translate" ], + "contributors": [ + "Ace Nassri ", + "Dave Gramlich ", + "Eric Uldall ", + "Ernest Landrito ", + "Jason Dobry ", + "Jason Dobry ", + "Luke Sneeringer ", + "Luke Sneeringer ", + "Stephen Sawchuk ", + "Stephen Sawchuk ", + "Tim Swast ", + "florencep ", + "greenkeeper[bot] " + ], + "scripts": { + "cover": "nyc --reporter=lcov mocha --require intelli-espower-loader test/*.js && nyc report", + "docs": "repo-tools exec -- jsdoc -c .jsdoc.js", + "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", + "lint": "repo-tools lint --cmd eslint -- src/ samples/ system-test/ test/", + "prettier": "repo-tools exec -- prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", + "publish-module": "node ../../scripts/publish.js translate", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "system-test": "repo-tools test run --cmd mocha -- system-test/*.js --no-timeouts", + "test-no-cover": "repo-tools test run --cmd mocha -- test/*.js --no-timeouts", + "test": "repo-tools test run --cmd npm -- run cover" + }, "dependencies": { "@google-cloud/common": "^0.13.0", "arrify": "^1.0.0", - "extend": "^3.0.0", + "extend": "^3.0.1", "is": "^3.0.1", "is-html": "^1.0.0", "propprop": "^0.3.0" }, "devDependencies": { - "mocha": "^3.0.1", + "@google-cloud/nodejs-repo-tools": "^2.0.11", + "async": "^2.5.0", + "codecov": "^3.0.0", + "eslint": "^4.9.0", + "eslint-config-prettier": "^2.6.0", + "eslint-plugin-node": "^5.2.0", + "eslint-plugin-prettier": "^2.3.1", + "ink-docstrap": "^1.3.0", + "intelli-espower-loader": "^1.0.1", + "jsdoc": "^3.5.5", + "mocha": "^4.0.1", + "nyc": "^11.2.1", + "power-assert": "^1.4.4", + "prettier": "^1.7.4", "proxyquire": "^1.7.10" - }, - "scripts": { - "publish-module": "node ../../scripts/publish.js translate", - "test": "mocha test/*.js", - "system-test": "mocha system-test/*.js --no-timeouts --bail" - }, - "license": "Apache-2.0", - "engines": { - "node": ">=4.0.0" } } diff --git a/packages/google-cloud-translate/samples/.eslintrc.yml b/packages/google-cloud-translate/samples/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-translate/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index eb94019b151..e7c959ca7e2 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -1,53 +1,46 @@ Google Cloud Platform logo -# Google Cloud Translation API Node.js Samples +# Google Cloud Translation API: Node.js Samples -[![Build](https://storage.googleapis.com/cloud-docs-samples-badges/GoogleCloudPlatform/nodejs-docs-samples/nodejs-docs-samples-translate.svg)]() +[![Build](https://storage.googleapis.com/.svg)]() The [Cloud Translation API](https://cloud.google.com/translate/docs), can dynamically translate text between thousands of language pairs. The Cloud Translation API lets websites and programs integrate with the translation service programmatically. The Cloud Translation API is part of the larger Cloud Machine Learning API family. ## Table of Contents -* [Setup](#setup) +* [Before you begin](#before-you-begin) * [Samples](#samples) * [Translate](#translate) -* [Running the tests](#running-the-tests) -## Setup +## Before you begin -1. Read [Prerequisites][prereq] and [How to run a sample][run] first. -1. Install dependencies: - - With **npm**: - - npm install - - With **yarn**: - - yarn install - -[prereq]: ../README.md#prerequisites -[run]: ../README.md#how-to-run-a-sample +Before running the samples, make sure you've followed the steps in the +[Before you begin section](../README.md#before-you-begin) of the client +library's README. ## Samples ### Translate -View the [documentation][translate_0_docs] or the [source code][translate_0_code]. +View the [source code][translate_0_code]. __Usage:__ `node translate.js --help` ``` +translate.js + Commands: - detect Detects the language of one or more strings. - list [target] Lists available translation languages. To language names in a language - other than English, specify a target language. - translate Translates one or more strings into the target language. - translate-with-model Translates one or more strings into the target language using the - specified model. + translate.js detect Detects the language of one or more strings. + translate.js list [target] Lists available translation languages. To language names + in a language other than English, specify a target + language. + translate.js translate Translates one or more strings into the target language. + translate.js translate-with-model Translates one or more strings into the target language + using the specified model. Options: - --help Show help [boolean] + --version Show version number [boolean] + --help Show help [boolean] Examples: node translate.js detect "Hello world!" Detects the language of a string. @@ -66,17 +59,3 @@ For more information, see https://cloud.google.com/translate/docs [translate_0_docs]: https://cloud.google.com/translate/docs [translate_0_code]: translate.js - -## Running the tests - -1. Set the **GCLOUD_PROJECT** and **GOOGLE_APPLICATION_CREDENTIALS** environment variables. - -1. Run the tests: - - With **npm**: - - npm test - - With **yarn**: - - yarn test diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 3cd11dc889e..33e343ddf3c 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -4,40 +4,23 @@ "private": true, "license": "Apache-2.0", "author": "Google Inc.", - "repository": { - "type": "git", - "url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git" - }, + "repository": "googleapis/nodejs-translate", "engines": { "node": ">=4.3.2" }, "scripts": { - "lint": "samples lint", - "pretest": "npm run lint", - "test": "samples test run --cmd ava -- -T 20s --verbose system-test/*.test.js" + "ava": "ava -T 20s --verbose test/*.test.js ./system-test/*.test.js", + "cover": "nyc --reporter=lcov --cache ava -T 20s --verbose test/*.test.js ./system-test/*.test.js && nyc report", + "test": "repo-tools test run --cmd npm -- run cover" }, "dependencies": { "@google-cloud/translate": "1.0.0", - "yargs": "8.0.2" + "yargs": "10.0.3" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "1.4.17", - "ava": "0.21.0", + "@google-cloud/nodejs-repo-tools": "2.0.11", + "ava": "0.22.0", "proxyquire": "1.8.0", - "sinon": "3.2.0" - }, - "cloud-repo-tools": { - "requiresKeyFile": true, - "requiresProjectId": true, - "product": "translate", - "samples": [ - { - "id": "translate", - "name": "Translate", - "file": "translate.js", - "docs_link": "https://cloud.google.com/translate/docs", - "usage": "node translate.js --help" - } - ] + "sinon": "4.0.1" } } diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index 473201dc215..6fd4e0350b1 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -23,8 +23,8 @@ const Translate = require('@google-cloud/translate'); const projectId = 'YOUR_PROJECT_ID'; // Instantiates a client -const translateClient = Translate({ - projectId: projectId +const translate = new Translate({ + projectId: projectId, }); // The text to translate @@ -33,14 +33,15 @@ const text = 'Hello, world!'; const target = 'ru'; // Translates some text into Russian -translateClient.translate(text, target) - .then((results) => { +translate + .translate(text, target) + .then(results => { const translation = results[0]; console.log(`Text: ${text}`); console.log(`Translation: ${translation}`); }) - .catch((err) => { + .catch(err => { console.error('ERROR:', err); }); // [END translate_quickstart] diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index c901c381602..fa71058ac56 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -14,10 +14,6 @@ * limitations under the License. */ -/*! - * @module translate - */ - 'use strict'; var arrify = require('arrify'); @@ -30,6 +26,33 @@ var util = require('util'); var PKG = require('../package.json'); +/** + * @typedef {object} ClientConfig + * @property {string} [projectId] The project ID from the Google Developer's + * Console, e.g. 'grape-spaceship-123'. We will also check the environment + * variable `GCLOUD_PROJECT` for your project ID. If your app is running in + * an environment which supports {@link https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application Application Default Credentials}, + * your project ID will be detected automatically. + * @property {string} [key] An API key. You should prefer using a Service + * Account key file instead of an API key. + * @property {string} [keyFilename] Full path to the a .json, .pem, or .p12 key + * downloaded from the Google Developers Console. If you provide a path to a + * JSON file, the `projectId` option above is not necessary. NOTE: .pem and + * .p12 require you to specify the `email` option as well. + * @property {string} [email] Account email address. Required when using a .pem + * or .p12 keyFilename. + * @property {object} [credentials] Credentials object. + * @property {string} [credentials.client_email] + * @property {string} [credentials.private_key] + * @property {boolean} [autoRetry=true] Automatically retry requests if the + * response is related to rate limits or certain intermittent server errors. + * We will exponentially backoff subsequent requests by default. + * @property {number} [maxRetries=3] Maximum number of automatic retries + * attempted before returning the error. + * @property {Constructor} [promise] Custom promise module to use instead of + * native Promises. + */ + /** * With [Google Translate](https://cloud.google.com/translate), you can * dynamically translate text between thousands of language pairs. @@ -37,14 +60,12 @@ var PKG = require('../package.json'); * The Google Translate API lets websites and programs integrate with Google * Translate programmatically. * - * @constructor - * @alias module:translate + * @class * - * @resource [Getting Started]{@link https://cloud.google.com/translate/v2/getting_started} - * @resource [Identifying your application to Google]{@link https://cloud.google.com/translate/v2/using_rest#auth} + * @see [Getting Started]{@link https://cloud.google.com/translate/v2/getting_started} + * @see [Identifying your application to Google]{@link https://cloud.google.com/translate/v2/using_rest#auth} * - * @param {object} options - [Configuration object](#/docs). - * @param {string=} options.key - An API key. + * @param {ClientConfig} [options] Configuration options. * * @example * //- @@ -53,11 +74,15 @@ var PKG = require('../package.json'); * // The environment variable, `GOOGLE_CLOUD_TRANSLATE_ENDPOINT`, is honored as * // a custom backend which our library will send requests to. * //- + * + * @example include:samples/quickstart.js + * region_tag:translate_quickstart + * Full quickstart example: */ function Translate(options) { if (!(this instanceof Translate)) { options = common.util.normalizeArguments(this, options, { - projectIdRequired: false + projectIdRequired: false, }); return new Translate(options); } @@ -65,8 +90,7 @@ function Translate(options) { var baseUrl = 'https://translation.googleapis.com/language/translate/v2'; if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { - baseUrl = process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT - .replace(/\/+$/, ''); + baseUrl = process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT.replace(/\/+$/, ''); } if (options.key) { @@ -78,7 +102,7 @@ function Translate(options) { baseUrl: baseUrl, scopes: ['https://www.googleapis.com/auth/cloud-platform'], packageJson: require('../package.json'), - projectIdRequired: false + projectIdRequired: false, }; common.Service.call(this, config, options); @@ -86,25 +110,39 @@ function Translate(options) { util.inherits(Translate, common.Service); +/** + * @typedef {array} DetectResponse + * @property {object|object[]} 0 The detection results. + * @property {string} 0.language The language code matched from the input. + * @property {number} [0.confidence] A float 0 - 1. The higher the number, the + * higher the confidence in language detection. Note, this is not always + * returned from the API. + * @property {object} 1 The full API response. + */ +/** + * @callback DetectCallback + * @param {?Error} err Request error, if any. + * @param {object|object[]} results The detection results. + * @param {string} results.language The language code matched from the input. + * @param {number} [results.confidence] A float 0 - 1. The higher the number, the + * higher the confidence in language detection. Note, this is not always + * returned from the API. + * @param {object} apiResponse The full API response. + */ /** * Detect the language used in a string or multiple strings. * - * @resource [Detect Language]{@link https://cloud.google.com/translate/v2/using_rest#detect-language} + * @see [Detect Language]{@link https://cloud.google.com/translate/v2/using_rest#detect-language} * * @param {string|string[]} input - The source string input. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {object|object[]} callback.results - If a single string input was - * given, a single result object is given. Otherwise, it is an array of - * result objects. - * @param {string} callback.results[].language - The language code matched from - * the input. - * @param {number=} callback.results[].confidence - A float 0 - 1. The higher - * the number, the higher the confidence in language detection. Note, this - * is not always returned from the API. - * @param {object} callback.apiResponse - Raw API response. + * @param {DetectCallback} [callback] Callback function. + * @returns {Promise} * * @example + * const Translate = require('@google-cloud/translate'); + * + * const translate = new Translate(); + * * //- * // Detect the language from a single string input. * //- @@ -149,110 +187,85 @@ util.inherits(Translate, common.Service); * var results = data[0]; * var apiResponse = data[2]; * }); + * + * @example include:samples/translate.js + * region_tag:translate_detect_language + * Here's a full example: */ Translate.prototype.detect = function(input, callback) { var inputIsArray = Array.isArray(input); input = arrify(input); - this.request({ - method: 'POST', - uri: '/detect', - json: { - q: input - } - }, function(err, resp) { - if (err) { - callback(err, null, resp); - return; - } + this.request( + { + method: 'POST', + uri: '/detect', + json: { + q: input, + }, + }, + function(err, resp) { + if (err) { + callback(err, null, resp); + return; + } - var results = resp.data.detections.map(function(detection, index) { - var result = extend({}, detection[0], { - input: input[index] - }); + var results = resp.data.detections.map(function(detection, index) { + var result = extend({}, detection[0], { + input: input[index], + }); - // Deprecated. - delete result.isReliable; + // Deprecated. + delete result.isReliable; - return result; - }); + return result; + }); - if (input.length === 1 && !inputIsArray) { - results = results[0]; - } + if (input.length === 1 && !inputIsArray) { + results = results[0]; + } - callback(null, results, resp); - }); + callback(null, results, resp); + } + ); }; +/** + * @typedef {array} GetLanguagesResponse + * @property {object[]} 0 The languages supported by the API. + * @property {string} 0.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * language code. + * @property {string} 0.name The language name. This can be translated into your + * preferred language with the `target` option. + * @property {object} 1 The full API response. + */ +/** + * @callback GetLanguagesCallback + * @param {?Error} err Request error, if any. + * @param {object[]} results The languages supported by the API. + * @param {string} results.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * language code. + * @param {string} results.name The language name. This can be translated into your + * preferred language with the `target` option. + * @param {object} apiResponse The full API response. + */ /** * Get an array of all supported languages. * - * @resource [Discovering Supported Languages]{@link https://cloud.google.com/translate/v2/discovering-supported-languages-with-rest} + * @see [Discovering Supported Languages]{@link https://cloud.google.com/translate/v2/discovering-supported-languages-with-rest} * - * @param {string=} target - Get the language names in a language other than + * @param {string} [target] Get the language names in a language other than * English. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {object[]} callback.languages - The languages supported by the API. - * @param {string} callback.languages[].code - The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) - * language code. - * @param {string} callback.languages[].name - The language name. This can be - * translated into your preferred language with the `target` option - * described above. - * @param {object} callback.apiResponse - Raw API response. - * - * @example - * translate.getLanguages(function(err, languages) { - * if (!err) { - * // languages = [ - * // { - * // code: 'af', - * // name: 'Afrikaans' - * // }, - * // { - * // code: 'ar', - * // name: 'Arabic' - * // }, - * // { - * // code: 'az', - * // name: 'Azerbaijani' - * // }, - * // ... - * // ] - * } - * }); + * @param {GetLanguagesCallback} [callback] Callback function. + * @returns {Promise} * - * //- - * // Get the language names in a language other than English. - * //- - * translate.getLanguages('es', function(err, languages) { - * if (!err) { - * // languages = [ - * // { - * // code: 'af', - * // name: 'afrikáans' - * // }, - * // { - * // code: 'ar', - * // name: 'árabe' - * // }, - * // { - * // code: 'az', - * // name: 'azerí' - * // }, - * // ... - * // ] - * } - * }); + * @example include:samples/translate.js + * region_tag:translate_list_codes + * Gets the language names in English: * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * translate.getLanguages().then(function(data) { - * var languages = data[0]; - * var apiResponse = data[1]; - * }); + * @example include:samples/translate.js + * region_tag:translate_list_language_names + * Gets the language names in a langauge other than English: */ Translate.prototype.getLanguages = function(target, callback) { if (is.fn(target)) { @@ -263,7 +276,7 @@ Translate.prototype.getLanguages = function(target, callback) { var reqOpts = { uri: '/languages', useQuerystring: true, - qs: {} + qs: {}, }; if (target && is.string(target)) { @@ -279,7 +292,7 @@ Translate.prototype.getLanguages = function(target, callback) { var languages = resp.data.languages.map(function(language) { return { code: language.language, - name: language.name + name: language.name, }; }); @@ -287,35 +300,49 @@ Translate.prototype.getLanguages = function(target, callback) { }); }; +/** + * Translate request options. + * + * @typedef {object} TranslateRequest + * @property {string} [format] Set the text's format as `html` or `text`. + * If not provided, we will try to auto-detect if the text given is HTML. If + * not, we set the format as `text`. + * @property {string} [from] The ISO 639-1 language code the source input + * is written in. + * @property {string} [model] Set the model type requested for this + * translation. Please refer to the upstream documentation for possible + * values. + * @property {string} to The ISO 639-1 language code to translate the + * input to. + */ +/** + * @typedef {array} TranslateResponse + * @property {object|object[]} 0 If a single string input was given, a single + * translation is given. Otherwise, it is an array of translations. + * @property {object} 1 The full API response. + */ +/** + * @callback TranslateCallback + * @param {?Error} err Request error, if any. + * @param {object|object[]} translations If a single string input was given, a + * single translation is given. Otherwise, it is an array of translations. + * @param {object} apiResponse The full API response. + */ /** * Translate a string or multiple strings into another language. * - * @resource [Translate Text](https://cloud.google.com/translate/v2/using_rest#Translate) + * @see [Translate Text](https://cloud.google.com/translate/v2/using_rest#Translate) * * @throws {Error} If `options` is provided as an object without a `to` * property. * - * @param {string|string[]} input - The source string input. - * @param {string|object=} options - If a string, it is interpreted as the + * @param {string|string[]} input The source string input. + * @param {string|TranslateRequest} [options] If a string, it is interpreted as the * target ISO 639-1 language code to translate the source input to. (e.g. * `en` for English). If an object, you may also specify the source * language. - * @param {string} options.format - Set the text's format as `html` or `text`. - * If not provided, we will try to auto-detect if the text given is HTML. If - * not, we set the format as `text`. - * @param {string} options.from - The ISO 639-1 language code the source input - * is written in. - * @param {string} options.model - Set the model type requested for this - * translation. Please refer to the upstream documentation for possible - * values. - * @param {string} options.to - The ISO 639-1 language code to translate the - * input to. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {object|object[]} callback.translations - If a single string input was - * given, a single translation is given. Otherwise, it is an array of - * translations. - * @param {object} callback.apiResponse - Raw API response. + * @param {TranslateCallback} [callback] Callback function. + * @returns {Promise} * * @example * //- @@ -367,6 +394,14 @@ Translate.prototype.getLanguages = function(target, callback) { * var translation = data[0]; * var apiResponse = data[1]; * }); + * + * @example include:samples/translate.js + * region_tag:translate_translate_text + * Full translation example: + * + * @example include:samples/translate.js + * region_tag:translate_text_with_model + * Translation using the premium model: */ Translate.prototype.translate = function(input, options, callback) { var inputIsArray = Array.isArray(input); @@ -374,7 +409,7 @@ Translate.prototype.translate = function(input, options, callback) { var body = { q: input, - format: options.format || (isHtml(input[0]) ? 'html' : 'text') + format: options.format || (isHtml(input[0]) ? 'html' : 'text'), }; if (is.string(options)) { @@ -397,24 +432,27 @@ Translate.prototype.translate = function(input, options, callback) { throw new Error('A target language is required to perform a translation.'); } - this.request({ - method: 'POST', - uri: '', - json: body - }, function(err, resp) { - if (err) { - callback(err, null, resp); - return; - } + this.request( + { + method: 'POST', + uri: '', + json: body, + }, + function(err, resp) { + if (err) { + callback(err, null, resp); + return; + } - var translations = resp.data.translations.map(prop('translatedText')); + var translations = resp.data.translations.map(prop('translatedText')); - if (body.q.length === 1 && !inputIsArray) { - translations = translations[0]; - } + if (body.q.length === 1 && !inputIsArray) { + translations = translations[0]; + } - callback(err, translations, resp); - }); + callback(err, translations, resp); + } + ); }; /** @@ -438,11 +476,11 @@ Translate.prototype.request = function(reqOpts, callback) { reqOpts = extend(true, {}, reqOpts, { qs: { - key: this.key + key: this.key, }, headers: { - 'User-Agent': common.util.getUserAgentFromPackageJson(PKG) - } + 'User-Agent': common.util.getUserAgentFromPackageJson(PKG), + }, }); common.util.makeRequest(reqOpts, this.options, callback); @@ -455,4 +493,33 @@ Translate.prototype.request = function(reqOpts, callback) { */ common.util.promisifyAll(Translate); +/** + * The `@google-cloud/translate` package has a single default export, the + * {@link Translate} class. + * + * See {@link Storage} and {@link ClientConfig} for client methods and + * configuration options. + * + * @module {constructor} @google-cloud/translate + * @alias nodejs-translate + * + * @example Install the client library with npm: + * npm install --save @google-cloud/translate + * + * @example Import the client library: + * const Translate = require('@google-cloud/translate'); + * + * @example Create a client that uses Application Default Credentials (ADC): + * const client = new Translate(); + * + * @example Create a client with explicit credentials: + * const client = new Translate({ + * projectId: 'your-project-id', + * keyFilename: '/path/to/keyfile.json', + * }); + * + * @example include:samples/quickstart.js + * region_tag:translate_quickstart + * Full quickstart example: + */ module.exports = Translate; diff --git a/packages/google-cloud-translate/system-test/.eslintrc.yml b/packages/google-cloud-translate/system-test/.eslintrc.yml new file mode 100644 index 00000000000..2e6882e46d2 --- /dev/null +++ b/packages/google-cloud-translate/system-test/.eslintrc.yml @@ -0,0 +1,6 @@ +--- +env: + mocha: true +rules: + node/no-unpublished-require: off + no-console: off diff --git a/packages/google-cloud-translate/system-test/translate.js b/packages/google-cloud-translate/system-test/translate.js index 8f29cffd77b..1504ac5c948 100644 --- a/packages/google-cloud-translate/system-test/translate.js +++ b/packages/google-cloud-translate/system-test/translate.js @@ -17,27 +17,25 @@ 'use strict'; var assert = require('assert'); -var extend = require('extend'); var prop = require('propprop'); -var env = require('../../../system-test/env.js'); var Translate = require('../'); -var API_KEY = process.env.GCLOUD_TESTS_API_KEY; +var API_KEY = process.env.TRANSLATE_API_KEY; describe('translate', function() { - var translate = new Translate(extend({}, env)); + var translate = new Translate(); describe('detecting language from input', function() { var INPUT = [ { input: 'Hello!', - expectedLanguage: 'en' + expectedLanguage: 'en', }, { input: '¡Hola!', - expectedLanguage: 'es' - } + expectedLanguage: 'es', + }, ]; it('should detect a langauge', function(done) { @@ -56,12 +54,12 @@ describe('translate', function() { var INPUT = [ { input: 'Hello!', - expectedTranslation: 'Hola' + expectedTranslation: 'Hola', }, { input: 'How are you today?', - expectedTranslation: 'Cómo estás hoy' - } + expectedTranslation: 'Cómo estás hoy', + }, ]; function removeSymbols(input) { @@ -88,7 +86,7 @@ describe('translate', function() { var opts = { from: 'en', - to: 'es' + to: 'es', }; translate.translate(input, opts, function(err, results) { @@ -105,7 +103,7 @@ describe('translate', function() { var opts = { from: 'en', - to: 'es' + to: 'es', }; translate.translate(input, opts, function(err, results) { @@ -134,7 +132,7 @@ describe('translate', function() { assert.deepEqual(englishResult, { code: 'en', - name: 'English' + name: 'English', }); done(); @@ -151,7 +149,7 @@ describe('translate', function() { assert.deepEqual(englishResult, { code: 'en', - name: 'inglés' + name: 'inglés', }); done(); @@ -161,7 +159,7 @@ describe('translate', function() { (API_KEY ? describe : describe.skip)('authentication', function() { beforeEach(function() { - translate = new Translate({ key: API_KEY }); + translate = new Translate({key: API_KEY}); }); it('should use an API key to authenticate', function(done) { diff --git a/packages/google-cloud-translate/test/.eslintrc.yml b/packages/google-cloud-translate/test/.eslintrc.yml new file mode 100644 index 00000000000..73f7bbc946f --- /dev/null +++ b/packages/google-cloud-translate/test/.eslintrc.yml @@ -0,0 +1,5 @@ +--- +env: + mocha: true +rules: + node/no-unpublished-require: off diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index 00c034065ff..96e2dab57aa 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -35,7 +35,7 @@ var fakeUtil = extend({}, util, { if (Class.name === 'Translate') { promisified = true; } - } + }, }); function FakeService() { @@ -44,7 +44,7 @@ function FakeService() { describe('Translate', function() { var OPTIONS = { - projectId: 'test-project' + projectId: 'test-project', }; var Translate; @@ -54,8 +54,8 @@ describe('Translate', function() { Translate = proxyquire('../', { '@google-cloud/common': { util: fakeUtil, - Service: FakeService - } + Service: FakeService, + }, }); }); @@ -98,7 +98,7 @@ describe('Translate', function() { assert.strictEqual(calledWith.baseUrl, baseUrl); assert.deepEqual(calledWith.scopes, [ - 'https://www.googleapis.com/auth/cloud-platform' + 'https://www.googleapis.com/auth/cloud-platform', ]); assert.deepEqual(calledWith.packageJson, require('../package.json')); assert.strictEqual(calledWith.projectIdRequired, false); @@ -106,7 +106,7 @@ describe('Translate', function() { describe('Using an API Key', function() { var KEY_OPTIONS = { - key: 'api-key' + key: 'api-key', }; beforeEach(function() { @@ -114,7 +114,7 @@ describe('Translate', function() { }); it('should localize the options', function() { - var options = { key: '...' }; + var options = {key: '...'}; var translate = new Translate(options); assert.strictEqual(translate.options, options); }); @@ -163,7 +163,7 @@ describe('Translate', function() { translate.request = function(reqOpts) { assert.strictEqual(reqOpts.uri, '/detect'); assert.strictEqual(reqOpts.method, 'POST'); - assert.deepEqual(reqOpts.json, { q: [INPUT] }); + assert.deepEqual(reqOpts.json, {q: [INPUT]}); done(); }; @@ -198,11 +198,11 @@ describe('Translate', function() { { isReliable: true, a: 'b', - c: 'd' - } - ] - ] - } + c: 'd', + }, + ], + ], + }, }; var originalApiResponse = extend({}, apiResponse); @@ -210,7 +210,7 @@ describe('Translate', function() { var expectedResults = { a: 'b', c: 'd', - input: INPUT + input: INPUT, }; beforeEach(function() { @@ -254,7 +254,7 @@ describe('Translate', function() { translate.request = function(reqOpts) { assert.strictEqual(reqOpts.uri, '/languages'); assert.deepEqual(reqOpts.qs, { - target: 'en' + target: 'en', }); done(); }; @@ -266,7 +266,7 @@ describe('Translate', function() { translate.request = function(reqOpts) { assert.strictEqual(reqOpts.uri, '/languages'); assert.deepEqual(reqOpts.qs, { - target: 'es' + target: 'es', }); done(); }; @@ -300,25 +300,25 @@ describe('Translate', function() { languages: [ { language: 'en', - name: 'English' + name: 'English', }, { language: 'es', - name: 'Spanish' - } - ] - } + name: 'Spanish', + }, + ], + }, }; var expectedResults = [ { code: 'en', - name: 'English' + name: 'English', }, { code: 'es', - name: 'Spanish' - } + name: 'Spanish', + }, ]; beforeEach(function() { @@ -346,7 +346,7 @@ describe('Translate', function() { var OPTIONS = { from: SOURCE_LANG_CODE, - to: TARGET_LANG_CODE + to: TARGET_LANG_CODE, }; describe('options = target langauge', function() { @@ -363,7 +363,7 @@ describe('Translate', function() { describe('options = { source & target }', function() { it('should throw if `to` is not provided', function() { assert.throws(function() { - translate.translate(INPUT, { from: SOURCE_LANG_CODE }, util.noop); + translate.translate(INPUT, {from: SOURCE_LANG_CODE}, util.noop); }, /A target language is required to perform a translation\./); }); @@ -374,10 +374,14 @@ describe('Translate', function() { done(); }; - translate.translate(INPUT, { - from: SOURCE_LANG_CODE, - to: TARGET_LANG_CODE - }, assert.ifError); + translate.translate( + INPUT, + { + from: SOURCE_LANG_CODE, + to: TARGET_LANG_CODE, + }, + assert.ifError + ); }); }); @@ -402,7 +406,7 @@ describe('Translate', function() { it('should allow overriding the format', function(done) { var options = extend({}, OPTIONS, { - format: 'custom format' + format: 'custom format', }); translate.request = function(reqOpts) { @@ -418,7 +422,7 @@ describe('Translate', function() { it('should set the model option when available', function(done) { var fakeOptions = { model: 'nmt', - to: 'es' + to: 'es', }; translate.request = function(reqOpts) { @@ -438,7 +442,7 @@ describe('Translate', function() { q: [INPUT], format: 'text', source: SOURCE_LANG_CODE, - target: TARGET_LANG_CODE + target: TARGET_LANG_CODE, }); done(); }; @@ -473,10 +477,10 @@ describe('Translate', function() { { translatedText: 'text', a: 'b', - c: 'd' - } - ] - } + c: 'd', + }, + ], + }, }; var expectedResults = apiResponse.data.translations[0].translatedText; @@ -532,8 +536,8 @@ describe('Translate', function() { uri: '/test', a: 'b', json: { - a: 'b' - } + a: 'b', + }, }; FakeService.prototype.request = function(reqOpts, callback) { @@ -547,7 +551,7 @@ describe('Translate', function() { describe('API key mode', function() { var KEY_OPTIONS = { - key: 'api-key' + key: 'api-key', }; beforeEach(function() { @@ -570,17 +574,17 @@ describe('Translate', function() { c: 'd', qs: { a: 'b', - c: 'd' - } + c: 'd', + }, }; var expectedReqOpts = extend(true, {}, reqOpts, { qs: { - key: translate.key + key: translate.key, }, headers: { - 'User-Agent': userAgent - } + 'User-Agent': userAgent, + }, }); expectedReqOpts.uri = translate.baseUrl + reqOpts.uri; From 981da33db21178e58b1aff520c6298d18b833523 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Tue, 24 Oct 2017 16:38:20 -0700 Subject: [PATCH 073/513] Make the translate function not error on no options. (#7) --- packages/google-cloud-translate/src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index fa71058ac56..35f05c3b19e 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -80,6 +80,8 @@ var PKG = require('../package.json'); * Full quickstart example: */ function Translate(options) { + options = options || {}; + if (!(this instanceof Translate)) { options = common.util.normalizeArguments(this, options, { projectIdRequired: false, From fdec7fadc23bdc71a15772b2a24b7fff9b333d89 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Tue, 24 Oct 2017 16:55:05 -0700 Subject: [PATCH 074/513] Bump version to 1.1.0 (#8) --- packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 2d7cdabf522..bd6faf165d4 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "1.0.0", + "version": "1.1.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 33e343ddf3c..c7c28f32f95 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -14,7 +14,7 @@ "test": "repo-tools test run --cmd npm -- run cover" }, "dependencies": { - "@google-cloud/translate": "1.0.0", + "@google-cloud/translate": "1.1.0", "yargs": "10.0.3" }, "devDependencies": { From 2e793451bdbf2c932aeddfa76705229a435abc79 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Mon, 30 Oct 2017 06:26:39 -0700 Subject: [PATCH 075/513] Upgrade repo-tools and regenerate scaffolding. (#9) --- packages/google-cloud-translate/CONTRIBUTORS | 2 -- packages/google-cloud-translate/README.md | 17 ++++++++++------- packages/google-cloud-translate/package.json | 6 ++---- .../google-cloud-translate/samples/README.md | 7 ++++++- .../google-cloud-translate/samples/package.json | 8 ++++---- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/packages/google-cloud-translate/CONTRIBUTORS b/packages/google-cloud-translate/CONTRIBUTORS index f2a60a03135..cd076f28ef6 100644 --- a/packages/google-cloud-translate/CONTRIBUTORS +++ b/packages/google-cloud-translate/CONTRIBUTORS @@ -10,9 +10,7 @@ Ernest Landrito Jason Dobry Jason Dobry Luke Sneeringer -Luke Sneeringer Stephen Sawchuk Stephen Sawchuk Tim Swast florencep -greenkeeper[bot] diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 67a2995d9cc..1320177090e 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -1,6 +1,6 @@ Google Cloud Platform logo -# Google Cloud Translation API: Node.js Client +# [Google Cloud Translation API: Node.js Client](https://github.com/googleapis/nodejs-translate) [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![CircleCI](https://img.shields.io/circleci/project/github/googleapis/nodejs-translate.svg?style=flat)](https://circleci.com/gh/googleapis/nodejs-translate) @@ -11,7 +11,9 @@ The [Cloud Translation API](https://cloud.google.com/translate/docs), can dynamically translate text between thousands of language pairs. The Cloud Translation API lets websites and programs integrate with the translation service programmatically. The Cloud Translation API is part of the larger Cloud Machine Learning API family. + * [Cloud Translation API Node.js Client API Reference][client-docs] +* [github.com/googleapis/nodejs-translate](https://github.com/googleapis/nodejs-translate) * [Cloud Translation API Documentation][product-docs] Read more about the client libraries for Cloud APIs, including the older @@ -93,12 +95,12 @@ translate ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-translate/blob/master/samples) directory. The samples' `README.md` +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-translate/tree/master/samples) directory. The samples' `README.md` has instructions for running the samples. -| Sample | Source Code | -| --------------------------- | --------------------------------- | -| Translate | [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/translate.js) | +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Translate | [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/translate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/translate.js,samples/README.md) | The [Cloud Translation API Node.js Client API Reference][client-docs] documentation also contains samples. @@ -119,13 +121,14 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](.github/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-translate/blob/master/.github/CONTRIBUTING.md). ## License Apache Version 2.0 -See [LICENSE](LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-translate/blob/master/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/translate/latest/ [product-docs]: https://cloud.google.com/translate/docs +[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index bd6faf165d4..58bf2467916 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -35,12 +35,10 @@ "Jason Dobry ", "Jason Dobry ", "Luke Sneeringer ", - "Luke Sneeringer ", "Stephen Sawchuk ", "Stephen Sawchuk ", "Tim Swast ", - "florencep ", - "greenkeeper[bot] " + "florencep " ], "scripts": { "cover": "nyc --reporter=lcov mocha --require intelli-espower-loader test/*.js && nyc report", @@ -63,7 +61,7 @@ "propprop": "^0.3.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^2.0.11", + "@google-cloud/nodejs-repo-tools": "^2.1.0", "async": "^2.5.0", "codecov": "^3.0.0", "eslint": "^4.9.0", diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index e7c959ca7e2..691e8b49a30 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -2,7 +2,7 @@ # Google Cloud Translation API: Node.js Samples -[![Build](https://storage.googleapis.com/.svg)]() +[![Open in Cloud Shell][shell_img]][shell_link] The [Cloud Translation API](https://cloud.google.com/translate/docs), can dynamically translate text between thousands of language pairs. The Cloud Translation API lets websites and programs integrate with the translation service programmatically. The Cloud Translation API is part of the larger Cloud Machine Learning API family. @@ -24,6 +24,8 @@ library's README. View the [source code][translate_0_code]. +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/translate.js,samples/README.md) + __Usage:__ `node translate.js --help` ``` @@ -59,3 +61,6 @@ For more information, see https://cloud.google.com/translate/docs [translate_0_docs]: https://cloud.google.com/translate/docs [translate_0_code]: translate.js + +[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index c7c28f32f95..4bfe6c26772 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -6,7 +6,7 @@ "author": "Google Inc.", "repository": "googleapis/nodejs-translate", "engines": { - "node": ">=4.3.2" + "node": ">=4.0.0" }, "scripts": { "ava": "ava -T 20s --verbose test/*.test.js ./system-test/*.test.js", @@ -18,9 +18,9 @@ "yargs": "10.0.3" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "2.0.11", - "ava": "0.22.0", + "@google-cloud/nodejs-repo-tools": "2.1.0", + "ava": "0.23.0", "proxyquire": "1.8.0", - "sinon": "4.0.1" + "sinon": "4.0.2" } } From ec10c9c2e911375547197ed794a00c8e085d20ca Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sat, 4 Nov 2017 09:46:55 -0400 Subject: [PATCH 076/513] fix(package): update @google-cloud/common to version 0.14.0 (#11) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 58bf2467916..1ba2db0c02d 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -53,7 +53,7 @@ "test": "repo-tools test run --cmd npm -- run cover" }, "dependencies": { - "@google-cloud/common": "^0.13.0", + "@google-cloud/common": "^0.14.0", "arrify": "^1.0.0", "extend": "^3.0.1", "is": "^3.0.1", From 4d1f5f7039952130b09a494e9337527fa943bb9d Mon Sep 17 00:00:00 2001 From: Stephen Date: Tue, 14 Nov 2017 20:06:43 -0500 Subject: [PATCH 077/513] Test on Node 9. (#16) --- packages/google-cloud-translate/.appveyor.yml | 3 --- packages/google-cloud-translate/.circleci/config.yml | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/.appveyor.yml b/packages/google-cloud-translate/.appveyor.yml index babe1d587f4..24082152655 100644 --- a/packages/google-cloud-translate/.appveyor.yml +++ b/packages/google-cloud-translate/.appveyor.yml @@ -1,8 +1,5 @@ environment: matrix: - - nodejs_version: 4 - - nodejs_version: 6 - - nodejs_version: 7 - nodejs_version: 8 install: diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 82ddc90f379..c057b85bf8d 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -35,12 +35,17 @@ workflows: filters: tags: only: /.*/ + - node9: + filters: + tags: + only: /.*/ - lint: requires: - node4 - node6 - node7 - node8 + - node9 filters: tags: only: /.*/ @@ -50,6 +55,7 @@ workflows: - node6 - node7 - node8 + - node9 filters: tags: only: /.*/ @@ -109,6 +115,10 @@ jobs: docker: - image: node:8 <<: *unit_tests + node9: + docker: + - image: node:9 + <<: *unit_tests lint: docker: From 0bc989248289ffebe1084aadbd7afcebca301cb8 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sat, 18 Nov 2017 14:56:41 -0500 Subject: [PATCH 078/513] fix(package): update @google-cloud/common to version 0.15.0 (#19) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 1ba2db0c02d..9e86ee5aae3 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -53,7 +53,7 @@ "test": "repo-tools test run --cmd npm -- run cover" }, "dependencies": { - "@google-cloud/common": "^0.14.0", + "@google-cloud/common": "^0.15.0", "arrify": "^1.0.0", "extend": "^3.0.1", "is": "^3.0.1", From f2e7fb50218ff4246b27ce02f2bec346be2efcc1 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 18 Jan 2018 08:16:14 -0500 Subject: [PATCH 079/513] =?UTF-8?q?Update=20mocha=20to=20the=20latest=20ve?= =?UTF-8?q?rsion=20=F0=9F=9A=80=20(#22)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 9e86ee5aae3..12238f3a029 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -71,7 +71,7 @@ "ink-docstrap": "^1.3.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", - "mocha": "^4.0.1", + "mocha": "^5.0.0", "nyc": "^11.2.1", "power-assert": "^1.4.4", "prettier": "^1.7.4", From 2a033adf9a7387f3c0bff8ac388df4a9311998b0 Mon Sep 17 00:00:00 2001 From: Stephen Date: Wed, 24 Jan 2018 16:22:28 -0500 Subject: [PATCH 080/513] Normalize arguments when using new. (#23) --- packages/google-cloud-translate/src/index.js | 9 +++--- packages/google-cloud-translate/test/index.js | 29 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js index 35f05c3b19e..e71f18be8c5 100644 --- a/packages/google-cloud-translate/src/index.js +++ b/packages/google-cloud-translate/src/index.js @@ -80,15 +80,14 @@ var PKG = require('../package.json'); * Full quickstart example: */ function Translate(options) { - options = options || {}; - if (!(this instanceof Translate)) { - options = common.util.normalizeArguments(this, options, { - projectIdRequired: false, - }); return new Translate(options); } + options = common.util.normalizeArguments(this, options, { + projectIdRequired: false, + }); + var baseUrl = 'https://translation.googleapis.com/language/translate/v2'; if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.js index 96e2dab57aa..76913a6f4f5 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.js @@ -37,6 +37,7 @@ var fakeUtil = extend({}, util, { } }, }); +var originalFakeUtil = extend(true, {}, fakeUtil); function FakeService() { this.calledWith_ = arguments; @@ -60,6 +61,7 @@ describe('Translate', function() { }); beforeEach(function() { + extend(fakeUtil, originalFakeUtil); makeRequestOverride = null; translate = new Translate(OPTIONS); @@ -70,24 +72,25 @@ describe('Translate', function() { assert(promisified); }); + it('should work without new', function() { + assert.doesNotThrow(function() { + Translate(OPTIONS); + }); + }); + it('should normalize the arguments', function() { - var normalizeArguments = fakeUtil.normalizeArguments; var normalizeArgumentsCalled = false; - var fakeOptions = extend({}, OPTIONS); - var fakeContext = {}; + var options = {}; - fakeUtil.normalizeArguments = function(context, options, cfg) { + fakeUtil.normalizeArguments = function(context, options_, config) { normalizeArgumentsCalled = true; - assert.strictEqual(context, fakeContext); - assert.strictEqual(options, fakeOptions); - assert.strictEqual(cfg.projectIdRequired, false); - return options; + assert.strictEqual(options_, options); + assert.strictEqual(config.projectIdRequired, false); + return options_; }; - Translate.call(fakeContext, fakeOptions); - assert(normalizeArgumentsCalled); - - fakeUtil.normalizeArguments = normalizeArguments; + new Translate(options); + assert.strictEqual(normalizeArgumentsCalled, true); }); it('should inherit from Service', function() { @@ -116,7 +119,7 @@ describe('Translate', function() { it('should localize the options', function() { var options = {key: '...'}; var translate = new Translate(options); - assert.strictEqual(translate.options, options); + assert.strictEqual(translate.options.key, options.key); }); it('should localize the api key', function() { From f9774bf420c866c465d1ffa4d6603958a96146cb Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Mon, 5 Feb 2018 13:40:49 -0500 Subject: [PATCH 081/513] =?UTF-8?q?Update=20eslint-plugin-node=20to=20the?= =?UTF-8?q?=20latest=20version=20=F0=9F=9A=80=20(#26)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 12238f3a029..573a6a8be60 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -66,7 +66,7 @@ "codecov": "^3.0.0", "eslint": "^4.9.0", "eslint-config-prettier": "^2.6.0", - "eslint-plugin-node": "^5.2.0", + "eslint-plugin-node": "^6.0.0", "eslint-plugin-prettier": "^2.3.1", "ink-docstrap": "^1.3.0", "intelli-espower-loader": "^1.0.1", From 37e417fcae6236c695645263c85c0ff091aa06ff Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 7 Feb 2018 10:39:55 -0500 Subject: [PATCH 082/513] =?UTF-8?q?Update=20@google-cloud/common=20to=20th?= =?UTF-8?q?e=20latest=20version=20=F0=9F=9A=80=20(#27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 573a6a8be60..626101e914a 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -53,7 +53,7 @@ "test": "repo-tools test run --cmd npm -- run cover" }, "dependencies": { - "@google-cloud/common": "^0.15.0", + "@google-cloud/common": "^0.16.0", "arrify": "^1.0.0", "extend": "^3.0.1", "is": "^3.0.1", From 8f4b30c701ca2dad0d301c830135e50dbd33524f Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 22 Feb 2018 16:10:38 -0800 Subject: [PATCH 083/513] chore: removing node7 job from CircleCI (#28) * chore: removing node7 job from CircleCI * chore: rename reference --- .../.circleci/config.yml | 61 +++++++------------ 1 file changed, 21 insertions(+), 40 deletions(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index c057b85bf8d..da437441ff3 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -1,7 +1,5 @@ ---- -# "Include" for unit tests definition. -unit_tests: &unit_tests - steps: +unit_tests: + steps: &unit_tests - checkout - run: name: Install modules and dependencies. @@ -13,8 +11,7 @@ unit_tests: &unit_tests name: Submit coverage data to codecov. command: node_modules/.bin/codecov when: always - -version: 2.0 +version: 2 workflows: version: 2 tests: @@ -27,10 +24,6 @@ workflows: filters: tags: only: /.*/ - - node7: - filters: - tags: - only: /.*/ - node8: filters: tags: @@ -43,7 +36,6 @@ workflows: requires: - node4 - node6 - - node7 - node8 - node9 filters: @@ -53,7 +45,6 @@ workflows: requires: - node4 - node6 - - node7 - node8 - node9 filters: @@ -67,7 +58,7 @@ workflows: branches: only: master tags: - only: /^v[\d.]+$/ + only: '/^v[\d.]+$/' - sample_tests: requires: - lint @@ -76,7 +67,7 @@ workflows: branches: only: master tags: - only: /^v[\d.]+$/ + only: '/^v[\d.]+$/' - publish_npm: requires: - system_tests @@ -85,12 +76,11 @@ workflows: branches: ignore: /.*/ tags: - only: /^v[\d.]+$/ - + only: '/^v[\d.]+$/' jobs: node4: docker: - - image: node:4 + - image: 'node:4' steps: - checkout - run: @@ -105,24 +95,19 @@ jobs: when: always node6: docker: - - image: node:6 - <<: *unit_tests - node7: - docker: - - image: node:7 - <<: *unit_tests + - image: 'node:6' + steps: *unit_tests node8: docker: - - image: node:8 - <<: *unit_tests + - image: 'node:8' + steps: *unit_tests node9: docker: - - image: node:9 - <<: *unit_tests - + - image: 'node:9' + steps: *unit_tests lint: docker: - - image: node:8 + - image: 'node:8' steps: - checkout - run: @@ -140,10 +125,9 @@ jobs: - run: name: Run linting. command: npm run lint - docs: docker: - - image: node:8 + - image: 'node:8' steps: - checkout - run: @@ -152,10 +136,9 @@ jobs: - run: name: Build documentation. command: npm run docs - sample_tests: docker: - - image: node:8 + - image: 'node:8' steps: - checkout - run: @@ -187,10 +170,9 @@ jobs: command: rm .circleci/key.json when: always working_directory: /var/translate/ - system_tests: docker: - - image: node:8 + - image: 'node:8' steps: - checkout - run: @@ -211,15 +193,14 @@ jobs: name: Remove unencrypted key. command: rm .circleci/key.json when: always - publish_npm: docker: - - image: node:8 + - image: 'node:8' steps: - checkout - run: name: Set NPM authentication. - command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc + command: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc' - run: - name: Publish the module to npm. - command: npm publish + name: Publish the module to npm. + command: npm publish From ac63cb216321f1cccdd9b9107aafe65a57f87f91 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Mon, 5 Mar 2018 15:26:09 -0500 Subject: [PATCH 084/513] =?UTF-8?q?Update=20proxyquire=20to=20the=20latest?= =?UTF-8?q?=20version=20=F0=9F=9A=80=20(#29)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 626101e914a..0d22241a5d1 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -75,6 +75,6 @@ "nyc": "^11.2.1", "power-assert": "^1.4.4", "prettier": "^1.7.4", - "proxyquire": "^1.7.10" + "proxyquire": "^2.0.0" } } From 4856eb0361f04e9f88e0457080de9c8421678361 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Fri, 16 Mar 2018 17:41:09 -0700 Subject: [PATCH 085/513] Upgrade repo-tools and regenerate scaffolding. (#33) * Upgrade repo-tools and regenerate scaffolding. * update package-lock.json, trigger CI --- packages/google-cloud-translate/.gitignore | 1 - packages/google-cloud-translate/CONTRIBUTORS | 3 + packages/google-cloud-translate/README.md | 2 +- .../google-cloud-translate/package-lock.json | 11786 ++++++++++++++++ packages/google-cloud-translate/package.json | 7 +- .../google-cloud-translate/samples/README.md | 2 +- .../samples/package.json | 2 +- 7 files changed, 11797 insertions(+), 6 deletions(-) create mode 100644 packages/google-cloud-translate/package-lock.json diff --git a/packages/google-cloud-translate/.gitignore b/packages/google-cloud-translate/.gitignore index 6b80718f261..b7d407606fb 100644 --- a/packages/google-cloud-translate/.gitignore +++ b/packages/google-cloud-translate/.gitignore @@ -7,4 +7,3 @@ out/ system-test/secrets.js system-test/*key.json *.lock -*-lock.js* diff --git a/packages/google-cloud-translate/CONTRIBUTORS b/packages/google-cloud-translate/CONTRIBUTORS index cd076f28ef6..1f8a5887454 100644 --- a/packages/google-cloud-translate/CONTRIBUTORS +++ b/packages/google-cloud-translate/CONTRIBUTORS @@ -4,13 +4,16 @@ # name # Ace Nassri +Alexander Fenster Dave Gramlich Eric Uldall Ernest Landrito Jason Dobry Jason Dobry Luke Sneeringer +Stephen Stephen Sawchuk Stephen Sawchuk Tim Swast florencep +greenkeeper[bot] diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 1320177090e..702f41d11d9 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -131,4 +131,4 @@ See [LICENSE](https://github.com/googleapis/nodejs-translate/blob/master/LICENSE [client-docs]: https://cloud.google.com/nodejs/docs/reference/translate/latest/ [product-docs]: https://cloud.google.com/translate/docs -[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png +[shell_img]: //gstatic.com/cloudssh/images/open-btn.png diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json new file mode 100644 index 00000000000..30f95e700b1 --- /dev/null +++ b/packages/google-cloud-translate/package-lock.json @@ -0,0 +1,11786 @@ +{ + "name": "@google-cloud/translate", + "version": "1.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@ava/babel-plugin-throws-helper": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@ava/babel-plugin-throws-helper/-/babel-plugin-throws-helper-2.0.0.tgz", + "integrity": "sha1-L8H+PCEacQcaTsp7j3r1hCzRrnw=", + "dev": true + }, + "@ava/babel-preset-stage-4": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@ava/babel-preset-stage-4/-/babel-preset-stage-4-1.1.0.tgz", + "integrity": "sha512-oWqTnIGXW3k72UFidXzW0ONlO7hnO9x02S/QReJ7NBGeiBH9cUHY9+EfV6C8PXC6YJH++WrliEq03wMSJGNZFg==", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "6.22.0", + "babel-plugin-syntax-trailing-function-commas": "6.22.0", + "babel-plugin-transform-async-to-generator": "6.24.1", + "babel-plugin-transform-es2015-destructuring": "6.23.0", + "babel-plugin-transform-es2015-function-name": "6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-plugin-transform-es2015-parameters": "6.24.1", + "babel-plugin-transform-es2015-spread": "6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "6.24.1", + "babel-plugin-transform-es2015-unicode-regex": "6.24.1", + "babel-plugin-transform-exponentiation-operator": "6.24.1", + "package-hash": "1.2.0" + }, + "dependencies": { + "md5-hex": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", + "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", + "dev": true, + "requires": { + "md5-o-matic": "0.1.1" + } + }, + "package-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-1.2.0.tgz", + "integrity": "sha1-AD5WzVe3NqbtYRTMK4FUJnJ3DkQ=", + "dev": true, + "requires": { + "md5-hex": "1.3.0" + } + } + } + }, + "@ava/babel-preset-transform-test-files": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@ava/babel-preset-transform-test-files/-/babel-preset-transform-test-files-3.0.0.tgz", + "integrity": "sha1-ze0RlqjY2TgaUJJAq5LpGl7Aafc=", + "dev": true, + "requires": { + "@ava/babel-plugin-throws-helper": "2.0.0", + "babel-plugin-espower": "2.4.0" + } + }, + "@ava/write-file-atomic": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ava/write-file-atomic/-/write-file-atomic-2.2.0.tgz", + "integrity": "sha512-BTNB3nGbEfJT+69wuqXFr/bQH7Vr7ihx2xGOMNqPgDGhwspoZhiWumDDZNjBy7AScmqS5CELIOGtPVXESyrnDA==", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "imurmurhash": "0.1.4", + "slide": "1.1.6" + } + }, + "@concordance/react": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@concordance/react/-/react-1.0.0.tgz", + "integrity": "sha512-htrsRaQX8Iixlsek8zQU7tE8wcsTQJ5UhZkSPEA8slCDAisKpC/2VgU/ucPn32M5/LjGGXRaUEKvEw1Wiuu4zQ==", + "dev": true, + "requires": { + "arrify": "1.0.1" + } + }, + "@google-cloud/common": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.16.2.tgz", + "integrity": "sha512-GrkaFoj0/oO36pNs4yLmaYhTujuA3i21FdQik99Fd/APix1uhf01VlpJY4lAteTDFLRNkRx6ydEh7OVvmeUHng==", + "requires": { + "array-uniq": "1.0.3", + "arrify": "1.0.1", + "concat-stream": "1.6.1", + "create-error-class": "3.0.2", + "duplexify": "3.5.4", + "ent": "2.2.0", + "extend": "3.0.1", + "google-auto-auth": "0.9.7", + "is": "3.2.1", + "log-driver": "1.2.7", + "methmeth": "1.1.0", + "modelo": "4.2.3", + "request": "2.85.0", + "retry-request": "3.3.1", + "split-array-stream": "1.0.3", + "stream-events": "1.0.2", + "string-format-obj": "1.1.1", + "through2": "2.0.3" + } + }, + "@google-cloud/nodejs-repo-tools": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.2.4.tgz", + "integrity": "sha512-yHxW7JvhnqgoIftv6dAn1r/9AEcPuumD0xXggdYHmDeyf38OMYyjTk92gP9vflTOee1JhM0vOarwGrlKYUbmnQ==", + "dev": true, + "requires": { + "ava": "0.25.0", + "colors": "1.1.2", + "fs-extra": "5.0.0", + "got": "8.2.0", + "handlebars": "4.0.11", + "lodash": "4.17.5", + "nyc": "11.4.1", + "proxyquire": "1.8.0", + "sinon": "4.3.0", + "string": "3.3.3", + "supertest": "3.0.0", + "yargs": "11.0.0", + "yargs-parser": "9.0.2" + }, + "dependencies": { + "nyc": { + "version": "11.4.1", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.4.1.tgz", + "integrity": "sha512-5eCZpvaksFVjP2rt1r60cfXmt3MUtsQDw8bAzNqNEr4WLvUMLgiVENMf/B9bE9YAX0mGVvaGA3v9IS9ekNqB1Q==", + "dev": true, + "requires": { + "archy": "1.0.0", + "arrify": "1.0.1", + "caching-transform": "1.0.1", + "convert-source-map": "1.5.1", + "debug-log": "1.0.1", + "default-require-extensions": "1.0.0", + "find-cache-dir": "0.1.1", + "find-up": "2.1.0", + "foreground-child": "1.5.6", + "glob": "7.1.2", + "istanbul-lib-coverage": "1.1.1", + "istanbul-lib-hook": "1.1.0", + "istanbul-lib-instrument": "1.9.1", + "istanbul-lib-report": "1.1.2", + "istanbul-lib-source-maps": "1.2.2", + "istanbul-reports": "1.1.3", + "md5-hex": "1.3.0", + "merge-source-map": "1.0.4", + "micromatch": "2.3.11", + "mkdirp": "0.5.1", + "resolve-from": "2.0.0", + "rimraf": "2.6.2", + "signal-exit": "3.0.2", + "spawn-wrap": "1.4.2", + "test-exclude": "4.1.1", + "yargs": "10.0.3", + "yargs-parser": "8.0.0" + }, + "dependencies": { + "align-text": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "amdefine": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "bundled": true, + "dev": true + }, + "append-transform": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "requires": { + "default-require-extensions": "1.0.0" + } + }, + "archy": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "arr-diff": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "arrify": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "async": { + "version": "1.5.2", + "bundled": true, + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "babel-generator": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.4", + "source-map": "0.5.7", + "trim-right": "1.0.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-runtime": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "core-js": "2.5.3", + "regenerator-runtime": "0.11.1" + } + }, + "babel-template": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "lodash": "4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "debug": "2.6.9", + "globals": "9.18.0", + "invariant": "2.2.2", + "lodash": "4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "esutils": "2.0.2", + "lodash": "4.17.4", + "to-fast-properties": "1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "bundled": true, + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.8", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "bundled": true, + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "builtin-modules": { + "version": "1.1.1", + "bundled": true, + "dev": true + }, + "caching-transform": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "md5-hex": "1.3.0", + "mkdirp": "0.5.1", + "write-file-atomic": "1.3.4" + } + }, + "camelcase": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true + }, + "center-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chalk": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "cliui": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "commondir": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "convert-source-map": { + "version": "1.5.1", + "bundled": true, + "dev": true + }, + "core-js": { + "version": "2.5.3", + "bundled": true, + "dev": true + }, + "cross-spawn": { + "version": "4.0.2", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "4.1.1", + "which": "1.3.0" + } + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-log": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "default-require-extensions": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "strip-bom": "2.0.0" + } + }, + "detect-indent": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "error-ex": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "bundled": true, + "dev": true + }, + "esutils": { + "version": "2.0.2", + "bundled": true, + "dev": true + }, + "execa": { + "version": "0.7.0", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + } + } + }, + "expand-brackets": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "bundled": true, + "dev": true, + "requires": { + "fill-range": "2.2.3" + } + }, + "extglob": { + "version": "0.3.2", + "bundled": true, + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "filename-regex": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "fill-range": { + "version": "2.2.3", + "bundled": true, + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "find-cache-dir": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "requires": { + "commondir": "1.0.1", + "mkdirp": "0.5.1", + "pkg-dir": "1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "for-in": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "for-own": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "foreground-child": { + "version": "1.5.6", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "4.0.2", + "signal-exit": "3.0.2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "get-caller-file": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "bundled": true, + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "globals": { + "version": "9.18.0", + "bundled": true, + "dev": true + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "handlebars": { + "version": "4.0.11", + "bundled": true, + "dev": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "bundled": true, + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "has-ansi": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "hosted-git-info": { + "version": "2.5.0", + "bundled": true, + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "bundled": true, + "dev": true + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "invariant": { + "version": "2.2.2", + "bundled": true, + "dev": true, + "requires": { + "loose-envify": "1.3.1" + } + }, + "invert-kv": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "bundled": true, + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-dotfile": { + "version": "1.0.3", + "bundled": true, + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-glob": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-number": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isexe": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "isobject": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "istanbul-lib-coverage": { + "version": "1.1.1", + "bundled": true, + "dev": true + }, + "istanbul-lib-hook": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "append-transform": "0.4.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.9.1", + "bundled": true, + "dev": true, + "requires": { + "babel-generator": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "istanbul-lib-coverage": "1.1.1", + "semver": "5.4.1" + } + }, + "istanbul-lib-report": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "requires": { + "istanbul-lib-coverage": "1.1.1", + "mkdirp": "0.5.1", + "path-parse": "1.0.5", + "supports-color": "3.2.3" + }, + "dependencies": { + "supports-color": { + "version": "3.2.3", + "bundled": true, + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.2", + "bundled": true, + "dev": true, + "requires": { + "debug": "3.1.0", + "istanbul-lib-coverage": "1.1.1", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "source-map": "0.5.7" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "istanbul-reports": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "requires": { + "handlebars": "4.0.11" + } + }, + "js-tokens": { + "version": "3.0.2", + "bundled": true, + "dev": true + }, + "jsesc": { + "version": "1.3.0", + "bundled": true, + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "lazy-cache": { + "version": "1.0.4", + "bundled": true, + "dev": true, + "optional": true + }, + "lcid": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "invert-kv": "1.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "bundled": true, + "dev": true + } + } + }, + "lodash": { + "version": "4.17.4", + "bundled": true, + "dev": true + }, + "longest": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "loose-envify": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "js-tokens": "3.0.2" + } + }, + "lru-cache": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "md5-hex": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "md5-o-matic": "0.1.1" + } + }, + "md5-o-matic": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "mem": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "mimic-fn": "1.1.0" + } + }, + "merge-source-map": { + "version": "1.0.4", + "bundled": true, + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "micromatch": { + "version": "2.3.11", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } + }, + "mimic-fn": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "normalize-package-data": { + "version": "2.4.0", + "bundled": true, + "dev": true, + "requires": { + "hosted-git-info": "2.5.0", + "is-builtin-module": "1.0.0", + "semver": "5.4.1", + "validate-npm-package-license": "3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "npm-run-path": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "path-key": "2.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true + }, + "object.omit": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "optimist": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8", + "wordwrap": "0.0.3" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "p-limit": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "p-locate": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-limit": "1.1.0" + } + }, + "parse-glob": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } + }, + "parse-json": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "path-exists": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "path-key": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "bundled": true, + "dev": true + }, + "path-type": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pify": { + "version": "2.3.0", + "bundled": true, + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "bundled": true, + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pkg-dir": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "1.1.2" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + } + } + }, + "preserve": { + "version": "0.2.0", + "bundled": true, + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "randomatic": { + "version": "1.1.7", + "bundled": true, + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "read-pkg": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + } + } + }, + "regenerator-runtime": { + "version": "0.11.1", + "bundled": true, + "dev": true + }, + "regex-cache": { + "version": "0.4.4", + "bundled": true, + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "bundled": true, + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "bundled": true, + "dev": true + }, + "repeating": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "require-directory": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "resolve-from": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "right-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "semver": { + "version": "5.4.1", + "bundled": true, + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true + }, + "slide": { + "version": "1.1.6", + "bundled": true, + "dev": true + }, + "source-map": { + "version": "0.5.7", + "bundled": true, + "dev": true + }, + "spawn-wrap": { + "version": "1.4.2", + "bundled": true, + "dev": true, + "requires": { + "foreground-child": "1.5.6", + "mkdirp": "0.5.1", + "os-homedir": "1.0.2", + "rimraf": "2.6.2", + "signal-exit": "3.0.2", + "which": "1.3.0" + } + }, + "spdx-correct": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "spdx-license-ids": "1.2.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "bundled": true, + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "bundled": true, + "dev": true + }, + "string-width": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-eof": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "test-exclude": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "requires": { + "arrify": "1.0.1", + "micromatch": "2.3.11", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "require-main-filename": "1.0.1" + } + }, + "to-fast-properties": { + "version": "1.0.3", + "bundled": true, + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "yargs": { + "version": "3.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "validate-npm-package-license": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.4" + } + }, + "which": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "window-size": { + "version": "0.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.3", + "bundled": true, + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "write-file-atomic": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "imurmurhash": "0.1.4", + "slide": "1.1.6" + } + }, + "y18n": { + "version": "3.2.1", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "2.1.2", + "bundled": true, + "dev": true + }, + "yargs": { + "version": "10.0.3", + "bundled": true, + "dev": true, + "requires": { + "cliui": "3.2.0", + "decamelize": "1.2.0", + "find-up": "2.1.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "8.0.0" + }, + "dependencies": { + "cliui": { + "version": "3.2.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + }, + "dependencies": { + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + } + } + }, + "yargs-parser": { + "version": "8.0.0", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "bundled": true, + "dev": true + } + } + } + } + }, + "proxyquire": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-1.8.0.tgz", + "integrity": "sha1-AtUUpb7ZhvBMuyCTrxZ0FTX3ntw=", + "dev": true, + "requires": { + "fill-keys": "1.0.2", + "module-not-found-error": "1.0.1", + "resolve": "1.1.7" + } + } + } + }, + "@ladjs/time-require": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@ladjs/time-require/-/time-require-0.1.4.tgz", + "integrity": "sha512-weIbJqTMfQ4r1YX85u54DKfjLZs2jwn1XZ6tIOP/pFgMwhIN5BAtaCp/1wn9DzyLsDR9tW0R2NIePcVJ45ivQQ==", + "dev": true, + "requires": { + "chalk": "0.4.0", + "date-time": "0.1.1", + "pretty-ms": "0.2.2", + "text-table": "0.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", + "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", + "dev": true + }, + "chalk": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", + "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", + "dev": true, + "requires": { + "ansi-styles": "1.0.0", + "has-color": "0.1.7", + "strip-ansi": "0.1.1" + } + }, + "pretty-ms": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-0.2.2.tgz", + "integrity": "sha1-2oeaaC/zOjcBEEbxPWJ/Z8c7hPY=", + "dev": true, + "requires": { + "parse-ms": "0.1.2" + } + }, + "strip-ansi": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", + "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", + "dev": true + } + } + }, + "@sindresorhus/is": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", + "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==", + "dev": true + }, + "@sinonjs/formatio": { + "version": "2.0.0", + "resolved": "http://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", + "integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==", + "dev": true, + "requires": { + "samsam": "1.3.0" + } + }, + "acorn": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "dev": true + }, + "acorn-es7-plugin": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz", + "integrity": "sha1-8u4fMiipDurRJF+asZIusucdM2s=", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-align": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "dev": true, + "requires": { + "string-width": "2.1.1" + } + }, + "ansi-escapes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", + "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "2.3.11", + "normalize-path": "2.1.1" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "argv": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz", + "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=", + "dev": true + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "arr-exclude": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/arr-exclude/-/arr-exclude-1.0.0.tgz", + "integrity": "sha1-38fC5VKicHI8zaBM8xKMjL/lxjE=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true + }, + "array-filter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", + "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", + "dev": true + }, + "array-find": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz", + "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "requires": { + "lodash": "4.17.5" + } + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "auto-bind": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-1.2.0.tgz", + "integrity": "sha512-Zw7pZp7tztvKnWWtoII4AmqH5a2PV3ZN5F0BPRTGcc1kpRm4b6QXQnPU7Znbl6BfPfqOVOV29g4JeMqZQaqqOA==", + "dev": true + }, + "ava": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/ava/-/ava-0.25.0.tgz", + "integrity": "sha512-4lGNJCf6xL8SvsKVEKxEE46se7JAUIAZoKHw9itTQuwcsydhpAMkBs5gOOiWiwt0JKNIuXWc2/r4r8ZdcNrBEw==", + "dev": true, + "requires": { + "@ava/babel-preset-stage-4": "1.1.0", + "@ava/babel-preset-transform-test-files": "3.0.0", + "@ava/write-file-atomic": "2.2.0", + "@concordance/react": "1.0.0", + "@ladjs/time-require": "0.1.4", + "ansi-escapes": "3.0.0", + "ansi-styles": "3.2.1", + "arr-flatten": "1.1.0", + "array-union": "1.0.2", + "array-uniq": "1.0.3", + "arrify": "1.0.1", + "auto-bind": "1.2.0", + "ava-init": "0.2.1", + "babel-core": "6.26.0", + "babel-generator": "6.26.1", + "babel-plugin-syntax-object-rest-spread": "6.13.0", + "bluebird": "3.5.1", + "caching-transform": "1.0.1", + "chalk": "2.3.2", + "chokidar": "1.7.0", + "clean-stack": "1.3.0", + "clean-yaml-object": "0.1.0", + "cli-cursor": "2.1.0", + "cli-spinners": "1.1.0", + "cli-truncate": "1.1.0", + "co-with-promise": "4.6.0", + "code-excerpt": "2.1.1", + "common-path-prefix": "1.0.0", + "concordance": "3.0.0", + "convert-source-map": "1.5.1", + "core-assert": "0.2.1", + "currently-unhandled": "0.4.1", + "debug": "3.1.0", + "dot-prop": "4.2.0", + "empower-core": "0.6.2", + "equal-length": "1.0.1", + "figures": "2.0.0", + "find-cache-dir": "1.0.0", + "fn-name": "2.0.1", + "get-port": "3.2.0", + "globby": "6.1.0", + "has-flag": "2.0.0", + "hullabaloo-config-manager": "1.1.1", + "ignore-by-default": "1.0.1", + "import-local": "0.1.1", + "indent-string": "3.2.0", + "is-ci": "1.1.0", + "is-generator-fn": "1.0.0", + "is-obj": "1.0.1", + "is-observable": "1.1.0", + "is-promise": "2.1.0", + "last-line-stream": "1.0.0", + "lodash.clonedeepwith": "4.5.0", + "lodash.debounce": "4.0.8", + "lodash.difference": "4.5.0", + "lodash.flatten": "4.4.0", + "loud-rejection": "1.6.0", + "make-dir": "1.2.0", + "matcher": "1.1.0", + "md5-hex": "2.0.0", + "meow": "3.7.0", + "ms": "2.0.0", + "multimatch": "2.1.0", + "observable-to-promise": "0.5.0", + "option-chain": "1.0.0", + "package-hash": "2.0.0", + "pkg-conf": "2.1.0", + "plur": "2.1.2", + "pretty-ms": "3.1.0", + "require-precompiled": "0.1.0", + "resolve-cwd": "2.0.0", + "safe-buffer": "5.1.1", + "semver": "5.5.0", + "slash": "1.0.0", + "source-map-support": "0.5.4", + "stack-utils": "1.0.1", + "strip-ansi": "4.0.0", + "strip-bom-buf": "1.0.0", + "supertap": "1.0.0", + "supports-color": "5.3.0", + "trim-off-newlines": "1.0.1", + "unique-temp-dir": "1.0.0", + "update-notifier": "2.3.0" + } + }, + "ava-init": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ava-init/-/ava-init-0.2.1.tgz", + "integrity": "sha512-lXwK5LM+2g1euDRqW1mcSX/tqzY1QU7EjKpqayFPPtNRmbSYZ8RzPO5tqluTToijmtjp2M+pNpVdbcHssC4glg==", + "dev": true, + "requires": { + "arr-exclude": "1.0.0", + "execa": "0.7.0", + "has-yarn": "1.0.0", + "read-pkg-up": "2.0.0", + "write-pkg": "3.1.0" + } + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" + }, + "axios": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", + "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", + "requires": { + "follow-redirects": "1.4.1", + "is-buffer": "1.1.6" + } + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "babel-core": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", + "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-generator": "6.26.1", + "babel-helpers": "6.24.1", + "babel-messages": "6.23.0", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "convert-source-map": "1.5.1", + "debug": "2.6.9", + "json5": "0.5.1", + "lodash": "4.17.5", + "minimatch": "3.0.4", + "path-is-absolute": "1.0.1", + "private": "0.1.8", + "slash": "1.0.0", + "source-map": "0.5.7" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.5", + "source-map": "0.5.7", + "trim-right": "1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + } + } + }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "dev": true, + "requires": { + "babel-helper-explode-assignable-expression": "6.24.1", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "6.24.1", + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "lodash": "4.17.5" + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-espower": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/babel-plugin-espower/-/babel-plugin-espower-2.4.0.tgz", + "integrity": "sha512-/+SRpy7pKgTI28oEHfn1wkuM5QFAdRq8WNsOOih1dVrdV6A/WbNbRZyl0eX5eyDgtb0lOE27PeDFuCX2j8OxVg==", + "dev": true, + "requires": { + "babel-generator": "6.26.1", + "babylon": "6.18.0", + "call-matcher": "1.0.1", + "core-js": "2.5.3", + "espower-location-detector": "1.0.0", + "espurify": "1.7.0", + "estraverse": "4.2.0" + } + }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "dev": true + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "dev": true + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "dev": true + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "dev": true + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "6.24.1", + "babel-plugin-syntax-async-functions": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz", + "integrity": "sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo=", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "6.24.1", + "babel-helper-get-function-arity": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "requires": { + "babel-helper-regex": "6.26.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "requires": { + "babel-helper-regex": "6.26.0", + "babel-runtime": "6.26.0", + "regexpu-core": "2.0.0" + } + }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dev": true, + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "6.24.1", + "babel-plugin-syntax-exponentiation-operator": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "6.26.0", + "babel-runtime": "6.26.0", + "core-js": "2.5.3", + "home-or-tmp": "2.0.0", + "lodash": "4.17.5", + "mkdirp": "0.5.1", + "source-map-support": "0.4.18" + }, + "dependencies": { + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + } + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "2.5.3", + "regenerator-runtime": "0.11.1" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "lodash": "4.17.5" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "debug": "2.6.9", + "globals": "9.18.0", + "invariant": "2.2.4", + "lodash": "4.17.5" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "esutils": "2.0.2", + "lodash": "4.17.5", + "to-fast-properties": "1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base64url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", + "integrity": "sha1-6sFuA+oUOO/5Qj1puqNiYu0fcLs=" + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "binary-extensions": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "dev": true + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "dev": true + }, + "boom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "requires": { + "hoek": "4.2.1" + } + }, + "boxen": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", + "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "dev": true, + "requires": { + "ansi-align": "2.0.0", + "camelcase": "4.1.0", + "chalk": "2.3.2", + "cli-boxes": "1.0.0", + "string-width": "2.1.1", + "term-size": "1.2.0", + "widest-line": "2.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "buf-compare": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buf-compare/-/buf-compare-1.0.1.tgz", + "integrity": "sha1-/vKNqLgROgoNtEMLC2Rntpcws0o=", + "dev": true + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "cacheable-request": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz", + "integrity": "sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=", + "dev": true, + "requires": { + "clone-response": "1.0.2", + "get-stream": "3.0.0", + "http-cache-semantics": "3.8.1", + "keyv": "3.0.0", + "lowercase-keys": "1.0.0", + "normalize-url": "2.0.1", + "responselike": "1.0.2" + } + }, + "caching-transform": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", + "integrity": "sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE=", + "dev": true, + "requires": { + "md5-hex": "1.3.0", + "mkdirp": "0.5.1", + "write-file-atomic": "1.3.4" + }, + "dependencies": { + "md5-hex": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", + "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", + "dev": true, + "requires": { + "md5-o-matic": "0.1.1" + } + }, + "write-file-atomic": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "imurmurhash": "0.1.4", + "slide": "1.1.6" + } + } + } + }, + "call-matcher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-matcher/-/call-matcher-1.0.1.tgz", + "integrity": "sha1-UTTQd5hPcSpU2tPL9i3ijc5BbKg=", + "dev": true, + "requires": { + "core-js": "2.5.3", + "deep-equal": "1.0.1", + "espurify": "1.7.0", + "estraverse": "4.2.0" + } + }, + "call-signature": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", + "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "2.1.1", + "map-obj": "1.0.1" + } + }, + "capture-stack-trace": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", + "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "catharsis": { + "version": "0.8.9", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.9.tgz", + "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", + "dev": true, + "requires": { + "underscore-contrib": "0.3.0" + } + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chalk": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.3.0" + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "1.3.2", + "async-each": "1.0.1", + "fsevents": "1.1.3", + "glob-parent": "2.0.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "2.0.1", + "path-is-absolute": "1.0.1", + "readdirp": "2.1.0" + } + }, + "ci-info": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.3.tgz", + "integrity": "sha512-SK/846h/Rcy8q9Z9CAwGBLfCJ6EkjJWdpelWDufQpqVDYq2Wnnv8zlSO6AMQap02jvhVruKKpEtQOufo3pFhLg==", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "clean-stack": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-1.3.0.tgz", + "integrity": "sha1-noIVAa6XmYbEax1m0tQy2y/UrjE=", + "dev": true + }, + "clean-yaml-object": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", + "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", + "dev": true + }, + "cli-boxes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", + "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-spinners": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.1.0.tgz", + "integrity": "sha1-8YR7FohE2RemceudFH499JfJDQY=", + "dev": true + }, + "cli-truncate": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-1.1.0.tgz", + "integrity": "sha512-bAtZo0u82gCfaAGfSNxUdTI9mNyza7D8w4CVCcaOsy7sgwDzvx6ekr6cuWJqY3UGzgnQ1+4wgENup5eIhgxEYA==", + "dev": true, + "requires": { + "slice-ansi": "1.0.0", + "string-width": "2.1.1" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + } + } + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "1.0.0" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "co-with-promise": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co-with-promise/-/co-with-promise-4.6.0.tgz", + "integrity": "sha1-QT59tvWJOmC5Qs9JLEvsk9tBWrc=", + "dev": true, + "requires": { + "pinkie-promise": "1.0.0" + } + }, + "code-excerpt": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-2.1.1.tgz", + "integrity": "sha512-tJLhH3EpFm/1x7heIW0hemXJTUU5EWl2V0EIX558jp05Mt1U6DVryCgkp3l37cxqs+DNbNgxG43SkwJXpQ14Jw==", + "dev": true, + "requires": { + "convert-to-spaces": "1.0.2" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "codecov": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.0.tgz", + "integrity": "sha1-wnO4xPEpRXI+jcnSWAPYk0Pl8o4=", + "dev": true, + "requires": { + "argv": "0.0.2", + "request": "2.81.0", + "urlgrey": "0.4.4" + }, + "dependencies": { + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "dev": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.6", + "mime-types": "2.1.18" + } + }, + "har-schema": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", + "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", + "dev": true + }, + "har-validator": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", + "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", + "dev": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.1", + "sshpk": "1.14.1" + } + }, + "performance-now": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", + "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", + "dev": true + }, + "qs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", + "dev": true + }, + "request": { + "version": "2.81.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "dev": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.6", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.18", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.4", + "tunnel-agent": "0.6.0", + "uuid": "3.2.1" + } + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + } + } + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "1.0.0" + } + }, + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + }, + "common-path-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-1.0.0.tgz", + "integrity": "sha1-zVL28HEuC6q5fW+XModPIvR3UsA=", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.1.tgz", + "integrity": "sha512-gslSSJx03QKa59cIKqeJO9HQ/WZMotvYJCuaUULrLpjj8oG40kV2Z+gz82pVxlTkOADi4PJxQPPfhl1ELYrrXw==", + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.5", + "typedarray": "0.0.6" + } + }, + "concordance": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/concordance/-/concordance-3.0.0.tgz", + "integrity": "sha512-CZBzJ3/l5QJjlZM20WY7+5GP5pMTw+1UEbThcpMw8/rojsi5sBCiD8ZbBLtD+jYpRGAkwuKuqk108c154V9eyQ==", + "dev": true, + "requires": { + "date-time": "2.1.0", + "esutils": "2.0.2", + "fast-diff": "1.1.2", + "function-name-support": "0.2.0", + "js-string-escape": "1.0.1", + "lodash.clonedeep": "4.5.0", + "lodash.flattendeep": "4.4.0", + "lodash.merge": "4.6.1", + "md5-hex": "2.0.0", + "semver": "5.5.0", + "well-known-symbols": "1.0.0" + }, + "dependencies": { + "date-time": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-2.1.0.tgz", + "integrity": "sha512-/9+C44X7lot0IeiyfgJmETtRMhBidBYM2QFFIkGa0U1k+hSyY87Nw7PY3eDqpvCBm7I3WCSfPeZskW/YYq6m4g==", + "dev": true, + "requires": { + "time-zone": "1.0.0" + } + } + } + }, + "configstore": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.1.tgz", + "integrity": "sha512-5oNkD/L++l0O6xGXxb1EWS7SivtjfGQlRyxJsYgE0Z495/L81e2h4/d3r969hoPXuFItzNOKMtsXgYG4c7dYvw==", + "dev": true, + "requires": { + "dot-prop": "4.2.0", + "graceful-fs": "4.1.11", + "make-dir": "1.2.0", + "unique-string": "1.0.0", + "write-file-atomic": "2.3.0", + "xdg-basedir": "3.0.0" + } + }, + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true + }, + "convert-to-spaces": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz", + "integrity": "sha1-fj5Iu+bZl7FBfdyihoIEtNPYVxU=", + "dev": true + }, + "cookiejar": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.1.tgz", + "integrity": "sha1-Qa1XsbVVlR7BcUEqgZQrHoIA00o=", + "dev": true + }, + "core-assert": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/core-assert/-/core-assert-0.2.1.tgz", + "integrity": "sha1-+F4s+b/tKPdzzIs/pcW2m9wC/j8=", + "dev": true, + "requires": { + "buf-compare": "1.0.1", + "is-error": "2.2.1" + } + }, + "core-js": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", + "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "create-error-class": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", + "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", + "requires": { + "capture-stack-trace": "1.0.0" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.2", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, + "cryptiles": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "requires": { + "boom": "5.2.0" + }, + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "requires": { + "hoek": "4.2.1" + } + } + } + }, + "crypto-random-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", + "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", + "dev": true + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "1.0.2" + } + }, + "d": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, + "requires": { + "es5-ext": "0.10.41" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "date-time": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-0.1.1.tgz", + "integrity": "sha1-7S9tk9l5DOL9ZtW1/z7dW7y/Owc=", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "1.0.0" + } + }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true + }, + "deep-extend": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.11" + } + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + }, + "dependencies": { + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "diff-match-patch": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.0.tgz", + "integrity": "sha1-HMPIOkkNZ/ldkeOfatHy4Ia2MEg=", + "dev": true + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "1.1.3", + "entities": "1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + } + } + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domhandler": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.1.tgz", + "integrity": "sha1-iS5HAAqZvlW783dP/qBWHYh5wlk=", + "dev": true, + "requires": { + "domelementtype": "1.3.0" + } + }, + "domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "dev": true, + "requires": { + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" + } + }, + "dot-prop": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dev": true, + "requires": { + "is-obj": "1.0.1" + } + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "duplexify": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.4.tgz", + "integrity": "sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA==", + "requires": { + "end-of-stream": "1.4.1", + "inherits": "2.0.3", + "readable-stream": "2.3.5", + "stream-shift": "1.0.0" + } + }, + "eastasianwidth": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.1.1.tgz", + "integrity": "sha1-RNZW3p2kFWlEZzNTZfsxR7hXK3w=", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.9.tgz", + "integrity": "sha1-S8kmJ07Dtau1AW5+HWCSGsJisqE=", + "requires": { + "base64url": "2.0.0", + "safe-buffer": "5.1.1" + } + }, + "empower": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/empower/-/empower-1.2.3.tgz", + "integrity": "sha1-bw2nNEf07dg4/sXGAxOoi6XLhSs=", + "dev": true, + "requires": { + "core-js": "2.5.3", + "empower-core": "0.6.2" + } + }, + "empower-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/empower-assert/-/empower-assert-1.0.1.tgz", + "integrity": "sha1-MeMQq8BluqfDoEh+a+W7zGXzwd4=", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "empower-core": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-0.6.2.tgz", + "integrity": "sha1-Wt71ZgiOMfuoC6CjbfR9cJQWkUQ=", + "dev": true, + "requires": { + "call-signature": "0.0.2", + "core-js": "2.5.3" + } + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "1.4.0" + } + }, + "ent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", + "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=" + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + }, + "equal-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/equal-length/-/equal-length-1.0.1.tgz", + "integrity": "sha1-IcoRLUirJLTh5//A5TOdMf38J0w=", + "dev": true + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es5-ext": { + "version": "0.10.41", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.41.tgz", + "integrity": "sha512-MYK02wXfwTMie5TEJWPolgOsXEmz7wKCQaGzgmRjZOoV6VLG8I5dSv2bn6AOClXhK64gnSQTQ9W9MKvx87J4gw==", + "dev": true, + "requires": { + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1", + "next-tick": "1.0.0" + } + }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.41", + "es6-symbol": "3.1.1" + } + }, + "es6-map": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.41", + "es6-iterator": "2.0.3", + "es6-set": "0.1.5", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-set": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.41", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.41" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.41", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1" + } + }, + "escallmatch": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/escallmatch/-/escallmatch-1.5.0.tgz", + "integrity": "sha1-UAmdhugJGwkt+N37w/mm+wWgJNA=", + "dev": true, + "requires": { + "call-matcher": "1.0.1", + "esprima": "2.7.3" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + } + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz", + "integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==", + "dev": true, + "requires": { + "esprima": "3.1.3", + "estraverse": "4.2.0", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.6.1" + }, + "dependencies": { + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, + "escope": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", + "dev": true, + "requires": { + "es6-map": "0.1.5", + "es6-weak-map": "2.0.2", + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "eslint": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.0.tgz", + "integrity": "sha512-r83L5CuqaocDvfwdojbz68b6tCUk8KJkqfppO+gmSAQqYCzTr0bCSMu6A6yFCLKG65j5eKcKUw4Cw4Yl4gfWkg==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "babel-code-frame": "6.26.0", + "chalk": "2.3.2", + "concat-stream": "1.6.1", + "cross-spawn": "5.1.0", + "debug": "3.1.0", + "doctrine": "2.1.0", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.4", + "esquery": "1.0.0", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.2", + "globals": "11.3.0", + "ignore": "3.3.7", + "imurmurhash": "0.1.4", + "inquirer": "3.3.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.11.0", + "json-stable-stringify-without-jsonify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.5", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "7.0.0", + "progress": "2.0.0", + "regexpp": "1.0.1", + "require-uncached": "1.0.3", + "semver": "5.5.0", + "strip-ansi": "4.0.0", + "strip-json-comments": "2.0.1", + "table": "4.0.2", + "text-table": "0.2.0" + }, + "dependencies": { + "globals": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz", + "integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==", + "dev": true + } + } + }, + "eslint-config-prettier": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz", + "integrity": "sha512-ag8YEyBXsm3nmOv1Hz991VtNNDMRa+MNy8cY47Pl4bw6iuzqKbJajXdqUpiw13STdLLrznxgm1hj9NhxeOYq0A==", + "dev": true, + "requires": { + "get-stdin": "5.0.1" + }, + "dependencies": { + "get-stdin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", + "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", + "dev": true + } + } + }, + "eslint-plugin-node": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz", + "integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==", + "dev": true, + "requires": { + "ignore": "3.3.7", + "minimatch": "3.0.4", + "resolve": "1.5.0", + "semver": "5.5.0" + }, + "dependencies": { + "resolve": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + } + } + }, + "eslint-plugin-prettier": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz", + "integrity": "sha512-floiaI4F7hRkTrFe8V2ItOK97QYrX75DjmdzmVITZoAP6Cn06oEDPQRsO6MlHEP/u2SxI3xQ52Kpjw6j5WGfeQ==", + "dev": true, + "requires": { + "fast-diff": "1.1.2", + "jest-docblock": "21.2.0" + } + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espower": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/espower/-/espower-2.1.0.tgz", + "integrity": "sha1-zh7bPZhwKEH99ZbRy46FvcSujkg=", + "dev": true, + "requires": { + "array-find": "1.0.0", + "escallmatch": "1.5.0", + "escodegen": "1.9.1", + "escope": "3.6.0", + "espower-location-detector": "1.0.0", + "espurify": "1.7.0", + "estraverse": "4.2.0", + "source-map": "0.5.7", + "type-name": "2.0.2", + "xtend": "4.0.1" + } + }, + "espower-loader": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/espower-loader/-/espower-loader-1.2.2.tgz", + "integrity": "sha1-7bRsPFmga6yOpzppXIblxaC8gto=", + "dev": true, + "requires": { + "convert-source-map": "1.5.1", + "espower-source": "2.2.0", + "minimatch": "3.0.4", + "source-map-support": "0.4.18", + "xtend": "4.0.1" + }, + "dependencies": { + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + } + } + }, + "espower-location-detector": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/espower-location-detector/-/espower-location-detector-1.0.0.tgz", + "integrity": "sha1-oXt+zFnTDheeK+9z+0E3cEyzMbU=", + "dev": true, + "requires": { + "is-url": "1.2.2", + "path-is-absolute": "1.0.1", + "source-map": "0.5.7", + "xtend": "4.0.1" + } + }, + "espower-source": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/espower-source/-/espower-source-2.2.0.tgz", + "integrity": "sha1-fgBSVa5HtcE2RIZEs/PYAtUD91I=", + "dev": true, + "requires": { + "acorn": "5.5.3", + "acorn-es7-plugin": "1.1.7", + "convert-source-map": "1.5.1", + "empower-assert": "1.0.1", + "escodegen": "1.9.1", + "espower": "2.1.0", + "estraverse": "4.2.0", + "merge-estraverse-visitors": "1.0.0", + "multi-stage-sourcemap": "0.2.1", + "path-is-absolute": "1.0.1", + "xtend": "4.0.1" + } + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "5.5.3", + "acorn-jsx": "3.0.1" + } + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "espurify": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.7.0.tgz", + "integrity": "sha1-HFz2y8zDLm9jk4C9T5kfq5up0iY=", + "dev": true, + "requires": { + "core-js": "2.5.3" + } + }, + "esquery": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.41" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "2.2.3" + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "external-editor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", + "dev": true, + "requires": { + "chardet": "0.4.2", + "iconv-lite": "0.4.19", + "tmp": "0.0.33" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-diff": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz", + "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-keys": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fill-keys/-/fill-keys-1.0.2.tgz", + "integrity": "sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=", + "dev": true, + "requires": { + "is-object": "1.0.1", + "merge-descriptors": "1.0.1" + } + }, + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "find-cache-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "dev": true, + "requires": { + "commondir": "1.0.1", + "make-dir": "1.2.0", + "pkg-dir": "2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, + "fn-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fn-name/-/fn-name-2.0.1.tgz", + "integrity": "sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc=", + "dev": true + }, + "follow-redirects": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.4.1.tgz", + "integrity": "sha512-uxYePVPogtya1ktGnAAXOacnbIuRMB4dkvqeNz2qTtTQsuzSfbDolV+wMMKxAmCx0bLgAKLbBOkjItMbbkR1vg==", + "requires": { + "debug": "3.1.0" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.6", + "mime-types": "2.1.18" + } + }, + "formidable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.0.tgz", + "integrity": "sha512-hr9aT30rAi7kf8Q2aaTpSP7xGMhlJ+MdrUDVZs3rxbD3L/K46A86s2VY7qC2D2kGYGBtiT/3j6wTx1eeUq5xAQ==", + "dev": true + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.5" + } + }, + "fs-extra": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", + "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "4.0.0", + "universalify": "0.1.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.10.0", + "node-pre-gyp": "0.6.39" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true, + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true, + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true, + "dev": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "dev": true, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true, + "dev": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "dev": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "dev": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "dev": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + } + } + }, + "function-name-support": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/function-name-support/-/function-name-support-0.2.0.tgz", + "integrity": "sha1-VdO/qm6v1QWlD5vIH99XVkoLsHE=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gcp-metadata": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.6.3.tgz", + "integrity": "sha512-MSmczZctbz91AxCvqp9GHBoZOSbJKAICV7Ow/AIWSJZRrRchUd5NL1b2P4OfP+4m490BEUPhhARfpHdqCxuCvg==", + "requires": { + "axios": "0.18.0", + "extend": "3.0.1", + "retry-axios": "0.3.2" + } + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true + }, + "get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "dev": true, + "requires": { + "ini": "1.3.5" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + } + } + }, + "google-auth-library": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-1.3.2.tgz", + "integrity": "sha512-aRz0om4Bs85uyR2Ousk3Gb8Nffx2Sr2RoKts1smg1MhRwrehE1aD1HC4RmprNt1HVJ88IDnQ8biJQ/aXjiIxlQ==", + "requires": { + "axios": "0.18.0", + "gcp-metadata": "0.6.3", + "gtoken": "2.2.0", + "jws": "3.1.4", + "lodash.isstring": "4.0.1", + "lru-cache": "4.1.2", + "retry-axios": "0.3.2" + } + }, + "google-auto-auth": { + "version": "0.9.7", + "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.9.7.tgz", + "integrity": "sha512-Nro7aIFrL2NP0G7PoGrJqXGMZj8AjdBOcbZXRRm/8T3w08NUHIiNN3dxpuUYzDsZizslH+c8e+7HXL8vh3JXTQ==", + "requires": { + "async": "2.6.0", + "gcp-metadata": "0.6.3", + "google-auth-library": "1.3.2", + "request": "2.85.0" + } + }, + "google-p12-pem": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.2.tgz", + "integrity": "sha512-+EuKr4CLlGsnXx4XIJIVkcKYrsa2xkAmCvxRhX2HsazJzUBAJ35wARGeApHUn4nNfPD03Vl057FskNr20VaCyg==", + "requires": { + "node-forge": "0.7.4", + "pify": "3.0.0" + } + }, + "got": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/got/-/got-8.2.0.tgz", + "integrity": "sha512-giadqJpXIwjY+ZsuWys8p2yjZGhOHiU4hiJHjS/oeCxw1u8vANQz3zPlrxW2Zw/siCXsSMI3hvzWGcnFyujyAg==", + "dev": true, + "requires": { + "@sindresorhus/is": "0.7.0", + "cacheable-request": "2.1.4", + "decompress-response": "3.3.0", + "duplexer3": "0.1.4", + "get-stream": "3.0.0", + "into-stream": "3.1.0", + "is-retry-allowed": "1.1.0", + "isurl": "1.0.0", + "lowercase-keys": "1.0.0", + "mimic-response": "1.0.0", + "p-cancelable": "0.3.0", + "p-timeout": "2.0.1", + "pify": "3.0.0", + "safe-buffer": "5.1.1", + "timed-out": "4.0.1", + "url-parse-lax": "3.0.0", + "url-to-options": "1.0.1" + }, + "dependencies": { + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "2.0.0" + } + } + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "growl": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", + "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", + "dev": true + }, + "gtoken": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.2.0.tgz", + "integrity": "sha512-tvQs8B1z5+I1FzMPZnq/OCuxTWFOkvy7cUJcpNdBOK2L7yEtPZTVCPtZU181sSDF+isUPebSqFTNTkIejFASAQ==", + "requires": { + "axios": "0.18.0", + "google-p12-pem": "1.0.2", + "jws": "3.1.4", + "mime": "2.2.0", + "pify": "3.0.0" + } + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "requires": { + "ajv": "5.5.2", + "har-schema": "2.0.0" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-color": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=", + "dev": true + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", + "dev": true + }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "dev": true, + "requires": { + "has-symbol-support-x": "1.4.2" + } + }, + "has-yarn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-1.0.0.tgz", + "integrity": "sha1-ieJdtgS3Jcj1l2//Ct3JIbgopac=", + "dev": true + }, + "hawk": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "requires": { + "boom": "4.3.1", + "cryptiles": "3.1.2", + "hoek": "4.2.1", + "sntp": "2.1.0" + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hoek": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "hosted-git-info": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "dev": true + }, + "html-tags": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-1.2.0.tgz", + "integrity": "sha1-x43mW1Zjqll5id0rerSSANfk25g=" + }, + "htmlparser2": { + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", + "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", + "dev": true, + "requires": { + "domelementtype": "1.3.0", + "domhandler": "2.4.1", + "domutils": "1.7.0", + "entities": "1.1.1", + "inherits": "2.0.3", + "readable-stream": "2.3.5" + } + }, + "http-cache-semantics": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", + "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.14.1" + } + }, + "hullabaloo-config-manager": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/hullabaloo-config-manager/-/hullabaloo-config-manager-1.1.1.tgz", + "integrity": "sha512-ztKnkZV0TmxnumCDHHgLGNiDnotu4EHCp9YMkznWuo4uTtCyJ+cu+RNcxUeXYKTllpvLFWnbfWry09yzszgg+A==", + "dev": true, + "requires": { + "dot-prop": "4.2.0", + "es6-error": "4.1.1", + "graceful-fs": "4.1.11", + "indent-string": "3.2.0", + "json5": "0.5.1", + "lodash.clonedeep": "4.5.0", + "lodash.clonedeepwith": "4.5.0", + "lodash.isequal": "4.5.0", + "lodash.merge": "4.6.1", + "md5-hex": "2.0.0", + "package-hash": "2.0.0", + "pkg-dir": "2.0.0", + "resolve-from": "3.0.0", + "safe-buffer": "5.1.1" + } + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", + "dev": true + }, + "ignore": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "dev": true + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "dev": true + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true + }, + "import-local": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-0.1.1.tgz", + "integrity": "sha1-sReVcqrNwRxqkQCftDDbyrX2aKg=", + "dev": true, + "requires": { + "pkg-dir": "2.0.0", + "resolve-cwd": "2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "ink-docstrap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/ink-docstrap/-/ink-docstrap-1.3.2.tgz", + "integrity": "sha512-STx5orGQU1gfrkoI/fMU7lX6CSP7LBGO10gXNgOZhwKhUqbtNjCkYSewJtNnLmWP1tAGN6oyEpG1HFPw5vpa5Q==", + "dev": true, + "requires": { + "moment": "2.21.0", + "sanitize-html": "1.18.2" + } + }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dev": true, + "requires": { + "ansi-escapes": "3.0.0", + "chalk": "2.3.2", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "2.1.0", + "figures": "2.0.0", + "lodash": "4.17.5", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + } + }, + "intelli-espower-loader": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/intelli-espower-loader/-/intelli-espower-loader-1.0.1.tgz", + "integrity": "sha1-LHsDFGvB1GvyENCgOXxckatMorA=", + "dev": true, + "requires": { + "espower-loader": "1.2.2" + } + }, + "into-stream": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", + "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", + "dev": true, + "requires": { + "from2": "2.3.0", + "p-is-promise": "1.1.0" + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "1.3.1" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "irregular-plurals": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-1.4.0.tgz", + "integrity": "sha1-LKmwM2UREYVUEvFr5dd8YqRYp2Y=", + "dev": true + }, + "is": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz", + "integrity": "sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU=" + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "1.11.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-ci": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.1.0.tgz", + "integrity": "sha512-c7TnwxLePuqIlxHgr7xtxzycJPegNHFuIrBkwbf8hc58//+Op1CqFkyS+xnIMkwn9UsJIwc174BIjkyBmSpjKg==", + "dev": true, + "requires": { + "ci-info": "1.1.3" + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-error": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-error/-/is-error-2.2.1.tgz", + "integrity": "sha1-aEqW2EB2V3yY9M20DG0mpRI78Zw=", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-generator-fn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz", + "integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-html": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-html/-/is-html-1.1.0.tgz", + "integrity": "sha1-4E8cGNOUhRETlvmgJz6rUa8hhGQ=", + "requires": { + "html-tags": "1.2.0" + } + }, + "is-installed-globally": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", + "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", + "dev": true, + "requires": { + "global-dirs": "0.1.1", + "is-path-inside": "1.0.1" + } + }, + "is-npm": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", + "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", + "dev": true + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", + "dev": true + }, + "is-observable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz", + "integrity": "sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==", + "dev": true, + "requires": { + "symbol-observable": "1.2.0" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-redirect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", + "dev": true + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-retry-allowed": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-stream-ended": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.3.tgz", + "integrity": "sha1-oEc7Jnx1ZjVIa+7cfjNE5UnRUqw=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-url": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.2.tgz", + "integrity": "sha1-SYkFpZO/R8wtnn9zg3K792lsfyY=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "dev": true, + "requires": { + "has-to-string-tag-x": "1.4.1", + "is-object": "1.0.1" + } + }, + "jest-docblock": { + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-21.2.0.tgz", + "integrity": "sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw==", + "dev": true + }, + "js-string-escape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", + "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", + "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + } + }, + "js2xmlparser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", + "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", + "dev": true, + "requires": { + "xmlcreate": "1.0.2" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "jsdoc": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.5.5.tgz", + "integrity": "sha512-6PxB65TAU4WO0Wzyr/4/YhlGovXl0EVYfpKbpSroSj0qBxT4/xod/l40Opkm38dRHRdQgdeY836M0uVnJQG7kg==", + "dev": true, + "requires": { + "babylon": "7.0.0-beta.19", + "bluebird": "3.5.1", + "catharsis": "0.8.9", + "escape-string-regexp": "1.0.5", + "js2xmlparser": "3.0.0", + "klaw": "2.0.0", + "marked": "0.3.17", + "mkdirp": "0.5.1", + "requizzle": "0.2.1", + "strip-json-comments": "2.0.1", + "taffydb": "2.6.2", + "underscore": "1.8.3" + }, + "dependencies": { + "babylon": { + "version": "7.0.0-beta.19", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", + "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", + "dev": true + } + } + }, + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz", + "integrity": "sha512-xyQpxeWWMKyJps9CuGJYeng6ssI5bpqS9ltQpdVQ90t4ql6NdnxFKh95JcRt2cun/DjMVNrdjniLPuMA69xmCw==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "just-extend": { + "version": "1.1.27", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-1.1.27.tgz", + "integrity": "sha512-mJVp13Ix6gFo3SBAy9U/kL+oeZqzlYYYLQBwXVBlVzIsZwBqGREnOro24oC/8s8aox+rJhtZ2DiQof++IrkA+g==", + "dev": true + }, + "jwa": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.5.tgz", + "integrity": "sha1-oFUs4CIHQs1S4VN3SjKQXDDnVuU=", + "requires": { + "base64url": "2.0.0", + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.9", + "safe-buffer": "5.1.1" + } + }, + "jws": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.4.tgz", + "integrity": "sha1-+ei5M46KhHJ31kRLFGT2GIDgUKI=", + "requires": { + "base64url": "2.0.0", + "jwa": "1.1.5", + "safe-buffer": "5.1.1" + } + }, + "keyv": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", + "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "klaw": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", + "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "last-line-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/last-line-stream/-/last-line-stream-1.0.0.tgz", + "integrity": "sha1-0bZNafhv8kry0EiDos7uFFIKVgA=", + "dev": true, + "requires": { + "through2": "2.0.3" + } + }, + "latest-version": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", + "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", + "dev": true, + "requires": { + "package-json": "4.0.1" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "1.0.0" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + } + }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.clonedeepwith": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeepwith/-/lodash.clonedeepwith-4.5.0.tgz", + "integrity": "sha1-buMFc6A6GmDWcKYu8zwQzxr9vdQ=", + "dev": true + }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true + }, + "lodash.difference": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=", + "dev": true + }, + "lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=", + "dev": true + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", + "dev": true + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", + "dev": true + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", + "dev": true + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, + "lodash.merge": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", + "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==", + "dev": true + }, + "lodash.mergewith": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", + "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", + "dev": true + }, + "log-driver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", + "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==" + }, + "lolex": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.3.2.tgz", + "integrity": "sha512-A5pN2tkFj7H0dGIAM6MFvHKMJcPnjZsOMvR7ujCjfgW5TbV6H9vb1PgxLtHvjqNZTHsUolz+6/WEO0N1xNx2ng==", + "dev": true + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "dev": true, + "requires": { + "js-tokens": "3.0.2" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "0.4.1", + "signal-exit": "3.0.2" + } + }, + "lowercase-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", + "dev": true + }, + "lru-cache": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", + "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "make-dir": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", + "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", + "dev": true, + "requires": { + "pify": "3.0.0" + } + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "marked": { + "version": "0.3.17", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.17.tgz", + "integrity": "sha512-+AKbNsjZl6jFfLPwHhWmGTqE009wTKn3RTmn9K8oUKHrX/abPJjtcRtXpYB/FFrwPJRUA86LX/de3T0knkPCmQ==", + "dev": true + }, + "matcher": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-1.1.0.tgz", + "integrity": "sha512-aZGv6JBTHqfqAd09jmAlbKnAICTfIvb5Z8gXVxPB5WZtFfHMaAMdACL7tQflD2V+6/8KNcY8s6DYtWLgpJP5lA==", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "md5-hex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-2.0.0.tgz", + "integrity": "sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=", + "dev": true, + "requires": { + "md5-o-matic": "0.1.1" + } + }, + "md5-o-matic": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", + "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", + "dev": true + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "2.1.0", + "decamelize": "1.2.0", + "loud-rejection": "1.6.0", + "map-obj": "1.0.1", + "minimist": "1.2.0", + "normalize-package-data": "2.4.0", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "redent": "1.0.0", + "trim-newlines": "1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + } + } + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "merge-estraverse-visitors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/merge-estraverse-visitors/-/merge-estraverse-visitors-1.0.0.tgz", + "integrity": "sha1-65aDOLXe1c7tgs7AMH3sui2OqZQ=", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "methmeth": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/methmeth/-/methmeth-1.1.0.tgz", + "integrity": "sha1-6AomYY5S9cQiKGG7dIUQvRDikIk=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } + }, + "mime": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.2.0.tgz", + "integrity": "sha512-0Qz9uF1ATtl8RKJG4VRfOymh7PyEor6NbrI/61lRfuRe4vx9SNATrvAeTj2EWVRKjEQGskrzWkJBBY5NbaVHIA==" + }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "requires": { + "mime-db": "1.33.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "mimic-response": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.0.tgz", + "integrity": "sha1-3z02Uqc/3ta5sLJBRub9BSNTRY4=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.0.4.tgz", + "integrity": "sha512-nMOpAPFosU1B4Ix1jdhx5e3q7XO55ic5a8cgYvW27CequcEY+BabS0kUVL1Cw1V5PuVHZWeNRWFLmEPexo79VA==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.11.0", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.3", + "he": "1.1.1", + "mkdirp": "0.5.1", + "supports-color": "4.4.0" + }, + "dependencies": { + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "modelo": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/modelo/-/modelo-4.2.3.tgz", + "integrity": "sha512-9DITV2YEMcw7XojdfvGl3gDD8J9QjZTJ7ZOUuSAkP+F3T6rDbzMJuPktxptsdHYEvZcmXrCD3LMOhdSAEq6zKA==" + }, + "module-not-found-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz", + "integrity": "sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA=", + "dev": true + }, + "moment": { + "version": "2.21.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.21.0.tgz", + "integrity": "sha512-TCZ36BjURTeFTM/CwRcViQlfkMvL1/vFISuNLO5GkcVm1+QHfbSiNqZuWeMFjj1/3+uAjXswgRk30j1kkLYJBQ==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "multi-stage-sourcemap": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/multi-stage-sourcemap/-/multi-stage-sourcemap-0.2.1.tgz", + "integrity": "sha1-sJ/IWG6qF/gdV1xK0C4Pej9rEQU=", + "dev": true, + "requires": { + "source-map": "0.1.43" + }, + "dependencies": { + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "multimatch": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", + "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", + "dev": true, + "requires": { + "array-differ": "1.0.0", + "array-union": "1.0.2", + "arrify": "1.0.1", + "minimatch": "3.0.4" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "dev": true, + "optional": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "nise": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.3.1.tgz", + "integrity": "sha512-kIH3X5YCj1vvj/32zDa9KNgzvfZd51ItGbiaCbtYhpnsCedLo0tIkb9zl169a41ATzF4z7kwMLz35XXDypma3g==", + "dev": true, + "requires": { + "@sinonjs/formatio": "2.0.0", + "just-extend": "1.1.27", + "lolex": "2.3.2", + "path-to-regexp": "1.7.0", + "text-encoding": "0.6.4" + } + }, + "node-forge": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.4.tgz", + "integrity": "sha512-8Df0906+tq/omxuCZD6PqhPaQDYuyJ1d+VITgxoIA8zvQd1ru+nMJcDChHH324MWitIgbVkAkQoGEEVJNpn/PA==" + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "2.6.0", + "is-builtin-module": "1.0.0", + "semver": "5.5.0", + "validate-npm-package-license": "3.0.3" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "normalize-url": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", + "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", + "dev": true, + "requires": { + "prepend-http": "2.0.0", + "query-string": "5.1.1", + "sort-keys": "2.0.0" + }, + "dependencies": { + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + } + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "2.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nyc": { + "version": "11.6.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.6.0.tgz", + "integrity": "sha512-ZaXCh0wmbk2aSBH2B5hZGGvK2s9aM8DIm2rVY+BG3Fx8tUS+bpJSswUVZqOD1YfCmnYRFSqgYJSr7UeeUcW0jg==", + "dev": true, + "requires": { + "archy": "1.0.0", + "arrify": "1.0.1", + "caching-transform": "1.0.1", + "convert-source-map": "1.5.1", + "debug-log": "1.0.1", + "default-require-extensions": "1.0.0", + "find-cache-dir": "0.1.1", + "find-up": "2.1.0", + "foreground-child": "1.5.6", + "glob": "7.1.2", + "istanbul-lib-coverage": "1.2.0", + "istanbul-lib-hook": "1.1.0", + "istanbul-lib-instrument": "1.10.1", + "istanbul-lib-report": "1.1.3", + "istanbul-lib-source-maps": "1.2.3", + "istanbul-reports": "1.3.0", + "md5-hex": "1.3.0", + "merge-source-map": "1.1.0", + "micromatch": "2.3.11", + "mkdirp": "0.5.1", + "resolve-from": "2.0.0", + "rimraf": "2.6.2", + "signal-exit": "3.0.2", + "spawn-wrap": "1.4.2", + "test-exclude": "4.2.1", + "yargs": "11.1.0", + "yargs-parser": "8.1.0" + }, + "dependencies": { + "align-text": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "amdefine": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "bundled": true, + "dev": true + }, + "append-transform": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "requires": { + "default-require-extensions": "1.0.0" + } + }, + "archy": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "arr-diff": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "bundled": true, + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "arrify": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "async": { + "version": "1.5.2", + "bundled": true, + "dev": true + }, + "atob": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "babel-generator": { + "version": "6.26.1", + "bundled": true, + "dev": true, + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.5", + "source-map": "0.5.7", + "trim-right": "1.0.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-runtime": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "core-js": "2.5.3", + "regenerator-runtime": "0.11.1" + } + }, + "babel-template": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "lodash": "4.17.5" + } + }, + "babel-traverse": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "debug": "2.6.9", + "globals": "9.18.0", + "invariant": "2.2.3", + "lodash": "4.17.5" + } + }, + "babel-types": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "esutils": "2.0.2", + "lodash": "4.17.5", + "to-fast-properties": "1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "bundled": true, + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "base": { + "version": "0.11.2", + "bundled": true, + "dev": true, + "requires": { + "cache-base": "1.0.1", + "class-utils": "0.3.6", + "component-emitter": "1.2.1", + "define-property": "1.0.0", + "isobject": "3.0.1", + "mixin-deep": "1.3.1", + "pascalcase": "0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "bundled": true, + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "builtin-modules": { + "version": "1.1.1", + "bundled": true, + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "collection-visit": "1.0.0", + "component-emitter": "1.2.1", + "get-value": "2.0.6", + "has-value": "1.0.0", + "isobject": "3.0.1", + "set-value": "2.0.0", + "to-object-path": "0.3.0", + "union-value": "1.0.0", + "unset-value": "1.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, + "caching-transform": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "md5-hex": "1.3.0", + "mkdirp": "0.5.1", + "write-file-atomic": "1.3.4" + } + }, + "camelcase": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true + }, + "center-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chalk": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "class-utils": { + "version": "0.3.6", + "bundled": true, + "dev": true, + "requires": { + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.1", + "static-extend": "0.1.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + }, + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true + } + } + }, + "cliui": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "map-visit": "1.0.0", + "object-visit": "1.0.1" + } + }, + "commondir": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "component-emitter": { + "version": "1.2.1", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "convert-source-map": { + "version": "1.5.1", + "bundled": true, + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "core-js": { + "version": "2.5.3", + "bundled": true, + "dev": true + }, + "cross-spawn": { + "version": "4.0.2", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "4.1.2", + "which": "1.3.0" + } + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-log": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "bundled": true, + "dev": true + }, + "default-require-extensions": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "strip-bom": "2.0.0" + } + }, + "define-property": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "1.0.2", + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, + "detect-indent": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "error-ex": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "bundled": true, + "dev": true + }, + "esutils": { + "version": "2.0.2", + "bundled": true, + "dev": true + }, + "execa": { + "version": "0.7.0", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "4.1.2", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + } + } + }, + "expand-brackets": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "bundled": true, + "dev": true, + "requires": { + "fill-range": "2.2.3" + } + }, + "extend-shallow": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "requires": { + "assign-symbols": "1.0.0", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, + "extglob": { + "version": "0.3.2", + "bundled": true, + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "filename-regex": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "fill-range": { + "version": "2.2.3", + "bundled": true, + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "find-cache-dir": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "requires": { + "commondir": "1.0.1", + "mkdirp": "0.5.1", + "pkg-dir": "1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "for-in": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "for-own": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "foreground-child": { + "version": "1.5.6", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "4.0.2", + "signal-exit": "3.0.2" + } + }, + "fragment-cache": { + "version": "0.2.1", + "bundled": true, + "dev": true, + "requires": { + "map-cache": "0.2.2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "get-caller-file": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "get-value": { + "version": "2.0.6", + "bundled": true, + "dev": true + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "bundled": true, + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "globals": { + "version": "9.18.0", + "bundled": true, + "dev": true + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "handlebars": { + "version": "4.0.11", + "bundled": true, + "dev": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "bundled": true, + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "has-ansi": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "has-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "get-value": "2.0.6", + "has-values": "1.0.0", + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, + "has-values": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "hosted-git-info": { + "version": "2.6.0", + "bundled": true, + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "bundled": true, + "dev": true + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "invariant": { + "version": "2.2.3", + "bundled": true, + "dev": true, + "requires": { + "loose-envify": "1.3.1" + } + }, + "invert-kv": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "bundled": true, + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "is-dotfile": { + "version": "1.0.3", + "bundled": true, + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-number": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-odd": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-number": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "bundled": true, + "dev": true + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "bundled": true, + "dev": true, + "requires": { + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isexe": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "isobject": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "istanbul-lib-coverage": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "istanbul-lib-hook": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "append-transform": "0.4.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.10.1", + "bundled": true, + "dev": true, + "requires": { + "babel-generator": "6.26.1", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "istanbul-lib-coverage": "1.2.0", + "semver": "5.5.0" + } + }, + "istanbul-lib-report": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "requires": { + "istanbul-lib-coverage": "1.2.0", + "mkdirp": "0.5.1", + "path-parse": "1.0.5", + "supports-color": "3.2.3" + }, + "dependencies": { + "supports-color": { + "version": "3.2.3", + "bundled": true, + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.3", + "bundled": true, + "dev": true, + "requires": { + "debug": "3.1.0", + "istanbul-lib-coverage": "1.2.0", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "source-map": "0.5.7" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "istanbul-reports": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "handlebars": "4.0.11" + } + }, + "js-tokens": { + "version": "3.0.2", + "bundled": true, + "dev": true + }, + "jsesc": { + "version": "1.3.0", + "bundled": true, + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "lazy-cache": { + "version": "1.0.4", + "bundled": true, + "dev": true, + "optional": true + }, + "lcid": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "invert-kv": "1.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "bundled": true, + "dev": true + } + } + }, + "lodash": { + "version": "4.17.5", + "bundled": true, + "dev": true + }, + "longest": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "loose-envify": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "js-tokens": "3.0.2" + } + }, + "lru-cache": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "map-cache": { + "version": "0.2.2", + "bundled": true, + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "object-visit": "1.0.1" + } + }, + "md5-hex": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "md5-o-matic": "0.1.1" + } + }, + "md5-o-matic": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "mem": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, + "merge-source-map": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } + } + }, + "micromatch": { + "version": "2.3.11", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } + }, + "mimic-fn": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mixin-deep": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "for-in": "1.0.2", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "nanomatch": { + "version": "1.2.9", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "fragment-cache": "0.2.1", + "is-odd": "2.0.0", + "is-windows": "1.0.2", + "kind-of": "6.0.2", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "bundled": true, + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "bundled": true, + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "normalize-package-data": { + "version": "2.4.0", + "bundled": true, + "dev": true, + "requires": { + "hosted-git-info": "2.6.0", + "is-builtin-module": "1.0.0", + "semver": "5.5.0", + "validate-npm-package-license": "3.0.3" + } + }, + "normalize-path": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "npm-run-path": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "path-key": "2.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "bundled": true, + "dev": true, + "requires": { + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true + } + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, + "object.omit": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "optimist": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8", + "wordwrap": "0.0.3" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "p-limit": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "p-try": "1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-limit": "1.2.0" + } + }, + "p-try": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "parse-glob": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } + }, + "parse-json": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "pascalcase": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "path-key": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "bundled": true, + "dev": true + }, + "path-type": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pify": { + "version": "2.3.0", + "bundled": true, + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "bundled": true, + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pkg-dir": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "1.1.2" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + } + } + }, + "posix-character-classes": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "preserve": { + "version": "0.2.0", + "bundled": true, + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "randomatic": { + "version": "1.1.7", + "bundled": true, + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "read-pkg": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + } + } + }, + "regenerator-runtime": { + "version": "0.11.1", + "bundled": true, + "dev": true + }, + "regex-cache": { + "version": "0.4.4", + "bundled": true, + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "3.0.2", + "safe-regex": "1.1.0" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "bundled": true, + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "bundled": true, + "dev": true + }, + "repeating": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "require-directory": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "resolve-from": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "ret": { + "version": "0.1.15", + "bundled": true, + "dev": true + }, + "right-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-regex": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "ret": "0.1.15" + } + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "set-value": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "split-string": "3.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true + }, + "slide": { + "version": "1.1.6", + "bundled": true, + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "requires": { + "base": "0.11.2", + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.7", + "source-map-resolve": "0.5.1", + "use": "3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "define-property": "1.0.0", + "isobject": "3.0.1", + "snapdragon-util": "3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "source-map": { + "version": "0.5.7", + "bundled": true, + "dev": true + }, + "source-map-resolve": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "atob": "2.0.3", + "decode-uri-component": "0.2.0", + "resolve-url": "0.2.1", + "source-map-url": "0.4.0", + "urix": "0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "bundled": true, + "dev": true + }, + "spawn-wrap": { + "version": "1.4.2", + "bundled": true, + "dev": true, + "requires": { + "foreground-child": "1.5.6", + "mkdirp": "0.5.1", + "os-homedir": "1.0.2", + "rimraf": "2.6.2", + "signal-exit": "3.0.2", + "which": "1.3.0" + } + }, + "spdx-correct": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "bundled": true, + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "split-string": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "3.0.2" + } + }, + "static-extend": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "requires": { + "define-property": "0.2.5", + "object-copy": "0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true + } + } + }, + "string-width": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-eof": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "test-exclude": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "requires": { + "arrify": "1.0.1", + "micromatch": "3.1.9", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "require-main-filename": "1.0.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "bundled": true, + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "bundled": true, + "dev": true + }, + "braces": { + "version": "2.3.1", + "bundled": true, + "dev": true, + "requires": { + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "define-property": "1.0.0", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "kind-of": "6.0.2", + "repeat-element": "1.1.2", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "requires": { + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + } + }, + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true + } + } + }, + "extglob": { + "version": "2.0.4", + "bundled": true, + "dev": true, + "requires": { + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + }, + "micromatch": { + "version": "3.1.9", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.1", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.9", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + } + } + }, + "to-fast-properties": { + "version": "1.0.3", + "bundled": true, + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "to-regex": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "requires": { + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "regex-not": "1.0.2", + "safe-regex": "1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-number": "3.0.0", + "repeat-string": "1.6.1" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + } + } + }, + "trim-right": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "yargs": { + "version": "3.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "union-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "set-value": { + "version": "0.4.3", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + } + } + }, + "unset-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "has-value": "0.3.1", + "isobject": "3.0.1" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "bundled": true, + "dev": true, + "requires": { + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "bundled": true, + "dev": true + }, + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + } + } + }, + "urix": { + "version": "0.1.0", + "bundled": true, + "dev": true + }, + "use": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "validate-npm-package-license": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "requires": { + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" + } + }, + "which": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "window-size": { + "version": "0.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.3", + "bundled": true, + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "write-file-atomic": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "imurmurhash": "0.1.4", + "slide": "1.1.6" + } + }, + "y18n": { + "version": "3.2.1", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "2.1.2", + "bundled": true, + "dev": true + }, + "yargs": { + "version": "11.1.0", + "bundled": true, + "dev": true, + "requires": { + "cliui": "4.0.0", + "decamelize": "1.2.0", + "find-up": "2.1.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "9.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "bundled": true, + "dev": true + }, + "cliui": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "wrap-ansi": "2.1.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "yargs-parser": { + "version": "9.0.2", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "8.1.0", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "bundled": true, + "dev": true + } + } + } + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "dev": true + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } + }, + "observable-to-promise": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/observable-to-promise/-/observable-to-promise-0.5.0.tgz", + "integrity": "sha1-yCjw8NxH6fhq+KSXfF1VB2znqR8=", + "dev": true, + "requires": { + "is-observable": "0.2.0", + "symbol-observable": "1.2.0" + }, + "dependencies": { + "is-observable": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-0.2.0.tgz", + "integrity": "sha1-s2ExHYPG5dcmyr9eJQsCNxBvWuI=", + "dev": true, + "requires": { + "symbol-observable": "0.2.4" + }, + "dependencies": { + "symbol-observable": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-0.2.4.tgz", + "integrity": "sha1-lag9smGG1q9+ehjb2XYKL4bQj0A=", + "dev": true + } + } + } + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.8", + "wordwrap": "0.0.3" + } + }, + "option-chain": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/option-chain/-/option-chain-1.0.0.tgz", + "integrity": "sha1-k41zvU4Xg/lI00AjZEraI2aeMPI=", + "dev": true + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + }, + "dependencies": { + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + } + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-cancelable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", + "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", + "dev": true + }, + "p-limit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.2.0" + } + }, + "p-timeout": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", + "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", + "dev": true, + "requires": { + "p-finally": "1.0.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "package-hash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-2.0.0.tgz", + "integrity": "sha1-eK4ybIngWk2BO2hgGXevBcANKg0=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "lodash.flattendeep": "4.4.0", + "md5-hex": "2.0.0", + "release-zalgo": "1.0.0" + } + }, + "package-json": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", + "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", + "dev": true, + "requires": { + "got": "6.7.1", + "registry-auth-token": "3.3.2", + "registry-url": "3.1.0", + "semver": "5.5.0" + }, + "dependencies": { + "got": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", + "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", + "dev": true, + "requires": { + "create-error-class": "3.0.2", + "duplexer3": "0.1.4", + "get-stream": "3.0.0", + "is-redirect": "1.0.0", + "is-retry-allowed": "1.1.0", + "is-stream": "1.1.0", + "lowercase-keys": "1.0.0", + "safe-buffer": "5.1.1", + "timed-out": "4.0.1", + "unzip-response": "2.0.1", + "url-parse-lax": "1.0.0" + } + } + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "parse-ms": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-0.1.2.tgz", + "integrity": "sha1-3T+iXtbC78e93hKtm0bBY6opIk4=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "dev": true, + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "2.3.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + }, + "pinkie": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-1.0.0.tgz", + "integrity": "sha1-Wkfyi6EBXQIBvae/DzWOR77Ix+Q=", + "dev": true + }, + "pinkie-promise": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-1.0.0.tgz", + "integrity": "sha1-0dpn9UglY7t89X8oauKCLs+/NnA=", + "dev": true, + "requires": { + "pinkie": "1.0.0" + } + }, + "pkg-conf": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", + "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "load-json-file": "4.0.0" + }, + "dependencies": { + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "4.0.0", + "pify": "3.0.0", + "strip-bom": "3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.1", + "json-parse-better-errors": "1.0.1" + } + } + } + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "2.1.0" + } + }, + "plur": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/plur/-/plur-2.1.2.tgz", + "integrity": "sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=", + "dev": true, + "requires": { + "irregular-plurals": "1.4.0" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "postcss": { + "version": "6.0.19", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.19.tgz", + "integrity": "sha512-f13HRz0HtVwVaEuW6J6cOUCBLFtymhgyLPV7t4QEk2UD3twRI9IluDcQNdzQdBpiixkXj2OmzejhhTbSbDxNTg==", + "dev": true, + "requires": { + "chalk": "2.3.2", + "source-map": "0.6.1", + "supports-color": "5.3.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "power-assert": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.4.4.tgz", + "integrity": "sha1-kpXqdDcZb1pgH95CDwQmMRhtdRc=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "empower": "1.2.3", + "power-assert-formatter": "1.4.1", + "universal-deep-strict-equal": "1.2.2", + "xtend": "4.0.1" + } + }, + "power-assert-context-formatter": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-context-formatter/-/power-assert-context-formatter-1.1.1.tgz", + "integrity": "sha1-7bo1LT7YpgMRTWZyZazOYNaJzN8=", + "dev": true, + "requires": { + "core-js": "2.5.3", + "power-assert-context-traversal": "1.1.1" + } + }, + "power-assert-context-reducer-ast": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.1.2.tgz", + "integrity": "sha1-SEqZ4m9Jc/+IMuXFzHVnAuYJQXQ=", + "dev": true, + "requires": { + "acorn": "4.0.13", + "acorn-es7-plugin": "1.1.7", + "core-js": "2.5.3", + "espurify": "1.7.0", + "estraverse": "4.2.0" + }, + "dependencies": { + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "dev": true + } + } + }, + "power-assert-context-traversal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-context-traversal/-/power-assert-context-traversal-1.1.1.tgz", + "integrity": "sha1-iMq8oNE7Y1nwfT0+ivppkmRXftk=", + "dev": true, + "requires": { + "core-js": "2.5.3", + "estraverse": "4.2.0" + } + }, + "power-assert-formatter": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/power-assert-formatter/-/power-assert-formatter-1.4.1.tgz", + "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", + "dev": true, + "requires": { + "core-js": "2.5.3", + "power-assert-context-formatter": "1.1.1", + "power-assert-context-reducer-ast": "1.1.2", + "power-assert-renderer-assertion": "1.1.1", + "power-assert-renderer-comparison": "1.1.1", + "power-assert-renderer-diagram": "1.1.2", + "power-assert-renderer-file": "1.1.1" + } + }, + "power-assert-renderer-assertion": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.1.1.tgz", + "integrity": "sha1-y/wOd+AIao+Wrz8djme57n4ozpg=", + "dev": true, + "requires": { + "power-assert-renderer-base": "1.1.1", + "power-assert-util-string-width": "1.1.1" + } + }, + "power-assert-renderer-base": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz", + "integrity": "sha1-lqZQxv0F7hvB9mtUrWFELIs/Y+s=", + "dev": true + }, + "power-assert-renderer-comparison": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.1.1.tgz", + "integrity": "sha1-10Odl9hRVr5OMKAPL7WnJRTOPAg=", + "dev": true, + "requires": { + "core-js": "2.5.3", + "diff-match-patch": "1.0.0", + "power-assert-renderer-base": "1.1.1", + "stringifier": "1.3.0", + "type-name": "2.0.2" + } + }, + "power-assert-renderer-diagram": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.1.2.tgz", + "integrity": "sha1-ZV+PcRk1qbbVQbhjJ2VHF8Y3qYY=", + "dev": true, + "requires": { + "core-js": "2.5.3", + "power-assert-renderer-base": "1.1.1", + "power-assert-util-string-width": "1.1.1", + "stringifier": "1.3.0" + } + }, + "power-assert-renderer-file": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-renderer-file/-/power-assert-renderer-file-1.1.1.tgz", + "integrity": "sha1-o34rvReMys0E5427eckv40kzxec=", + "dev": true, + "requires": { + "power-assert-renderer-base": "1.1.1" + } + }, + "power-assert-util-string-width": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-util-string-width/-/power-assert-util-string-width-1.1.1.tgz", + "integrity": "sha1-vmWet5N/3S5smncmjar2S9W3xZI=", + "dev": true, + "requires": { + "eastasianwidth": "0.1.1" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "prettier": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.11.1.tgz", + "integrity": "sha512-T/KD65Ot0PB97xTrG8afQ46x3oiVhnfGjGESSI9NWYcG92+OUPZKkwHqGWXH2t9jK1crnQjubECW0FuOth+hxw==", + "dev": true + }, + "pretty-ms": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-3.1.0.tgz", + "integrity": "sha1-6crJx2v27lL+lC3ZxsQhMVOxKIE=", + "dev": true, + "requires": { + "parse-ms": "1.0.1", + "plur": "2.1.2" + }, + "dependencies": { + "parse-ms": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", + "integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=", + "dev": true + } + } + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "propprop": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/propprop/-/propprop-0.3.1.tgz", + "integrity": "sha1-oEmjVouJZEAGfRXY7J8zc15XAXg=" + }, + "proxyquire": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-2.0.0.tgz", + "integrity": "sha512-TO9TAIz0mpa+SKddXsgCFatoe/KmHvoNVj2jDMC1kXE6kKn7/4CRpxvQ+0wAK9sbMT2FVO89qItlvnZMcFbJ2Q==", + "dev": true, + "requires": { + "fill-keys": "1.0.2", + "module-not-found-error": "1.0.1", + "resolve": "1.1.7" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + }, + "query-string": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "dev": true, + "requires": { + "decode-uri-component": "0.2.0", + "object-assign": "4.1.1", + "strict-uri-encode": "1.1.0" + } + }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "rc": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.6.tgz", + "integrity": "sha1-6xiYnG1PTxYsOZ953dKfODVWgJI=", + "dev": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.4.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + } + }, + "readable-stream": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", + "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "minimatch": "3.0.4", + "readable-stream": "2.3.5", + "set-immediate-shim": "1.0.1" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "2.1.0", + "strip-indent": "1.0.1" + }, + "dependencies": { + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + } + } + }, + "regenerate": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz", + "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3" + } + }, + "regexpp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.0.1.tgz", + "integrity": "sha512-8Ph721maXiOYSLtaDGKVmDn5wdsNaF6Px85qFNeMPQq0r8K5Y10tgP6YuR65Ws35n4DvzFcCxEnRNBIXQunzLw==", + "dev": true + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "1.3.3", + "regjsgen": "0.2.0", + "regjsparser": "0.1.5" + } + }, + "registry-auth-token": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", + "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", + "dev": true, + "requires": { + "rc": "1.2.6", + "safe-buffer": "5.1.1" + } + }, + "registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "dev": true, + "requires": { + "rc": "1.2.6" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "0.5.0" + } + }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "4.1.1" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "request": { + "version": "2.85.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", + "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", + "requires": { + "aws-sign2": "0.7.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.6", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.2", + "har-validator": "5.0.3", + "hawk": "6.0.2", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.18", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.1", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.4", + "tunnel-agent": "0.6.0", + "uuid": "3.2.1" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "require-precompiled": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/require-precompiled/-/require-precompiled-0.1.0.tgz", + "integrity": "sha1-WhtS63Dr7UPrmC6XTIWrWVceVvo=", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + }, + "dependencies": { + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + } + } + }, + "requizzle": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", + "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", + "dev": true, + "requires": { + "underscore": "1.6.0" + }, + "dependencies": { + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + } + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "3.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "1.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "retry-axios": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/retry-axios/-/retry-axios-0.3.2.tgz", + "integrity": "sha512-jp4YlI0qyDFfXiXGhkCOliBN1G7fRH03Nqy8YdShzGqbY5/9S2x/IR6C88ls2DFkbWuL3ASkP7QD3pVrNpPgwQ==" + }, + "retry-request": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-3.3.1.tgz", + "integrity": "sha512-PjAmtWIxjNj4Co/6FRtBl8afRP3CxrrIAnUzb1dzydfROd+6xt7xAebFeskgQgkfFf8NmzrXIoaB3HxmswXyxw==", + "requires": { + "request": "2.85.0", + "through2": "2.0.3" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "4.0.8" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "samsam": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", + "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", + "dev": true + }, + "sanitize-html": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.18.2.tgz", + "integrity": "sha512-52ThA+Z7h6BnvpSVbURwChl10XZrps5q7ytjTwWcIe9bmJwnVP6cpEVK2NvDOUhGupoqAvNbUz3cpnJDp4+/pg==", + "dev": true, + "requires": { + "chalk": "2.3.2", + "htmlparser2": "3.9.2", + "lodash.clonedeep": "4.5.0", + "lodash.escaperegexp": "4.1.2", + "lodash.isplainobject": "4.0.6", + "lodash.isstring": "4.0.1", + "lodash.mergewith": "4.6.1", + "postcss": "6.0.19", + "srcset": "1.0.0", + "xtend": "4.0.1" + } + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "semver-diff": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", + "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", + "dev": true, + "requires": { + "semver": "5.5.0" + } + }, + "serialize-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "sinon": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-4.3.0.tgz", + "integrity": "sha512-pmf05hFgEZUS52AGJcsVjOjqAyJW2yo14cOwVYvzCyw7+inv06YXkLyW75WG6X6p951lzkoKh51L2sNbR9CDvw==", + "dev": true, + "requires": { + "@sinonjs/formatio": "2.0.0", + "diff": "3.5.0", + "lodash.get": "4.4.2", + "lolex": "2.3.2", + "nise": "1.3.1", + "supports-color": "5.3.0", + "type-detect": "4.0.8" + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + } + }, + "slide": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "dev": true + }, + "sntp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", + "requires": { + "hoek": "4.2.1" + } + }, + "sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", + "dev": true, + "requires": { + "is-plain-obj": "1.1.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-support": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.4.tgz", + "integrity": "sha512-PETSPG6BjY1AHs2t64vS2aqAgu6dMIMXJULWFBGbh2Gr8nVLbCFDo6i/RMMvviIQ2h1Z8+5gQhVKSn2je9nmdg==", + "dev": true, + "requires": { + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "spdx-correct": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "dev": true, + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "dev": true + }, + "split-array-stream": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/split-array-stream/-/split-array-stream-1.0.3.tgz", + "integrity": "sha1-0rdajl4Ngk1S/eyLgiWDncLjXfo=", + "requires": { + "async": "2.6.0", + "is-stream-ended": "0.1.3" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "srcset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/srcset/-/srcset-1.0.0.tgz", + "integrity": "sha1-pWad4StC87HV6D7QPHEEb8SPQe8=", + "dev": true, + "requires": { + "array-uniq": "1.0.3", + "number-is-nan": "1.0.1" + } + }, + "sshpk": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", + "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + } + }, + "stack-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.1.tgz", + "integrity": "sha1-1PM6tU6OOHeLDKXP07OvsS22hiA=", + "dev": true + }, + "stream-events": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.2.tgz", + "integrity": "sha1-q/OfZsCJCk63lbyNXoWbJhW1kLI=", + "requires": { + "stubs": "3.0.0" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true + }, + "string": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/string/-/string-3.3.3.tgz", + "integrity": "sha1-XqIRzZLSKOGEKUmQpsyXs2anfLA=", + "dev": true + }, + "string-format-obj": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string-format-obj/-/string-format-obj-1.1.1.tgz", + "integrity": "sha512-Mm+sROy+pHJmx0P/0Bs1uxIX6UhGJGj6xDGQZ5zh9v/SZRmLGevp+p0VJxV7lirrkAmQ2mvva/gHKpnF/pTb+Q==" + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "stringifier": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/stringifier/-/stringifier-1.3.0.tgz", + "integrity": "sha1-3vGDQvaTPbDy2/yaoCF1tEjBeVk=", + "dev": true, + "requires": { + "core-js": "2.5.3", + "traverse": "0.6.6", + "type-name": "2.0.2" + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + } + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-bom-buf": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz", + "integrity": "sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "4.0.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "stubs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", + "integrity": "sha1-6NK6H6nJBXAwPAMLaQD31fiavls=" + }, + "superagent": { + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.2.tgz", + "integrity": "sha512-gVH4QfYHcY3P0f/BZzavLreHW3T1v7hG9B+hpMQotGQqurOvhv87GcMCd6LWySmBuf+BDR44TQd0aISjVHLeNQ==", + "dev": true, + "requires": { + "component-emitter": "1.2.1", + "cookiejar": "2.1.1", + "debug": "3.1.0", + "extend": "3.0.1", + "form-data": "2.3.2", + "formidable": "1.2.0", + "methods": "1.1.2", + "mime": "1.6.0", + "qs": "6.5.1", + "readable-stream": "2.3.5" + }, + "dependencies": { + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + } + } + }, + "supertap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supertap/-/supertap-1.0.0.tgz", + "integrity": "sha512-HZJ3geIMPgVwKk2VsmO5YHqnnJYl6bV5A9JW2uzqV43WmpgliNEYbuvukfor7URpaqpxuw3CfZ3ONdVbZjCgIA==", + "dev": true, + "requires": { + "arrify": "1.0.1", + "indent-string": "3.2.0", + "js-yaml": "3.11.0", + "serialize-error": "2.1.0", + "strip-ansi": "4.0.0" + } + }, + "supertest": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-3.0.0.tgz", + "integrity": "sha1-jUu2j9GDDuBwM7HFpamkAhyWUpY=", + "dev": true, + "requires": { + "methods": "1.1.2", + "superagent": "3.8.2" + } + }, + "supports-color": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + } + } + }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", + "dev": true + }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "ajv-keywords": "2.1.1", + "chalk": "2.3.2", + "lodash": "4.17.5", + "slice-ansi": "1.0.0", + "string-width": "2.1.1" + } + }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "dev": true + }, + "term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "dev": true, + "requires": { + "execa": "0.7.0" + } + }, + "text-encoding": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", + "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", + "dev": true + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "requires": { + "readable-stream": "2.3.5", + "xtend": "4.0.1" + } + }, + "time-zone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", + "integrity": "sha1-mcW/VZWJZq9tBtg73zgA3IL67F0=", + "dev": true + }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "requires": { + "punycode": "1.4.1" + } + }, + "traverse": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", + "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=", + "dev": true + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "trim-off-newlines": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", + "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", + "integrity": "sha1-7+fUEj2KxSr/9/QMfk3sUmYAj7Q=", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "uid2": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", + "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=", + "dev": true + }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", + "dev": true + }, + "underscore-contrib": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz", + "integrity": "sha1-ZltmwkeD+PorGMn4y7Dix9SMJsc=", + "dev": true, + "requires": { + "underscore": "1.6.0" + }, + "dependencies": { + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + } + } + }, + "unique-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", + "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", + "dev": true, + "requires": { + "crypto-random-string": "1.0.0" + } + }, + "unique-temp-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-temp-dir/-/unique-temp-dir-1.0.0.tgz", + "integrity": "sha1-bc6VsmgcoAPuv7MEpBX5y6vMU4U=", + "dev": true, + "requires": { + "mkdirp": "0.5.1", + "os-tmpdir": "1.0.2", + "uid2": "0.0.3" + } + }, + "universal-deep-strict-equal": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz", + "integrity": "sha1-DaSsL3PP95JMgfpN4BjKViyisKc=", + "dev": true, + "requires": { + "array-filter": "1.0.0", + "indexof": "0.0.1", + "object-keys": "1.0.11" + } + }, + "universalify": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", + "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=", + "dev": true + }, + "unzip-response": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", + "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", + "dev": true + }, + "update-notifier": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.3.0.tgz", + "integrity": "sha1-TognpruRUUCrCTVZ1wFOPruDdFE=", + "dev": true, + "requires": { + "boxen": "1.3.0", + "chalk": "2.3.2", + "configstore": "3.1.1", + "import-lazy": "2.1.0", + "is-installed-globally": "0.1.0", + "is-npm": "1.0.0", + "latest-version": "3.1.0", + "semver-diff": "2.1.0", + "xdg-basedir": "3.0.0" + } + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "requires": { + "prepend-http": "1.0.4" + } + }, + "url-to-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", + "dev": true + }, + "urlgrey": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz", + "integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "uuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" + }, + "validate-npm-package-license": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "dev": true, + "requires": { + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + } + }, + "well-known-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-1.0.0.tgz", + "integrity": "sha1-c8eK6Bp3Jqj6WY4ogIAcixYiVRg=", + "dev": true + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "widest-line": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz", + "integrity": "sha1-AUKk6KJD+IgsAjOqDgKBqnYVInM=", + "dev": true, + "requires": { + "string-width": "2.1.1" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + } + }, + "write-file-atomic": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "imurmurhash": "0.1.4", + "signal-exit": "3.0.2" + } + }, + "write-json-file": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz", + "integrity": "sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=", + "dev": true, + "requires": { + "detect-indent": "5.0.0", + "graceful-fs": "4.1.11", + "make-dir": "1.2.0", + "pify": "3.0.0", + "sort-keys": "2.0.0", + "write-file-atomic": "2.3.0" + }, + "dependencies": { + "detect-indent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", + "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=", + "dev": true + } + } + }, + "write-pkg": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-3.1.0.tgz", + "integrity": "sha1-AwqZlMyZk9JbTnWp8aGSNgcpHOk=", + "dev": true, + "requires": { + "sort-keys": "2.0.0", + "write-json-file": "2.3.0" + } + }, + "xdg-basedir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", + "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", + "dev": true + }, + "xmlcreate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", + "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yargs": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.0.0.tgz", + "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", + "dev": true, + "requires": { + "cliui": "4.0.0", + "decamelize": "1.2.0", + "find-up": "2.1.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "9.0.2" + }, + "dependencies": { + "cliui": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.0.0.tgz", + "integrity": "sha512-nY3W5Gu2racvdDk//ELReY+dHjb9PlIcVDFXP72nVIhq2Gy3LuVXYwJoPVudwQnv1shtohpgkdCKT2YaKY0CKw==", + "dev": true, + "requires": { + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "wrap-ansi": "2.1.0" + } + } + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + } + } + } + } +} diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 0d22241a5d1..3065b0ee9cb 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -29,16 +29,19 @@ ], "contributors": [ "Ace Nassri ", + "Alexander Fenster ", "Dave Gramlich ", "Eric Uldall ", "Ernest Landrito ", "Jason Dobry ", "Jason Dobry ", "Luke Sneeringer ", + "Stephen ", "Stephen Sawchuk ", "Stephen Sawchuk ", "Tim Swast ", - "florencep " + "florencep ", + "greenkeeper[bot] " ], "scripts": { "cover": "nyc --reporter=lcov mocha --require intelli-espower-loader test/*.js && nyc report", @@ -61,7 +64,7 @@ "propprop": "^0.3.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^2.1.0", + "@google-cloud/nodejs-repo-tools": "^2.2.3", "async": "^2.5.0", "codecov": "^3.0.0", "eslint": "^4.9.0", diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 691e8b49a30..d967f6cb836 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -62,5 +62,5 @@ For more information, see https://cloud.google.com/translate/docs [translate_0_docs]: https://cloud.google.com/translate/docs [translate_0_code]: translate.js -[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png +[shell_img]: //gstatic.com/cloudssh/images/open-btn.png [shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 4bfe6c26772..bcd5b7effa2 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -18,7 +18,7 @@ "yargs": "10.0.3" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "2.1.0", + "@google-cloud/nodejs-repo-tools": "2.2.3", "ava": "0.23.0", "proxyquire": "1.8.0", "sinon": "4.0.2" From 341f7e324d65ad54c68fc38bcb24ccfc079fbaf9 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 19 Mar 2018 18:33:35 -0700 Subject: [PATCH 086/513] chore: setup nighty build in CircleCI (#34) * chore: setup nighty build in CircleCI * chore: setup nighty build in CircleCI --- .../.circleci/config.yml | 48 +++++++------ .../.circleci/get_workflow_name.py | 67 +++++++++++++++++++ 2 files changed, 96 insertions(+), 19 deletions(-) create mode 100644 packages/google-cloud-translate/.circleci/get_workflow_name.py diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index da437441ff3..5cdff4dd932 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -1,21 +1,8 @@ -unit_tests: - steps: &unit_tests - - checkout - - run: - name: Install modules and dependencies. - command: npm install - - run: - name: Run unit tests. - command: npm test - - run: - name: Submit coverage data to codecov. - command: node_modules/.bin/codecov - when: always version: 2 workflows: version: 2 tests: - jobs: + jobs: &workflow_jobs - node4: filters: tags: @@ -77,15 +64,34 @@ workflows: ignore: /.*/ tags: only: '/^v[\d.]+$/' + nightly: + triggers: + - schedule: + cron: 0 7 * * * + filters: + branches: + only: master + jobs: *workflow_jobs jobs: node4: docker: - image: 'node:4' - steps: + steps: &unit_tests_steps - checkout + - run: &remove_package_lock + name: Remove package-lock.json if needed. + command: | + WORKFLOW_NAME=`python .circleci/get_workflow_name.py` + echo "Workflow name: $WORKFLOW_NAME" + if [ "$WORKFLOW_NAME" = "nightly" ]; then + echo "Nightly build detected, removing package-lock.json." + rm -f package-lock.json samples/package-lock.json + else + echo "Not a nightly build, skipping this step." + fi - run: name: Install modules and dependencies. - command: npm install --unsafe-perm + command: npm install - run: name: Run unit tests. command: npm test @@ -96,20 +102,21 @@ jobs: node6: docker: - image: 'node:6' - steps: *unit_tests + steps: *unit_tests_steps node8: docker: - image: 'node:8' - steps: *unit_tests + steps: *unit_tests_steps node9: docker: - image: 'node:9' - steps: *unit_tests + steps: *unit_tests_steps lint: docker: - image: 'node:8' steps: - checkout + - run: *remove_package_lock - run: name: Install modules and dependencies. command: | @@ -130,6 +137,7 @@ jobs: - image: 'node:8' steps: - checkout + - run: *remove_package_lock - run: name: Install modules and dependencies. command: npm install @@ -141,6 +149,7 @@ jobs: - image: 'node:8' steps: - checkout + - run: *remove_package_lock - run: name: Decrypt credentials. command: | @@ -175,6 +184,7 @@ jobs: - image: 'node:8' steps: - checkout + - run: *remove_package_lock - run: name: Decrypt credentials. command: | diff --git a/packages/google-cloud-translate/.circleci/get_workflow_name.py b/packages/google-cloud-translate/.circleci/get_workflow_name.py new file mode 100644 index 00000000000..ff6b58fd24f --- /dev/null +++ b/packages/google-cloud-translate/.circleci/get_workflow_name.py @@ -0,0 +1,67 @@ +# Copyright 2018 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. + +""" +Get workflow name for the current build using CircleCI API. +Would be great if this information is available in one of +CircleCI environment variables, but it's not there. +https://circleci.ideas.aha.io/ideas/CCI-I-295 +""" + +import json +import os +import sys +import urllib2 + + +def main(): + try: + username = os.environ['CIRCLE_PROJECT_USERNAME'] + reponame = os.environ['CIRCLE_PROJECT_REPONAME'] + build_num = os.environ['CIRCLE_BUILD_NUM'] + except: + sys.stderr.write( + 'Looks like we are not inside CircleCI container. Exiting...\n') + return 1 + + try: + request = urllib2.Request( + "https://circleci.com/api/v1.1/project/github/%s/%s/%s" % + (username, reponame, build_num), + headers={"Accept": "application/json"}) + contents = urllib2.urlopen(request).read() + except: + sys.stderr.write('Cannot query CircleCI API. Exiting...\n') + return 1 + + try: + build_info = json.loads(contents) + except: + sys.stderr.write( + 'Cannot parse JSON received from CircleCI API. Exiting...\n') + return 1 + + try: + workflow_name = build_info['workflows']['workflow_name'] + except: + sys.stderr.write( + 'Cannot get workflow name from CircleCI build info. Exiting...\n') + return 1 + + print workflow_name + return 0 + + +retval = main() +exit(retval) From 1cd58cd5fb1c09082664ea15334315647965b841 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 22 Mar 2018 13:48:30 -0400 Subject: [PATCH 087/513] =?UTF-8?q?Update=20@google-cloud/common=20to=20th?= =?UTF-8?q?e=20latest=20version=20=F0=9F=9A=80=20(#35)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(package): update @google-cloud/common to version 0.17.0 * Update package locks --- .../google-cloud-translate/package-lock.json | 103 ++++++++++-------- packages/google-cloud-translate/package.json | 2 +- 2 files changed, 61 insertions(+), 44 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 30f95e700b1..bdd2910d43c 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -81,18 +81,18 @@ } }, "@google-cloud/common": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.16.2.tgz", - "integrity": "sha512-GrkaFoj0/oO36pNs4yLmaYhTujuA3i21FdQik99Fd/APix1uhf01VlpJY4lAteTDFLRNkRx6ydEh7OVvmeUHng==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.17.0.tgz", + "integrity": "sha512-HRZLSU762E6HaKoGfJGa8W95yRjb9rY7LePhjaHK9ILAnFacMuUGVamDbTHu1csZomm1g3tZTtXfX/aAhtie/Q==", "requires": { "array-uniq": "1.0.3", "arrify": "1.0.1", - "concat-stream": "1.6.1", + "concat-stream": "1.6.2", "create-error-class": "3.0.2", "duplexify": "3.5.4", "ent": "2.2.0", "extend": "3.0.1", - "google-auto-auth": "0.9.7", + "google-auto-auth": "0.10.0", "is": "3.2.1", "log-driver": "1.2.7", "methmeth": "1.1.0", @@ -2712,6 +2712,11 @@ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, + "buffer-from": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", + "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==" + }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -3219,10 +3224,11 @@ "dev": true }, "concat-stream": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.1.tgz", - "integrity": "sha512-gslSSJx03QKa59cIKqeJO9HQ/WZMotvYJCuaUULrLpjj8oG40kV2Z+gz82pVxlTkOADi4PJxQPPfhl1ELYrrXw==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "requires": { + "buffer-from": "1.0.0", "inherits": "2.0.3", "readable-stream": "2.3.5", "typedarray": "0.0.6" @@ -3451,7 +3457,7 @@ "requires": { "globby": "5.0.0", "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", "object-assign": "4.1.1", "pify": "2.3.0", "pinkie-promise": "2.0.1", @@ -3828,15 +3834,15 @@ } }, "eslint": { - "version": "4.19.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.0.tgz", - "integrity": "sha512-r83L5CuqaocDvfwdojbz68b6tCUk8KJkqfppO+gmSAQqYCzTr0bCSMu6A6yFCLKG65j5eKcKUw4Cw4Yl4gfWkg==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", "dev": true, "requires": { "ajv": "5.5.2", "babel-code-frame": "6.26.0", "chalk": "2.3.2", - "concat-stream": "1.6.1", + "concat-stream": "1.6.2", "cross-spawn": "5.1.0", "debug": "3.1.0", "doctrine": "2.1.0", @@ -3906,14 +3912,14 @@ "requires": { "ignore": "3.3.7", "minimatch": "3.0.4", - "resolve": "1.5.0", + "resolve": "1.6.0", "semver": "5.5.0" }, "dependencies": { "resolve": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", - "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.6.0.tgz", + "integrity": "sha512-mw7JQNu5ExIkcw4LPih0owX/TZXjD/ZUF/ZQ/pDnkw3ZKhDcZZw5klmBlj6gVMwjQ3Pz5Jgu7F3d0jcDVuEWdw==", "dev": true, "requires": { "path-parse": "1.0.5" @@ -3995,7 +4001,7 @@ "integrity": "sha1-oXt+zFnTDheeK+9z+0E3cEyzMbU=", "dev": true, "requires": { - "is-url": "1.2.2", + "is-url": "1.2.3", "path-is-absolute": "1.0.1", "source-map": "0.5.7", "xtend": "4.0.1" @@ -4301,9 +4307,9 @@ } }, "formidable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.0.tgz", - "integrity": "sha512-hr9aT30rAi7kf8Q2aaTpSP7xGMhlJ+MdrUDVZs3rxbD3L/K46A86s2VY7qC2D2kGYGBtiT/3j6wTx1eeUq5xAQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", + "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==", "dev": true }, "from2": { @@ -5390,9 +5396,9 @@ } }, "google-auto-auth": { - "version": "0.9.7", - "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.9.7.tgz", - "integrity": "sha512-Nro7aIFrL2NP0G7PoGrJqXGMZj8AjdBOcbZXRRm/8T3w08NUHIiNN3dxpuUYzDsZizslH+c8e+7HXL8vh3JXTQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.10.0.tgz", + "integrity": "sha512-R6m473OqgZacPvlidJ0aownTlUWyLy654ugjKSXyi1ffIicXlXg3wMfse9T9zxqG6w01q6K1iG+b7dImMkVJ2Q==", "requires": { "async": "2.6.0", "gcp-metadata": "0.6.3", @@ -5967,9 +5973,9 @@ "dev": true }, "is-path-in-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", - "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { "is-path-inside": "1.0.1" @@ -6043,9 +6049,9 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, "is-url": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.2.tgz", - "integrity": "sha1-SYkFpZO/R8wtnn9zg3K792lsfyY=", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.3.tgz", + "integrity": "sha512-vmOHLvzbcnsdFz8wQPXj1lgI5SE8AUlUGMenzuZzRFjoReb1WB+pLt9GrIo7BTker+aTcwrjTDle7odioWeqyw==", "dev": true }, "is-utf8": { @@ -6885,9 +6891,9 @@ "dev": true }, "nise": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.3.1.tgz", - "integrity": "sha512-kIH3X5YCj1vvj/32zDa9KNgzvfZd51ItGbiaCbtYhpnsCedLo0tIkb9zl169a41ATzF4z7kwMLz35XXDypma3g==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.3.2.tgz", + "integrity": "sha512-KPKb+wvETBiwb4eTwtR/OsA2+iijXP+VnlSFYJo3EHjm2yjek1NWxHOUQat3i7xNLm1Bm18UA5j5Wor0yO2GtA==", "dev": true, "requires": { "@sinonjs/formatio": "2.0.0", @@ -10133,9 +10139,9 @@ "dev": true }, "postcss": { - "version": "6.0.19", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.19.tgz", - "integrity": "sha512-f13HRz0HtVwVaEuW6J6cOUCBLFtymhgyLPV7t4QEk2UD3twRI9IluDcQNdzQdBpiixkXj2OmzejhhTbSbDxNTg==", + "version": "6.0.20", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.20.tgz", + "integrity": "sha512-Opr6usW30Iy0xEDrJywDckRxtylfO7gTGs3Kfb2LdLQlGsUg89fTy0R3Vm1Dub2YHO7MK58avr0p70+uFFHb7A==", "dev": true, "requires": { "chalk": "2.3.2", @@ -10344,14 +10350,25 @@ "integrity": "sha1-oEmjVouJZEAGfRXY7J8zc15XAXg=" }, "proxyquire": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-2.0.0.tgz", - "integrity": "sha512-TO9TAIz0mpa+SKddXsgCFatoe/KmHvoNVj2jDMC1kXE6kKn7/4CRpxvQ+0wAK9sbMT2FVO89qItlvnZMcFbJ2Q==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-2.0.1.tgz", + "integrity": "sha512-fQr3VQrbdzHrdaDn3XuisVoJlJNDJizHAvUXw9IuXRR8BpV2x0N7LsCxrpJkeKfPbNjiNU/V5vc008cI0TmzzQ==", "dev": true, "requires": { "fill-keys": "1.0.2", "module-not-found-error": "1.0.1", - "resolve": "1.1.7" + "resolve": "1.5.0" + }, + "dependencies": { + "resolve": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + } } }, "pseudomap": { @@ -10820,7 +10837,7 @@ "lodash.isplainobject": "4.0.6", "lodash.isstring": "4.0.1", "lodash.mergewith": "4.6.1", - "postcss": "6.0.19", + "postcss": "6.0.20", "srcset": "1.0.0", "xtend": "4.0.1" } @@ -10889,7 +10906,7 @@ "diff": "3.5.0", "lodash.get": "4.4.2", "lolex": "2.3.2", - "nise": "1.3.1", + "nise": "1.3.2", "supports-color": "5.3.0", "type-detect": "4.0.8" } @@ -11166,7 +11183,7 @@ "debug": "3.1.0", "extend": "3.0.1", "form-data": "2.3.2", - "formidable": "1.2.0", + "formidable": "1.2.1", "methods": "1.1.2", "mime": "1.6.0", "qs": "6.5.1", diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 3065b0ee9cb..fbed57be273 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -56,7 +56,7 @@ "test": "repo-tools test run --cmd npm -- run cover" }, "dependencies": { - "@google-cloud/common": "^0.16.0", + "@google-cloud/common": "^0.17.0", "arrify": "^1.0.0", "extend": "^3.0.1", "is": "^3.0.1", From 2b3d893c5977fcfbb40c6a2a71c17aa0bf9bcf31 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 27 Mar 2018 18:10:47 -0700 Subject: [PATCH 088/513] chore: workaround for repo-tools EPERM (#36) --- .../.circleci/config.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 5cdff4dd932..be2f70e65ee 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -91,7 +91,12 @@ jobs: fi - run: name: Install modules and dependencies. - command: npm install + command: |- + npm install + repo_tools="node_modules/@google-cloud/nodejs-repo-tools/bin/tools" + if ! test -x "$repo_tools"; then + chmod +x "$repo_tools" + fi - run: name: Run unit tests. command: npm test @@ -121,6 +126,10 @@ jobs: name: Install modules and dependencies. command: | npm install + repo_tools="node_modules/@google-cloud/nodejs-repo-tools/bin/tools" + if ! test -x "$repo_tools"; then + chmod +x "$repo_tools" + fi npm link - run: name: Link the module being tested to the samples. @@ -140,7 +149,12 @@ jobs: - run: *remove_package_lock - run: name: Install modules and dependencies. - command: npm install + command: |- + npm install + repo_tools="node_modules/@google-cloud/nodejs-repo-tools/bin/tools" + if ! test -x "$repo_tools"; then + chmod +x "$repo_tools" + fi - run: name: Build documentation. command: npm run docs From d226bcd6e9c0c575b88b654d7e41d2652e4514ec Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Wed, 28 Mar 2018 18:45:20 -0700 Subject: [PATCH 089/513] chore: one more workaround for repo-tools EPERM (#37) --- packages/google-cloud-translate/.circleci/config.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index be2f70e65ee..73222e5682b 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -174,6 +174,10 @@ jobs: name: Install and link the module. command: | npm install + repo_tools="node_modules/@google-cloud/nodejs-repo-tools/bin/tools" + if ! test -x "$repo_tools"; then + chmod +x "$repo_tools" + fi npm link - run: name: Link the module being tested to the samples. @@ -207,7 +211,12 @@ jobs: -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" - run: name: Install modules and dependencies. - command: npm install + command: |- + npm install + repo_tools="node_modules/@google-cloud/nodejs-repo-tools/bin/tools" + if ! test -x "$repo_tools"; then + chmod +x "$repo_tools" + fi - run: name: Run system tests. command: npm run system-test From 51558e220f95b6c75e43d0e1292e554524c872f6 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Wed, 2 May 2018 08:32:05 -0700 Subject: [PATCH 090/513] chore: lock files maintenance (#40) * chore: lock files maintenance * chore: lock files maintenance --- .../google-cloud-translate/package-lock.json | 1733 ++++++----------- 1 file changed, 565 insertions(+), 1168 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index bdd2910d43c..8a3e687ba44 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -21,7 +21,7 @@ "babel-plugin-transform-async-to-generator": "6.24.1", "babel-plugin-transform-es2015-destructuring": "6.23.0", "babel-plugin-transform-es2015-function-name": "6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", "babel-plugin-transform-es2015-parameters": "6.24.1", "babel-plugin-transform-es2015-spread": "6.22.0", "babel-plugin-transform-es2015-sticky-regex": "6.24.1", @@ -92,7 +92,7 @@ "duplexify": "3.5.4", "ent": "2.2.0", "extend": "3.0.1", - "google-auto-auth": "0.10.0", + "google-auto-auth": "0.10.1", "is": "3.2.1", "log-driver": "1.2.7", "methmeth": "1.1.0", @@ -100,15 +100,15 @@ "request": "2.85.0", "retry-request": "3.3.1", "split-array-stream": "1.0.3", - "stream-events": "1.0.2", + "stream-events": "1.0.4", "string-format-obj": "1.1.1", "through2": "2.0.3" } }, "@google-cloud/nodejs-repo-tools": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.2.4.tgz", - "integrity": "sha512-yHxW7JvhnqgoIftv6dAn1r/9AEcPuumD0xXggdYHmDeyf38OMYyjTk92gP9vflTOee1JhM0vOarwGrlKYUbmnQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.3.0.tgz", + "integrity": "sha512-c8dIGESnNkmM88duFxGHvMQP5QKPgp/sfJq0QhC6+gOcJC7/PKjqd0PkmgPPeIgVl6SXy5Zf/KLbxnJUVgNT1Q==", "dev": true, "requires": { "ava": "0.25.0", @@ -119,6 +119,7 @@ "lodash": "4.17.5", "nyc": "11.4.1", "proxyquire": "1.8.0", + "semver": "5.5.0", "sinon": "4.3.0", "string": "3.3.3", "supertest": "3.0.0", @@ -126,6 +127,12 @@ "yargs-parser": "9.0.2" }, "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + }, "nyc": { "version": "11.4.1", "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.4.1.tgz", @@ -1867,9 +1874,9 @@ } }, "ansi-escapes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", - "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "dev": true }, "ansi-regex": { @@ -1997,7 +2004,7 @@ "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", "requires": { - "lodash": "4.17.5" + "lodash": "4.17.10" } }, "async-each": { @@ -2028,7 +2035,7 @@ "@ava/write-file-atomic": "2.2.0", "@concordance/react": "1.0.0", "@ladjs/time-require": "0.1.4", - "ansi-escapes": "3.0.0", + "ansi-escapes": "3.1.0", "ansi-styles": "3.2.1", "arr-flatten": "1.1.0", "array-union": "1.0.2", @@ -2036,17 +2043,17 @@ "arrify": "1.0.1", "auto-bind": "1.2.0", "ava-init": "0.2.1", - "babel-core": "6.26.0", + "babel-core": "6.26.3", "babel-generator": "6.26.1", "babel-plugin-syntax-object-rest-spread": "6.13.0", "bluebird": "3.5.1", "caching-transform": "1.0.1", - "chalk": "2.3.2", + "chalk": "2.4.1", "chokidar": "1.7.0", "clean-stack": "1.3.0", "clean-yaml-object": "0.1.0", "cli-cursor": "2.1.0", - "cli-spinners": "1.1.0", + "cli-spinners": "1.3.1", "cli-truncate": "1.1.0", "co-with-promise": "4.6.0", "code-excerpt": "2.1.1", @@ -2094,18 +2101,18 @@ "pretty-ms": "3.1.0", "require-precompiled": "0.1.0", "resolve-cwd": "2.0.0", - "safe-buffer": "5.1.1", + "safe-buffer": "5.1.2", "semver": "5.5.0", "slash": "1.0.0", - "source-map-support": "0.5.4", + "source-map-support": "0.5.5", "stack-utils": "1.0.1", "strip-ansi": "4.0.0", "strip-bom-buf": "1.0.0", "supertap": "1.0.0", - "supports-color": "5.3.0", + "supports-color": "5.4.0", "trim-off-newlines": "1.0.1", "unique-temp-dir": "1.0.0", - "update-notifier": "2.3.0" + "update-notifier": "2.5.0" } }, "ava-init": { @@ -2127,9 +2134,9 @@ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", + "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" }, "axios": { "version": "0.18.0", @@ -2188,9 +2195,9 @@ } }, "babel-core": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", - "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", "dev": true, "requires": { "babel-code-frame": "6.26.0", @@ -2206,7 +2213,7 @@ "convert-source-map": "1.5.1", "debug": "2.6.9", "json5": "0.5.1", - "lodash": "4.17.5", + "lodash": "4.17.10", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", "private": "0.1.8", @@ -2236,7 +2243,7 @@ "babel-types": "6.26.0", "detect-indent": "4.0.0", "jsesc": "1.3.0", - "lodash": "4.17.5", + "lodash": "4.17.10", "source-map": "0.5.7", "trim-right": "1.0.1" }, @@ -2324,7 +2331,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "lodash": "4.17.5" + "lodash": "4.17.10" } }, "babel-helper-remap-async-to-generator": { @@ -2377,7 +2384,7 @@ "babel-generator": "6.26.1", "babylon": "6.18.0", "call-matcher": "1.0.1", - "core-js": "2.5.3", + "core-js": "2.5.5", "espower-location-detector": "1.0.0", "espurify": "1.7.0", "estraverse": "4.2.0" @@ -2439,9 +2446,9 @@ } }, "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz", - "integrity": "sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo=", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", "dev": true, "requires": { "babel-plugin-transform-strict-mode": "6.24.1", @@ -2522,11 +2529,11 @@ "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", "dev": true, "requires": { - "babel-core": "6.26.0", + "babel-core": "6.26.3", "babel-runtime": "6.26.0", - "core-js": "2.5.3", + "core-js": "2.5.5", "home-or-tmp": "2.0.0", - "lodash": "4.17.5", + "lodash": "4.17.10", "mkdirp": "0.5.1", "source-map-support": "0.4.18" }, @@ -2548,7 +2555,7 @@ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { - "core-js": "2.5.3", + "core-js": "2.5.5", "regenerator-runtime": "0.11.1" } }, @@ -2562,7 +2569,7 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "lodash": "4.17.5" + "lodash": "4.17.10" } }, "babel-traverse": { @@ -2579,7 +2586,7 @@ "debug": "2.6.9", "globals": "9.18.0", "invariant": "2.2.4", - "lodash": "4.17.5" + "lodash": "4.17.10" }, "dependencies": { "debug": { @@ -2601,7 +2608,7 @@ "requires": { "babel-runtime": "6.26.0", "esutils": "2.0.2", - "lodash": "4.17.5", + "lodash": "4.17.10", "to-fast-properties": "1.0.3" } }, @@ -2659,7 +2666,7 @@ "requires": { "ansi-align": "2.0.0", "camelcase": "4.1.0", - "chalk": "2.3.2", + "chalk": "2.4.1", "cli-boxes": "1.0.0", "string-width": "2.1.1", "term-size": "1.2.0", @@ -2736,6 +2743,14 @@ "lowercase-keys": "1.0.0", "normalize-url": "2.0.1", "responselike": "1.0.2" + }, + "dependencies": { + "lowercase-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", + "dev": true + } } }, "caching-transform": { @@ -2777,7 +2792,7 @@ "integrity": "sha1-UTTQd5hPcSpU2tPL9i3ijc5BbKg=", "dev": true, "requires": { - "core-js": "2.5.3", + "core-js": "2.5.5", "deep-equal": "1.0.1", "espurify": "1.7.0", "estraverse": "4.2.0" @@ -2851,14 +2866,14 @@ } }, "chalk": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", - "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "5.3.0" + "supports-color": "5.4.0" } }, "chardet": { @@ -2875,7 +2890,7 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", - "fsevents": "1.1.3", + "fsevents": "1.2.3", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -2924,9 +2939,9 @@ } }, "cli-spinners": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.1.0.tgz", - "integrity": "sha1-8YR7FohE2RemceudFH499JfJDQY=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz", + "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", "dev": true }, "cli-truncate": { @@ -3005,163 +3020,14 @@ "dev": true }, "codecov": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.0.tgz", - "integrity": "sha1-wnO4xPEpRXI+jcnSWAPYk0Pl8o4=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.1.tgz", + "integrity": "sha512-0TjnXrbvcPzAkRPv/Y5D8aZju/M5adkFxShRyMMgDReB8EV9nF4XMERXs6ajgLA1di9LUFW2tgePDQd2JPWy7g==", "dev": true, "requires": { "argv": "0.0.2", - "request": "2.81.0", + "request": "2.85.0", "urlgrey": "0.4.4" - }, - "dependencies": { - "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", - "dev": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, - "assert-plus": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", - "dev": true - }, - "aws-sign2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", - "dev": true - }, - "boom": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "cryptiles": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", - "dev": true, - "requires": { - "boom": "2.10.1" - } - }, - "form-data": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", - "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", - "dev": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.6", - "mime-types": "2.1.18" - } - }, - "har-schema": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", - "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", - "dev": true - }, - "har-validator": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", - "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", - "dev": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, - "hawk": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", - "dev": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true - }, - "http-signature": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", - "dev": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.1", - "sshpk": "1.14.1" - } - }, - "performance-now": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", - "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", - "dev": true - }, - "qs": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", - "dev": true - }, - "request": { - "version": "2.81.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", - "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", - "dev": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.6.0", - "uuid": "3.2.1" - } - }, - "sntp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", - "dev": true, - "requires": { - "hoek": "2.16.3" - } - } } }, "color-convert": { @@ -3230,7 +3096,7 @@ "requires": { "buffer-from": "1.0.0", "inherits": "2.0.3", - "readable-stream": "2.3.5", + "readable-stream": "2.3.6", "typedarray": "0.0.6" } }, @@ -3265,9 +3131,9 @@ } }, "configstore": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.1.tgz", - "integrity": "sha512-5oNkD/L++l0O6xGXxb1EWS7SivtjfGQlRyxJsYgE0Z495/L81e2h4/d3r969hoPXuFItzNOKMtsXgYG4c7dYvw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", + "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", "dev": true, "requires": { "dot-prop": "4.2.0", @@ -3307,9 +3173,9 @@ } }, "core-js": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", - "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=", + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.5.tgz", + "integrity": "sha1-sU3ek2xkDAV5prUMq8wTLdYSfjs=", "dev": true }, "core-util-is": { @@ -3375,7 +3241,7 @@ "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "dev": true, "requires": { - "es5-ext": "0.10.41" + "es5-ext": "0.10.42" } }, "dashdash": { @@ -3428,9 +3294,9 @@ "dev": true }, "deep-extend": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", - "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz", + "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", "dev": true }, "deep-is": { @@ -3601,7 +3467,7 @@ "requires": { "end-of-stream": "1.4.1", "inherits": "2.0.3", - "readable-stream": "2.3.5", + "readable-stream": "2.3.6", "stream-shift": "1.0.0" } }, @@ -3626,7 +3492,7 @@ "integrity": "sha1-S8kmJ07Dtau1AW5+HWCSGsJisqE=", "requires": { "base64url": "2.0.0", - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "empower": { @@ -3635,14 +3501,14 @@ "integrity": "sha1-bw2nNEf07dg4/sXGAxOoi6XLhSs=", "dev": true, "requires": { - "core-js": "2.5.3", + "core-js": "2.5.5", "empower-core": "0.6.2" } }, "empower-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/empower-assert/-/empower-assert-1.0.1.tgz", - "integrity": "sha1-MeMQq8BluqfDoEh+a+W7zGXzwd4=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/empower-assert/-/empower-assert-1.1.0.tgz", + "integrity": "sha512-Ylck0Q6p8y/LpNzYeBccaxAPm2ZyuqBgErgZpO9KT0HuQWF0sJckBKCLmgS1/DEXEiyBi9XtYh3clZm5cAdARw==", "dev": true, "requires": { "estraverse": "4.2.0" @@ -3655,7 +3521,7 @@ "dev": true, "requires": { "call-signature": "0.0.2", - "core-js": "2.5.3" + "core-js": "2.5.5" } }, "end-of-stream": { @@ -3693,9 +3559,9 @@ } }, "es5-ext": { - "version": "0.10.41", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.41.tgz", - "integrity": "sha512-MYK02wXfwTMie5TEJWPolgOsXEmz7wKCQaGzgmRjZOoV6VLG8I5dSv2bn6AOClXhK64gnSQTQ9W9MKvx87J4gw==", + "version": "0.10.42", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.42.tgz", + "integrity": "sha512-AJxO1rmPe1bDEfSR6TJ/FgMFYuTBhR5R57KW58iCkYACMyFbrkqVyzXSurYoScDGvgyMpk7uRF/lPUPPTmsRSA==", "dev": true, "requires": { "es6-iterator": "2.0.3", @@ -3716,7 +3582,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.41", + "es5-ext": "0.10.42", "es6-symbol": "3.1.1" } }, @@ -3727,7 +3593,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.41", + "es5-ext": "0.10.42", "es6-iterator": "2.0.3", "es6-set": "0.1.5", "es6-symbol": "3.1.1", @@ -3741,7 +3607,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.41", + "es5-ext": "0.10.42", "es6-iterator": "2.0.3", "es6-symbol": "3.1.1", "event-emitter": "0.3.5" @@ -3754,7 +3620,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.41" + "es5-ext": "0.10.42" } }, "es6-weak-map": { @@ -3764,7 +3630,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.41", + "es5-ext": "0.10.42", "es6-iterator": "2.0.3", "es6-symbol": "3.1.1" } @@ -3841,7 +3707,7 @@ "requires": { "ajv": "5.5.2", "babel-code-frame": "6.26.0", - "chalk": "2.3.2", + "chalk": "2.4.1", "concat-stream": "1.6.2", "cross-spawn": "5.1.0", "debug": "3.1.0", @@ -3849,20 +3715,20 @@ "eslint-scope": "3.7.1", "eslint-visitor-keys": "1.0.0", "espree": "3.5.4", - "esquery": "1.0.0", + "esquery": "1.0.1", "esutils": "2.0.2", "file-entry-cache": "2.0.0", "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "11.3.0", - "ignore": "3.3.7", + "globals": "11.5.0", + "ignore": "3.3.8", "imurmurhash": "0.1.4", "inquirer": "3.3.0", "is-resolvable": "1.1.0", "js-yaml": "3.11.0", "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", - "lodash": "4.17.5", + "lodash": "4.17.10", "minimatch": "3.0.4", "mkdirp": "0.5.1", "natural-compare": "1.4.0", @@ -3870,7 +3736,7 @@ "path-is-inside": "1.0.2", "pluralize": "7.0.0", "progress": "2.0.0", - "regexpp": "1.0.1", + "regexpp": "1.1.0", "require-uncached": "1.0.3", "semver": "5.5.0", "strip-ansi": "4.0.0", @@ -3880,9 +3746,9 @@ }, "dependencies": { "globals": { - "version": "11.3.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz", - "integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==", + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", + "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", "dev": true } } @@ -3910,16 +3776,16 @@ "integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==", "dev": true, "requires": { - "ignore": "3.3.7", + "ignore": "3.3.8", "minimatch": "3.0.4", - "resolve": "1.6.0", + "resolve": "1.7.1", "semver": "5.5.0" }, "dependencies": { "resolve": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.6.0.tgz", - "integrity": "sha512-mw7JQNu5ExIkcw4LPih0owX/TZXjD/ZUF/ZQ/pDnkw3ZKhDcZZw5klmBlj6gVMwjQ3Pz5Jgu7F3d0jcDVuEWdw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", + "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", "dev": true, "requires": { "path-parse": "1.0.5" @@ -4001,7 +3867,7 @@ "integrity": "sha1-oXt+zFnTDheeK+9z+0E3cEyzMbU=", "dev": true, "requires": { - "is-url": "1.2.3", + "is-url": "1.2.4", "path-is-absolute": "1.0.1", "source-map": "0.5.7", "xtend": "4.0.1" @@ -4016,7 +3882,7 @@ "acorn": "5.5.3", "acorn-es7-plugin": "1.1.7", "convert-source-map": "1.5.1", - "empower-assert": "1.0.1", + "empower-assert": "1.1.0", "escodegen": "1.9.1", "espower": "2.1.0", "estraverse": "4.2.0", @@ -4048,13 +3914,13 @@ "integrity": "sha1-HFz2y8zDLm9jk4C9T5kfq5up0iY=", "dev": true, "requires": { - "core-js": "2.5.3" + "core-js": "2.5.5" } }, "esquery": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", - "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", "dev": true, "requires": { "estraverse": "4.2.0" @@ -4088,7 +3954,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.41" + "es5-ext": "0.10.42" } }, "execa": { @@ -4130,13 +3996,13 @@ "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" }, "external-editor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", - "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", "dev": true, "requires": { "chardet": "0.4.2", - "iconv-lite": "0.4.19", + "iconv-lite": "0.4.21", "tmp": "0.0.33" } }, @@ -4319,7 +4185,7 @@ "dev": true, "requires": { "inherits": "2.0.3", - "readable-stream": "2.3.5" + "readable-stream": "2.3.6" } }, "fs-extra": { @@ -4340,39 +4206,29 @@ "dev": true }, "fsevents": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", - "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.3.tgz", + "integrity": "sha512-X+57O5YkDTiEQGiw8i7wYc2nQgweIekqkepI8Q3y4wVlurgBt2SuwxTeYUYMZIGpLZH3r/TsMjczCMXE5ZOt7Q==", "dev": true, "optional": true, "requires": { "nan": "2.10.0", - "node-pre-gyp": "0.6.39" + "node-pre-gyp": "0.9.1" }, "dependencies": { "abbrev": { - "version": "1.1.0", + "version": "1.1.1", "bundled": true, "dev": true, "optional": true }, - "ajv": { - "version": "4.11.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, "ansi-regex": { "version": "2.1.1", "bundled": true, "dev": true }, "aproba": { - "version": "1.1.1", + "version": "1.2.0", "bundled": true, "dev": true, "optional": true @@ -4384,91 +4240,25 @@ "optional": true, "requires": { "delegates": "1.0.0", - "readable-stream": "2.2.9" + "readable-stream": "2.3.6" } }, - "asn1": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "assert-plus": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws4": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "optional": true - }, "balanced-match": { - "version": "0.4.2", + "version": "1.0.0", "bundled": true, "dev": true }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "block-stream": { - "version": "0.0.9", - "bundled": true, - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "boom": { - "version": "2.10.1", - "bundled": true, - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, "brace-expansion": { - "version": "1.1.7", + "version": "1.1.11", "bundled": true, "dev": true, "requires": { - "balanced-match": "0.4.2", + "balanced-match": "1.0.0", "concat-map": "0.0.1" } }, - "buffer-shims": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "caseless": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true - }, - "co": { - "version": "4.6.0", + "chownr": { + "version": "1.0.1", "bundled": true, "dev": true, "optional": true @@ -4478,14 +4268,6 @@ "bundled": true, "dev": true }, - "combined-stream": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, "concat-map": { "version": "0.0.1", "bundled": true, @@ -4499,35 +4281,11 @@ "core-util-is": { "version": "1.0.2", "bundled": true, - "dev": true - }, - "cryptiles": { - "version": "2.0.5", - "bundled": true, - "dev": true, - "requires": { - "boom": "2.10.1" - } - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } + "optional": true }, "debug": { - "version": "2.6.8", + "version": "2.6.9", "bundled": true, "dev": true, "optional": true, @@ -4541,11 +4299,6 @@ "dev": true, "optional": true }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, "delegates": { "version": "1.0.0", "bundled": true, @@ -4553,74 +4306,25 @@ "optional": true }, "detect-libc": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "ecc-jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "extend": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "extsprintf": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "forever-agent": { - "version": "0.6.1", + "version": "1.0.3", "bundled": true, "dev": true, "optional": true }, - "form-data": { - "version": "2.1.4", + "fs-minipass": { + "version": "1.2.5", "bundled": true, "dev": true, "optional": true, "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" + "minipass": "2.2.4" } }, "fs.realpath": { "version": "1.0.0", "bundled": true, - "dev": true - }, - "fstream": { - "version": "1.0.11", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.1" - } - }, - "fstream-ignore": { - "version": "1.0.5", - "bundled": true, "dev": true, - "optional": true, - "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.4" - } + "optional": true }, "gauge": { "version": "2.7.4", @@ -4628,7 +4332,7 @@ "dev": true, "optional": true, "requires": { - "aproba": "1.1.1", + "aproba": "1.2.0", "console-control-strings": "1.1.0", "has-unicode": "2.0.1", "object-assign": "4.1.1", @@ -4638,27 +4342,11 @@ "wide-align": "1.1.2" } }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, "glob": { "version": "7.1.2", "bundled": true, "dev": true, + "optional": true, "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", @@ -4668,64 +4356,35 @@ "path-is-absolute": "1.0.1" } }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "har-schema": { - "version": "1.0.5", + "has-unicode": { + "version": "2.0.1", "bundled": true, "dev": true, "optional": true }, - "har-validator": { - "version": "4.2.1", + "iconv-lite": { + "version": "0.4.21", "bundled": true, "dev": true, "optional": true, "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" + "safer-buffer": "2.1.2" } }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "hawk": { - "version": "3.1.3", - "bundled": true, - "dev": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "hoek": { - "version": "2.16.3", - "bundled": true, - "dev": true - }, - "http-signature": { - "version": "1.1.1", + "ignore-walk": { + "version": "3.0.1", "bundled": true, "dev": true, "optional": true, "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.0" + "minimatch": "3.0.4" } }, "inflight": { "version": "1.0.6", "bundled": true, "dev": true, + "optional": true, "requires": { "once": "1.4.0", "wrappy": "1.0.2" @@ -4737,7 +4396,7 @@ "dev": true }, "ini": { - "version": "1.3.4", + "version": "1.3.5", "bundled": true, "dev": true, "optional": true @@ -4750,111 +4409,43 @@ "number-is-nan": "1.0.1" } }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, "isarray": { "version": "1.0.0", "bundled": true, - "dev": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "jodid25519": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "jsbn": { - "version": "0.1.1", - "bundled": true, "dev": true, "optional": true }, - "json-schema": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "jsonify": { - "version": "0.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "jsprim": { - "version": "1.4.0", + "minimatch": { + "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.0.2", - "json-schema": "0.2.3", - "verror": "1.3.6" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } + "brace-expansion": "1.1.11" } }, - "mime-db": { - "version": "1.27.0", + "minimist": { + "version": "0.0.8", "bundled": true, "dev": true }, - "mime-types": { - "version": "2.1.15", + "minipass": { + "version": "2.2.4", "bundled": true, "dev": true, "requires": { - "mime-db": "1.27.0" + "safe-buffer": "5.1.1", + "yallist": "3.0.2" } }, - "minimatch": { - "version": "3.0.4", + "minizlib": { + "version": "1.1.0", "bundled": true, "dev": true, + "optional": true, "requires": { - "brace-expansion": "1.1.7" + "minipass": "2.2.4" } }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, "mkdirp": { "version": "0.5.1", "bundled": true, @@ -4869,23 +4460,33 @@ "dev": true, "optional": true }, + "needle": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.9", + "iconv-lite": "0.4.21", + "sax": "1.2.4" + } + }, "node-pre-gyp": { - "version": "0.6.39", + "version": "0.9.1", "bundled": true, "dev": true, "optional": true, "requires": { - "detect-libc": "1.0.2", - "hawk": "3.1.3", + "detect-libc": "1.0.3", "mkdirp": "0.5.1", + "needle": "2.2.0", "nopt": "4.0.1", - "npmlog": "4.1.0", - "rc": "1.2.1", - "request": "2.81.0", - "rimraf": "2.6.1", - "semver": "5.3.0", - "tar": "2.2.1", - "tar-pack": "3.4.0" + "npm-packlist": "1.1.10", + "npmlog": "4.1.2", + "rc": "1.2.6", + "rimraf": "2.6.2", + "semver": "5.5.0", + "tar": "4.4.1" } }, "nopt": { @@ -4894,12 +4495,28 @@ "dev": true, "optional": true, "requires": { - "abbrev": "1.1.0", - "osenv": "0.1.4" + "abbrev": "1.1.1", + "osenv": "0.1.5" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "3.0.1", + "npm-bundled": "1.0.3" } }, "npmlog": { - "version": "4.1.0", + "version": "4.1.2", "bundled": true, "dev": true, "optional": true, @@ -4915,12 +4532,6 @@ "bundled": true, "dev": true }, - "oauth-sign": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "optional": true - }, "object-assign": { "version": "4.1.1", "bundled": true, @@ -4948,7 +4559,7 @@ "optional": true }, "osenv": { - "version": "0.1.4", + "version": "0.1.5", "bundled": true, "dev": true, "optional": true, @@ -4960,39 +4571,23 @@ "path-is-absolute": { "version": "1.0.1", "bundled": true, - "dev": true - }, - "performance-now": { - "version": "0.2.0", - "bundled": true, "dev": true, "optional": true }, "process-nextick-args": { - "version": "1.0.7", - "bundled": true, - "dev": true - }, - "punycode": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true - }, - "qs": { - "version": "6.4.0", + "version": "2.0.0", "bundled": true, "dev": true, "optional": true }, "rc": { - "version": "1.2.1", + "version": "1.2.6", "bundled": true, "dev": true, "optional": true, "requires": { "deep-extend": "0.4.2", - "ini": "1.3.4", + "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" }, @@ -5006,112 +4601,63 @@ } }, "readable-stream": { - "version": "2.2.9", + "version": "2.3.6", "bundled": true, "dev": true, + "optional": true, "requires": { - "buffer-shims": "1.0.0", "core-util-is": "1.0.2", "inherits": "2.0.3", "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "1.0.1", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.1.1", "util-deprecate": "1.0.2" } }, - "request": { - "version": "2.81.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.0.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.0.1" - } - }, "rimraf": { - "version": "2.6.1", + "version": "2.6.2", "bundled": true, "dev": true, + "optional": true, "requires": { "glob": "7.1.2" } }, "safe-buffer": { - "version": "5.0.1", + "version": "5.1.1", "bundled": true, "dev": true }, - "semver": { - "version": "5.3.0", + "safer-buffer": { + "version": "2.1.2", "bundled": true, "dev": true, "optional": true }, - "set-blocking": { - "version": "2.0.0", + "sax": { + "version": "1.2.4", "bundled": true, "dev": true, "optional": true }, - "signal-exit": { - "version": "3.0.2", + "semver": { + "version": "5.5.0", "bundled": true, "dev": true, "optional": true }, - "sntp": { - "version": "1.0.9", + "set-blocking": { + "version": "2.0.0", "bundled": true, "dev": true, - "requires": { - "hoek": "2.16.3" - } + "optional": true }, - "sshpk": { - "version": "1.13.0", + "signal-exit": { + "version": "3.0.2", "bundled": true, "dev": true, - "optional": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jodid25519": "1.0.2", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } + "optional": true }, "string-width": { "version": "1.0.2", @@ -5124,19 +4670,14 @@ } }, "string_decoder": { - "version": "1.0.1", + "version": "1.1.1", "bundled": true, "dev": true, + "optional": true, "requires": { - "safe-buffer": "5.0.1" + "safe-buffer": "5.1.1" } }, - "stringstream": { - "version": "0.0.5", - "bundled": true, - "dev": true, - "optional": true - }, "strip-ansi": { "version": "3.0.1", "bundled": true, @@ -5152,81 +4693,26 @@ "optional": true }, "tar": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-pack": { - "version": "3.4.0", + "version": "4.4.1", "bundled": true, "dev": true, "optional": true, "requires": { - "debug": "2.6.8", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.2.9", - "rimraf": "2.6.1", - "tar": "2.2.1", - "uid-number": "0.0.6" - } - }, - "tough-cookie": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "punycode": "1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.0.1" + "chownr": "1.0.1", + "fs-minipass": "1.2.5", + "minipass": "2.2.4", + "minizlib": "1.1.0", + "mkdirp": "0.5.1", + "safe-buffer": "5.1.1", + "yallist": "3.0.2" } }, - "tweetnacl": { - "version": "0.14.5", - "bundled": true, - "dev": true, - "optional": true - }, - "uid-number": { - "version": "0.0.6", - "bundled": true, - "dev": true, - "optional": true - }, "util-deprecate": { "version": "1.0.2", "bundled": true, - "dev": true - }, - "uuid": { - "version": "3.0.1", - "bundled": true, "dev": true, "optional": true }, - "verror": { - "version": "1.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "extsprintf": "1.0.2" - } - }, "wide-align": { "version": "1.1.2", "bundled": true, @@ -5240,6 +4726,11 @@ "version": "1.0.2", "bundled": true, "dev": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "dev": true } } }, @@ -5382,13 +4873,13 @@ } }, "google-auth-library": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-1.3.2.tgz", - "integrity": "sha512-aRz0om4Bs85uyR2Ousk3Gb8Nffx2Sr2RoKts1smg1MhRwrehE1aD1HC4RmprNt1HVJ88IDnQ8biJQ/aXjiIxlQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-1.4.0.tgz", + "integrity": "sha512-vWRx6pJulK7Y5V/Xyr7MPMlx2mWfmrUVbcffZ7hpq8ElFg5S8WY6PvjMovdcr6JfuAwwpAX4R0I1XOcyWuBcUw==", "requires": { "axios": "0.18.0", "gcp-metadata": "0.6.3", - "gtoken": "2.2.0", + "gtoken": "2.3.0", "jws": "3.1.4", "lodash.isstring": "4.0.1", "lru-cache": "4.1.2", @@ -5396,13 +4887,13 @@ } }, "google-auto-auth": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.10.0.tgz", - "integrity": "sha512-R6m473OqgZacPvlidJ0aownTlUWyLy654ugjKSXyi1ffIicXlXg3wMfse9T9zxqG6w01q6K1iG+b7dImMkVJ2Q==", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.10.1.tgz", + "integrity": "sha512-iIqSbY7Ypd32mnHGbYctp80vZzXoDlvI9gEfvtl3kmyy5HzOcrZCIGCBdSlIzRsg7nHpQiHE3Zl6Ycur6TSodQ==", "requires": { "async": "2.6.0", "gcp-metadata": "0.6.3", - "google-auth-library": "1.3.2", + "google-auth-library": "1.4.0", "request": "2.85.0" } }, @@ -5411,7 +4902,7 @@ "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.2.tgz", "integrity": "sha512-+EuKr4CLlGsnXx4XIJIVkcKYrsa2xkAmCvxRhX2HsazJzUBAJ35wARGeApHUn4nNfPD03Vl057FskNr20VaCyg==", "requires": { - "node-forge": "0.7.4", + "node-forge": "0.7.5", "pify": "3.0.0" } }, @@ -5429,12 +4920,12 @@ "into-stream": "3.1.0", "is-retry-allowed": "1.1.0", "isurl": "1.0.0", - "lowercase-keys": "1.0.0", + "lowercase-keys": "1.0.1", "mimic-response": "1.0.0", "p-cancelable": "0.3.0", "p-timeout": "2.0.1", "pify": "3.0.0", - "safe-buffer": "5.1.1", + "safe-buffer": "5.1.2", "timed-out": "4.0.1", "url-parse-lax": "3.0.0", "url-to-options": "1.0.1" @@ -5470,14 +4961,14 @@ "dev": true }, "gtoken": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.2.0.tgz", - "integrity": "sha512-tvQs8B1z5+I1FzMPZnq/OCuxTWFOkvy7cUJcpNdBOK2L7yEtPZTVCPtZU181sSDF+isUPebSqFTNTkIejFASAQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.0.tgz", + "integrity": "sha512-Jc9/8mV630cZE9FC5tIlJCZNdUjwunvlwOtCz6IDlaiB4Sz68ki29a1+q97sWTnTYroiuF9B135rod9zrQdHLw==", "requires": { "axios": "0.18.0", "google-p12-pem": "1.0.2", "jws": "3.1.4", - "mime": "2.2.0", + "mime": "2.3.1", "pify": "3.0.0" } }, @@ -5620,7 +5111,7 @@ "domutils": "1.7.0", "entities": "1.1.1", "inherits": "2.0.3", - "readable-stream": "2.3.5" + "readable-stream": "2.3.6" } }, "http-cache-semantics": { @@ -5658,19 +5149,22 @@ "package-hash": "2.0.0", "pkg-dir": "2.0.0", "resolve-from": "3.0.0", - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", - "dev": true + "version": "0.4.21", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.21.tgz", + "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", + "dev": true, + "requires": { + "safer-buffer": "2.1.2" + } }, "ignore": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", - "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz", + "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==", "dev": true }, "ignore-by-default": { @@ -5740,7 +5234,7 @@ "integrity": "sha512-STx5orGQU1gfrkoI/fMU7lX6CSP7LBGO10gXNgOZhwKhUqbtNjCkYSewJtNnLmWP1tAGN6oyEpG1HFPw5vpa5Q==", "dev": true, "requires": { - "moment": "2.21.0", + "moment": "2.22.1", "sanitize-html": "1.18.2" } }, @@ -5750,13 +5244,13 @@ "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "dev": true, "requires": { - "ansi-escapes": "3.0.0", - "chalk": "2.3.2", + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", "cli-cursor": "2.1.0", "cli-width": "2.2.0", - "external-editor": "2.1.0", + "external-editor": "2.2.0", "figures": "2.0.0", - "lodash": "4.17.5", + "lodash": "4.17.10", "mute-stream": "0.0.7", "run-async": "2.3.0", "rx-lite": "4.0.8", @@ -6039,9 +5533,9 @@ "dev": true }, "is-stream-ended": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.3.tgz", - "integrity": "sha1-oEc7Jnx1ZjVIa+7cfjNE5UnRUqw=" + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", + "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" }, "is-typedarray": { "version": "1.0.0", @@ -6049,9 +5543,9 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, "is-url": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.3.tgz", - "integrity": "sha512-vmOHLvzbcnsdFz8wQPXj1lgI5SE8AUlUGMenzuZzRFjoReb1WB+pLt9GrIo7BTker+aTcwrjTDle7odioWeqyw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", "dev": true }, "is-utf8": { @@ -6150,7 +5644,7 @@ "escape-string-regexp": "1.0.5", "js2xmlparser": "3.0.0", "klaw": "2.0.0", - "marked": "0.3.17", + "marked": "0.3.19", "mkdirp": "0.5.1", "requizzle": "0.2.1", "strip-json-comments": "2.0.1", @@ -6179,9 +5673,9 @@ "dev": true }, "json-parse-better-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz", - "integrity": "sha512-xyQpxeWWMKyJps9CuGJYeng6ssI5bpqS9ltQpdVQ90t4ql6NdnxFKh95JcRt2cun/DjMVNrdjniLPuMA69xmCw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, "json-schema": { @@ -6194,15 +5688,6 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "dev": true, - "requires": { - "jsonify": "0.0.0" - } - }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -6229,12 +5714,6 @@ "graceful-fs": "4.1.11" } }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -6260,7 +5739,7 @@ "base64url": "2.0.0", "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.9", - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "jws": { @@ -6270,7 +5749,7 @@ "requires": { "base64url": "2.0.0", "jwa": "1.1.5", - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "keyv": { @@ -6375,9 +5854,9 @@ } }, "lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" }, "lodash.clonedeep": { "version": "4.5.0", @@ -6493,9 +5972,9 @@ } }, "lowercase-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", - "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", "dev": true }, "lru-cache": { @@ -6523,9 +6002,9 @@ "dev": true }, "marked": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.17.tgz", - "integrity": "sha512-+AKbNsjZl6jFfLPwHhWmGTqE009wTKn3RTmn9K8oUKHrX/abPJjtcRtXpYB/FFrwPJRUA86LX/de3T0knkPCmQ==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", + "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", "dev": true }, "matcher": { @@ -6729,9 +6208,9 @@ } }, "mime": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.2.0.tgz", - "integrity": "sha512-0Qz9uF1ATtl8RKJG4VRfOymh7PyEor6NbrI/61lRfuRe4vx9SNATrvAeTj2EWVRKjEQGskrzWkJBBY5NbaVHIA==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", + "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==" }, "mime-db": { "version": "1.33.0", @@ -6783,9 +6262,9 @@ } }, "mocha": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.0.4.tgz", - "integrity": "sha512-nMOpAPFosU1B4Ix1jdhx5e3q7XO55ic5a8cgYvW27CequcEY+BabS0kUVL1Cw1V5PuVHZWeNRWFLmEPexo79VA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.1.1.tgz", + "integrity": "sha512-kKKs/H1KrMMQIEsWNxGmb4/BGsmj0dkeyotEvbrAuQ01FcWRLssUNXCEUZk6SZtyJBi6EE7SL0zDDtItw1rGhw==", "dev": true, "requires": { "browser-stdout": "1.3.1", @@ -6796,6 +6275,7 @@ "glob": "7.1.2", "growl": "1.10.3", "he": "1.1.1", + "minimatch": "3.0.4", "mkdirp": "0.5.1", "supports-color": "4.4.0" }, @@ -6823,9 +6303,9 @@ "dev": true }, "moment": { - "version": "2.21.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.21.0.tgz", - "integrity": "sha512-TCZ36BjURTeFTM/CwRcViQlfkMvL1/vFISuNLO5GkcVm1+QHfbSiNqZuWeMFjj1/3+uAjXswgRk30j1kkLYJBQ==", + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.1.tgz", + "integrity": "sha512-shJkRTSebXvsVqk56I+lkb2latjBs8I+pc2TzWc545y2iFnSjm7Wg0QMh+ZWcdSLQyGEau5jI8ocnmkyTgr9YQ==", "dev": true }, "ms": { @@ -6891,9 +6371,9 @@ "dev": true }, "nise": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.3.2.tgz", - "integrity": "sha512-KPKb+wvETBiwb4eTwtR/OsA2+iijXP+VnlSFYJo3EHjm2yjek1NWxHOUQat3i7xNLm1Bm18UA5j5Wor0yO2GtA==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.3.3.tgz", + "integrity": "sha512-v1J/FLUB9PfGqZLGDBhQqODkbLotP0WtLo9R4EJY2PPu5f5Xg4o0rA8FDlmrjFSv9vBBKcfnOSpfYYuu5RTHqg==", "dev": true, "requires": { "@sinonjs/formatio": "2.0.0", @@ -6904,9 +6384,9 @@ } }, "node-forge": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.4.tgz", - "integrity": "sha512-8Df0906+tq/omxuCZD6PqhPaQDYuyJ1d+VITgxoIA8zvQd1ru+nMJcDChHH324MWitIgbVkAkQoGEEVJNpn/PA==" + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.5.tgz", + "integrity": "sha512-MmbQJ2MTESTjt3Gi/3yG1wGpIMhUfcIypUCGtTizFR9IiccFwxSpfp0vtIZlkFclEqERemxfnSdZEMR9VqqEFQ==" }, "normalize-package-data": { "version": "2.4.0", @@ -6964,9 +6444,9 @@ "dev": true }, "nyc": { - "version": "11.6.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.6.0.tgz", - "integrity": "sha512-ZaXCh0wmbk2aSBH2B5hZGGvK2s9aM8DIm2rVY+BG3Fx8tUS+bpJSswUVZqOD1YfCmnYRFSqgYJSr7UeeUcW0jg==", + "version": "11.7.1", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.7.1.tgz", + "integrity": "sha512-EGePURSKUEpS1jWnEKAMhY+GWZzi7JC+f8iBDOATaOsLZW5hM/9eYx2dHGaEXa1ITvMm44CJugMksvP3NwMQMw==", "dev": true, "requires": { "archy": "1.0.0", @@ -6984,7 +6464,7 @@ "istanbul-lib-instrument": "1.10.1", "istanbul-lib-report": "1.1.3", "istanbul-lib-source-maps": "1.2.3", - "istanbul-reports": "1.3.0", + "istanbul-reports": "1.4.0", "md5-hex": "1.3.0", "merge-source-map": "1.1.0", "micromatch": "2.3.11", @@ -7075,7 +6555,7 @@ "dev": true }, "atob": { - "version": "2.0.3", + "version": "2.1.0", "bundled": true, "dev": true }, @@ -7117,7 +6597,7 @@ "bundled": true, "dev": true, "requires": { - "core-js": "2.5.3", + "core-js": "2.5.5", "regenerator-runtime": "0.11.1" } }, @@ -7145,7 +6625,7 @@ "babylon": "6.18.0", "debug": "2.6.9", "globals": "9.18.0", - "invariant": "2.2.3", + "invariant": "2.2.4", "lodash": "4.17.5" } }, @@ -7192,10 +6672,41 @@ "is-descriptor": "1.0.2" } }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + }, "isobject": { "version": "3.0.1", "bundled": true, "dev": true + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true } } }, @@ -7303,61 +6814,10 @@ "is-descriptor": "0.1.6" } }, - "is-accessor-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, "isobject": { "version": "3.0.1", "bundled": true, "dev": true - }, - "kind-of": { - "version": "5.1.0", - "bundled": true, - "dev": true } } }, @@ -7420,7 +6880,7 @@ "dev": true }, "core-js": { - "version": "2.5.3", + "version": "2.5.5", "bundled": true, "dev": true }, @@ -7473,10 +6933,41 @@ "isobject": "3.0.1" }, "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + }, "isobject": { "version": "3.0.1", "bundled": true, "dev": true + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true } } }, @@ -7813,7 +7304,7 @@ "dev": true }, "invariant": { - "version": "2.2.3", + "version": "2.2.4", "bundled": true, "dev": true, "requires": { @@ -7826,18 +7317,11 @@ "dev": true }, "is-accessor-descriptor": { - "version": "1.0.0", + "version": "0.1.6", "bundled": true, "dev": true, "requires": { - "kind-of": "6.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } + "kind-of": "3.2.2" } }, "is-arrayish": { @@ -7859,32 +7343,25 @@ } }, "is-data-descriptor": { - "version": "1.0.0", + "version": "0.1.4", "bundled": true, "dev": true, "requires": { - "kind-of": "6.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } + "kind-of": "3.2.2" } }, "is-descriptor": { - "version": "1.0.2", + "version": "0.1.6", "bundled": true, "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" }, "dependencies": { "kind-of": { - "version": "6.0.2", + "version": "5.1.0", "bundled": true, "dev": true } @@ -8086,7 +7563,7 @@ } }, "istanbul-reports": { - "version": "1.3.0", + "version": "1.4.0", "bundled": true, "dev": true, "requires": { @@ -8389,39 +7866,6 @@ "requires": { "is-descriptor": "0.1.6" } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "bundled": true, - "dev": true - } - } } } }, @@ -8877,57 +8321,6 @@ "requires": { "is-extendable": "0.1.1" } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, - "kind-of": { - "version": "5.1.0", - "bundled": true, - "dev": true } } }, @@ -8949,10 +8342,41 @@ "is-descriptor": "1.0.2" } }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + }, "isobject": { "version": "3.0.1", "bundled": true, "dev": true + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true } } }, @@ -8974,7 +8398,7 @@ "bundled": true, "dev": true, "requires": { - "atob": "2.0.3", + "atob": "2.1.0", "decode-uri-component": "0.2.0", "resolve-url": "0.2.1", "source-map-url": "0.4.0", @@ -9051,57 +8475,6 @@ "requires": { "is-descriptor": "0.1.6" } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, - "kind-of": { - "version": "5.1.0", - "bundled": true, - "dev": true } } }, @@ -9161,7 +8534,7 @@ "dev": true, "requires": { "arrify": "1.0.1", - "micromatch": "3.1.9", + "micromatch": "3.1.10", "object-assign": "4.1.1", "read-pkg-up": "1.0.1", "require-main-filename": "1.0.1" @@ -9178,17 +8551,15 @@ "dev": true }, "braces": { - "version": "2.3.1", + "version": "2.3.2", "bundled": true, "dev": true, "requires": { "arr-flatten": "1.1.0", "array-unique": "0.3.2", - "define-property": "1.0.0", "extend-shallow": "2.0.1", "fill-range": "4.0.0", "isobject": "3.0.1", - "kind-of": "6.0.2", "repeat-element": "1.1.2", "snapdragon": "0.8.2", "snapdragon-node": "2.1.1", @@ -9196,14 +8567,6 @@ "to-regex": "3.0.2" }, "dependencies": { - "define-property": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, "extend-shallow": { "version": "2.0.1", "bundled": true, @@ -9244,6 +8607,42 @@ "is-extendable": "0.1.1" } }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, "is-descriptor": { "version": "0.1.6", "bundled": true, @@ -9316,39 +8715,29 @@ } }, "is-accessor-descriptor": { - "version": "0.1.6", + "version": "1.0.0", "bundled": true, "dev": true, "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } + "kind-of": "6.0.2" } }, "is-data-descriptor": { - "version": "0.1.4", + "version": "1.0.0", "bundled": true, "dev": true, "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" } }, "is-number": { @@ -9380,13 +8769,13 @@ "dev": true }, "micromatch": { - "version": "3.1.9", + "version": "3.1.10", "bundled": true, "dev": true, "requires": { "arr-diff": "4.0.0", "array-unique": "0.3.2", - "braces": "2.3.1", + "braces": "2.3.2", "define-property": "2.0.2", "extend-shallow": "3.0.2", "extglob": "2.0.4", @@ -9955,8 +9344,8 @@ "is-redirect": "1.0.0", "is-retry-allowed": "1.1.0", "is-stream": "1.1.0", - "lowercase-keys": "1.0.0", - "safe-buffer": "5.1.1", + "lowercase-keys": "1.0.1", + "safe-buffer": "5.1.2", "timed-out": "4.0.1", "unzip-response": "2.0.1", "url-parse-lax": "1.0.0" @@ -10109,7 +9498,7 @@ "dev": true, "requires": { "error-ex": "1.3.1", - "json-parse-better-errors": "1.0.1" + "json-parse-better-errors": "1.0.2" } } } @@ -10139,14 +9528,14 @@ "dev": true }, "postcss": { - "version": "6.0.20", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.20.tgz", - "integrity": "sha512-Opr6usW30Iy0xEDrJywDckRxtylfO7gTGs3Kfb2LdLQlGsUg89fTy0R3Vm1Dub2YHO7MK58avr0p70+uFFHb7A==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.2", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "5.3.0" + "supports-color": "5.4.0" }, "dependencies": { "source-map": { @@ -10158,9 +9547,9 @@ } }, "power-assert": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.4.4.tgz", - "integrity": "sha1-kpXqdDcZb1pgH95CDwQmMRhtdRc=", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.5.0.tgz", + "integrity": "sha512-WaWSw+Ts283o6dzxW1BxIxoaHok7aSSGx4SaR6dW62Pk31ynv9DERDieuZpPYv5XaJ+H+zdcOaJQ+PvlasAOVw==", "dev": true, "requires": { "define-properties": "1.1.2", @@ -10176,7 +9565,7 @@ "integrity": "sha1-7bo1LT7YpgMRTWZyZazOYNaJzN8=", "dev": true, "requires": { - "core-js": "2.5.3", + "core-js": "2.5.5", "power-assert-context-traversal": "1.1.1" } }, @@ -10188,7 +9577,7 @@ "requires": { "acorn": "4.0.13", "acorn-es7-plugin": "1.1.7", - "core-js": "2.5.3", + "core-js": "2.5.5", "espurify": "1.7.0", "estraverse": "4.2.0" }, @@ -10207,7 +9596,7 @@ "integrity": "sha1-iMq8oNE7Y1nwfT0+ivppkmRXftk=", "dev": true, "requires": { - "core-js": "2.5.3", + "core-js": "2.5.5", "estraverse": "4.2.0" } }, @@ -10217,7 +9606,7 @@ "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", "dev": true, "requires": { - "core-js": "2.5.3", + "core-js": "2.5.5", "power-assert-context-formatter": "1.1.1", "power-assert-context-reducer-ast": "1.1.2", "power-assert-renderer-assertion": "1.1.1", @@ -10248,7 +9637,7 @@ "integrity": "sha1-10Odl9hRVr5OMKAPL7WnJRTOPAg=", "dev": true, "requires": { - "core-js": "2.5.3", + "core-js": "2.5.5", "diff-match-patch": "1.0.0", "power-assert-renderer-base": "1.1.1", "stringifier": "1.3.0", @@ -10261,7 +9650,7 @@ "integrity": "sha1-ZV+PcRk1qbbVQbhjJ2VHF8Y3qYY=", "dev": true, "requires": { - "core-js": "2.5.3", + "core-js": "2.5.5", "power-assert-renderer-base": "1.1.1", "power-assert-util-string-width": "1.1.1", "stringifier": "1.3.0" @@ -10304,9 +9693,9 @@ "dev": true }, "prettier": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.11.1.tgz", - "integrity": "sha512-T/KD65Ot0PB97xTrG8afQ46x3oiVhnfGjGESSI9NWYcG92+OUPZKkwHqGWXH2t9jK1crnQjubECW0FuOth+hxw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.12.1.tgz", + "integrity": "sha1-wa0g6APndJ+vkFpAnSNn4Gu+cyU=", "dev": true }, "pretty-ms": { @@ -10439,12 +9828,12 @@ } }, "rc": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.6.tgz", - "integrity": "sha1-6xiYnG1PTxYsOZ953dKfODVWgJI=", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.7.tgz", + "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", "dev": true, "requires": { - "deep-extend": "0.4.2", + "deep-extend": "0.5.1", "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" @@ -10480,16 +9869,16 @@ } }, "readable-stream": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", - "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", "isarray": "1.0.0", "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", "util-deprecate": "1.0.2" } }, @@ -10501,7 +9890,7 @@ "requires": { "graceful-fs": "4.1.11", "minimatch": "3.0.4", - "readable-stream": "2.3.5", + "readable-stream": "2.3.6", "set-immediate-shim": "1.0.1" } }, @@ -10548,9 +9937,9 @@ } }, "regexpp": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.0.1.tgz", - "integrity": "sha512-8Ph721maXiOYSLtaDGKVmDn5wdsNaF6Px85qFNeMPQq0r8K5Y10tgP6YuR65Ws35n4DvzFcCxEnRNBIXQunzLw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", + "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", "dev": true }, "regexpu-core": { @@ -10570,8 +9959,8 @@ "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", "dev": true, "requires": { - "rc": "1.2.6", - "safe-buffer": "5.1.1" + "rc": "1.2.7", + "safe-buffer": "5.1.2" } }, "registry-url": { @@ -10580,7 +9969,7 @@ "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", "dev": true, "requires": { - "rc": "1.2.6" + "rc": "1.2.7" } }, "regjsgen": { @@ -10640,7 +10029,7 @@ "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", "requires": { "aws-sign2": "0.7.0", - "aws4": "1.6.0", + "aws4": "1.7.0", "caseless": "0.12.0", "combined-stream": "1.0.6", "extend": "3.0.1", @@ -10656,7 +10045,7 @@ "oauth-sign": "0.8.2", "performance-now": "2.1.0", "qs": "6.5.1", - "safe-buffer": "5.1.1", + "safe-buffer": "5.1.2", "stringstream": "0.0.5", "tough-cookie": "2.3.4", "tunnel-agent": "0.6.0", @@ -10743,7 +10132,7 @@ "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", "dev": true, "requires": { - "lowercase-keys": "1.0.0" + "lowercase-keys": "1.0.1" } }, "restore-cursor": { @@ -10814,9 +10203,15 @@ } }, "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "samsam": { "version": "1.3.0", @@ -10830,14 +10225,14 @@ "integrity": "sha512-52ThA+Z7h6BnvpSVbURwChl10XZrps5q7ytjTwWcIe9bmJwnVP6cpEVK2NvDOUhGupoqAvNbUz3cpnJDp4+/pg==", "dev": true, "requires": { - "chalk": "2.3.2", + "chalk": "2.4.1", "htmlparser2": "3.9.2", "lodash.clonedeep": "4.5.0", "lodash.escaperegexp": "4.1.2", "lodash.isplainobject": "4.0.6", "lodash.isstring": "4.0.1", "lodash.mergewith": "4.6.1", - "postcss": "6.0.20", + "postcss": "6.0.22", "srcset": "1.0.0", "xtend": "4.0.1" } @@ -10906,8 +10301,8 @@ "diff": "3.5.0", "lodash.get": "4.4.2", "lolex": "2.3.2", - "nise": "1.3.2", - "supports-color": "5.3.0", + "nise": "1.3.3", + "supports-color": "5.4.0", "type-detect": "4.0.8" } }, @@ -10956,11 +10351,12 @@ "dev": true }, "source-map-support": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.4.tgz", - "integrity": "sha512-PETSPG6BjY1AHs2t64vS2aqAgu6dMIMXJULWFBGbh2Gr8nVLbCFDo6i/RMMvviIQ2h1Z8+5gQhVKSn2je9nmdg==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.5.tgz", + "integrity": "sha512-mR7/Nd5l1z6g99010shcXJiNEaf3fEtmLhRB/sBcQVJGodcHCULPp2y4Sfa43Kv2zq7T+Izmfp/WHCR6dYkQCA==", "dev": true, "requires": { + "buffer-from": "1.0.0", "source-map": "0.6.1" }, "dependencies": { @@ -11010,7 +10406,7 @@ "integrity": "sha1-0rdajl4Ngk1S/eyLgiWDncLjXfo=", "requires": { "async": "2.6.0", - "is-stream-ended": "0.1.3" + "is-stream-ended": "0.1.4" } }, "sprintf-js": { @@ -11051,9 +10447,9 @@ "dev": true }, "stream-events": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.2.tgz", - "integrity": "sha1-q/OfZsCJCk63lbyNXoWbJhW1kLI=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.4.tgz", + "integrity": "sha512-D243NJaYs/xBN2QnoiMDY7IesJFIK7gEhnvAYqJa5JvDdnh2dC4qDBwlCf0ohPpX2QRlA/4gnbnPd3rs3KxVcA==", "requires": { "stubs": "3.0.0" } @@ -11091,11 +10487,11 @@ } }, "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "stringifier": { @@ -11104,7 +10500,7 @@ "integrity": "sha1-3vGDQvaTPbDy2/yaoCF1tEjBeVk=", "dev": true, "requires": { - "core-js": "2.5.3", + "core-js": "2.5.5", "traverse": "0.6.6", "type-name": "2.0.2" } @@ -11173,9 +10569,9 @@ "integrity": "sha1-6NK6H6nJBXAwPAMLaQD31fiavls=" }, "superagent": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.2.tgz", - "integrity": "sha512-gVH4QfYHcY3P0f/BZzavLreHW3T1v7hG9B+hpMQotGQqurOvhv87GcMCd6LWySmBuf+BDR44TQd0aISjVHLeNQ==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", + "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", "dev": true, "requires": { "component-emitter": "1.2.1", @@ -11187,7 +10583,7 @@ "methods": "1.1.2", "mime": "1.6.0", "qs": "6.5.1", - "readable-stream": "2.3.5" + "readable-stream": "2.3.6" }, "dependencies": { "mime": { @@ -11218,13 +10614,13 @@ "dev": true, "requires": { "methods": "1.1.2", - "superagent": "3.8.2" + "superagent": "3.8.3" } }, "supports-color": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", - "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { "has-flag": "3.0.0" @@ -11252,8 +10648,8 @@ "requires": { "ajv": "5.5.2", "ajv-keywords": "2.1.1", - "chalk": "2.3.2", - "lodash": "4.17.5", + "chalk": "2.4.1", + "lodash": "4.17.10", "slice-ansi": "1.0.0", "string-width": "2.1.1" } @@ -11296,7 +10692,7 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", "requires": { - "readable-stream": "2.3.5", + "readable-stream": "2.3.6", "xtend": "4.0.1" } }, @@ -11364,7 +10760,7 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "tweetnacl": { @@ -11513,15 +10909,16 @@ "dev": true }, "update-notifier": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.3.0.tgz", - "integrity": "sha1-TognpruRUUCrCTVZ1wFOPruDdFE=", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", + "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", "dev": true, "requires": { "boxen": "1.3.0", - "chalk": "2.3.2", - "configstore": "3.1.1", + "chalk": "2.4.1", + "configstore": "3.1.2", "import-lazy": "2.1.0", + "is-ci": "1.1.0", "is-installed-globally": "0.1.0", "is-npm": "1.0.0", "latest-version": "3.1.0", @@ -11755,7 +11152,7 @@ "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", "dev": true, "requires": { - "cliui": "4.0.0", + "cliui": "4.1.0", "decamelize": "1.2.0", "find-up": "2.1.0", "get-caller-file": "1.0.2", @@ -11770,9 +11167,9 @@ }, "dependencies": { "cliui": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.0.0.tgz", - "integrity": "sha512-nY3W5Gu2racvdDk//ELReY+dHjb9PlIcVDFXP72nVIhq2Gy3LuVXYwJoPVudwQnv1shtohpgkdCKT2YaKY0CKw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { "string-width": "2.1.1", From 50cbacd24920a7f6bf34a45e8d5be4b24772ed39 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Wed, 2 May 2018 15:10:52 -0700 Subject: [PATCH 091/513] chore: test on node10 (#41) --- .../.circleci/config.yml | 65 ++++++------------- 1 file changed, 20 insertions(+), 45 deletions(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 73222e5682b..46039168b35 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -19,12 +19,17 @@ workflows: filters: tags: only: /.*/ + - node10: + filters: + tags: + only: /.*/ - lint: requires: - node4 - node6 - node8 - node9 + - node10 filters: tags: only: /.*/ @@ -34,6 +39,7 @@ workflows: - node6 - node8 - node9 + - node10 filters: tags: only: /.*/ @@ -89,14 +95,15 @@ jobs: else echo "Not a nightly build, skipping this step." fi - - run: - name: Install modules and dependencies. - command: |- + - run: &npm_install_and_link + name: Install and link the module. + command: | npm install repo_tools="node_modules/@google-cloud/nodejs-repo-tools/bin/tools" if ! test -x "$repo_tools"; then chmod +x "$repo_tools" fi + npm link - run: name: Run unit tests. command: npm test @@ -116,22 +123,18 @@ jobs: docker: - image: 'node:9' steps: *unit_tests_steps + node10: + docker: + - image: 'node:10' + steps: *unit_tests_steps lint: docker: - image: 'node:8' steps: - checkout - run: *remove_package_lock - - run: - name: Install modules and dependencies. - command: | - npm install - repo_tools="node_modules/@google-cloud/nodejs-repo-tools/bin/tools" - if ! test -x "$repo_tools"; then - chmod +x "$repo_tools" - fi - npm link - - run: + - run: *npm_install_and_link + - run: &samples_npm_install_and_link name: Link the module being tested to the samples. command: | cd samples/ @@ -147,14 +150,7 @@ jobs: steps: - checkout - run: *remove_package_lock - - run: - name: Install modules and dependencies. - command: |- - npm install - repo_tools="node_modules/@google-cloud/nodejs-repo-tools/bin/tools" - if ! test -x "$repo_tools"; then - chmod +x "$repo_tools" - fi + - run: *npm_install_and_link - run: name: Build documentation. command: npm run docs @@ -170,22 +166,8 @@ jobs: openssl aes-256-cbc -d -in .circleci/key.json.enc \ -out .circleci/key.json \ -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" - - run: - name: Install and link the module. - command: | - npm install - repo_tools="node_modules/@google-cloud/nodejs-repo-tools/bin/tools" - if ! test -x "$repo_tools"; then - chmod +x "$repo_tools" - fi - npm link - - run: - name: Link the module being tested to the samples. - command: | - cd samples/ - npm link @google-cloud/translate - npm install - cd .. + - run: *npm_install_and_link + - run: *samples_npm_install_and_link - run: name: Run sample tests. command: npm run samples-test @@ -209,14 +191,7 @@ jobs: openssl aes-256-cbc -d -in .circleci/key.json.enc \ -out .circleci/key.json \ -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" - - run: - name: Install modules and dependencies. - command: |- - npm install - repo_tools="node_modules/@google-cloud/nodejs-repo-tools/bin/tools" - if ! test -x "$repo_tools"; then - chmod +x "$repo_tools" - fi + - run: *npm_install_and_link - run: name: Run system tests. command: npm run system-test From c17edbc7aa0e181822e3a151ec4a3037e616526b Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 8 May 2018 14:27:57 -0700 Subject: [PATCH 092/513] chore: lock files maintenance (#43) * chore: lock files maintenance * chore: lock files maintenance --- .../google-cloud-translate/package-lock.json | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 8a3e687ba44..1d6275c37de 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -89,7 +89,7 @@ "arrify": "1.0.1", "concat-stream": "1.6.2", "create-error-class": "3.0.2", - "duplexify": "3.5.4", + "duplexify": "3.6.0", "ent": "2.2.0", "extend": "3.0.1", "google-auto-auth": "0.10.1", @@ -2384,7 +2384,7 @@ "babel-generator": "6.26.1", "babylon": "6.18.0", "call-matcher": "1.0.1", - "core-js": "2.5.5", + "core-js": "2.5.6", "espower-location-detector": "1.0.0", "espurify": "1.7.0", "estraverse": "4.2.0" @@ -2531,7 +2531,7 @@ "requires": { "babel-core": "6.26.3", "babel-runtime": "6.26.0", - "core-js": "2.5.5", + "core-js": "2.5.6", "home-or-tmp": "2.0.0", "lodash": "4.17.10", "mkdirp": "0.5.1", @@ -2555,7 +2555,7 @@ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { - "core-js": "2.5.5", + "core-js": "2.5.6", "regenerator-runtime": "0.11.1" } }, @@ -2792,7 +2792,7 @@ "integrity": "sha1-UTTQd5hPcSpU2tPL9i3ijc5BbKg=", "dev": true, "requires": { - "core-js": "2.5.5", + "core-js": "2.5.6", "deep-equal": "1.0.1", "espurify": "1.7.0", "estraverse": "4.2.0" @@ -3173,9 +3173,9 @@ } }, "core-js": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.5.tgz", - "integrity": "sha1-sU3ek2xkDAV5prUMq8wTLdYSfjs=", + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.6.tgz", + "integrity": "sha512-lQUVfQi0aLix2xpyjrrJEvfuYCqPc/HwmTKsC/VNf8q0zsjX7SQZtp4+oRONN5Tsur9GDETPjj+Ub2iDiGZfSQ==", "dev": true }, "core-util-is": { @@ -3461,9 +3461,9 @@ "dev": true }, "duplexify": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.4.tgz", - "integrity": "sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", + "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", "requires": { "end-of-stream": "1.4.1", "inherits": "2.0.3", @@ -3501,7 +3501,7 @@ "integrity": "sha1-bw2nNEf07dg4/sXGAxOoi6XLhSs=", "dev": true, "requires": { - "core-js": "2.5.5", + "core-js": "2.5.6", "empower-core": "0.6.2" } }, @@ -3521,7 +3521,7 @@ "dev": true, "requires": { "call-signature": "0.0.2", - "core-js": "2.5.5" + "core-js": "2.5.6" } }, "end-of-stream": { @@ -3914,7 +3914,7 @@ "integrity": "sha1-HFz2y8zDLm9jk4C9T5kfq5up0iY=", "dev": true, "requires": { - "core-js": "2.5.5" + "core-js": "2.5.6" } }, "esquery": { @@ -4002,7 +4002,7 @@ "dev": true, "requires": { "chardet": "0.4.2", - "iconv-lite": "0.4.21", + "iconv-lite": "0.4.22", "tmp": "0.0.33" } }, @@ -5153,9 +5153,9 @@ } }, "iconv-lite": { - "version": "0.4.21", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.21.tgz", - "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", + "version": "0.4.22", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.22.tgz", + "integrity": "sha512-1AinFBeDTnsvVEP+V1QBlHpM1UZZl7gWB6fcz7B1Ho+LI1dUh2sSrxoCfVt2PinRHzXAziSniEV3P7JbTDHcXA==", "dev": true, "requires": { "safer-buffer": "2.1.2" @@ -9565,7 +9565,7 @@ "integrity": "sha1-7bo1LT7YpgMRTWZyZazOYNaJzN8=", "dev": true, "requires": { - "core-js": "2.5.5", + "core-js": "2.5.6", "power-assert-context-traversal": "1.1.1" } }, @@ -9577,7 +9577,7 @@ "requires": { "acorn": "4.0.13", "acorn-es7-plugin": "1.1.7", - "core-js": "2.5.5", + "core-js": "2.5.6", "espurify": "1.7.0", "estraverse": "4.2.0" }, @@ -9596,7 +9596,7 @@ "integrity": "sha1-iMq8oNE7Y1nwfT0+ivppkmRXftk=", "dev": true, "requires": { - "core-js": "2.5.5", + "core-js": "2.5.6", "estraverse": "4.2.0" } }, @@ -9606,7 +9606,7 @@ "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", "dev": true, "requires": { - "core-js": "2.5.5", + "core-js": "2.5.6", "power-assert-context-formatter": "1.1.1", "power-assert-context-reducer-ast": "1.1.2", "power-assert-renderer-assertion": "1.1.1", @@ -9637,7 +9637,7 @@ "integrity": "sha1-10Odl9hRVr5OMKAPL7WnJRTOPAg=", "dev": true, "requires": { - "core-js": "2.5.5", + "core-js": "2.5.6", "diff-match-patch": "1.0.0", "power-assert-renderer-base": "1.1.1", "stringifier": "1.3.0", @@ -9650,7 +9650,7 @@ "integrity": "sha1-ZV+PcRk1qbbVQbhjJ2VHF8Y3qYY=", "dev": true, "requires": { - "core-js": "2.5.5", + "core-js": "2.5.6", "power-assert-renderer-base": "1.1.1", "power-assert-util-string-width": "1.1.1", "stringifier": "1.3.0" @@ -9771,9 +9771,9 @@ "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" }, "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, "query-string": { "version": "5.1.1", @@ -10044,7 +10044,7 @@ "mime-types": "2.1.18", "oauth-sign": "0.8.2", "performance-now": "2.1.0", - "qs": "6.5.1", + "qs": "6.5.2", "safe-buffer": "5.1.2", "stringstream": "0.0.5", "tough-cookie": "2.3.4", @@ -10500,7 +10500,7 @@ "integrity": "sha1-3vGDQvaTPbDy2/yaoCF1tEjBeVk=", "dev": true, "requires": { - "core-js": "2.5.5", + "core-js": "2.5.6", "traverse": "0.6.6", "type-name": "2.0.2" } @@ -10582,7 +10582,7 @@ "formidable": "1.2.1", "methods": "1.1.2", "mime": "1.6.0", - "qs": "6.5.1", + "qs": "6.5.2", "readable-stream": "2.3.6" }, "dependencies": { From b854bdd5a0f4caa04700b3642b3f5365fa5e6503 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Wed, 16 May 2018 16:52:43 -0700 Subject: [PATCH 093/513] chore: timeout for system test (#44) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index fbed57be273..fe8b5a26900 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -51,7 +51,7 @@ "prettier": "repo-tools exec -- prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", "publish-module": "node ../../scripts/publish.js translate", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "repo-tools test run --cmd mocha -- system-test/*.js --no-timeouts", + "system-test": "repo-tools test run --cmd mocha -- system-test/*.js --timeout 600000", "test-no-cover": "repo-tools test run --cmd mocha -- test/*.js --no-timeouts", "test": "repo-tools test run --cmd npm -- run cover" }, From b1c4f978c2b114385717e97aa4859450f0baf681 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 22 May 2018 11:32:41 -0700 Subject: [PATCH 094/513] chore: lock files maintenance (#46) * chore: lock files maintenance * chore: lock files maintenance --- .../google-cloud-translate/package-lock.json | 730 +++++++----------- 1 file changed, 297 insertions(+), 433 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 1d6275c37de..081df99cb9f 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -97,7 +97,7 @@ "log-driver": "1.2.7", "methmeth": "1.1.0", "modelo": "4.2.3", - "request": "2.85.0", + "request": "2.87.0", "retry-request": "3.3.1", "split-array-stream": "1.0.3", "stream-events": "1.0.4", @@ -1794,7 +1794,7 @@ }, "@sinonjs/formatio": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", "integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==", "dev": true, "requires": { @@ -2000,9 +2000,9 @@ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, "async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", - "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "requires": { "lodash": "4.17.10" } @@ -2087,7 +2087,7 @@ "lodash.difference": "4.5.0", "lodash.flatten": "4.4.0", "loud-rejection": "1.6.0", - "make-dir": "1.2.0", + "make-dir": "1.3.0", "matcher": "1.1.0", "md5-hex": "2.0.0", "meow": "3.7.0", @@ -2104,7 +2104,7 @@ "safe-buffer": "5.1.2", "semver": "5.5.0", "slash": "1.0.0", - "source-map-support": "0.5.5", + "source-map-support": "0.5.6", "stack-utils": "1.0.1", "strip-ansi": "4.0.0", "strip-bom-buf": "1.0.0", @@ -2143,7 +2143,7 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", "requires": { - "follow-redirects": "1.4.1", + "follow-redirects": "1.5.0", "is-buffer": "1.1.6" } }, @@ -2386,7 +2386,7 @@ "call-matcher": "1.0.1", "core-js": "2.5.6", "espower-location-detector": "1.0.0", - "espurify": "1.7.0", + "espurify": "1.8.0", "estraverse": "4.2.0" } }, @@ -2624,11 +2624,6 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "base64url": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", - "integrity": "sha1-6sFuA+oUOO/5Qj1puqNiYu0fcLs=" - }, "bcrypt-pbkdf": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", @@ -2650,14 +2645,6 @@ "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", "dev": true }, - "boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", - "requires": { - "hoek": "4.2.1" - } - }, "boxen": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", @@ -2794,7 +2781,7 @@ "requires": { "core-js": "2.5.6", "deep-equal": "1.0.1", - "espurify": "1.7.0", + "espurify": "1.8.0", "estraverse": "4.2.0" } }, @@ -2890,7 +2877,7 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", - "fsevents": "1.2.3", + "fsevents": "1.2.4", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -3020,13 +3007,13 @@ "dev": true }, "codecov": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.1.tgz", - "integrity": "sha512-0TjnXrbvcPzAkRPv/Y5D8aZju/M5adkFxShRyMMgDReB8EV9nF4XMERXs6ajgLA1di9LUFW2tgePDQd2JPWy7g==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.2.tgz", + "integrity": "sha512-9ljtIROIjPIUmMRqO+XuDITDoV8xRrZmA0jcEq6p2hg2+wY9wGmLfreAZGIL72IzUfdEDZaU8+Vjidg1fBQ8GQ==", "dev": true, "requires": { "argv": "0.0.2", - "request": "2.85.0", + "request": "2.87.0", "urlgrey": "0.4.4" } }, @@ -3060,9 +3047,9 @@ } }, "commander": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, "common-path-prefix": { @@ -3138,7 +3125,7 @@ "requires": { "dot-prop": "4.2.0", "graceful-fs": "4.1.11", - "make-dir": "1.2.0", + "make-dir": "1.3.0", "unique-string": "1.0.0", "write-file-atomic": "2.3.0", "xdg-basedir": "3.0.0" @@ -3197,29 +3184,11 @@ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { - "lru-cache": "4.1.2", + "lru-cache": "4.1.3", "shebang-command": "1.2.0", "which": "1.3.0" } }, - "cryptiles": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", - "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", - "requires": { - "boom": "5.2.0" - }, - "dependencies": { - "boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "requires": { - "hoek": "4.2.1" - } - } - } - }, "crypto-random-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", @@ -3388,9 +3357,9 @@ "dev": true }, "diff-match-patch": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.0.tgz", - "integrity": "sha1-HMPIOkkNZ/ldkeOfatHy4Ia2MEg=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.1.tgz", + "integrity": "sha512-A0QEhr4PxGUMEtKxd6X+JLnOTFd3BfIPSDpsc4dMvj+CbSaErDwTpoTo/nFJDMSrjxLW4BiNq+FbNisAAHhWeQ==", "dev": true }, "doctrine": { @@ -3427,9 +3396,9 @@ "dev": true }, "domhandler": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.1.tgz", - "integrity": "sha1-iS5HAAqZvlW783dP/qBWHYh5wlk=", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", "dev": true, "requires": { "domelementtype": "1.3.0" @@ -3487,11 +3456,10 @@ } }, "ecdsa-sig-formatter": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.9.tgz", - "integrity": "sha1-S8kmJ07Dtau1AW5+HWCSGsJisqE=", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", + "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", "requires": { - "base64url": "2.0.0", "safe-buffer": "5.1.2" } }, @@ -3820,9 +3788,9 @@ "dev": true }, "espower": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/espower/-/espower-2.1.0.tgz", - "integrity": "sha1-zh7bPZhwKEH99ZbRy46FvcSujkg=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/espower/-/espower-2.1.1.tgz", + "integrity": "sha512-F4TY1qYJB1aUyzB03NsZksZzUQmQoEBaTUjRJGR30GxbkbjKI41NhCyYjrF+bGgWN7x/ZsczYppRpz/0WdI0ug==", "dev": true, "requires": { "array-find": "1.0.0", @@ -3830,7 +3798,7 @@ "escodegen": "1.9.1", "escope": "3.6.0", "espower-location-detector": "1.0.0", - "espurify": "1.7.0", + "espurify": "1.8.0", "estraverse": "4.2.0", "source-map": "0.5.7", "type-name": "2.0.2", @@ -3884,7 +3852,7 @@ "convert-source-map": "1.5.1", "empower-assert": "1.1.0", "escodegen": "1.9.1", - "espower": "2.1.0", + "espower": "2.1.1", "estraverse": "4.2.0", "merge-estraverse-visitors": "1.0.0", "multi-stage-sourcemap": "0.2.1", @@ -3909,9 +3877,9 @@ "dev": true }, "espurify": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.7.0.tgz", - "integrity": "sha1-HFz2y8zDLm9jk4C9T5kfq5up0iY=", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.0.tgz", + "integrity": "sha512-jdkJG9jswjKCCDmEridNUuIQei9algr+o66ZZ19610ZoBsiWLRsQGNYS4HGez3Z/DsR0lhANGAqiwBUclPuNag==", "dev": true, "requires": { "core-js": "2.5.6" @@ -3987,7 +3955,7 @@ "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "dev": true, "requires": { - "fill-range": "2.2.3" + "fill-range": "2.2.4" } }, "extend": { @@ -4002,7 +3970,7 @@ "dev": true, "requires": { "chardet": "0.4.2", - "iconv-lite": "0.4.22", + "iconv-lite": "0.4.23", "tmp": "0.0.33" } }, @@ -4078,14 +4046,14 @@ } }, "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", "dev": true, "requires": { "is-number": "2.1.0", "isobject": "2.1.0", - "randomatic": "1.1.7", + "randomatic": "3.0.0", "repeat-element": "1.1.2", "repeat-string": "1.6.1" } @@ -4097,7 +4065,7 @@ "dev": true, "requires": { "commondir": "1.0.1", - "make-dir": "1.2.0", + "make-dir": "1.3.0", "pkg-dir": "2.0.0" } }, @@ -4129,9 +4097,9 @@ "dev": true }, "follow-redirects": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.4.1.tgz", - "integrity": "sha512-uxYePVPogtya1ktGnAAXOacnbIuRMB4dkvqeNz2qTtTQsuzSfbDolV+wMMKxAmCx0bLgAKLbBOkjItMbbkR1vg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.0.tgz", + "integrity": "sha512-fdrt472/9qQ6Kgjvb935ig6vJCuofpBUD14f9Vb+SLlm7xIe4Qva5gey8EKtv8lp7ahE1wilg3xL1znpVGtZIA==", "requires": { "debug": "3.1.0" } @@ -4206,14 +4174,14 @@ "dev": true }, "fsevents": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.3.tgz", - "integrity": "sha512-X+57O5YkDTiEQGiw8i7wYc2nQgweIekqkepI8Q3y4wVlurgBt2SuwxTeYUYMZIGpLZH3r/TsMjczCMXE5ZOt7Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", "dev": true, "optional": true, "requires": { "nan": "2.10.0", - "node-pre-gyp": "0.9.1" + "node-pre-gyp": "0.10.0" }, "dependencies": { "abbrev": { @@ -4294,7 +4262,7 @@ } }, "deep-extend": { - "version": "0.4.2", + "version": "0.5.1", "bundled": true, "dev": true, "optional": true @@ -4472,7 +4440,7 @@ } }, "node-pre-gyp": { - "version": "0.9.1", + "version": "0.10.0", "bundled": true, "dev": true, "optional": true, @@ -4483,7 +4451,7 @@ "nopt": "4.0.1", "npm-packlist": "1.1.10", "npmlog": "4.1.2", - "rc": "1.2.6", + "rc": "1.2.7", "rimraf": "2.6.2", "semver": "5.5.0", "tar": "4.4.1" @@ -4581,12 +4549,12 @@ "optional": true }, "rc": { - "version": "1.2.6", + "version": "1.2.7", "bundled": true, "dev": true, "optional": true, "requires": { - "deep-extend": "0.4.2", + "deep-extend": "0.5.1", "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" @@ -4873,16 +4841,16 @@ } }, "google-auth-library": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-1.4.0.tgz", - "integrity": "sha512-vWRx6pJulK7Y5V/Xyr7MPMlx2mWfmrUVbcffZ7hpq8ElFg5S8WY6PvjMovdcr6JfuAwwpAX4R0I1XOcyWuBcUw==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-1.5.0.tgz", + "integrity": "sha512-xpibA/hkq4waBcpIkSJg4GiDAqcBWjJee3c47zj7xP3RQ0A9mc8MP3Vc9sc8SGRoDYA0OszZxTjW7SbcC4pJIA==", "requires": { "axios": "0.18.0", "gcp-metadata": "0.6.3", "gtoken": "2.3.0", - "jws": "3.1.4", + "jws": "3.1.5", "lodash.isstring": "4.0.1", - "lru-cache": "4.1.2", + "lru-cache": "4.1.3", "retry-axios": "0.3.2" } }, @@ -4891,10 +4859,10 @@ "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.10.1.tgz", "integrity": "sha512-iIqSbY7Ypd32mnHGbYctp80vZzXoDlvI9gEfvtl3kmyy5HzOcrZCIGCBdSlIzRsg7nHpQiHE3Zl6Ycur6TSodQ==", "requires": { - "async": "2.6.0", + "async": "2.6.1", "gcp-metadata": "0.6.3", - "google-auth-library": "1.4.0", - "request": "2.85.0" + "google-auth-library": "1.5.0", + "request": "2.87.0" } }, "google-p12-pem": { @@ -4955,9 +4923,9 @@ "dev": true }, "growl": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", - "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, "gtoken": { @@ -4967,7 +4935,7 @@ "requires": { "axios": "0.18.0", "google-p12-pem": "1.0.2", - "jws": "3.1.4", + "jws": "3.1.5", "mime": "2.3.1", "pify": "3.0.0" } @@ -5057,28 +5025,12 @@ "integrity": "sha1-ieJdtgS3Jcj1l2//Ct3JIbgopac=", "dev": true }, - "hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", - "requires": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.1", - "sntp": "2.1.0" - } - }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", "dev": true }, - "hoek": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", - "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" - }, "home-or-tmp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", @@ -5107,7 +5059,7 @@ "dev": true, "requires": { "domelementtype": "1.3.0", - "domhandler": "2.4.1", + "domhandler": "2.4.2", "domutils": "1.7.0", "entities": "1.1.1", "inherits": "2.0.3", @@ -5153,9 +5105,9 @@ } }, "iconv-lite": { - "version": "0.4.22", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.22.tgz", - "integrity": "sha512-1AinFBeDTnsvVEP+V1QBlHpM1UZZl7gWB6fcz7B1Ho+LI1dUh2sSrxoCfVt2PinRHzXAziSniEV3P7JbTDHcXA==", + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", "dev": true, "requires": { "safer-buffer": "2.1.2" @@ -5732,23 +5684,21 @@ "dev": true }, "jwa": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.5.tgz", - "integrity": "sha1-oFUs4CIHQs1S4VN3SjKQXDDnVuU=", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz", + "integrity": "sha512-tBO/cf++BUsJkYql/kBbJroKOgHWEigTKBAjjBEmrMGYd1QMBC74Hr4Wo2zCZw6ZrVhlJPvoMrkcOnlWR/DJfw==", "requires": { - "base64url": "2.0.0", "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.9", + "ecdsa-sig-formatter": "1.0.10", "safe-buffer": "5.1.2" } }, "jws": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.4.tgz", - "integrity": "sha1-+ei5M46KhHJ31kRLFGT2GIDgUKI=", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", + "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", "requires": { - "base64url": "2.0.0", - "jwa": "1.1.5", + "jwa": "1.1.6", "safe-buffer": "5.1.2" } }, @@ -5941,9 +5891,9 @@ "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==" }, "lolex": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.3.2.tgz", - "integrity": "sha512-A5pN2tkFj7H0dGIAM6MFvHKMJcPnjZsOMvR7ujCjfgW5TbV6H9vb1PgxLtHvjqNZTHsUolz+6/WEO0N1xNx2ng==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.6.0.tgz", + "integrity": "sha512-e1UtIo1pbrIqEXib/yMjHciyqkng5lc0rrIbytgjmRgDR9+2ceNIAcwOWSgylRjoEP9VdVguCSRwnNmlbnOUwA==", "dev": true }, "longest": { @@ -5978,18 +5928,18 @@ "dev": true }, "lru-cache": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", - "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "requires": { "pseudomap": "1.0.2", "yallist": "2.1.2" } }, "make-dir": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", - "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { "pify": "3.0.0" @@ -6016,6 +5966,12 @@ "escape-string-regexp": "1.0.5" } }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, "md5-hex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-2.0.0.tgz", @@ -6262,33 +6218,22 @@ } }, "mocha": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.1.1.tgz", - "integrity": "sha512-kKKs/H1KrMMQIEsWNxGmb4/BGsmj0dkeyotEvbrAuQ01FcWRLssUNXCEUZk6SZtyJBi6EE7SL0zDDtItw1rGhw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", "dev": true, "requires": { "browser-stdout": "1.3.1", - "commander": "2.11.0", + "commander": "2.15.1", "debug": "3.1.0", "diff": "3.5.0", "escape-string-regexp": "1.0.5", "glob": "7.1.2", - "growl": "1.10.3", + "growl": "1.10.5", "he": "1.1.1", "minimatch": "3.0.4", "mkdirp": "0.5.1", - "supports-color": "4.4.0" - }, - "dependencies": { - "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", - "dev": true, - "requires": { - "has-flag": "2.0.0" - } - } + "supports-color": "5.4.0" } }, "modelo": { @@ -6378,7 +6323,7 @@ "requires": { "@sinonjs/formatio": "2.0.0", "just-extend": "1.1.27", - "lolex": "2.3.2", + "lolex": "2.6.0", "path-to-regexp": "1.7.0", "text-encoding": "0.6.4" } @@ -6444,9 +6389,9 @@ "dev": true }, "nyc": { - "version": "11.7.1", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.7.1.tgz", - "integrity": "sha512-EGePURSKUEpS1jWnEKAMhY+GWZzi7JC+f8iBDOATaOsLZW5hM/9eYx2dHGaEXa1ITvMm44CJugMksvP3NwMQMw==", + "version": "11.8.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.8.0.tgz", + "integrity": "sha512-PUFq1PSsx5OinSk5g5aaZygcDdI3QQT5XUlbR9QRMihtMS6w0Gm8xj4BxmKeeAlpQXC5M2DIhH16Y+KejceivQ==", "dev": true, "requires": { "archy": "1.0.0", @@ -6467,7 +6412,7 @@ "istanbul-reports": "1.4.0", "md5-hex": "1.3.0", "merge-source-map": "1.1.0", - "micromatch": "2.3.11", + "micromatch": "3.1.10", "mkdirp": "0.5.1", "resolve-from": "2.0.0", "rimraf": "2.6.2", @@ -6517,12 +6462,9 @@ "dev": true }, "arr-diff": { - "version": "2.0.0", + "version": "4.0.0", "bundled": true, - "dev": true, - "requires": { - "arr-flatten": "1.1.0" - } + "dev": true }, "arr-flatten": { "version": "1.1.0", @@ -6535,7 +6477,7 @@ "dev": true }, "array-unique": { - "version": "0.2.1", + "version": "0.3.2", "bundled": true, "dev": true }, @@ -6555,7 +6497,7 @@ "dev": true }, "atob": { - "version": "2.1.0", + "version": "2.1.1", "bundled": true, "dev": true }, @@ -6579,7 +6521,7 @@ "babel-types": "6.26.0", "detect-indent": "4.0.0", "jsesc": "1.3.0", - "lodash": "4.17.5", + "lodash": "4.17.10", "source-map": "0.5.7", "trim-right": "1.0.1" } @@ -6597,7 +6539,7 @@ "bundled": true, "dev": true, "requires": { - "core-js": "2.5.5", + "core-js": "2.5.6", "regenerator-runtime": "0.11.1" } }, @@ -6610,7 +6552,7 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "lodash": "4.17.5" + "lodash": "4.17.10" } }, "babel-traverse": { @@ -6626,7 +6568,7 @@ "debug": "2.6.9", "globals": "9.18.0", "invariant": "2.2.4", - "lodash": "4.17.5" + "lodash": "4.17.10" } }, "babel-types": { @@ -6636,7 +6578,7 @@ "requires": { "babel-runtime": "6.26.0", "esutils": "2.0.2", - "lodash": "4.17.5", + "lodash": "4.17.10", "to-fast-properties": "1.0.3" } }, @@ -6720,13 +6662,30 @@ } }, "braces": { - "version": "1.8.5", + "version": "2.3.2", "bundled": true, "dev": true, "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "repeat-element": "1.1.2", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, "builtin-modules": { @@ -6880,7 +6839,7 @@ "dev": true }, "core-js": { - "version": "2.5.5", + "version": "2.5.6", "bundled": true, "dev": true }, @@ -6889,7 +6848,7 @@ "bundled": true, "dev": true, "requires": { - "lru-cache": "4.1.2", + "lru-cache": "4.1.3", "which": "1.3.0" } }, @@ -7016,7 +6975,7 @@ "bundled": true, "dev": true, "requires": { - "lru-cache": "4.1.2", + "lru-cache": "4.1.3", "shebang-command": "1.2.0", "which": "1.3.0" } @@ -7024,19 +6983,35 @@ } }, "expand-brackets": { - "version": "0.1.5", + "version": "2.1.4", "bundled": true, "dev": true, "requires": { - "is-posix-bracket": "0.1.1" - } - }, - "expand-range": { - "version": "1.8.2", - "bundled": true, - "dev": true, - "requires": { - "fill-range": "2.2.3" + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, "extend-shallow": { @@ -7059,28 +7034,88 @@ } }, "extglob": { - "version": "0.3.2", + "version": "2.0.4", "bundled": true, "dev": true, "requires": { - "is-extglob": "1.0.0" + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } } }, - "filename-regex": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, "fill-range": { - "version": "2.2.3", + "version": "4.0.0", "bundled": true, "dev": true, "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, "find-cache-dir": { @@ -7106,14 +7141,6 @@ "bundled": true, "dev": true }, - "for-own": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "requires": { - "for-in": "1.0.2" - } - }, "foreground-child": { "version": "1.5.6", "bundled": true, @@ -7164,23 +7191,6 @@ "path-is-absolute": "1.0.1" } }, - "glob-base": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" - } - }, - "glob-parent": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-glob": "2.0.1" - } - }, "globals": { "version": "9.18.0", "bundled": true, @@ -7367,29 +7377,11 @@ } } }, - "is-dotfile": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "requires": { - "is-primitive": "2.0.0" - } - }, "is-extendable": { "version": "0.1.1", "bundled": true, "dev": true }, - "is-extglob": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, "is-finite": { "version": "1.0.2", "bundled": true, @@ -7403,16 +7395,8 @@ "bundled": true, "dev": true }, - "is-glob": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - }, "is-number": { - "version": "2.1.0", + "version": "3.0.0", "bundled": true, "dev": true, "requires": { @@ -7449,16 +7433,6 @@ } } }, - "is-posix-bracket": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, "is-stream": { "version": "1.1.0", "bundled": true, @@ -7485,12 +7459,9 @@ "dev": true }, "isobject": { - "version": "2.1.0", + "version": "3.0.1", "bundled": true, - "dev": true, - "requires": { - "isarray": "1.0.0" - } + "dev": true }, "istanbul-lib-coverage": { "version": "1.2.0", @@ -7631,7 +7602,7 @@ } }, "lodash": { - "version": "4.17.5", + "version": "4.17.10", "bundled": true, "dev": true }, @@ -7649,7 +7620,7 @@ } }, "lru-cache": { - "version": "4.1.2", + "version": "4.1.3", "bundled": true, "dev": true, "requires": { @@ -7707,23 +7678,30 @@ } }, "micromatch": { - "version": "2.3.11", + "version": "3.1.10", "bundled": true, "dev": true, "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.9", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } } }, "mimic-fn": { @@ -7823,14 +7801,6 @@ "validate-npm-package-license": "3.0.3" } }, - "normalize-path": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "remove-trailing-separator": "1.1.0" - } - }, "npm-run-path": { "version": "2.0.2", "bundled": true, @@ -7884,15 +7854,6 @@ } } }, - "object.omit": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" - } - }, "object.pick": { "version": "1.3.0", "bundled": true, @@ -7966,17 +7927,6 @@ "bundled": true, "dev": true }, - "parse-glob": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" - } - }, "parse-json": { "version": "2.2.0", "bundled": true, @@ -8065,53 +8015,11 @@ "bundled": true, "dev": true }, - "preserve": { - "version": "0.2.0", - "bundled": true, - "dev": true - }, "pseudomap": { "version": "1.0.2", "bundled": true, "dev": true }, - "randomatic": { - "version": "1.1.7", - "bundled": true, - "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, "read-pkg": { "version": "1.1.0", "bundled": true, @@ -8147,14 +8055,6 @@ "bundled": true, "dev": true }, - "regex-cache": { - "version": "0.4.4", - "bundled": true, - "dev": true, - "requires": { - "is-equal-shallow": "0.1.3" - } - }, "regex-not": { "version": "1.0.2", "bundled": true, @@ -8164,11 +8064,6 @@ "safe-regex": "1.1.0" } }, - "remove-trailing-separator": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, "repeat-element": { "version": "1.1.2", "bundled": true, @@ -8398,7 +8293,7 @@ "bundled": true, "dev": true, "requires": { - "atob": "2.1.0", + "atob": "2.1.1", "decode-uri-component": "0.2.0", "resolve-url": "0.2.1", "source-map-url": "0.4.0", @@ -9054,7 +8949,7 @@ "bundled": true, "dev": true, "requires": { - "cliui": "4.0.0", + "cliui": "4.1.0", "decamelize": "1.2.0", "find-up": "2.1.0", "get-caller-file": "1.0.2", @@ -9079,7 +8974,7 @@ "dev": true }, "cliui": { - "version": "4.0.0", + "version": "4.1.0", "bundled": true, "dev": true, "requires": { @@ -9578,7 +9473,7 @@ "acorn": "4.0.13", "acorn-es7-plugin": "1.1.7", "core-js": "2.5.6", - "espurify": "1.7.0", + "espurify": "1.8.0", "estraverse": "4.2.0" }, "dependencies": { @@ -9638,7 +9533,7 @@ "dev": true, "requires": { "core-js": "2.5.6", - "diff-match-patch": "1.0.0", + "diff-match-patch": "1.0.1", "power-assert-renderer-base": "1.1.1", "stringifier": "1.3.0", "type-name": "2.0.2" @@ -9787,43 +9682,27 @@ } }, "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", + "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", "dev": true, "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "4.0.0", + "kind-of": "6.0.2", + "math-random": "1.0.1" }, "dependencies": { "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true }, "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true } } }, @@ -9916,9 +9795,9 @@ } }, "regenerate": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz", - "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", "dev": true }, "regenerator-runtime": { @@ -9948,7 +9827,7 @@ "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", "dev": true, "requires": { - "regenerate": "1.3.3", + "regenerate": "1.4.0", "regjsgen": "0.2.0", "regjsparser": "0.1.5" } @@ -10024,9 +9903,9 @@ } }, "request": { - "version": "2.85.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", - "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", + "version": "2.87.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", + "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", "requires": { "aws-sign2": "0.7.0", "aws4": "1.7.0", @@ -10036,7 +9915,6 @@ "forever-agent": "0.6.1", "form-data": "2.3.2", "har-validator": "5.0.3", - "hawk": "6.0.2", "http-signature": "1.2.0", "is-typedarray": "1.0.0", "isstream": "0.1.2", @@ -10046,7 +9924,6 @@ "performance-now": "2.1.0", "qs": "6.5.2", "safe-buffer": "5.1.2", - "stringstream": "0.0.5", "tough-cookie": "2.3.4", "tunnel-agent": "0.6.0", "uuid": "3.2.1" @@ -10155,7 +10032,7 @@ "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-3.3.1.tgz", "integrity": "sha512-PjAmtWIxjNj4Co/6FRtBl8afRP3CxrrIAnUzb1dzydfROd+6xt7xAebFeskgQgkfFf8NmzrXIoaB3HxmswXyxw==", "requires": { - "request": "2.85.0", + "request": "2.87.0", "through2": "2.0.3" } }, @@ -10300,7 +10177,7 @@ "@sinonjs/formatio": "2.0.0", "diff": "3.5.0", "lodash.get": "4.4.2", - "lolex": "2.3.2", + "lolex": "2.6.0", "nise": "1.3.3", "supports-color": "5.4.0", "type-detect": "4.0.8" @@ -10327,14 +10204,6 @@ "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", "dev": true }, - "sntp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", - "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", - "requires": { - "hoek": "4.2.1" - } - }, "sort-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", @@ -10351,9 +10220,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.5.tgz", - "integrity": "sha512-mR7/Nd5l1z6g99010shcXJiNEaf3fEtmLhRB/sBcQVJGodcHCULPp2y4Sfa43Kv2zq7T+Izmfp/WHCR6dYkQCA==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz", + "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==", "dev": true, "requires": { "buffer-from": "1.0.0", @@ -10405,7 +10274,7 @@ "resolved": "https://registry.npmjs.org/split-array-stream/-/split-array-stream-1.0.3.tgz", "integrity": "sha1-0rdajl4Ngk1S/eyLgiWDncLjXfo=", "requires": { - "async": "2.6.0", + "async": "2.6.1", "is-stream-ended": "0.1.4" } }, @@ -10505,11 +10374,6 @@ "type-name": "2.0.2" } }, - "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" - }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -11094,7 +10958,7 @@ "requires": { "detect-indent": "5.0.0", "graceful-fs": "4.1.11", - "make-dir": "1.2.0", + "make-dir": "1.3.0", "pify": "3.0.0", "sort-keys": "2.0.0", "write-file-atomic": "2.3.0" From 9dc9e827e71cc6a0c47de42956ea276cf67ebe0e Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sun, 3 Jun 2018 20:53:18 -0700 Subject: [PATCH 095/513] =?UTF-8?q?Update=20nyc=20to=20the=20latest=20vers?= =?UTF-8?q?ion=20=F0=9F=9A=80=20(#47)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update nyc to version 12.0.1 * Update package.json --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index fe8b5a26900..ce83f811328 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -75,7 +75,7 @@ "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", "mocha": "^5.0.0", - "nyc": "^11.2.1", + "nyc": "^12.0.2", "power-assert": "^1.4.4", "prettier": "^1.7.4", "proxyquire": "^2.0.0" From 101c1014febe31e04b58e7efeb57b5b90743618f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sat, 9 Jun 2018 17:35:07 -0700 Subject: [PATCH 096/513] fix: update all the dependencies (#48) --- .../google-cloud-translate/package-lock.json | 4743 ++++++++--------- packages/google-cloud-translate/package.json | 34 +- .../samples/package.json | 10 +- 3 files changed, 2190 insertions(+), 2597 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 081df99cb9f..26a75b6dbf3 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -16,18 +16,18 @@ "integrity": "sha512-oWqTnIGXW3k72UFidXzW0ONlO7hnO9x02S/QReJ7NBGeiBH9cUHY9+EfV6C8PXC6YJH++WrliEq03wMSJGNZFg==", "dev": true, "requires": { - "babel-plugin-check-es2015-constants": "6.22.0", - "babel-plugin-syntax-trailing-function-commas": "6.22.0", - "babel-plugin-transform-async-to-generator": "6.24.1", - "babel-plugin-transform-es2015-destructuring": "6.23.0", - "babel-plugin-transform-es2015-function-name": "6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", - "babel-plugin-transform-es2015-parameters": "6.24.1", - "babel-plugin-transform-es2015-spread": "6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "6.24.1", - "babel-plugin-transform-es2015-unicode-regex": "6.24.1", - "babel-plugin-transform-exponentiation-operator": "6.24.1", - "package-hash": "1.2.0" + "babel-plugin-check-es2015-constants": "^6.8.0", + "babel-plugin-syntax-trailing-function-commas": "^6.20.0", + "babel-plugin-transform-async-to-generator": "^6.16.0", + "babel-plugin-transform-es2015-destructuring": "^6.19.0", + "babel-plugin-transform-es2015-function-name": "^6.9.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.18.0", + "babel-plugin-transform-es2015-parameters": "^6.21.0", + "babel-plugin-transform-es2015-spread": "^6.8.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.8.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.11.0", + "babel-plugin-transform-exponentiation-operator": "^6.8.0", + "package-hash": "^1.2.0" }, "dependencies": { "md5-hex": { @@ -36,7 +36,7 @@ "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", "dev": true, "requires": { - "md5-o-matic": "0.1.1" + "md5-o-matic": "^0.1.1" } }, "package-hash": { @@ -45,7 +45,7 @@ "integrity": "sha1-AD5WzVe3NqbtYRTMK4FUJnJ3DkQ=", "dev": true, "requires": { - "md5-hex": "1.3.0" + "md5-hex": "^1.3.0" } } } @@ -56,8 +56,8 @@ "integrity": "sha1-ze0RlqjY2TgaUJJAq5LpGl7Aafc=", "dev": true, "requires": { - "@ava/babel-plugin-throws-helper": "2.0.0", - "babel-plugin-espower": "2.4.0" + "@ava/babel-plugin-throws-helper": "^2.0.0", + "babel-plugin-espower": "^2.3.2" } }, "@ava/write-file-atomic": { @@ -66,9 +66,142 @@ "integrity": "sha512-BTNB3nGbEfJT+69wuqXFr/bQH7Vr7ihx2xGOMNqPgDGhwspoZhiWumDDZNjBy7AScmqS5CELIOGtPVXESyrnDA==", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "slide": "1.1.6" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + }, + "@babel/code-frame": { + "version": "7.0.0-beta.49", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.49.tgz", + "integrity": "sha1-vs2AVIJzREDJ0TfkbXc0DmTX9Rs=", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-beta.49" + } + }, + "@babel/generator": { + "version": "7.0.0-beta.49", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.49.tgz", + "integrity": "sha1-6c/9qROZaszseTu8JauRvBnQv3o=", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.49", + "jsesc": "^2.5.1", + "lodash": "^4.17.5", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", + "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.0.0-beta.49", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.49.tgz", + "integrity": "sha1-olwRGbnwNSeGcBJuAiXAMEHI3jI=", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.0.0-beta.49", + "@babel/template": "7.0.0-beta.49", + "@babel/types": "7.0.0-beta.49" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0-beta.49", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.49.tgz", + "integrity": "sha1-z1Aj8y0q2S0Ic3STnOwJUby1FEE=", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.49" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0-beta.49", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.49.tgz", + "integrity": "sha1-QNeO2glo0BGxxShm5XRs+yPldUg=", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.49" + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.49", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.49.tgz", + "integrity": "sha1-lr3GtD4TSCASumaRsQGEktOWIsw=", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" + } + }, + "@babel/parser": { + "version": "7.0.0-beta.49", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.0.0-beta.49.tgz", + "integrity": "sha1-lE0MW6KBK7FZ7b0iZ0Ov0mUXm9w=", + "dev": true + }, + "@babel/template": { + "version": "7.0.0-beta.49", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.49.tgz", + "integrity": "sha1-44q+ghfLl5P0YaUwbXrXRdg+HSc=", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.49", + "@babel/parser": "7.0.0-beta.49", + "@babel/types": "7.0.0-beta.49", + "lodash": "^4.17.5" + } + }, + "@babel/traverse": { + "version": "7.0.0-beta.49", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.49.tgz", + "integrity": "sha1-TypzaCoYM07WYl0QCo0nMZ98LWg=", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.49", + "@babel/generator": "7.0.0-beta.49", + "@babel/helper-function-name": "7.0.0-beta.49", + "@babel/helper-split-export-declaration": "7.0.0-beta.49", + "@babel/parser": "7.0.0-beta.49", + "@babel/types": "7.0.0-beta.49", + "debug": "^3.1.0", + "globals": "^11.1.0", + "invariant": "^2.2.0", + "lodash": "^4.17.5" + }, + "dependencies": { + "globals": { + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", + "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.0.0-beta.49", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.49.tgz", + "integrity": "sha1-t+Oxw/TUz+Eb34yJ8e/V4WF7h6Y=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.5", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + } } }, "@concordance/react": { @@ -77,32 +210,29 @@ "integrity": "sha512-htrsRaQX8Iixlsek8zQU7tE8wcsTQJ5UhZkSPEA8slCDAisKpC/2VgU/ucPn32M5/LjGGXRaUEKvEw1Wiuu4zQ==", "dev": true, "requires": { - "arrify": "1.0.1" + "arrify": "^1.0.1" } }, "@google-cloud/common": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.17.0.tgz", - "integrity": "sha512-HRZLSU762E6HaKoGfJGa8W95yRjb9rY7LePhjaHK9ILAnFacMuUGVamDbTHu1csZomm1g3tZTtXfX/aAhtie/Q==", - "requires": { - "array-uniq": "1.0.3", - "arrify": "1.0.1", - "concat-stream": "1.6.2", - "create-error-class": "3.0.2", - "duplexify": "3.6.0", - "ent": "2.2.0", - "extend": "3.0.1", - "google-auto-auth": "0.10.1", - "is": "3.2.1", - "log-driver": "1.2.7", - "methmeth": "1.1.0", - "modelo": "4.2.3", - "request": "2.87.0", - "retry-request": "3.3.1", - "split-array-stream": "1.0.3", - "stream-events": "1.0.4", - "string-format-obj": "1.1.1", - "through2": "2.0.3" + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.19.2.tgz", + "integrity": "sha512-CuURBaMx6vUwLFpHLCYyLJXkg6EKYcrAfhH9Fva8C2B9dJ7flT8j/R+o05OuXwj4VQYC4c8bl/hrwyO+XvAwlg==", + "requires": { + "@types/duplexify": "^3.5.0", + "@types/request": "^2.47.0", + "arrify": "^1.0.1", + "axios": "^0.18.0", + "duplexify": "^3.5.4", + "ent": "^2.2.0", + "extend": "^3.0.1", + "google-auth-library": "^1.4.0", + "is": "^3.2.1", + "pify": "^3.0.0", + "request": "^2.85.0", + "retry-request": "^3.3.1", + "split-array-stream": "^2.0.0", + "stream-events": "^1.0.4", + "through2": "^2.0.3" } }, "@google-cloud/nodejs-repo-tools": { @@ -119,7 +249,7 @@ "lodash": "4.17.5", "nyc": "11.4.1", "proxyquire": "1.8.0", - "semver": "5.5.0", + "semver": "^5.5.0", "sinon": "4.3.0", "string": "3.3.3", "supertest": "3.0.0", @@ -127,45 +257,39 @@ "yargs-parser": "9.0.2" }, "dependencies": { - "lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", - "dev": true - }, "nyc": { "version": "11.4.1", "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.4.1.tgz", "integrity": "sha512-5eCZpvaksFVjP2rt1r60cfXmt3MUtsQDw8bAzNqNEr4WLvUMLgiVENMf/B9bE9YAX0mGVvaGA3v9IS9ekNqB1Q==", "dev": true, "requires": { - "archy": "1.0.0", - "arrify": "1.0.1", - "caching-transform": "1.0.1", - "convert-source-map": "1.5.1", - "debug-log": "1.0.1", - "default-require-extensions": "1.0.0", - "find-cache-dir": "0.1.1", - "find-up": "2.1.0", - "foreground-child": "1.5.6", - "glob": "7.1.2", - "istanbul-lib-coverage": "1.1.1", - "istanbul-lib-hook": "1.1.0", - "istanbul-lib-instrument": "1.9.1", - "istanbul-lib-report": "1.1.2", - "istanbul-lib-source-maps": "1.2.2", - "istanbul-reports": "1.1.3", - "md5-hex": "1.3.0", - "merge-source-map": "1.0.4", - "micromatch": "2.3.11", - "mkdirp": "0.5.1", - "resolve-from": "2.0.0", - "rimraf": "2.6.2", - "signal-exit": "3.0.2", - "spawn-wrap": "1.4.2", - "test-exclude": "4.1.1", - "yargs": "10.0.3", - "yargs-parser": "8.0.0" + "archy": "^1.0.0", + "arrify": "^1.0.1", + "caching-transform": "^1.0.0", + "convert-source-map": "^1.3.0", + "debug-log": "^1.0.1", + "default-require-extensions": "^1.0.0", + "find-cache-dir": "^0.1.1", + "find-up": "^2.1.0", + "foreground-child": "^1.5.3", + "glob": "^7.0.6", + "istanbul-lib-coverage": "^1.1.1", + "istanbul-lib-hook": "^1.1.0", + "istanbul-lib-instrument": "^1.9.1", + "istanbul-lib-report": "^1.1.2", + "istanbul-lib-source-maps": "^1.2.2", + "istanbul-reports": "^1.1.3", + "md5-hex": "^1.2.0", + "merge-source-map": "^1.0.2", + "micromatch": "^2.3.11", + "mkdirp": "^0.5.0", + "resolve-from": "^2.0.0", + "rimraf": "^2.5.4", + "signal-exit": "^3.0.1", + "spawn-wrap": "^1.4.2", + "test-exclude": "^4.1.1", + "yargs": "^10.0.3", + "yargs-parser": "^8.0.0" }, "dependencies": { "align-text": { @@ -173,9 +297,9 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" } }, "amdefine": { @@ -198,7 +322,7 @@ "bundled": true, "dev": true, "requires": { - "default-require-extensions": "1.0.0" + "default-require-extensions": "^1.0.0" } }, "archy": { @@ -211,7 +335,7 @@ "bundled": true, "dev": true, "requires": { - "arr-flatten": "1.1.0" + "arr-flatten": "^1.0.1" } }, "arr-flatten": { @@ -239,9 +363,9 @@ "bundled": true, "dev": true, "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" } }, "babel-generator": { @@ -249,14 +373,14 @@ "bundled": true, "dev": true, "requires": { - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "detect-indent": "4.0.0", - "jsesc": "1.3.0", - "lodash": "4.17.4", - "source-map": "0.5.7", - "trim-right": "1.0.1" + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.6", + "trim-right": "^1.0.1" } }, "babel-messages": { @@ -264,7 +388,7 @@ "bundled": true, "dev": true, "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-runtime": { @@ -272,8 +396,8 @@ "bundled": true, "dev": true, "requires": { - "core-js": "2.5.3", - "regenerator-runtime": "0.11.1" + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" } }, "babel-template": { @@ -281,11 +405,11 @@ "bundled": true, "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "lodash": "4.17.4" + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" } }, "babel-traverse": { @@ -293,15 +417,15 @@ "bundled": true, "dev": true, "requires": { - "babel-code-frame": "6.26.0", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "debug": "2.6.9", - "globals": "9.18.0", - "invariant": "2.2.2", - "lodash": "4.17.4" + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" } }, "babel-types": { @@ -309,10 +433,10 @@ "bundled": true, "dev": true, "requires": { - "babel-runtime": "6.26.0", - "esutils": "2.0.2", - "lodash": "4.17.4", - "to-fast-properties": "1.0.3" + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" } }, "babylon": { @@ -330,7 +454,7 @@ "bundled": true, "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -339,9 +463,9 @@ "bundled": true, "dev": true, "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" } }, "builtin-modules": { @@ -354,9 +478,9 @@ "bundled": true, "dev": true, "requires": { - "md5-hex": "1.3.0", - "mkdirp": "0.5.1", - "write-file-atomic": "1.3.4" + "md5-hex": "^1.2.0", + "mkdirp": "^0.5.1", + "write-file-atomic": "^1.1.4" } }, "camelcase": { @@ -371,8 +495,8 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" } }, "chalk": { @@ -380,11 +504,11 @@ "bundled": true, "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "cliui": { @@ -393,8 +517,8 @@ "dev": true, "optional": true, "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", + "center-align": "^0.1.1", + "right-align": "^0.1.1", "wordwrap": "0.0.2" }, "dependencies": { @@ -436,8 +560,8 @@ "bundled": true, "dev": true, "requires": { - "lru-cache": "4.1.1", - "which": "1.3.0" + "lru-cache": "^4.0.1", + "which": "^1.2.9" } }, "debug": { @@ -463,7 +587,7 @@ "bundled": true, "dev": true, "requires": { - "strip-bom": "2.0.0" + "strip-bom": "^2.0.0" } }, "detect-indent": { @@ -471,7 +595,7 @@ "bundled": true, "dev": true, "requires": { - "repeating": "2.0.1" + "repeating": "^2.0.0" } }, "error-ex": { @@ -479,7 +603,7 @@ "bundled": true, "dev": true, "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "escape-string-regexp": { @@ -497,13 +621,13 @@ "bundled": true, "dev": true, "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" }, "dependencies": { "cross-spawn": { @@ -511,9 +635,9 @@ "bundled": true, "dev": true, "requires": { - "lru-cache": "4.1.1", - "shebang-command": "1.2.0", - "which": "1.3.0" + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } } } @@ -523,7 +647,7 @@ "bundled": true, "dev": true, "requires": { - "is-posix-bracket": "0.1.1" + "is-posix-bracket": "^0.1.0" } }, "expand-range": { @@ -531,7 +655,7 @@ "bundled": true, "dev": true, "requires": { - "fill-range": "2.2.3" + "fill-range": "^2.1.0" } }, "extglob": { @@ -539,7 +663,7 @@ "bundled": true, "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "filename-regex": { @@ -552,11 +676,11 @@ "bundled": true, "dev": true, "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^1.1.3", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" } }, "find-cache-dir": { @@ -564,9 +688,9 @@ "bundled": true, "dev": true, "requires": { - "commondir": "1.0.1", - "mkdirp": "0.5.1", - "pkg-dir": "1.0.0" + "commondir": "^1.0.1", + "mkdirp": "^0.5.1", + "pkg-dir": "^1.0.0" } }, "find-up": { @@ -574,7 +698,7 @@ "bundled": true, "dev": true, "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "for-in": { @@ -587,7 +711,7 @@ "bundled": true, "dev": true, "requires": { - "for-in": "1.0.2" + "for-in": "^1.0.1" } }, "foreground-child": { @@ -595,8 +719,8 @@ "bundled": true, "dev": true, "requires": { - "cross-spawn": "4.0.2", - "signal-exit": "3.0.2" + "cross-spawn": "^4", + "signal-exit": "^3.0.0" } }, "fs.realpath": { @@ -619,12 +743,12 @@ "bundled": true, "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "glob-base": { @@ -632,8 +756,8 @@ "bundled": true, "dev": true, "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" } }, "glob-parent": { @@ -641,7 +765,7 @@ "bundled": true, "dev": true, "requires": { - "is-glob": "2.0.1" + "is-glob": "^2.0.0" } }, "globals": { @@ -659,10 +783,10 @@ "bundled": true, "dev": true, "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.8.29" + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" }, "dependencies": { "source-map": { @@ -670,7 +794,7 @@ "bundled": true, "dev": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } @@ -680,7 +804,7 @@ "bundled": true, "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "has-flag": { @@ -703,8 +827,8 @@ "bundled": true, "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -717,7 +841,7 @@ "bundled": true, "dev": true, "requires": { - "loose-envify": "1.3.1" + "loose-envify": "^1.0.0" } }, "invert-kv": { @@ -740,7 +864,7 @@ "bundled": true, "dev": true, "requires": { - "builtin-modules": "1.1.1" + "builtin-modules": "^1.0.0" } }, "is-dotfile": { @@ -753,7 +877,7 @@ "bundled": true, "dev": true, "requires": { - "is-primitive": "2.0.0" + "is-primitive": "^2.0.0" } }, "is-extendable": { @@ -771,7 +895,7 @@ "bundled": true, "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-fullwidth-code-point": { @@ -779,7 +903,7 @@ "bundled": true, "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-glob": { @@ -787,7 +911,7 @@ "bundled": true, "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "is-number": { @@ -795,7 +919,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "is-posix-bracket": { @@ -846,7 +970,7 @@ "bundled": true, "dev": true, "requires": { - "append-transform": "0.4.0" + "append-transform": "^0.4.0" } }, "istanbul-lib-instrument": { @@ -854,13 +978,13 @@ "bundled": true, "dev": true, "requires": { - "babel-generator": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "istanbul-lib-coverage": "1.1.1", - "semver": "5.4.1" + "babel-generator": "^6.18.0", + "babel-template": "^6.16.0", + "babel-traverse": "^6.18.0", + "babel-types": "^6.18.0", + "babylon": "^6.18.0", + "istanbul-lib-coverage": "^1.1.1", + "semver": "^5.3.0" } }, "istanbul-lib-report": { @@ -868,10 +992,10 @@ "bundled": true, "dev": true, "requires": { - "istanbul-lib-coverage": "1.1.1", - "mkdirp": "0.5.1", - "path-parse": "1.0.5", - "supports-color": "3.2.3" + "istanbul-lib-coverage": "^1.1.1", + "mkdirp": "^0.5.1", + "path-parse": "^1.0.5", + "supports-color": "^3.1.2" }, "dependencies": { "supports-color": { @@ -879,7 +1003,7 @@ "bundled": true, "dev": true, "requires": { - "has-flag": "1.0.0" + "has-flag": "^1.0.0" } } } @@ -889,11 +1013,11 @@ "bundled": true, "dev": true, "requires": { - "debug": "3.1.0", - "istanbul-lib-coverage": "1.1.1", - "mkdirp": "0.5.1", - "rimraf": "2.6.2", - "source-map": "0.5.7" + "debug": "^3.1.0", + "istanbul-lib-coverage": "^1.1.1", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "source-map": "^0.5.3" }, "dependencies": { "debug": { @@ -911,7 +1035,7 @@ "bundled": true, "dev": true, "requires": { - "handlebars": "4.0.11" + "handlebars": "^4.0.3" } }, "js-tokens": { @@ -929,7 +1053,7 @@ "bundled": true, "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } }, "lazy-cache": { @@ -943,7 +1067,7 @@ "bundled": true, "dev": true, "requires": { - "invert-kv": "1.0.0" + "invert-kv": "^1.0.0" } }, "load-json-file": { @@ -951,11 +1075,11 @@ "bundled": true, "dev": true, "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" } }, "locate-path": { @@ -963,8 +1087,8 @@ "bundled": true, "dev": true, "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" }, "dependencies": { "path-exists": { @@ -989,7 +1113,7 @@ "bundled": true, "dev": true, "requires": { - "js-tokens": "3.0.2" + "js-tokens": "^3.0.0" } }, "lru-cache": { @@ -997,8 +1121,8 @@ "bundled": true, "dev": true, "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "md5-hex": { @@ -1006,7 +1130,7 @@ "bundled": true, "dev": true, "requires": { - "md5-o-matic": "0.1.1" + "md5-o-matic": "^0.1.1" } }, "md5-o-matic": { @@ -1019,7 +1143,7 @@ "bundled": true, "dev": true, "requires": { - "mimic-fn": "1.1.0" + "mimic-fn": "^1.0.0" } }, "merge-source-map": { @@ -1027,7 +1151,7 @@ "bundled": true, "dev": true, "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.6" } }, "micromatch": { @@ -1035,19 +1159,19 @@ "bundled": true, "dev": true, "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" } }, "mimic-fn": { @@ -1060,7 +1184,7 @@ "bundled": true, "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -1086,10 +1210,10 @@ "bundled": true, "dev": true, "requires": { - "hosted-git-info": "2.5.0", - "is-builtin-module": "1.0.0", - "semver": "5.4.1", - "validate-npm-package-license": "3.0.1" + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "normalize-path": { @@ -1097,7 +1221,7 @@ "bundled": true, "dev": true, "requires": { - "remove-trailing-separator": "1.1.0" + "remove-trailing-separator": "^1.0.1" } }, "npm-run-path": { @@ -1105,7 +1229,7 @@ "bundled": true, "dev": true, "requires": { - "path-key": "2.0.1" + "path-key": "^2.0.0" } }, "number-is-nan": { @@ -1123,8 +1247,8 @@ "bundled": true, "dev": true, "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" } }, "once": { @@ -1132,7 +1256,7 @@ "bundled": true, "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "optimist": { @@ -1140,8 +1264,8 @@ "bundled": true, "dev": true, "requires": { - "minimist": "0.0.8", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" } }, "os-homedir": { @@ -1154,9 +1278,9 @@ "bundled": true, "dev": true, "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" } }, "p-finally": { @@ -1174,7 +1298,7 @@ "bundled": true, "dev": true, "requires": { - "p-limit": "1.1.0" + "p-limit": "^1.1.0" } }, "parse-glob": { @@ -1182,10 +1306,10 @@ "bundled": true, "dev": true, "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" } }, "parse-json": { @@ -1193,7 +1317,7 @@ "bundled": true, "dev": true, "requires": { - "error-ex": "1.3.1" + "error-ex": "^1.2.0" } }, "path-exists": { @@ -1201,7 +1325,7 @@ "bundled": true, "dev": true, "requires": { - "pinkie-promise": "2.0.1" + "pinkie-promise": "^2.0.0" } }, "path-is-absolute": { @@ -1224,9 +1348,9 @@ "bundled": true, "dev": true, "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "pify": { @@ -1244,7 +1368,7 @@ "bundled": true, "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "pkg-dir": { @@ -1252,7 +1376,7 @@ "bundled": true, "dev": true, "requires": { - "find-up": "1.1.2" + "find-up": "^1.0.0" }, "dependencies": { "find-up": { @@ -1260,8 +1384,8 @@ "bundled": true, "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } } } @@ -1281,8 +1405,8 @@ "bundled": true, "dev": true, "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "^3.0.0", + "kind-of": "^4.0.0" }, "dependencies": { "is-number": { @@ -1290,7 +1414,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -1298,7 +1422,7 @@ "bundled": true, "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -1308,7 +1432,7 @@ "bundled": true, "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -1318,9 +1442,9 @@ "bundled": true, "dev": true, "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" } }, "read-pkg-up": { @@ -1328,8 +1452,8 @@ "bundled": true, "dev": true, "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" }, "dependencies": { "find-up": { @@ -1337,8 +1461,8 @@ "bundled": true, "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } } } @@ -1353,7 +1477,7 @@ "bundled": true, "dev": true, "requires": { - "is-equal-shallow": "0.1.3" + "is-equal-shallow": "^0.1.3" } }, "remove-trailing-separator": { @@ -1376,7 +1500,7 @@ "bundled": true, "dev": true, "requires": { - "is-finite": "1.0.2" + "is-finite": "^1.0.0" } }, "require-directory": { @@ -1400,7 +1524,7 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4" + "align-text": "^0.1.1" } }, "rimraf": { @@ -1408,7 +1532,7 @@ "bundled": true, "dev": true, "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "semver": { @@ -1426,7 +1550,7 @@ "bundled": true, "dev": true, "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -1454,12 +1578,12 @@ "bundled": true, "dev": true, "requires": { - "foreground-child": "1.5.6", - "mkdirp": "0.5.1", - "os-homedir": "1.0.2", - "rimraf": "2.6.2", - "signal-exit": "3.0.2", - "which": "1.3.0" + "foreground-child": "^1.5.6", + "mkdirp": "^0.5.0", + "os-homedir": "^1.0.1", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "which": "^1.3.0" } }, "spdx-correct": { @@ -1467,7 +1591,7 @@ "bundled": true, "dev": true, "requires": { - "spdx-license-ids": "1.2.2" + "spdx-license-ids": "^1.0.2" } }, "spdx-expression-parse": { @@ -1485,8 +1609,8 @@ "bundled": true, "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" }, "dependencies": { "ansi-regex": { @@ -1504,7 +1628,7 @@ "bundled": true, "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -1514,7 +1638,7 @@ "bundled": true, "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-bom": { @@ -1522,7 +1646,7 @@ "bundled": true, "dev": true, "requires": { - "is-utf8": "0.2.1" + "is-utf8": "^0.2.0" } }, "strip-eof": { @@ -1540,11 +1664,11 @@ "bundled": true, "dev": true, "requires": { - "arrify": "1.0.1", - "micromatch": "2.3.11", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "require-main-filename": "1.0.1" + "arrify": "^1.0.1", + "micromatch": "^2.3.11", + "object-assign": "^4.1.0", + "read-pkg-up": "^1.0.1", + "require-main-filename": "^1.0.1" } }, "to-fast-properties": { @@ -1563,9 +1687,9 @@ "dev": true, "optional": true, "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" }, "dependencies": { "yargs": { @@ -1574,9 +1698,9 @@ "dev": true, "optional": true, "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", "window-size": "0.1.0" } } @@ -1593,8 +1717,8 @@ "bundled": true, "dev": true, "requires": { - "spdx-correct": "1.0.2", - "spdx-expression-parse": "1.0.4" + "spdx-correct": "~1.0.0", + "spdx-expression-parse": "~1.0.0" } }, "which": { @@ -1602,7 +1726,7 @@ "bundled": true, "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -1626,8 +1750,8 @@ "bundled": true, "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" }, "dependencies": { "string-width": { @@ -1635,9 +1759,9 @@ "bundled": true, "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } } } @@ -1652,9 +1776,9 @@ "bundled": true, "dev": true, "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "slide": "1.1.6" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" } }, "y18n": { @@ -1672,18 +1796,18 @@ "bundled": true, "dev": true, "requires": { - "cliui": "3.2.0", - "decamelize": "1.2.0", - "find-up": "2.1.0", - "get-caller-file": "1.0.2", - "os-locale": "2.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "8.0.0" + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^8.0.0" }, "dependencies": { "cliui": { @@ -1691,9 +1815,9 @@ "bundled": true, "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" }, "dependencies": { "string-width": { @@ -1701,9 +1825,9 @@ "bundled": true, "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } } } @@ -1715,7 +1839,7 @@ "bundled": true, "dev": true, "requires": { - "camelcase": "4.1.0" + "camelcase": "^4.1.0" }, "dependencies": { "camelcase": { @@ -1733,9 +1857,9 @@ "integrity": "sha1-AtUUpb7ZhvBMuyCTrxZ0FTX3ntw=", "dev": true, "requires": { - "fill-keys": "1.0.2", - "module-not-found-error": "1.0.1", - "resolve": "1.1.7" + "fill-keys": "^1.0.2", + "module-not-found-error": "^1.0.0", + "resolve": "~1.1.7" } } } @@ -1746,10 +1870,10 @@ "integrity": "sha512-weIbJqTMfQ4r1YX85u54DKfjLZs2jwn1XZ6tIOP/pFgMwhIN5BAtaCp/1wn9DzyLsDR9tW0R2NIePcVJ45ivQQ==", "dev": true, "requires": { - "chalk": "0.4.0", - "date-time": "0.1.1", - "pretty-ms": "0.2.2", - "text-table": "0.2.0" + "chalk": "^0.4.0", + "date-time": "^0.1.1", + "pretty-ms": "^0.2.1", + "text-table": "^0.2.0" }, "dependencies": { "ansi-styles": { @@ -1764,9 +1888,9 @@ "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", "dev": true, "requires": { - "ansi-styles": "1.0.0", - "has-color": "0.1.7", - "strip-ansi": "0.1.1" + "ansi-styles": "~1.0.0", + "has-color": "~0.1.0", + "strip-ansi": "~0.1.0" } }, "pretty-ms": { @@ -1775,7 +1899,7 @@ "integrity": "sha1-2oeaaC/zOjcBEEbxPWJ/Z8c7hPY=", "dev": true, "requires": { - "parse-ms": "0.1.2" + "parse-ms": "^0.1.0" } }, "strip-ansi": { @@ -1801,10 +1925,52 @@ "samsam": "1.3.0" } }, + "@types/caseless": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.1.tgz", + "integrity": "sha512-FhlMa34NHp9K5MY1Uz8yb+ZvuX0pnvn3jScRSNAb75KHGB8d3rEU6hqMs3Z2vjuytcMfRg6c5CHMc3wtYyD2/A==" + }, + "@types/duplexify": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@types/duplexify/-/duplexify-3.5.0.tgz", + "integrity": "sha512-+aZCCdxuR/Q6n58CBkXyqGqimIqpYUcFLfBXagXv7e9TdJUevqkKhzopBuRz3RB064sQxnJnhttHOkK/O93Ouw==", + "requires": { + "@types/node": "*" + } + }, + "@types/form-data": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", + "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "10.3.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.3.2.tgz", + "integrity": "sha512-9NfEUDp3tgRhmoxzTpTo+lq+KIVFxZahuRX0LHF/9IzKHaWuoWsIrrJ61zw5cnnlGINX8lqJzXYfQTOICS5Q+A==" + }, + "@types/request": { + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.47.0.tgz", + "integrity": "sha512-/KXM5oev+nNCLIgBjkwbk8VqxmzI56woD4VUxn95O+YeQ8hJzcSmIZ1IN3WexiqBb6srzDo2bdMbsXxgXNkz5Q==", + "requires": { + "@types/caseless": "*", + "@types/form-data": "*", + "@types/node": "*", + "@types/tough-cookie": "*" + } + }, + "@types/tough-cookie": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha512-MDQLxNFRLasqS4UlkWMSACMKeSm1x4Q3TxzUC7KQUsh6RK1ZrQ0VEyE3yzXcBu+K8ejVj4wuX32eUG02yNp+YQ==" + }, "acorn": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", - "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.6.2.tgz", + "integrity": "sha512-zUzo1E5dI2Ey8+82egfnttyMlMZ2y0D8xOCO3PNPPlYXpl8NZvF6Qk9L9BEtJs+43FqEmfBViDqc5d1ckRDguw==", "dev": true }, "acorn-es7-plugin": { @@ -1819,7 +1985,7 @@ "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, "requires": { - "acorn": "3.3.0" + "acorn": "^3.0.4" }, "dependencies": { "acorn": { @@ -1835,10 +2001,10 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" } }, "ajv-keywords": { @@ -1853,9 +2019,9 @@ "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" } }, "amdefine": { @@ -1870,7 +2036,7 @@ "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", "dev": true, "requires": { - "string-width": "2.1.1" + "string-width": "^2.0.0" } }, "ansi-escapes": { @@ -1891,7 +2057,7 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.1" + "color-convert": "^1.9.0" } }, "anymatch": { @@ -1900,8 +2066,8 @@ "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", "dev": true, "requires": { - "micromatch": "2.3.11", - "normalize-path": "2.1.1" + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" } }, "argparse": { @@ -1910,7 +2076,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "argv": { @@ -1925,7 +2091,7 @@ "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "dev": true, "requires": { - "arr-flatten": "1.1.0" + "arr-flatten": "^1.0.1" } }, "arr-exclude": { @@ -1970,13 +2136,14 @@ "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { - "array-uniq": "1.0.3" + "array-uniq": "^1.0.1" } }, "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true }, "array-unique": { "version": "0.2.1", @@ -2003,8 +2170,17 @@ "version": "2.6.1", "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, "requires": { - "lodash": "4.17.10" + "lodash": "^4.17.10" + }, + "dependencies": { + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + } } }, "async-each": { @@ -2030,89 +2206,89 @@ "integrity": "sha512-4lGNJCf6xL8SvsKVEKxEE46se7JAUIAZoKHw9itTQuwcsydhpAMkBs5gOOiWiwt0JKNIuXWc2/r4r8ZdcNrBEw==", "dev": true, "requires": { - "@ava/babel-preset-stage-4": "1.1.0", - "@ava/babel-preset-transform-test-files": "3.0.0", - "@ava/write-file-atomic": "2.2.0", - "@concordance/react": "1.0.0", - "@ladjs/time-require": "0.1.4", - "ansi-escapes": "3.1.0", - "ansi-styles": "3.2.1", - "arr-flatten": "1.1.0", - "array-union": "1.0.2", - "array-uniq": "1.0.3", - "arrify": "1.0.1", - "auto-bind": "1.2.0", - "ava-init": "0.2.1", - "babel-core": "6.26.3", - "babel-generator": "6.26.1", - "babel-plugin-syntax-object-rest-spread": "6.13.0", - "bluebird": "3.5.1", - "caching-transform": "1.0.1", - "chalk": "2.4.1", - "chokidar": "1.7.0", - "clean-stack": "1.3.0", - "clean-yaml-object": "0.1.0", - "cli-cursor": "2.1.0", - "cli-spinners": "1.3.1", - "cli-truncate": "1.1.0", - "co-with-promise": "4.6.0", - "code-excerpt": "2.1.1", - "common-path-prefix": "1.0.0", - "concordance": "3.0.0", - "convert-source-map": "1.5.1", - "core-assert": "0.2.1", - "currently-unhandled": "0.4.1", - "debug": "3.1.0", - "dot-prop": "4.2.0", - "empower-core": "0.6.2", - "equal-length": "1.0.1", - "figures": "2.0.0", - "find-cache-dir": "1.0.0", - "fn-name": "2.0.1", - "get-port": "3.2.0", - "globby": "6.1.0", - "has-flag": "2.0.0", - "hullabaloo-config-manager": "1.1.1", - "ignore-by-default": "1.0.1", - "import-local": "0.1.1", - "indent-string": "3.2.0", - "is-ci": "1.1.0", - "is-generator-fn": "1.0.0", - "is-obj": "1.0.1", - "is-observable": "1.1.0", - "is-promise": "2.1.0", - "last-line-stream": "1.0.0", - "lodash.clonedeepwith": "4.5.0", - "lodash.debounce": "4.0.8", - "lodash.difference": "4.5.0", - "lodash.flatten": "4.4.0", - "loud-rejection": "1.6.0", - "make-dir": "1.3.0", - "matcher": "1.1.0", - "md5-hex": "2.0.0", - "meow": "3.7.0", - "ms": "2.0.0", - "multimatch": "2.1.0", - "observable-to-promise": "0.5.0", - "option-chain": "1.0.0", - "package-hash": "2.0.0", - "pkg-conf": "2.1.0", - "plur": "2.1.2", - "pretty-ms": "3.1.0", - "require-precompiled": "0.1.0", - "resolve-cwd": "2.0.0", - "safe-buffer": "5.1.2", - "semver": "5.5.0", - "slash": "1.0.0", - "source-map-support": "0.5.6", - "stack-utils": "1.0.1", - "strip-ansi": "4.0.0", - "strip-bom-buf": "1.0.0", - "supertap": "1.0.0", - "supports-color": "5.4.0", - "trim-off-newlines": "1.0.1", - "unique-temp-dir": "1.0.0", - "update-notifier": "2.5.0" + "@ava/babel-preset-stage-4": "^1.1.0", + "@ava/babel-preset-transform-test-files": "^3.0.0", + "@ava/write-file-atomic": "^2.2.0", + "@concordance/react": "^1.0.0", + "@ladjs/time-require": "^0.1.4", + "ansi-escapes": "^3.0.0", + "ansi-styles": "^3.1.0", + "arr-flatten": "^1.0.1", + "array-union": "^1.0.1", + "array-uniq": "^1.0.2", + "arrify": "^1.0.0", + "auto-bind": "^1.1.0", + "ava-init": "^0.2.0", + "babel-core": "^6.17.0", + "babel-generator": "^6.26.0", + "babel-plugin-syntax-object-rest-spread": "^6.13.0", + "bluebird": "^3.0.0", + "caching-transform": "^1.0.0", + "chalk": "^2.0.1", + "chokidar": "^1.4.2", + "clean-stack": "^1.1.1", + "clean-yaml-object": "^0.1.0", + "cli-cursor": "^2.1.0", + "cli-spinners": "^1.0.0", + "cli-truncate": "^1.0.0", + "co-with-promise": "^4.6.0", + "code-excerpt": "^2.1.1", + "common-path-prefix": "^1.0.0", + "concordance": "^3.0.0", + "convert-source-map": "^1.5.1", + "core-assert": "^0.2.0", + "currently-unhandled": "^0.4.1", + "debug": "^3.0.1", + "dot-prop": "^4.1.0", + "empower-core": "^0.6.1", + "equal-length": "^1.0.0", + "figures": "^2.0.0", + "find-cache-dir": "^1.0.0", + "fn-name": "^2.0.0", + "get-port": "^3.0.0", + "globby": "^6.0.0", + "has-flag": "^2.0.0", + "hullabaloo-config-manager": "^1.1.0", + "ignore-by-default": "^1.0.0", + "import-local": "^0.1.1", + "indent-string": "^3.0.0", + "is-ci": "^1.0.7", + "is-generator-fn": "^1.0.0", + "is-obj": "^1.0.0", + "is-observable": "^1.0.0", + "is-promise": "^2.1.0", + "last-line-stream": "^1.0.0", + "lodash.clonedeepwith": "^4.5.0", + "lodash.debounce": "^4.0.3", + "lodash.difference": "^4.3.0", + "lodash.flatten": "^4.2.0", + "loud-rejection": "^1.2.0", + "make-dir": "^1.0.0", + "matcher": "^1.0.0", + "md5-hex": "^2.0.0", + "meow": "^3.7.0", + "ms": "^2.0.0", + "multimatch": "^2.1.0", + "observable-to-promise": "^0.5.0", + "option-chain": "^1.0.0", + "package-hash": "^2.0.0", + "pkg-conf": "^2.0.0", + "plur": "^2.0.0", + "pretty-ms": "^3.0.0", + "require-precompiled": "^0.1.0", + "resolve-cwd": "^2.0.0", + "safe-buffer": "^5.1.1", + "semver": "^5.4.1", + "slash": "^1.0.0", + "source-map-support": "^0.5.0", + "stack-utils": "^1.0.1", + "strip-ansi": "^4.0.0", + "strip-bom-buf": "^1.0.0", + "supertap": "^1.0.0", + "supports-color": "^5.0.0", + "trim-off-newlines": "^1.0.1", + "unique-temp-dir": "^1.0.0", + "update-notifier": "^2.3.0" } }, "ava-init": { @@ -2121,11 +2297,11 @@ "integrity": "sha512-lXwK5LM+2g1euDRqW1mcSX/tqzY1QU7EjKpqayFPPtNRmbSYZ8RzPO5tqluTToijmtjp2M+pNpVdbcHssC4glg==", "dev": true, "requires": { - "arr-exclude": "1.0.0", - "execa": "0.7.0", - "has-yarn": "1.0.0", - "read-pkg-up": "2.0.0", - "write-pkg": "3.1.0" + "arr-exclude": "^1.0.0", + "execa": "^0.7.0", + "has-yarn": "^1.0.0", + "read-pkg-up": "^2.0.0", + "write-pkg": "^3.1.0" } }, "aws-sign2": { @@ -2143,8 +2319,8 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", "requires": { - "follow-redirects": "1.5.0", - "is-buffer": "1.1.6" + "follow-redirects": "^1.3.0", + "is-buffer": "^1.1.5" } }, "babel-code-frame": { @@ -2153,9 +2329,9 @@ "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" }, "dependencies": { "ansi-styles": { @@ -2170,11 +2346,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "strip-ansi": { @@ -2183,7 +2359,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "supports-color": { @@ -2200,25 +2376,25 @@ "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", "dev": true, "requires": { - "babel-code-frame": "6.26.0", - "babel-generator": "6.26.1", - "babel-helpers": "6.24.1", - "babel-messages": "6.23.0", - "babel-register": "6.26.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "convert-source-map": "1.5.1", - "debug": "2.6.9", - "json5": "0.5.1", - "lodash": "4.17.10", - "minimatch": "3.0.4", - "path-is-absolute": "1.0.1", - "private": "0.1.8", - "slash": "1.0.0", - "source-map": "0.5.7" + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" }, "dependencies": { "debug": { @@ -2238,14 +2414,14 @@ "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "dev": true, "requires": { - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "detect-indent": "4.0.0", - "jsesc": "1.3.0", - "lodash": "4.17.10", - "source-map": "0.5.7", - "trim-right": "1.0.1" + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" }, "dependencies": { "jsesc": { @@ -2262,9 +2438,9 @@ "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", "dev": true, "requires": { - "babel-helper-explode-assignable-expression": "6.24.1", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-helper-call-delegate": { @@ -2273,10 +2449,10 @@ "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", "dev": true, "requires": { - "babel-helper-hoist-variables": "6.24.1", - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helper-explode-assignable-expression": { @@ -2285,9 +2461,9 @@ "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helper-function-name": { @@ -2296,11 +2472,11 @@ "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", "dev": true, "requires": { - "babel-helper-get-function-arity": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helper-get-function-arity": { @@ -2309,8 +2485,8 @@ "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-helper-hoist-variables": { @@ -2319,8 +2495,8 @@ "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-helper-regex": { @@ -2329,9 +2505,9 @@ "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.10" + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" } }, "babel-helper-remap-async-to-generator": { @@ -2340,11 +2516,11 @@ "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", "dev": true, "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helpers": { @@ -2353,8 +2529,8 @@ "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, "babel-messages": { @@ -2363,7 +2539,7 @@ "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-check-es2015-constants": { @@ -2372,7 +2548,7 @@ "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-espower": { @@ -2381,13 +2557,13 @@ "integrity": "sha512-/+SRpy7pKgTI28oEHfn1wkuM5QFAdRq8WNsOOih1dVrdV6A/WbNbRZyl0eX5eyDgtb0lOE27PeDFuCX2j8OxVg==", "dev": true, "requires": { - "babel-generator": "6.26.1", - "babylon": "6.18.0", - "call-matcher": "1.0.1", - "core-js": "2.5.6", - "espower-location-detector": "1.0.0", - "espurify": "1.8.0", - "estraverse": "4.2.0" + "babel-generator": "^6.1.0", + "babylon": "^6.1.0", + "call-matcher": "^1.0.0", + "core-js": "^2.0.0", + "espower-location-detector": "^1.0.0", + "espurify": "^1.6.0", + "estraverse": "^4.1.1" } }, "babel-plugin-syntax-async-functions": { @@ -2420,9 +2596,9 @@ "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", "dev": true, "requires": { - "babel-helper-remap-async-to-generator": "6.24.1", - "babel-plugin-syntax-async-functions": "6.13.0", - "babel-runtime": "6.26.0" + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-destructuring": { @@ -2431,7 +2607,7 @@ "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-function-name": { @@ -2440,9 +2616,9 @@ "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", "dev": true, "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-modules-commonjs": { @@ -2451,10 +2627,10 @@ "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", "dev": true, "requires": { - "babel-plugin-transform-strict-mode": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-types": "6.26.0" + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" } }, "babel-plugin-transform-es2015-parameters": { @@ -2463,12 +2639,12 @@ "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", "dev": true, "requires": { - "babel-helper-call-delegate": "6.24.1", - "babel-helper-get-function-arity": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-spread": { @@ -2477,7 +2653,7 @@ "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-sticky-regex": { @@ -2486,9 +2662,9 @@ "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", "dev": true, "requires": { - "babel-helper-regex": "6.26.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-unicode-regex": { @@ -2497,9 +2673,9 @@ "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", "dev": true, "requires": { - "babel-helper-regex": "6.26.0", - "babel-runtime": "6.26.0", - "regexpu-core": "2.0.0" + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" } }, "babel-plugin-transform-exponentiation-operator": { @@ -2508,9 +2684,9 @@ "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", "dev": true, "requires": { - "babel-helper-builder-binary-assignment-operator-visitor": "6.24.1", - "babel-plugin-syntax-exponentiation-operator": "6.13.0", - "babel-runtime": "6.26.0" + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-strict-mode": { @@ -2519,8 +2695,8 @@ "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-register": { @@ -2529,13 +2705,13 @@ "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", "dev": true, "requires": { - "babel-core": "6.26.3", - "babel-runtime": "6.26.0", - "core-js": "2.5.6", - "home-or-tmp": "2.0.0", - "lodash": "4.17.10", - "mkdirp": "0.5.1", - "source-map-support": "0.4.18" + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" }, "dependencies": { "source-map-support": { @@ -2544,7 +2720,7 @@ "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "dev": true, "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.6" } } } @@ -2555,8 +2731,8 @@ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { - "core-js": "2.5.6", - "regenerator-runtime": "0.11.1" + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" } }, "babel-template": { @@ -2565,11 +2741,11 @@ "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "lodash": "4.17.10" + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" } }, "babel-traverse": { @@ -2578,15 +2754,15 @@ "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", "dev": true, "requires": { - "babel-code-frame": "6.26.0", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "debug": "2.6.9", - "globals": "9.18.0", - "invariant": "2.2.4", - "lodash": "4.17.10" + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" }, "dependencies": { "debug": { @@ -2606,10 +2782,10 @@ "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "esutils": "2.0.2", - "lodash": "4.17.10", - "to-fast-properties": "1.0.3" + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" } }, "babylon": { @@ -2630,7 +2806,7 @@ "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", "optional": true, "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "binary-extensions": { @@ -2651,13 +2827,13 @@ "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", "dev": true, "requires": { - "ansi-align": "2.0.0", - "camelcase": "4.1.0", - "chalk": "2.4.1", - "cli-boxes": "1.0.0", - "string-width": "2.1.1", - "term-size": "1.2.0", - "widest-line": "2.0.0" + "ansi-align": "^2.0.0", + "camelcase": "^4.0.0", + "chalk": "^2.0.1", + "cli-boxes": "^1.0.0", + "string-width": "^2.0.0", + "term-size": "^1.2.0", + "widest-line": "^2.0.0" }, "dependencies": { "camelcase": { @@ -2674,7 +2850,7 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -2684,9 +2860,9 @@ "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", "dev": true, "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" } }, "browser-stdout": { @@ -2707,9 +2883,10 @@ "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, "buffer-from": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", - "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", + "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==", + "dev": true }, "builtin-modules": { "version": "1.1.1", @@ -2746,9 +2923,9 @@ "integrity": "sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE=", "dev": true, "requires": { - "md5-hex": "1.3.0", - "mkdirp": "0.5.1", - "write-file-atomic": "1.3.4" + "md5-hex": "^1.2.0", + "mkdirp": "^0.5.1", + "write-file-atomic": "^1.1.4" }, "dependencies": { "md5-hex": { @@ -2757,7 +2934,7 @@ "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", "dev": true, "requires": { - "md5-o-matic": "0.1.1" + "md5-o-matic": "^0.1.1" } }, "write-file-atomic": { @@ -2766,9 +2943,9 @@ "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "slide": "1.1.6" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" } } } @@ -2779,10 +2956,10 @@ "integrity": "sha1-UTTQd5hPcSpU2tPL9i3ijc5BbKg=", "dev": true, "requires": { - "core-js": "2.5.6", - "deep-equal": "1.0.1", - "espurify": "1.8.0", - "estraverse": "4.2.0" + "core-js": "^2.0.0", + "deep-equal": "^1.0.0", + "espurify": "^1.6.0", + "estraverse": "^4.0.0" } }, "call-signature": { @@ -2797,7 +2974,7 @@ "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", "dev": true, "requires": { - "callsites": "0.2.0" + "callsites": "^0.2.0" } }, "callsites": { @@ -2818,14 +2995,15 @@ "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "dev": true, "requires": { - "camelcase": "2.1.1", - "map-obj": "1.0.1" + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" } }, "capture-stack-trace": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", - "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=" + "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=", + "dev": true }, "caseless": { "version": "0.12.0", @@ -2838,7 +3016,7 @@ "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", "dev": true, "requires": { - "underscore-contrib": "0.3.0" + "underscore-contrib": "~0.3.0" } }, "center-align": { @@ -2848,8 +3026,8 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" } }, "chalk": { @@ -2858,9 +3036,9 @@ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "chardet": { @@ -2875,15 +3053,15 @@ "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", "dev": true, "requires": { - "anymatch": "1.3.2", - "async-each": "1.0.1", - "fsevents": "1.2.4", - "glob-parent": "2.0.0", - "inherits": "2.0.3", - "is-binary-path": "1.0.1", - "is-glob": "2.0.1", - "path-is-absolute": "1.0.1", - "readdirp": "2.1.0" + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" } }, "ci-info": { @@ -2922,7 +3100,7 @@ "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "dev": true, "requires": { - "restore-cursor": "2.0.0" + "restore-cursor": "^2.0.0" } }, "cli-spinners": { @@ -2937,8 +3115,8 @@ "integrity": "sha512-bAtZo0u82gCfaAGfSNxUdTI9mNyza7D8w4CVCcaOsy7sgwDzvx6ekr6cuWJqY3UGzgnQ1+4wgENup5eIhgxEYA==", "dev": true, "requires": { - "slice-ansi": "1.0.0", - "string-width": "2.1.1" + "slice-ansi": "^1.0.0", + "string-width": "^2.0.0" } }, "cli-width": { @@ -2954,8 +3132,8 @@ "dev": true, "optional": true, "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", + "center-align": "^0.1.1", + "right-align": "^0.1.1", "wordwrap": "0.0.2" }, "dependencies": { @@ -2974,7 +3152,7 @@ "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", "dev": true, "requires": { - "mimic-response": "1.0.0" + "mimic-response": "^1.0.0" } }, "co": { @@ -2988,7 +3166,7 @@ "integrity": "sha1-QT59tvWJOmC5Qs9JLEvsk9tBWrc=", "dev": true, "requires": { - "pinkie-promise": "1.0.0" + "pinkie-promise": "^1.0.0" } }, "code-excerpt": { @@ -2997,7 +3175,7 @@ "integrity": "sha512-tJLhH3EpFm/1x7heIW0hemXJTUU5EWl2V0EIX558jp05Mt1U6DVryCgkp3l37cxqs+DNbNgxG43SkwJXpQ14Jw==", "dev": true, "requires": { - "convert-to-spaces": "1.0.2" + "convert-to-spaces": "^1.0.1" } }, "code-point-at": { @@ -3013,7 +3191,7 @@ "dev": true, "requires": { "argv": "0.0.2", - "request": "2.87.0", + "request": "^2.81.0", "urlgrey": "0.4.4" } }, @@ -3023,7 +3201,7 @@ "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", "dev": true, "requires": { - "color-name": "1.1.3" + "color-name": "^1.1.1" } }, "color-name": { @@ -3043,7 +3221,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "commander": { @@ -3080,11 +3258,12 @@ "version": "1.6.2", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, "requires": { - "buffer-from": "1.0.0", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "typedarray": "0.0.6" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, "concordance": { @@ -3093,17 +3272,17 @@ "integrity": "sha512-CZBzJ3/l5QJjlZM20WY7+5GP5pMTw+1UEbThcpMw8/rojsi5sBCiD8ZbBLtD+jYpRGAkwuKuqk108c154V9eyQ==", "dev": true, "requires": { - "date-time": "2.1.0", - "esutils": "2.0.2", - "fast-diff": "1.1.2", - "function-name-support": "0.2.0", - "js-string-escape": "1.0.1", - "lodash.clonedeep": "4.5.0", - "lodash.flattendeep": "4.4.0", - "lodash.merge": "4.6.1", - "md5-hex": "2.0.0", - "semver": "5.5.0", - "well-known-symbols": "1.0.0" + "date-time": "^2.1.0", + "esutils": "^2.0.2", + "fast-diff": "^1.1.1", + "function-name-support": "^0.2.0", + "js-string-escape": "^1.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.flattendeep": "^4.4.0", + "lodash.merge": "^4.6.0", + "md5-hex": "^2.0.0", + "semver": "^5.3.0", + "well-known-symbols": "^1.0.0" }, "dependencies": { "date-time": { @@ -3112,7 +3291,7 @@ "integrity": "sha512-/9+C44X7lot0IeiyfgJmETtRMhBidBYM2QFFIkGa0U1k+hSyY87Nw7PY3eDqpvCBm7I3WCSfPeZskW/YYq6m4g==", "dev": true, "requires": { - "time-zone": "1.0.0" + "time-zone": "^1.0.0" } } } @@ -3123,12 +3302,12 @@ "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", "dev": true, "requires": { - "dot-prop": "4.2.0", - "graceful-fs": "4.1.11", - "make-dir": "1.3.0", - "unique-string": "1.0.0", - "write-file-atomic": "2.3.0", - "xdg-basedir": "3.0.0" + "dot-prop": "^4.1.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "unique-string": "^1.0.0", + "write-file-atomic": "^2.0.0", + "xdg-basedir": "^3.0.0" } }, "convert-source-map": { @@ -3144,9 +3323,9 @@ "dev": true }, "cookiejar": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.1.tgz", - "integrity": "sha1-Qa1XsbVVlR7BcUEqgZQrHoIA00o=", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", "dev": true }, "core-assert": { @@ -3155,14 +3334,14 @@ "integrity": "sha1-+F4s+b/tKPdzzIs/pcW2m9wC/j8=", "dev": true, "requires": { - "buf-compare": "1.0.1", - "is-error": "2.2.1" + "buf-compare": "^1.0.0", + "is-error": "^2.2.0" } }, "core-js": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.6.tgz", - "integrity": "sha512-lQUVfQi0aLix2xpyjrrJEvfuYCqPc/HwmTKsC/VNf8q0zsjX7SQZtp4+oRONN5Tsur9GDETPjj+Ub2iDiGZfSQ==", + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==", "dev": true }, "core-util-is": { @@ -3174,8 +3353,9 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", + "dev": true, "requires": { - "capture-stack-trace": "1.0.0" + "capture-stack-trace": "^1.0.0" } }, "cross-spawn": { @@ -3184,9 +3364,9 @@ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { - "lru-cache": "4.1.3", - "shebang-command": "1.2.0", - "which": "1.3.0" + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, "crypto-random-string": { @@ -3201,7 +3381,7 @@ "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", "dev": true, "requires": { - "array-find-index": "1.0.2" + "array-find-index": "^1.0.1" } }, "d": { @@ -3210,7 +3390,7 @@ "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "dev": true, "requires": { - "es5-ext": "0.10.42" + "es5-ext": "^0.10.9" } }, "dashdash": { @@ -3218,7 +3398,7 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "date-time": { @@ -3253,7 +3433,7 @@ "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", "dev": true, "requires": { - "mimic-response": "1.0.0" + "mimic-response": "^1.0.0" } }, "deep-equal": { @@ -3263,9 +3443,9 @@ "dev": true }, "deep-extend": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz", - "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true }, "deep-is": { @@ -3280,8 +3460,8 @@ "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", "dev": true, "requires": { - "foreach": "2.0.5", - "object-keys": "1.0.11" + "foreach": "^2.0.5", + "object-keys": "^1.0.8" } }, "del": { @@ -3290,13 +3470,13 @@ "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", "dev": true, "requires": { - "globby": "5.0.0", - "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.1", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "rimraf": "2.6.2" + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" }, "dependencies": { "globby": { @@ -3305,12 +3485,12 @@ "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { - "array-union": "1.0.2", - "arrify": "1.0.1", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "pify": { @@ -3331,7 +3511,7 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } } } @@ -3347,7 +3527,7 @@ "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", "dev": true, "requires": { - "repeating": "2.0.1" + "repeating": "^2.0.0" } }, "diff": { @@ -3368,7 +3548,7 @@ "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { - "esutils": "2.0.2" + "esutils": "^2.0.2" } }, "dom-serializer": { @@ -3377,8 +3557,8 @@ "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", "dev": true, "requires": { - "domelementtype": "1.1.3", - "entities": "1.1.1" + "domelementtype": "~1.1.1", + "entities": "~1.1.1" }, "dependencies": { "domelementtype": { @@ -3401,7 +3581,7 @@ "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", "dev": true, "requires": { - "domelementtype": "1.3.0" + "domelementtype": "1" } }, "domutils": { @@ -3410,8 +3590,8 @@ "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", "dev": true, "requires": { - "dom-serializer": "0.1.0", - "domelementtype": "1.3.0" + "dom-serializer": "0", + "domelementtype": "1" } }, "dot-prop": { @@ -3420,7 +3600,7 @@ "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", "dev": true, "requires": { - "is-obj": "1.0.1" + "is-obj": "^1.0.0" } }, "duplexer3": { @@ -3434,10 +3614,10 @@ "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", "requires": { - "end-of-stream": "1.4.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "stream-shift": "1.0.0" + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" } }, "eastasianwidth": { @@ -3452,7 +3632,7 @@ "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", "optional": true, "requires": { - "jsbn": "0.1.1" + "jsbn": "~0.1.0" } }, "ecdsa-sig-formatter": { @@ -3460,7 +3640,7 @@ "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.0.1" } }, "empower": { @@ -3469,8 +3649,8 @@ "integrity": "sha1-bw2nNEf07dg4/sXGAxOoi6XLhSs=", "dev": true, "requires": { - "core-js": "2.5.6", - "empower-core": "0.6.2" + "core-js": "^2.0.0", + "empower-core": "^0.6.2" } }, "empower-assert": { @@ -3479,7 +3659,7 @@ "integrity": "sha512-Ylck0Q6p8y/LpNzYeBccaxAPm2ZyuqBgErgZpO9KT0HuQWF0sJckBKCLmgS1/DEXEiyBi9XtYh3clZm5cAdARw==", "dev": true, "requires": { - "estraverse": "4.2.0" + "estraverse": "^4.2.0" } }, "empower-core": { @@ -3489,7 +3669,7 @@ "dev": true, "requires": { "call-signature": "0.0.2", - "core-js": "2.5.6" + "core-js": "^2.0.0" } }, "end-of-stream": { @@ -3497,7 +3677,7 @@ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "requires": { - "once": "1.4.0" + "once": "^1.4.0" } }, "ent": { @@ -3523,18 +3703,18 @@ "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", "dev": true, "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "es5-ext": { - "version": "0.10.42", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.42.tgz", - "integrity": "sha512-AJxO1rmPe1bDEfSR6TJ/FgMFYuTBhR5R57KW58iCkYACMyFbrkqVyzXSurYoScDGvgyMpk7uRF/lPUPPTmsRSA==", + "version": "0.10.45", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.45.tgz", + "integrity": "sha512-FkfM6Vxxfmztilbxxz5UKSD4ICMf5tSpRFtDNtkAhOxZ0EKtX6qwmXNyH/sFyIbX2P/nU5AMiA9jilWsUGJzCQ==", "dev": true, "requires": { - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1", - "next-tick": "1.0.0" + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.1", + "next-tick": "1" } }, "es6-error": { @@ -3549,9 +3729,9 @@ "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.42", - "es6-symbol": "3.1.1" + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" } }, "es6-map": { @@ -3560,12 +3740,12 @@ "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.42", - "es6-iterator": "2.0.3", - "es6-set": "0.1.5", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", + "es6-set": "~0.1.5", + "es6-symbol": "~3.1.1", + "event-emitter": "~0.3.5" } }, "es6-set": { @@ -3574,11 +3754,11 @@ "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.42", - "es6-iterator": "2.0.3", + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" + "event-emitter": "~0.3.5" } }, "es6-symbol": { @@ -3587,8 +3767,8 @@ "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.42" + "d": "1", + "es5-ext": "~0.10.14" } }, "es6-weak-map": { @@ -3597,10 +3777,10 @@ "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.42", - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1" + "d": "1", + "es5-ext": "^0.10.14", + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" } }, "escallmatch": { @@ -3609,8 +3789,8 @@ "integrity": "sha1-UAmdhugJGwkt+N37w/mm+wWgJNA=", "dev": true, "requires": { - "call-matcher": "1.0.1", - "esprima": "2.7.3" + "call-matcher": "^1.0.0", + "esprima": "^2.0.0" }, "dependencies": { "esprima": { @@ -3633,11 +3813,11 @@ "integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==", "dev": true, "requires": { - "esprima": "3.1.3", - "estraverse": "4.2.0", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.6.1" + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" }, "dependencies": { "esprima": { @@ -3661,10 +3841,10 @@ "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", "dev": true, "requires": { - "es6-map": "0.1.5", - "es6-weak-map": "2.0.2", - "esrecurse": "4.2.1", - "estraverse": "4.2.0" + "es6-map": "^0.1.3", + "es6-weak-map": "^2.0.1", + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" } }, "eslint": { @@ -3673,44 +3853,44 @@ "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", "dev": true, "requires": { - "ajv": "5.5.2", - "babel-code-frame": "6.26.0", - "chalk": "2.4.1", - "concat-stream": "1.6.2", - "cross-spawn": "5.1.0", - "debug": "3.1.0", - "doctrine": "2.1.0", - "eslint-scope": "3.7.1", - "eslint-visitor-keys": "1.0.0", - "espree": "3.5.4", - "esquery": "1.0.1", - "esutils": "2.0.2", - "file-entry-cache": "2.0.0", - "functional-red-black-tree": "1.0.1", - "glob": "7.1.2", - "globals": "11.5.0", - "ignore": "3.3.8", - "imurmurhash": "0.1.4", - "inquirer": "3.3.0", - "is-resolvable": "1.1.0", - "js-yaml": "3.11.0", - "json-stable-stringify-without-jsonify": "1.0.1", - "levn": "0.3.0", - "lodash": "4.17.10", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "natural-compare": "1.4.0", - "optionator": "0.8.2", - "path-is-inside": "1.0.2", - "pluralize": "7.0.0", - "progress": "2.0.0", - "regexpp": "1.1.0", - "require-uncached": "1.0.3", - "semver": "5.5.0", - "strip-ansi": "4.0.0", - "strip-json-comments": "2.0.1", + "ajv": "^5.3.0", + "babel-code-frame": "^6.22.0", + "chalk": "^2.1.0", + "concat-stream": "^1.6.0", + "cross-spawn": "^5.1.0", + "debug": "^3.1.0", + "doctrine": "^2.1.0", + "eslint-scope": "^3.7.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^3.5.4", + "esquery": "^1.0.0", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.0.1", + "ignore": "^3.3.3", + "imurmurhash": "^0.1.4", + "inquirer": "^3.0.6", + "is-resolvable": "^1.0.0", + "js-yaml": "^3.9.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.4", + "minimatch": "^3.0.2", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^1.0.1", + "require-uncached": "^1.0.3", + "semver": "^5.3.0", + "strip-ansi": "^4.0.0", + "strip-json-comments": "~2.0.1", "table": "4.0.2", - "text-table": "0.2.0" + "text-table": "~0.2.0" }, "dependencies": { "globals": { @@ -3727,7 +3907,7 @@ "integrity": "sha512-ag8YEyBXsm3nmOv1Hz991VtNNDMRa+MNy8cY47Pl4bw6iuzqKbJajXdqUpiw13STdLLrznxgm1hj9NhxeOYq0A==", "dev": true, "requires": { - "get-stdin": "5.0.1" + "get-stdin": "^5.0.1" }, "dependencies": { "get-stdin": { @@ -3744,10 +3924,10 @@ "integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==", "dev": true, "requires": { - "ignore": "3.3.8", - "minimatch": "3.0.4", - "resolve": "1.7.1", - "semver": "5.5.0" + "ignore": "^3.3.6", + "minimatch": "^3.0.4", + "resolve": "^1.3.3", + "semver": "^5.4.1" }, "dependencies": { "resolve": { @@ -3756,7 +3936,7 @@ "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", "dev": true, "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } } } @@ -3767,8 +3947,8 @@ "integrity": "sha512-floiaI4F7hRkTrFe8V2ItOK97QYrX75DjmdzmVITZoAP6Cn06oEDPQRsO6MlHEP/u2SxI3xQ52Kpjw6j5WGfeQ==", "dev": true, "requires": { - "fast-diff": "1.1.2", - "jest-docblock": "21.2.0" + "fast-diff": "^1.1.1", + "jest-docblock": "^21.0.0" } }, "eslint-scope": { @@ -3777,8 +3957,8 @@ "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", "dev": true, "requires": { - "esrecurse": "4.2.1", - "estraverse": "4.2.0" + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" } }, "eslint-visitor-keys": { @@ -3793,16 +3973,16 @@ "integrity": "sha512-F4TY1qYJB1aUyzB03NsZksZzUQmQoEBaTUjRJGR30GxbkbjKI41NhCyYjrF+bGgWN7x/ZsczYppRpz/0WdI0ug==", "dev": true, "requires": { - "array-find": "1.0.0", - "escallmatch": "1.5.0", - "escodegen": "1.9.1", - "escope": "3.6.0", - "espower-location-detector": "1.0.0", - "espurify": "1.8.0", - "estraverse": "4.2.0", - "source-map": "0.5.7", - "type-name": "2.0.2", - "xtend": "4.0.1" + "array-find": "^1.0.0", + "escallmatch": "^1.5.0", + "escodegen": "^1.7.0", + "escope": "^3.3.0", + "espower-location-detector": "^1.0.0", + "espurify": "^1.3.0", + "estraverse": "^4.1.0", + "source-map": "^0.5.0", + "type-name": "^2.0.0", + "xtend": "^4.0.0" } }, "espower-loader": { @@ -3811,11 +3991,11 @@ "integrity": "sha1-7bRsPFmga6yOpzppXIblxaC8gto=", "dev": true, "requires": { - "convert-source-map": "1.5.1", - "espower-source": "2.2.0", - "minimatch": "3.0.4", - "source-map-support": "0.4.18", - "xtend": "4.0.1" + "convert-source-map": "^1.1.0", + "espower-source": "^2.0.0", + "minimatch": "^3.0.0", + "source-map-support": "^0.4.0", + "xtend": "^4.0.0" }, "dependencies": { "source-map-support": { @@ -3824,7 +4004,7 @@ "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "dev": true, "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.6" } } } @@ -3835,10 +4015,10 @@ "integrity": "sha1-oXt+zFnTDheeK+9z+0E3cEyzMbU=", "dev": true, "requires": { - "is-url": "1.2.4", - "path-is-absolute": "1.0.1", - "source-map": "0.5.7", - "xtend": "4.0.1" + "is-url": "^1.2.1", + "path-is-absolute": "^1.0.0", + "source-map": "^0.5.0", + "xtend": "^4.0.0" } }, "espower-source": { @@ -3847,17 +4027,17 @@ "integrity": "sha1-fgBSVa5HtcE2RIZEs/PYAtUD91I=", "dev": true, "requires": { - "acorn": "5.5.3", - "acorn-es7-plugin": "1.1.7", - "convert-source-map": "1.5.1", - "empower-assert": "1.1.0", - "escodegen": "1.9.1", - "espower": "2.1.1", - "estraverse": "4.2.0", - "merge-estraverse-visitors": "1.0.0", - "multi-stage-sourcemap": "0.2.1", - "path-is-absolute": "1.0.1", - "xtend": "4.0.1" + "acorn": "^5.0.0", + "acorn-es7-plugin": "^1.0.10", + "convert-source-map": "^1.1.1", + "empower-assert": "^1.0.0", + "escodegen": "^1.6.1", + "espower": "^2.0.0", + "estraverse": "^4.0.0", + "merge-estraverse-visitors": "^1.0.0", + "multi-stage-sourcemap": "^0.2.1", + "path-is-absolute": "^1.0.0", + "xtend": "^4.0.0" } }, "espree": { @@ -3866,8 +4046,8 @@ "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { - "acorn": "5.5.3", - "acorn-jsx": "3.0.1" + "acorn": "^5.5.0", + "acorn-jsx": "^3.0.0" } }, "esprima": { @@ -3882,7 +4062,7 @@ "integrity": "sha512-jdkJG9jswjKCCDmEridNUuIQei9algr+o66ZZ19610ZoBsiWLRsQGNYS4HGez3Z/DsR0lhANGAqiwBUclPuNag==", "dev": true, "requires": { - "core-js": "2.5.6" + "core-js": "^2.0.0" } }, "esquery": { @@ -3891,7 +4071,7 @@ "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", "dev": true, "requires": { - "estraverse": "4.2.0" + "estraverse": "^4.0.0" } }, "esrecurse": { @@ -3900,7 +4080,7 @@ "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { - "estraverse": "4.2.0" + "estraverse": "^4.1.0" } }, "estraverse": { @@ -3921,8 +4101,8 @@ "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.42" + "d": "1", + "es5-ext": "~0.10.14" } }, "execa": { @@ -3931,13 +4111,13 @@ "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "dev": true, "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" } }, "expand-brackets": { @@ -3946,7 +4126,7 @@ "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", "dev": true, "requires": { - "is-posix-bracket": "0.1.1" + "is-posix-bracket": "^0.1.0" } }, "expand-range": { @@ -3955,7 +4135,7 @@ "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "dev": true, "requires": { - "fill-range": "2.2.4" + "fill-range": "^2.1.0" } }, "extend": { @@ -3969,9 +4149,9 @@ "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", "dev": true, "requires": { - "chardet": "0.4.2", - "iconv-lite": "0.4.23", - "tmp": "0.0.33" + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" } }, "extglob": { @@ -3980,7 +4160,7 @@ "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "extsprintf": { @@ -4016,7 +4196,7 @@ "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "dev": true, "requires": { - "escape-string-regexp": "1.0.5" + "escape-string-regexp": "^1.0.5" } }, "file-entry-cache": { @@ -4025,8 +4205,8 @@ "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { - "flat-cache": "1.3.0", - "object-assign": "4.1.1" + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" } }, "filename-regex": { @@ -4041,8 +4221,8 @@ "integrity": "sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=", "dev": true, "requires": { - "is-object": "1.0.1", - "merge-descriptors": "1.0.1" + "is-object": "~1.0.1", + "merge-descriptors": "~1.0.0" } }, "fill-range": { @@ -4051,11 +4231,11 @@ "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", "dev": true, "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "3.0.0", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" } }, "find-cache-dir": { @@ -4064,9 +4244,9 @@ "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", "dev": true, "requires": { - "commondir": "1.0.1", - "make-dir": "1.3.0", - "pkg-dir": "2.0.0" + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" } }, "find-up": { @@ -4075,7 +4255,7 @@ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "flat-cache": { @@ -4084,10 +4264,10 @@ "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", "dev": true, "requires": { - "circular-json": "0.3.3", - "del": "2.2.2", - "graceful-fs": "4.1.11", - "write": "0.2.1" + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" } }, "fn-name": { @@ -4101,7 +4281,7 @@ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.0.tgz", "integrity": "sha512-fdrt472/9qQ6Kgjvb935ig6vJCuofpBUD14f9Vb+SLlm7xIe4Qva5gey8EKtv8lp7ahE1wilg3xL1znpVGtZIA==", "requires": { - "debug": "3.1.0" + "debug": "^3.1.0" } }, "for-in": { @@ -4116,7 +4296,7 @@ "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", "dev": true, "requires": { - "for-in": "1.0.2" + "for-in": "^1.0.1" } }, "foreach": { @@ -4135,9 +4315,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "requires": { - "asynckit": "0.4.0", + "asynckit": "^0.4.0", "combined-stream": "1.0.6", - "mime-types": "2.1.18" + "mime-types": "^2.1.12" } }, "formidable": { @@ -4152,8 +4332,8 @@ "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", "dev": true, "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6" + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" } }, "fs-extra": { @@ -4162,9 +4342,9 @@ "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "4.0.0", - "universalify": "0.1.1" + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" } }, "fs.realpath": { @@ -4180,8 +4360,8 @@ "dev": true, "optional": true, "requires": { - "nan": "2.10.0", - "node-pre-gyp": "0.10.0" + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" }, "dependencies": { "abbrev": { @@ -4207,8 +4387,8 @@ "dev": true, "optional": true, "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" } }, "balanced-match": { @@ -4221,7 +4401,7 @@ "bundled": true, "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -4285,7 +4465,7 @@ "dev": true, "optional": true, "requires": { - "minipass": "2.2.4" + "minipass": "^2.2.1" } }, "fs.realpath": { @@ -4300,14 +4480,14 @@ "dev": true, "optional": true, "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" } }, "glob": { @@ -4316,12 +4496,12 @@ "dev": true, "optional": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "has-unicode": { @@ -4336,7 +4516,7 @@ "dev": true, "optional": true, "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": "^2.1.0" } }, "ignore-walk": { @@ -4345,7 +4525,7 @@ "dev": true, "optional": true, "requires": { - "minimatch": "3.0.4" + "minimatch": "^3.0.4" } }, "inflight": { @@ -4354,8 +4534,8 @@ "dev": true, "optional": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -4374,7 +4554,7 @@ "bundled": true, "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "isarray": { @@ -4388,7 +4568,7 @@ "bundled": true, "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -4401,8 +4581,8 @@ "bundled": true, "dev": true, "requires": { - "safe-buffer": "5.1.1", - "yallist": "3.0.2" + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" } }, "minizlib": { @@ -4411,7 +4591,7 @@ "dev": true, "optional": true, "requires": { - "minipass": "2.2.4" + "minipass": "^2.2.1" } }, "mkdirp": { @@ -4434,9 +4614,9 @@ "dev": true, "optional": true, "requires": { - "debug": "2.6.9", - "iconv-lite": "0.4.21", - "sax": "1.2.4" + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" } }, "node-pre-gyp": { @@ -4445,16 +4625,16 @@ "dev": true, "optional": true, "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.2.0", - "nopt": "4.0.1", - "npm-packlist": "1.1.10", - "npmlog": "4.1.2", - "rc": "1.2.7", - "rimraf": "2.6.2", - "semver": "5.5.0", - "tar": "4.4.1" + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" } }, "nopt": { @@ -4463,8 +4643,8 @@ "dev": true, "optional": true, "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" + "abbrev": "1", + "osenv": "^0.1.4" } }, "npm-bundled": { @@ -4479,8 +4659,8 @@ "dev": true, "optional": true, "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.3" + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" } }, "npmlog": { @@ -4489,10 +4669,10 @@ "dev": true, "optional": true, "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" } }, "number-is-nan": { @@ -4511,7 +4691,7 @@ "bundled": true, "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "os-homedir": { @@ -4532,8 +4712,8 @@ "dev": true, "optional": true, "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" } }, "path-is-absolute": { @@ -4554,10 +4734,10 @@ "dev": true, "optional": true, "requires": { - "deep-extend": "0.5.1", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" }, "dependencies": { "minimist": { @@ -4574,13 +4754,13 @@ "dev": true, "optional": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, "rimraf": { @@ -4589,7 +4769,7 @@ "dev": true, "optional": true, "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "safe-buffer": { @@ -4632,9 +4812,9 @@ "bundled": true, "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "string_decoder": { @@ -4643,7 +4823,7 @@ "dev": true, "optional": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "~5.1.0" } }, "strip-ansi": { @@ -4651,7 +4831,7 @@ "bundled": true, "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-json-comments": { @@ -4666,13 +4846,13 @@ "dev": true, "optional": true, "requires": { - "chownr": "1.0.1", - "fs-minipass": "1.2.5", - "minipass": "2.2.4", - "minizlib": "1.1.0", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.1", - "yallist": "3.0.2" + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" } }, "util-deprecate": { @@ -4687,7 +4867,7 @@ "dev": true, "optional": true, "requires": { - "string-width": "1.0.2" + "string-width": "^1.0.2" } }, "wrappy": { @@ -4719,8 +4899,8 @@ "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.6.3.tgz", "integrity": "sha512-MSmczZctbz91AxCvqp9GHBoZOSbJKAICV7Ow/AIWSJZRrRchUd5NL1b2P4OfP+4m490BEUPhhARfpHdqCxuCvg==", "requires": { - "axios": "0.18.0", - "extend": "3.0.1", + "axios": "^0.18.0", + "extend": "^3.0.1", "retry-axios": "0.3.2" } }, @@ -4753,7 +4933,7 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "glob": { @@ -4762,12 +4942,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "glob-base": { @@ -4776,8 +4956,8 @@ "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", "dev": true, "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" } }, "glob-parent": { @@ -4786,7 +4966,7 @@ "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", "dev": true, "requires": { - "is-glob": "2.0.1" + "is-glob": "^2.0.0" } }, "global-dirs": { @@ -4795,7 +4975,7 @@ "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", "dev": true, "requires": { - "ini": "1.3.5" + "ini": "^1.3.4" } }, "globals": { @@ -4810,11 +4990,11 @@ "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { - "array-union": "1.0.2", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" }, "dependencies": { "pify": { @@ -4835,34 +5015,23 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } } } }, "google-auth-library": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-1.5.0.tgz", - "integrity": "sha512-xpibA/hkq4waBcpIkSJg4GiDAqcBWjJee3c47zj7xP3RQ0A9mc8MP3Vc9sc8SGRoDYA0OszZxTjW7SbcC4pJIA==", - "requires": { - "axios": "0.18.0", - "gcp-metadata": "0.6.3", - "gtoken": "2.3.0", - "jws": "3.1.5", - "lodash.isstring": "4.0.1", - "lru-cache": "4.1.3", - "retry-axios": "0.3.2" - } - }, - "google-auto-auth": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.10.1.tgz", - "integrity": "sha512-iIqSbY7Ypd32mnHGbYctp80vZzXoDlvI9gEfvtl3kmyy5HzOcrZCIGCBdSlIzRsg7nHpQiHE3Zl6Ycur6TSodQ==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-1.6.1.tgz", + "integrity": "sha512-jYiWC8NA9n9OtQM7ANn0Tk464do9yhKEtaJ72pKcaBiEwn4LwcGYIYOfwtfsSm3aur/ed3tlSxbmg24IAT6gAg==", "requires": { - "async": "2.6.1", - "gcp-metadata": "0.6.3", - "google-auth-library": "1.5.0", - "request": "2.87.0" + "axios": "^0.18.0", + "gcp-metadata": "^0.6.3", + "gtoken": "^2.3.0", + "jws": "^3.1.5", + "lodash.isstring": "^4.0.1", + "lru-cache": "^4.1.3", + "retry-axios": "^0.3.2" } }, "google-p12-pem": { @@ -4870,8 +5039,8 @@ "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.2.tgz", "integrity": "sha512-+EuKr4CLlGsnXx4XIJIVkcKYrsa2xkAmCvxRhX2HsazJzUBAJ35wARGeApHUn4nNfPD03Vl057FskNr20VaCyg==", "requires": { - "node-forge": "0.7.5", - "pify": "3.0.0" + "node-forge": "^0.7.4", + "pify": "^3.0.0" } }, "got": { @@ -4880,23 +5049,23 @@ "integrity": "sha512-giadqJpXIwjY+ZsuWys8p2yjZGhOHiU4hiJHjS/oeCxw1u8vANQz3zPlrxW2Zw/siCXsSMI3hvzWGcnFyujyAg==", "dev": true, "requires": { - "@sindresorhus/is": "0.7.0", - "cacheable-request": "2.1.4", - "decompress-response": "3.3.0", - "duplexer3": "0.1.4", - "get-stream": "3.0.0", - "into-stream": "3.1.0", - "is-retry-allowed": "1.1.0", - "isurl": "1.0.0", - "lowercase-keys": "1.0.1", - "mimic-response": "1.0.0", - "p-cancelable": "0.3.0", - "p-timeout": "2.0.1", - "pify": "3.0.0", - "safe-buffer": "5.1.2", - "timed-out": "4.0.1", - "url-parse-lax": "3.0.0", - "url-to-options": "1.0.1" + "@sindresorhus/is": "^0.7.0", + "cacheable-request": "^2.1.1", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "into-stream": "^3.1.0", + "is-retry-allowed": "^1.1.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "mimic-response": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^2.0.1", + "pify": "^3.0.0", + "safe-buffer": "^5.1.1", + "timed-out": "^4.0.1", + "url-parse-lax": "^3.0.0", + "url-to-options": "^1.0.1" }, "dependencies": { "prepend-http": { @@ -4911,7 +5080,7 @@ "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", "dev": true, "requires": { - "prepend-http": "2.0.0" + "prepend-http": "^2.0.0" } } } @@ -4933,11 +5102,11 @@ "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.0.tgz", "integrity": "sha512-Jc9/8mV630cZE9FC5tIlJCZNdUjwunvlwOtCz6IDlaiB4Sz68ki29a1+q97sWTnTYroiuF9B135rod9zrQdHLw==", "requires": { - "axios": "0.18.0", - "google-p12-pem": "1.0.2", - "jws": "3.1.5", - "mime": "2.3.1", - "pify": "3.0.0" + "axios": "^0.18.0", + "google-p12-pem": "^1.0.0", + "jws": "^3.1.4", + "mime": "^2.2.0", + "pify": "^3.0.0" } }, "handlebars": { @@ -4946,10 +5115,10 @@ "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", "dev": true, "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.8.29" + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" }, "dependencies": { "async": { @@ -4964,7 +5133,7 @@ "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } @@ -4979,8 +5148,8 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" + "ajv": "^5.1.0", + "har-schema": "^2.0.0" } }, "has-ansi": { @@ -4989,7 +5158,7 @@ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "has-color": { @@ -5016,7 +5185,7 @@ "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", "dev": true, "requires": { - "has-symbol-support-x": "1.4.2" + "has-symbol-support-x": "^1.4.1" } }, "has-yarn": { @@ -5037,8 +5206,8 @@ "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", "dev": true, "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" } }, "hosted-git-info": { @@ -5058,12 +5227,12 @@ "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", "dev": true, "requires": { - "domelementtype": "1.3.0", - "domhandler": "2.4.2", - "domutils": "1.7.0", - "entities": "1.1.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6" + "domelementtype": "^1.3.0", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" } }, "http-cache-semantics": { @@ -5077,9 +5246,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.14.1" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "hullabaloo-config-manager": { @@ -5088,20 +5257,20 @@ "integrity": "sha512-ztKnkZV0TmxnumCDHHgLGNiDnotu4EHCp9YMkznWuo4uTtCyJ+cu+RNcxUeXYKTllpvLFWnbfWry09yzszgg+A==", "dev": true, "requires": { - "dot-prop": "4.2.0", - "es6-error": "4.1.1", - "graceful-fs": "4.1.11", - "indent-string": "3.2.0", - "json5": "0.5.1", - "lodash.clonedeep": "4.5.0", - "lodash.clonedeepwith": "4.5.0", - "lodash.isequal": "4.5.0", - "lodash.merge": "4.6.1", - "md5-hex": "2.0.0", - "package-hash": "2.0.0", - "pkg-dir": "2.0.0", - "resolve-from": "3.0.0", - "safe-buffer": "5.1.2" + "dot-prop": "^4.1.0", + "es6-error": "^4.0.2", + "graceful-fs": "^4.1.11", + "indent-string": "^3.1.0", + "json5": "^0.5.1", + "lodash.clonedeep": "^4.5.0", + "lodash.clonedeepwith": "^4.5.0", + "lodash.isequal": "^4.5.0", + "lodash.merge": "^4.6.0", + "md5-hex": "^2.0.0", + "package-hash": "^2.0.0", + "pkg-dir": "^2.0.0", + "resolve-from": "^3.0.0", + "safe-buffer": "^5.0.1" } }, "iconv-lite": { @@ -5110,7 +5279,7 @@ "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", "dev": true, "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": ">= 2.1.2 < 3" } }, "ignore": { @@ -5137,8 +5306,8 @@ "integrity": "sha1-sReVcqrNwRxqkQCftDDbyrX2aKg=", "dev": true, "requires": { - "pkg-dir": "2.0.0", - "resolve-cwd": "2.0.0" + "pkg-dir": "^2.0.0", + "resolve-cwd": "^2.0.0" } }, "imurmurhash": { @@ -5165,8 +5334,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -5186,8 +5355,8 @@ "integrity": "sha512-STx5orGQU1gfrkoI/fMU7lX6CSP7LBGO10gXNgOZhwKhUqbtNjCkYSewJtNnLmWP1tAGN6oyEpG1HFPw5vpa5Q==", "dev": true, "requires": { - "moment": "2.22.1", - "sanitize-html": "1.18.2" + "moment": "^2.14.1", + "sanitize-html": "^1.13.0" } }, "inquirer": { @@ -5196,20 +5365,20 @@ "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "dev": true, "requires": { - "ansi-escapes": "3.1.0", - "chalk": "2.4.1", - "cli-cursor": "2.1.0", - "cli-width": "2.2.0", - "external-editor": "2.2.0", - "figures": "2.0.0", - "lodash": "4.17.10", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", "mute-stream": "0.0.7", - "run-async": "2.3.0", - "rx-lite": "4.0.8", - "rx-lite-aggregates": "4.0.8", - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "through": "2.3.8" + "run-async": "^2.2.0", + "rx-lite": "^4.0.8", + "rx-lite-aggregates": "^4.0.8", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" } }, "intelli-espower-loader": { @@ -5218,7 +5387,7 @@ "integrity": "sha1-LHsDFGvB1GvyENCgOXxckatMorA=", "dev": true, "requires": { - "espower-loader": "1.2.2" + "espower-loader": "^1.0.0" } }, "into-stream": { @@ -5227,8 +5396,8 @@ "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", "dev": true, "requires": { - "from2": "2.3.0", - "p-is-promise": "1.1.0" + "from2": "^2.1.1", + "p-is-promise": "^1.1.0" } }, "invariant": { @@ -5237,7 +5406,7 @@ "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "dev": true, "requires": { - "loose-envify": "1.3.1" + "loose-envify": "^1.0.0" } }, "invert-kv": { @@ -5269,7 +5438,7 @@ "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { - "binary-extensions": "1.11.0" + "binary-extensions": "^1.0.0" } }, "is-buffer": { @@ -5283,7 +5452,7 @@ "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { - "builtin-modules": "1.1.1" + "builtin-modules": "^1.0.0" } }, "is-ci": { @@ -5292,7 +5461,7 @@ "integrity": "sha512-c7TnwxLePuqIlxHgr7xtxzycJPegNHFuIrBkwbf8hc58//+Op1CqFkyS+xnIMkwn9UsJIwc174BIjkyBmSpjKg==", "dev": true, "requires": { - "ci-info": "1.1.3" + "ci-info": "^1.0.0" } }, "is-dotfile": { @@ -5307,7 +5476,7 @@ "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", "dev": true, "requires": { - "is-primitive": "2.0.0" + "is-primitive": "^2.0.0" } }, "is-error": { @@ -5334,7 +5503,7 @@ "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-fullwidth-code-point": { @@ -5355,7 +5524,7 @@ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "is-html": { @@ -5363,7 +5532,7 @@ "resolved": "https://registry.npmjs.org/is-html/-/is-html-1.1.0.tgz", "integrity": "sha1-4E8cGNOUhRETlvmgJz6rUa8hhGQ=", "requires": { - "html-tags": "1.2.0" + "html-tags": "^1.0.0" } }, "is-installed-globally": { @@ -5372,8 +5541,8 @@ "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", "dev": true, "requires": { - "global-dirs": "0.1.1", - "is-path-inside": "1.0.1" + "global-dirs": "^0.1.0", + "is-path-inside": "^1.0.0" } }, "is-npm": { @@ -5388,7 +5557,7 @@ "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "is-obj": { @@ -5409,7 +5578,7 @@ "integrity": "sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==", "dev": true, "requires": { - "symbol-observable": "1.2.0" + "symbol-observable": "^1.1.0" } }, "is-path-cwd": { @@ -5424,7 +5593,7 @@ "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { - "is-path-inside": "1.0.1" + "is-path-inside": "^1.0.0" } }, "is-path-inside": { @@ -5433,7 +5602,7 @@ "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { - "path-is-inside": "1.0.2" + "path-is-inside": "^1.0.1" } }, "is-plain-obj": { @@ -5531,14 +5700,35 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "istanbul-lib-coverage": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.0.tgz", + "integrity": "sha512-yMSw5xLIbdaxiVXHk3amfNM2WeBxLrwH/BCyZ9HvA/fylwziAIJOG2rKqWyLqEJqwKT725vxxqidv+SyynnGAA==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-2.2.0.tgz", + "integrity": "sha512-ozQGtlIw+/a/F3n6QwWiuuyRAPp64+g2GVsKYsIez0sgIEzkU5ZpL2uZ5pmAzbEJ82anlRaPlOQZzkRXspgJyg==", + "dev": true, + "requires": { + "@babel/generator": "7.0.0-beta.49", + "@babel/parser": "7.0.0-beta.49", + "@babel/template": "7.0.0-beta.49", + "@babel/traverse": "7.0.0-beta.49", + "@babel/types": "7.0.0-beta.49", + "istanbul-lib-coverage": "^2.0.0", + "semver": "^5.5.0" + } + }, "isurl": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", "dev": true, "requires": { - "has-to-string-tag-x": "1.4.1", - "is-object": "1.0.1" + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" } }, "jest-docblock": { @@ -5560,13 +5750,13 @@ "dev": true }, "js-yaml": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", - "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "4.0.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "js2xmlparser": { @@ -5575,7 +5765,7 @@ "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", "dev": true, "requires": { - "xmlcreate": "1.0.2" + "xmlcreate": "^1.0.1" } }, "jsbn": { @@ -5591,17 +5781,17 @@ "dev": true, "requires": { "babylon": "7.0.0-beta.19", - "bluebird": "3.5.1", - "catharsis": "0.8.9", - "escape-string-regexp": "1.0.5", - "js2xmlparser": "3.0.0", - "klaw": "2.0.0", - "marked": "0.3.19", - "mkdirp": "0.5.1", - "requizzle": "0.2.1", - "strip-json-comments": "2.0.1", + "bluebird": "~3.5.0", + "catharsis": "~0.8.9", + "escape-string-regexp": "~1.0.5", + "js2xmlparser": "~3.0.0", + "klaw": "~2.0.0", + "marked": "~0.3.6", + "mkdirp": "~0.5.1", + "requizzle": "~0.2.1", + "strip-json-comments": "~2.0.1", "taffydb": "2.6.2", - "underscore": "1.8.3" + "underscore": "~1.8.3" }, "dependencies": { "babylon": { @@ -5663,7 +5853,7 @@ "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "dev": true, "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.6" } }, "jsprim": { @@ -5690,7 +5880,7 @@ "requires": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.10", - "safe-buffer": "5.1.2" + "safe-buffer": "^5.0.1" } }, "jws": { @@ -5698,8 +5888,8 @@ "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", "requires": { - "jwa": "1.1.6", - "safe-buffer": "5.1.2" + "jwa": "^1.1.5", + "safe-buffer": "^5.0.1" } }, "keyv": { @@ -5717,7 +5907,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } }, "klaw": { @@ -5726,7 +5916,7 @@ "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", "dev": true, "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.9" } }, "last-line-stream": { @@ -5735,7 +5925,7 @@ "integrity": "sha1-0bZNafhv8kry0EiDos7uFFIKVgA=", "dev": true, "requires": { - "through2": "2.0.3" + "through2": "^2.0.0" } }, "latest-version": { @@ -5744,7 +5934,7 @@ "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", "dev": true, "requires": { - "package-json": "4.0.1" + "package-json": "^4.0.0" } }, "lazy-cache": { @@ -5760,7 +5950,7 @@ "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { - "invert-kv": "1.0.0" + "invert-kv": "^1.0.0" } }, "levn": { @@ -5769,8 +5959,8 @@ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "load-json-file": { @@ -5779,10 +5969,10 @@ "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "strip-bom": "3.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" }, "dependencies": { "pify": { @@ -5799,14 +5989,15 @@ "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" } }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true }, "lodash.clonedeep": { "version": "4.5.0", @@ -5885,15 +6076,10 @@ "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", "dev": true }, - "log-driver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", - "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==" - }, "lolex": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.6.0.tgz", - "integrity": "sha512-e1UtIo1pbrIqEXib/yMjHciyqkng5lc0rrIbytgjmRgDR9+2ceNIAcwOWSgylRjoEP9VdVguCSRwnNmlbnOUwA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.0.tgz", + "integrity": "sha512-uJkH2e0BVfU5KOJUevbTOtpDduooSarH5PopO+LfM/vZf8Z9sJzODqKev804JYM2i++ktJfUmC1le4LwFQ1VMg==", "dev": true }, "longest": { @@ -5908,7 +6094,7 @@ "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", "dev": true, "requires": { - "js-tokens": "3.0.2" + "js-tokens": "^3.0.0" } }, "loud-rejection": { @@ -5917,8 +6103,8 @@ "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", "dev": true, "requires": { - "currently-unhandled": "0.4.1", - "signal-exit": "3.0.2" + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" } }, "lowercase-keys": { @@ -5932,8 +6118,8 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "make-dir": { @@ -5942,7 +6128,7 @@ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { - "pify": "3.0.0" + "pify": "^3.0.0" } }, "map-obj": { @@ -5958,12 +6144,12 @@ "dev": true }, "matcher": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/matcher/-/matcher-1.1.0.tgz", - "integrity": "sha512-aZGv6JBTHqfqAd09jmAlbKnAICTfIvb5Z8gXVxPB5WZtFfHMaAMdACL7tQflD2V+6/8KNcY8s6DYtWLgpJP5lA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-1.1.1.tgz", + "integrity": "sha512-+BmqxWIubKTRKNWx/ahnCkk3mG8m7OturVlqq6HiojGJTd5hVYbgZm6WzcYPCoB+KBT4Vd6R7WSRG2OADNaCjg==", "dev": true, "requires": { - "escape-string-regexp": "1.0.5" + "escape-string-regexp": "^1.0.4" } }, "math-random": { @@ -5978,7 +6164,7 @@ "integrity": "sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=", "dev": true, "requires": { - "md5-o-matic": "0.1.1" + "md5-o-matic": "^0.1.1" } }, "md5-o-matic": { @@ -5993,7 +6179,7 @@ "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "dev": true, "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "meow": { @@ -6002,16 +6188,16 @@ "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "dev": true, "requires": { - "camelcase-keys": "2.1.0", - "decamelize": "1.2.0", - "loud-rejection": "1.6.0", - "map-obj": "1.0.1", - "minimist": "1.2.0", - "normalize-package-data": "2.4.0", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "redent": "1.0.0", - "trim-newlines": "1.0.0" + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" }, "dependencies": { "find-up": { @@ -6020,8 +6206,8 @@ "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "load-json-file": { @@ -6030,11 +6216,11 @@ "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" } }, "minimist": { @@ -6049,7 +6235,7 @@ "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { - "pinkie-promise": "2.0.1" + "pinkie-promise": "^2.0.0" } }, "path-type": { @@ -6058,9 +6244,9 @@ "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "pify": { @@ -6081,7 +6267,7 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "read-pkg": { @@ -6090,9 +6276,9 @@ "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" } }, "read-pkg-up": { @@ -6101,8 +6287,8 @@ "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" } }, "strip-bom": { @@ -6111,7 +6297,7 @@ "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "dev": true, "requires": { - "is-utf8": "0.2.1" + "is-utf8": "^0.2.0" } } } @@ -6128,14 +6314,9 @@ "integrity": "sha1-65aDOLXe1c7tgs7AMH3sui2OqZQ=", "dev": true, "requires": { - "estraverse": "4.2.0" + "estraverse": "^4.0.0" } }, - "methmeth": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/methmeth/-/methmeth-1.1.0.tgz", - "integrity": "sha1-6AomYY5S9cQiKGG7dIUQvRDikIk=" - }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -6148,19 +6329,19 @@ "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", "dev": true, "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" } }, "mime": { @@ -6178,7 +6359,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", "requires": { - "mime-db": "1.33.0" + "mime-db": "~1.33.0" } }, "mimic-fn": { @@ -6199,7 +6380,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -6236,11 +6417,6 @@ "supports-color": "5.4.0" } }, - "modelo": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/modelo/-/modelo-4.2.3.tgz", - "integrity": "sha512-9DITV2YEMcw7XojdfvGl3gDD8J9QjZTJ7ZOUuSAkP+F3T6rDbzMJuPktxptsdHYEvZcmXrCD3LMOhdSAEq6zKA==" - }, "module-not-found-error": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz", @@ -6248,9 +6424,9 @@ "dev": true }, "moment": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.1.tgz", - "integrity": "sha512-shJkRTSebXvsVqk56I+lkb2latjBs8I+pc2TzWc545y2iFnSjm7Wg0QMh+ZWcdSLQyGEau5jI8ocnmkyTgr9YQ==", + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", + "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=", "dev": true }, "ms": { @@ -6264,7 +6440,7 @@ "integrity": "sha1-sJ/IWG6qF/gdV1xK0C4Pej9rEQU=", "dev": true, "requires": { - "source-map": "0.1.43" + "source-map": "^0.1.34" }, "dependencies": { "source-map": { @@ -6273,7 +6449,7 @@ "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", "dev": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } @@ -6284,10 +6460,10 @@ "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", "dev": true, "requires": { - "array-differ": "1.0.0", - "array-union": "1.0.2", - "arrify": "1.0.1", - "minimatch": "3.0.4" + "array-differ": "^1.0.0", + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "minimatch": "^3.0.0" } }, "mute-stream": { @@ -6316,16 +6492,16 @@ "dev": true }, "nise": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.3.3.tgz", - "integrity": "sha512-v1J/FLUB9PfGqZLGDBhQqODkbLotP0WtLo9R4EJY2PPu5f5Xg4o0rA8FDlmrjFSv9vBBKcfnOSpfYYuu5RTHqg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.1.tgz", + "integrity": "sha512-9JX3YwoIt3kS237scmSSOpEv7vCukVzLfwK0I0XhocDSHUANid8ZHnLEULbbSkfeMn98B2y5kphIWzZUylESRQ==", "dev": true, "requires": { - "@sinonjs/formatio": "2.0.0", - "just-extend": "1.1.27", - "lolex": "2.6.0", - "path-to-regexp": "1.7.0", - "text-encoding": "0.6.4" + "@sinonjs/formatio": "^2.0.0", + "just-extend": "^1.1.27", + "lolex": "^2.3.2", + "path-to-regexp": "^1.7.0", + "text-encoding": "^0.6.4" } }, "node-forge": { @@ -6339,10 +6515,10 @@ "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { - "hosted-git-info": "2.6.0", - "is-builtin-module": "1.0.0", - "semver": "5.5.0", - "validate-npm-package-license": "3.0.3" + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "normalize-path": { @@ -6351,7 +6527,7 @@ "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "dev": true, "requires": { - "remove-trailing-separator": "1.1.0" + "remove-trailing-separator": "^1.0.1" } }, "normalize-url": { @@ -6360,9 +6536,9 @@ "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", "dev": true, "requires": { - "prepend-http": "2.0.0", - "query-string": "5.1.1", - "sort-keys": "2.0.0" + "prepend-http": "^2.0.0", + "query-string": "^5.0.1", + "sort-keys": "^2.0.0" }, "dependencies": { "prepend-http": { @@ -6379,7 +6555,7 @@ "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { - "path-key": "2.0.1" + "path-key": "^2.0.0" } }, "number-is-nan": { @@ -6389,38 +6565,38 @@ "dev": true }, "nyc": { - "version": "11.8.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.8.0.tgz", - "integrity": "sha512-PUFq1PSsx5OinSk5g5aaZygcDdI3QQT5XUlbR9QRMihtMS6w0Gm8xj4BxmKeeAlpQXC5M2DIhH16Y+KejceivQ==", - "dev": true, - "requires": { - "archy": "1.0.0", - "arrify": "1.0.1", - "caching-transform": "1.0.1", - "convert-source-map": "1.5.1", - "debug-log": "1.0.1", - "default-require-extensions": "1.0.0", - "find-cache-dir": "0.1.1", - "find-up": "2.1.0", - "foreground-child": "1.5.6", - "glob": "7.1.2", - "istanbul-lib-coverage": "1.2.0", - "istanbul-lib-hook": "1.1.0", - "istanbul-lib-instrument": "1.10.1", - "istanbul-lib-report": "1.1.3", - "istanbul-lib-source-maps": "1.2.3", - "istanbul-reports": "1.4.0", - "md5-hex": "1.3.0", - "merge-source-map": "1.1.0", - "micromatch": "3.1.10", - "mkdirp": "0.5.1", - "resolve-from": "2.0.0", - "rimraf": "2.6.2", - "signal-exit": "3.0.2", - "spawn-wrap": "1.4.2", - "test-exclude": "4.2.1", + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-12.0.2.tgz", + "integrity": "sha1-ikpO1pCWbBHsWH/4fuoMEsl0upk=", + "dev": true, + "requires": { + "archy": "^1.0.0", + "arrify": "^1.0.1", + "caching-transform": "^1.0.0", + "convert-source-map": "^1.5.1", + "debug-log": "^1.0.1", + "default-require-extensions": "^1.0.0", + "find-cache-dir": "^0.1.1", + "find-up": "^2.1.0", + "foreground-child": "^1.5.3", + "glob": "^7.0.6", + "istanbul-lib-coverage": "^1.2.0", + "istanbul-lib-hook": "^1.1.0", + "istanbul-lib-instrument": "^2.1.0", + "istanbul-lib-report": "^1.1.3", + "istanbul-lib-source-maps": "^1.2.5", + "istanbul-reports": "^1.4.1", + "md5-hex": "^1.2.0", + "merge-source-map": "^1.1.0", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.0", + "resolve-from": "^2.0.0", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.1", + "spawn-wrap": "^1.4.2", + "test-exclude": "^4.2.0", "yargs": "11.1.0", - "yargs-parser": "8.1.0" + "yargs-parser": "^8.0.0" }, "dependencies": { "align-text": { @@ -6428,9 +6604,9 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" } }, "amdefine": { @@ -6439,12 +6615,7 @@ "dev": true }, "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", + "version": "3.0.0", "bundled": true, "dev": true }, @@ -6453,7 +6624,7 @@ "bundled": true, "dev": true, "requires": { - "default-require-extensions": "1.0.0" + "default-require-extensions": "^1.0.0" } }, "archy": { @@ -6501,92 +6672,6 @@ "bundled": true, "dev": true }, - "babel-code-frame": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" - } - }, - "babel-generator": { - "version": "6.26.1", - "bundled": true, - "dev": true, - "requires": { - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "detect-indent": "4.0.0", - "jsesc": "1.3.0", - "lodash": "4.17.10", - "source-map": "0.5.7", - "trim-right": "1.0.1" - } - }, - "babel-messages": { - "version": "6.23.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } - }, - "babel-runtime": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "core-js": "2.5.6", - "regenerator-runtime": "0.11.1" - } - }, - "babel-template": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "lodash": "4.17.10" - } - }, - "babel-traverse": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "babel-code-frame": "6.26.0", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "debug": "2.6.9", - "globals": "9.18.0", - "invariant": "2.2.4", - "lodash": "4.17.10" - } - }, - "babel-types": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "esutils": "2.0.2", - "lodash": "4.17.10", - "to-fast-properties": "1.0.3" - } - }, - "babylon": { - "version": "6.18.0", - "bundled": true, - "dev": true - }, "balanced-match": { "version": "1.0.0", "bundled": true, @@ -6597,13 +6682,13 @@ "bundled": true, "dev": true, "requires": { - "cache-base": "1.0.1", - "class-utils": "0.3.6", - "component-emitter": "1.2.1", - "define-property": "1.0.0", - "isobject": "3.0.1", - "mixin-deep": "1.3.1", - "pascalcase": "0.1.1" + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" }, "dependencies": { "define-property": { @@ -6611,7 +6696,7 @@ "bundled": true, "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "is-accessor-descriptor": { @@ -6619,7 +6704,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -6627,7 +6712,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -6635,16 +6720,11 @@ "bundled": true, "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, "kind-of": { "version": "6.0.2", "bundled": true, @@ -6657,7 +6737,7 @@ "bundled": true, "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -6666,16 +6746,16 @@ "bundled": true, "dev": true, "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -6683,7 +6763,7 @@ "bundled": true, "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -6698,22 +6778,15 @@ "bundled": true, "dev": true, "requires": { - "collection-visit": "1.0.0", - "component-emitter": "1.2.1", - "get-value": "2.0.6", - "has-value": "1.0.0", - "isobject": "3.0.1", - "set-value": "2.0.0", - "to-object-path": "0.3.0", - "union-value": "1.0.0", - "unset-value": "1.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true - } + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" } }, "caching-transform": { @@ -6721,9 +6794,9 @@ "bundled": true, "dev": true, "requires": { - "md5-hex": "1.3.0", - "mkdirp": "0.5.1", - "write-file-atomic": "1.3.4" + "md5-hex": "^1.2.0", + "mkdirp": "^0.5.1", + "write-file-atomic": "^1.1.4" } }, "camelcase": { @@ -6738,20 +6811,8 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" - } - }, - "chalk": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" } }, "class-utils": { @@ -6759,10 +6820,10 @@ "bundled": true, "dev": true, "requires": { - "arr-union": "3.1.0", - "define-property": "0.2.5", - "isobject": "3.0.1", - "static-extend": "0.1.2" + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" }, "dependencies": { "define-property": { @@ -6770,13 +6831,8 @@ "bundled": true, "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } - }, - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true } } }, @@ -6786,8 +6842,8 @@ "dev": true, "optional": true, "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", + "center-align": "^0.1.1", + "right-align": "^0.1.1", "wordwrap": "0.0.2" }, "dependencies": { @@ -6809,8 +6865,8 @@ "bundled": true, "dev": true, "requires": { - "map-visit": "1.0.0", - "object-visit": "1.0.1" + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" } }, "commondir": { @@ -6838,22 +6894,17 @@ "bundled": true, "dev": true }, - "core-js": { - "version": "2.5.6", - "bundled": true, - "dev": true - }, "cross-spawn": { "version": "4.0.2", "bundled": true, "dev": true, "requires": { - "lru-cache": "4.1.3", - "which": "1.3.0" + "lru-cache": "^4.0.1", + "which": "^1.2.9" } }, "debug": { - "version": "2.6.9", + "version": "3.1.0", "bundled": true, "dev": true, "requires": { @@ -6880,7 +6931,7 @@ "bundled": true, "dev": true, "requires": { - "strip-bom": "2.0.0" + "strip-bom": "^2.0.0" } }, "define-property": { @@ -6888,8 +6939,8 @@ "bundled": true, "dev": true, "requires": { - "is-descriptor": "1.0.2", - "isobject": "3.0.1" + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" }, "dependencies": { "is-accessor-descriptor": { @@ -6897,7 +6948,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -6905,7 +6956,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -6913,16 +6964,11 @@ "bundled": true, "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, "kind-of": { "version": "6.0.2", "bundled": true, @@ -6930,44 +6976,26 @@ } } }, - "detect-indent": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "repeating": "2.0.1" - } - }, "error-ex": { "version": "1.3.1", "bundled": true, "dev": true, "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, - "escape-string-regexp": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "esutils": { - "version": "2.0.2", - "bundled": true, - "dev": true - }, "execa": { "version": "0.7.0", "bundled": true, "dev": true, "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" }, "dependencies": { "cross-spawn": { @@ -6975,9 +7003,9 @@ "bundled": true, "dev": true, "requires": { - "lru-cache": "4.1.3", - "shebang-command": "1.2.0", - "which": "1.3.0" + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } } } @@ -6987,21 +7015,29 @@ "bundled": true, "dev": true, "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "define-property": { "version": "0.2.5", "bundled": true, "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -7009,7 +7045,7 @@ "bundled": true, "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -7019,8 +7055,8 @@ "bundled": true, "dev": true, "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -7028,7 +7064,7 @@ "bundled": true, "dev": true, "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -7038,14 +7074,14 @@ "bundled": true, "dev": true, "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -7053,7 +7089,7 @@ "bundled": true, "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "extend-shallow": { @@ -7061,7 +7097,7 @@ "bundled": true, "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "is-accessor-descriptor": { @@ -7069,7 +7105,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -7077,7 +7113,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -7085,9 +7121,9 @@ "bundled": true, "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "kind-of": { @@ -7102,10 +7138,10 @@ "bundled": true, "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { "extend-shallow": { @@ -7113,7 +7149,7 @@ "bundled": true, "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -7123,9 +7159,9 @@ "bundled": true, "dev": true, "requires": { - "commondir": "1.0.1", - "mkdirp": "0.5.1", - "pkg-dir": "1.0.0" + "commondir": "^1.0.1", + "mkdirp": "^0.5.1", + "pkg-dir": "^1.0.0" } }, "find-up": { @@ -7133,7 +7169,7 @@ "bundled": true, "dev": true, "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "for-in": { @@ -7146,8 +7182,8 @@ "bundled": true, "dev": true, "requires": { - "cross-spawn": "4.0.2", - "signal-exit": "3.0.2" + "cross-spawn": "^4", + "signal-exit": "^3.0.0" } }, "fragment-cache": { @@ -7155,7 +7191,7 @@ "bundled": true, "dev": true, "requires": { - "map-cache": "0.2.2" + "map-cache": "^0.2.2" } }, "fs.realpath": { @@ -7183,19 +7219,14 @@ "bundled": true, "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, - "globals": { - "version": "9.18.0", - "bundled": true, - "dev": true - }, "graceful-fs": { "version": "4.1.11", "bundled": true, @@ -7206,10 +7237,10 @@ "bundled": true, "dev": true, "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.8.29" + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" }, "dependencies": { "source-map": { @@ -7217,74 +7248,36 @@ "bundled": true, "dev": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } }, - "has-ansi": { - "version": "2.0.0", + "has-value": { + "version": "1.0.0", "bundled": true, "dev": true, "requires": { - "ansi-regex": "2.1.1" + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" } }, - "has-flag": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "has-value": { + "has-values": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "1.0.0", - "isobject": "3.0.1" + "is-number": "^3.0.0", + "kind-of": "^4.0.0" }, "dependencies": { - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true - } - } - }, - "has-values": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, "kind-of": { "version": "4.0.0", "bundled": true, "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -7304,8 +7297,8 @@ "bundled": true, "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -7313,14 +7306,6 @@ "bundled": true, "dev": true }, - "invariant": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "requires": { - "loose-envify": "1.3.1" - } - }, "invert-kv": { "version": "1.0.0", "bundled": true, @@ -7331,7 +7316,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "is-arrayish": { @@ -7349,7 +7334,7 @@ "bundled": true, "dev": true, "requires": { - "builtin-modules": "1.1.1" + "builtin-modules": "^1.0.0" } }, "is-data-descriptor": { @@ -7357,7 +7342,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "is-descriptor": { @@ -7365,9 +7350,9 @@ "bundled": true, "dev": true, "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" }, "dependencies": { "kind-of": { @@ -7382,14 +7367,6 @@ "bundled": true, "dev": true }, - "is-finite": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, "is-fullwidth-code-point": { "version": "2.0.0", "bundled": true, @@ -7400,7 +7377,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "is-odd": { @@ -7408,7 +7385,7 @@ "bundled": true, "dev": true, "requires": { - "is-number": "4.0.0" + "is-number": "^4.0.0" }, "dependencies": { "is-number": { @@ -7423,14 +7400,7 @@ "bundled": true, "dev": true, "requires": { - "isobject": "3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true - } + "isobject": "^3.0.1" } }, "is-stream": { @@ -7473,21 +7443,7 @@ "bundled": true, "dev": true, "requires": { - "append-transform": "0.4.0" - } - }, - "istanbul-lib-instrument": { - "version": "1.10.1", - "bundled": true, - "dev": true, - "requires": { - "babel-generator": "6.26.1", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "istanbul-lib-coverage": "1.2.0", - "semver": "5.5.0" + "append-transform": "^0.4.0" } }, "istanbul-lib-report": { @@ -7495,68 +7451,53 @@ "bundled": true, "dev": true, "requires": { - "istanbul-lib-coverage": "1.2.0", - "mkdirp": "0.5.1", - "path-parse": "1.0.5", - "supports-color": "3.2.3" + "istanbul-lib-coverage": "^1.1.2", + "mkdirp": "^0.5.1", + "path-parse": "^1.0.5", + "supports-color": "^3.1.2" }, "dependencies": { + "has-flag": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, "supports-color": { "version": "3.2.3", "bundled": true, "dev": true, "requires": { - "has-flag": "1.0.0" + "has-flag": "^1.0.0" } } } }, "istanbul-lib-source-maps": { - "version": "1.2.3", + "version": "1.2.5", "bundled": true, "dev": true, "requires": { - "debug": "3.1.0", - "istanbul-lib-coverage": "1.2.0", - "mkdirp": "0.5.1", - "rimraf": "2.6.2", - "source-map": "0.5.7" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - } + "debug": "^3.1.0", + "istanbul-lib-coverage": "^1.2.0", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "source-map": "^0.5.3" } }, "istanbul-reports": { - "version": "1.4.0", + "version": "1.4.1", "bundled": true, "dev": true, "requires": { - "handlebars": "4.0.11" + "handlebars": "^4.0.3" } }, - "js-tokens": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "jsesc": { - "version": "1.3.0", - "bundled": true, - "dev": true - }, "kind-of": { "version": "3.2.2", "bundled": true, "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } }, "lazy-cache": { @@ -7570,7 +7511,7 @@ "bundled": true, "dev": true, "requires": { - "invert-kv": "1.0.0" + "invert-kv": "^1.0.0" } }, "load-json-file": { @@ -7578,11 +7519,11 @@ "bundled": true, "dev": true, "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" } }, "locate-path": { @@ -7590,8 +7531,8 @@ "bundled": true, "dev": true, "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" }, "dependencies": { "path-exists": { @@ -7601,31 +7542,18 @@ } } }, - "lodash": { - "version": "4.17.10", - "bundled": true, - "dev": true - }, "longest": { "version": "1.0.1", "bundled": true, "dev": true }, - "loose-envify": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "js-tokens": "3.0.2" - } - }, "lru-cache": { "version": "4.1.3", "bundled": true, "dev": true, "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "map-cache": { @@ -7638,7 +7566,7 @@ "bundled": true, "dev": true, "requires": { - "object-visit": "1.0.1" + "object-visit": "^1.0.0" } }, "md5-hex": { @@ -7646,7 +7574,7 @@ "bundled": true, "dev": true, "requires": { - "md5-o-matic": "0.1.1" + "md5-o-matic": "^0.1.1" } }, "md5-o-matic": { @@ -7659,7 +7587,7 @@ "bundled": true, "dev": true, "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "merge-source-map": { @@ -7667,7 +7595,7 @@ "bundled": true, "dev": true, "requires": { - "source-map": "0.6.1" + "source-map": "^0.6.1" }, "dependencies": { "source-map": { @@ -7682,19 +7610,19 @@ "bundled": true, "dev": true, "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.9", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" }, "dependencies": { "kind-of": { @@ -7714,7 +7642,7 @@ "bundled": true, "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -7727,8 +7655,8 @@ "bundled": true, "dev": true, "requires": { - "for-in": "1.0.2", - "is-extendable": "1.0.1" + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -7736,7 +7664,7 @@ "bundled": true, "dev": true, "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -7759,30 +7687,20 @@ "bundled": true, "dev": true, "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-odd": "2.0.0", - "is-windows": "1.0.2", - "kind-of": "6.0.2", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { - "arr-diff": { - "version": "4.0.0", - "bundled": true, - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "bundled": true, - "dev": true - }, "kind-of": { "version": "6.0.2", "bundled": true, @@ -7795,10 +7713,10 @@ "bundled": true, "dev": true, "requires": { - "hosted-git-info": "2.6.0", - "is-builtin-module": "1.0.0", - "semver": "5.5.0", - "validate-npm-package-license": "3.0.3" + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "npm-run-path": { @@ -7806,7 +7724,7 @@ "bundled": true, "dev": true, "requires": { - "path-key": "2.0.1" + "path-key": "^2.0.0" } }, "number-is-nan": { @@ -7824,9 +7742,9 @@ "bundled": true, "dev": true, "requires": { - "copy-descriptor": "0.1.1", - "define-property": "0.2.5", - "kind-of": "3.2.2" + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" }, "dependencies": { "define-property": { @@ -7834,7 +7752,7 @@ "bundled": true, "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } } } @@ -7844,14 +7762,7 @@ "bundled": true, "dev": true, "requires": { - "isobject": "3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true - } + "isobject": "^3.0.0" } }, "object.pick": { @@ -7859,14 +7770,7 @@ "bundled": true, "dev": true, "requires": { - "isobject": "3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true - } + "isobject": "^3.0.1" } }, "once": { @@ -7874,7 +7778,7 @@ "bundled": true, "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "optimist": { @@ -7882,8 +7786,8 @@ "bundled": true, "dev": true, "requires": { - "minimist": "0.0.8", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" } }, "os-homedir": { @@ -7896,9 +7800,9 @@ "bundled": true, "dev": true, "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" } }, "p-finally": { @@ -7911,7 +7815,7 @@ "bundled": true, "dev": true, "requires": { - "p-try": "1.0.0" + "p-try": "^1.0.0" } }, "p-locate": { @@ -7919,7 +7823,7 @@ "bundled": true, "dev": true, "requires": { - "p-limit": "1.2.0" + "p-limit": "^1.1.0" } }, "p-try": { @@ -7932,7 +7836,7 @@ "bundled": true, "dev": true, "requires": { - "error-ex": "1.3.1" + "error-ex": "^1.2.0" } }, "pascalcase": { @@ -7945,7 +7849,7 @@ "bundled": true, "dev": true, "requires": { - "pinkie-promise": "2.0.1" + "pinkie-promise": "^2.0.0" } }, "path-is-absolute": { @@ -7968,9 +7872,9 @@ "bundled": true, "dev": true, "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "pify": { @@ -7988,7 +7892,7 @@ "bundled": true, "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "pkg-dir": { @@ -7996,7 +7900,7 @@ "bundled": true, "dev": true, "requires": { - "find-up": "1.1.2" + "find-up": "^1.0.0" }, "dependencies": { "find-up": { @@ -8004,8 +7908,8 @@ "bundled": true, "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } } } @@ -8025,9 +7929,9 @@ "bundled": true, "dev": true, "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" } }, "read-pkg-up": { @@ -8035,8 +7939,8 @@ "bundled": true, "dev": true, "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" }, "dependencies": { "find-up": { @@ -8044,24 +7948,19 @@ "bundled": true, "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } } } }, - "regenerator-runtime": { - "version": "0.11.1", - "bundled": true, - "dev": true - }, "regex-not": { "version": "1.0.2", "bundled": true, "dev": true, "requires": { - "extend-shallow": "3.0.2", - "safe-regex": "1.1.0" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, "repeat-element": { @@ -8074,14 +7973,6 @@ "bundled": true, "dev": true }, - "repeating": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-finite": "1.0.2" - } - }, "require-directory": { "version": "2.1.1", "bundled": true, @@ -8113,7 +8004,7 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4" + "align-text": "^0.1.1" } }, "rimraf": { @@ -8121,7 +8012,7 @@ "bundled": true, "dev": true, "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "safe-regex": { @@ -8129,7 +8020,7 @@ "bundled": true, "dev": true, "requires": { - "ret": "0.1.15" + "ret": "~0.1.10" } }, "semver": { @@ -8147,10 +8038,10 @@ "bundled": true, "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "split-string": "3.1.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -8158,7 +8049,7 @@ "bundled": true, "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -8168,7 +8059,7 @@ "bundled": true, "dev": true, "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -8191,22 +8082,30 @@ "bundled": true, "dev": true, "requires": { - "base": "0.11.2", - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "map-cache": "0.2.2", - "source-map": "0.5.7", - "source-map-resolve": "0.5.1", - "use": "3.1.0" + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" }, "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "define-property": { "version": "0.2.5", "bundled": true, "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -8214,7 +8113,7 @@ "bundled": true, "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -8224,9 +8123,9 @@ "bundled": true, "dev": true, "requires": { - "define-property": "1.0.0", - "isobject": "3.0.1", - "snapdragon-util": "3.0.1" + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" }, "dependencies": { "define-property": { @@ -8234,7 +8133,7 @@ "bundled": true, "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "is-accessor-descriptor": { @@ -8242,7 +8141,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -8250,7 +8149,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -8258,16 +8157,11 @@ "bundled": true, "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, "kind-of": { "version": "6.0.2", "bundled": true, @@ -8280,7 +8174,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.2.0" } }, "source-map": { @@ -8289,15 +8183,15 @@ "dev": true }, "source-map-resolve": { - "version": "0.5.1", + "version": "0.5.2", "bundled": true, "dev": true, "requires": { - "atob": "2.1.1", - "decode-uri-component": "0.2.0", - "resolve-url": "0.2.1", - "source-map-url": "0.4.0", - "urix": "0.1.0" + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" } }, "source-map-url": { @@ -8310,12 +8204,12 @@ "bundled": true, "dev": true, "requires": { - "foreground-child": "1.5.6", - "mkdirp": "0.5.1", - "os-homedir": "1.0.2", - "rimraf": "2.6.2", - "signal-exit": "3.0.2", - "which": "1.3.0" + "foreground-child": "^1.5.6", + "mkdirp": "^0.5.0", + "os-homedir": "^1.0.1", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "which": "^1.3.0" } }, "spdx-correct": { @@ -8323,8 +8217,8 @@ "bundled": true, "dev": true, "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.0" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { @@ -8337,8 +8231,8 @@ "bundled": true, "dev": true, "requires": { - "spdx-exceptions": "2.1.0", - "spdx-license-ids": "3.0.0" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { @@ -8351,7 +8245,7 @@ "bundled": true, "dev": true, "requires": { - "extend-shallow": "3.0.2" + "extend-shallow": "^3.0.0" } }, "static-extend": { @@ -8359,8 +8253,8 @@ "bundled": true, "dev": true, "requires": { - "define-property": "0.2.5", - "object-copy": "0.1.0" + "define-property": "^0.2.5", + "object-copy": "^0.1.0" }, "dependencies": { "define-property": { @@ -8368,7 +8262,7 @@ "bundled": true, "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } } } @@ -8378,31 +8272,16 @@ "bundled": true, "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "3.0.0" - } - } + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { - "version": "3.0.1", + "version": "4.0.0", "bundled": true, "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^3.0.0" } }, "strip-bom": { @@ -8410,7 +8289,7 @@ "bundled": true, "dev": true, "requires": { - "is-utf8": "0.2.1" + "is-utf8": "^0.2.0" } }, "strip-eof": { @@ -8418,284 +8297,24 @@ "bundled": true, "dev": true }, - "supports-color": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, "test-exclude": { "version": "4.2.1", "bundled": true, "dev": true, "requires": { - "arrify": "1.0.1", - "micromatch": "3.1.10", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "require-main-filename": "1.0.1" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "bundled": true, - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "bundled": true, - "dev": true - }, - "braces": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "bundled": true, - "dev": true, - "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, - "kind-of": { - "version": "5.1.0", - "bundled": true, - "dev": true - } - } - }, - "extglob": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - }, - "is-number": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "bundled": true, - "dev": true, - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.9", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - } - } + "arrify": "^1.0.1", + "micromatch": "^3.1.8", + "object-assign": "^4.1.0", + "read-pkg-up": "^1.0.1", + "require-main-filename": "^1.0.1" } }, - "to-fast-properties": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, "to-object-path": { "version": "0.3.0", "bundled": true, "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "to-regex": { @@ -8703,10 +8322,10 @@ "bundled": true, "dev": true, "requires": { - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "regex-not": "1.0.2", - "safe-regex": "1.1.0" + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" } }, "to-regex-range": { @@ -8714,34 +8333,19 @@ "bundled": true, "dev": true, "requires": { - "is-number": "3.0.0", - "repeat-string": "1.6.1" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - } + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } }, - "trim-right": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, "uglify-js": { "version": "2.8.29", "bundled": true, "dev": true, "optional": true, "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" }, "dependencies": { "yargs": { @@ -8750,9 +8354,9 @@ "dev": true, "optional": true, "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", "window-size": "0.1.0" } } @@ -8769,10 +8373,10 @@ "bundled": true, "dev": true, "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" }, "dependencies": { "extend-shallow": { @@ -8780,7 +8384,7 @@ "bundled": true, "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "set-value": { @@ -8788,10 +8392,10 @@ "bundled": true, "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" } } } @@ -8801,8 +8405,8 @@ "bundled": true, "dev": true, "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" + "has-value": "^0.3.1", + "isobject": "^3.0.0" }, "dependencies": { "has-value": { @@ -8810,9 +8414,9 @@ "bundled": true, "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" }, "dependencies": { "isobject": { @@ -8829,11 +8433,6 @@ "version": "0.1.4", "bundled": true, "dev": true - }, - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true } } }, @@ -8847,7 +8446,7 @@ "bundled": true, "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.2" }, "dependencies": { "kind-of": { @@ -8862,16 +8461,16 @@ "bundled": true, "dev": true, "requires": { - "spdx-correct": "3.0.0", - "spdx-expression-parse": "3.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "which": { - "version": "1.3.0", + "version": "1.3.1", "bundled": true, "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -8895,16 +8494,21 @@ "bundled": true, "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "string-width": { @@ -8912,9 +8516,17 @@ "bundled": true, "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" } } } @@ -8929,9 +8541,9 @@ "bundled": true, "dev": true, "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "slide": "1.1.6" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" } }, "y18n": { @@ -8949,25 +8561,20 @@ "bundled": true, "dev": true, "requires": { - "cliui": "4.1.0", - "decamelize": "1.2.0", - "find-up": "2.1.0", - "get-caller-file": "1.0.2", - "os-locale": "2.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "9.0.2" + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, "camelcase": { "version": "4.1.0", "bundled": true, @@ -8978,17 +8585,9 @@ "bundled": true, "dev": true, "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "3.0.0" + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" } }, "yargs-parser": { @@ -8996,7 +8595,7 @@ "bundled": true, "dev": true, "requires": { - "camelcase": "4.1.0" + "camelcase": "^4.1.0" } } } @@ -9006,7 +8605,7 @@ "bundled": true, "dev": true, "requires": { - "camelcase": "4.1.0" + "camelcase": "^4.1.0" }, "dependencies": { "camelcase": { @@ -9041,8 +8640,8 @@ "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", "dev": true, "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" } }, "observable-to-promise": { @@ -9051,8 +8650,8 @@ "integrity": "sha1-yCjw8NxH6fhq+KSXfF1VB2znqR8=", "dev": true, "requires": { - "is-observable": "0.2.0", - "symbol-observable": "1.2.0" + "is-observable": "^0.2.0", + "symbol-observable": "^1.0.4" }, "dependencies": { "is-observable": { @@ -9061,7 +8660,7 @@ "integrity": "sha1-s2ExHYPG5dcmyr9eJQsCNxBvWuI=", "dev": true, "requires": { - "symbol-observable": "0.2.4" + "symbol-observable": "^0.2.2" }, "dependencies": { "symbol-observable": { @@ -9079,7 +8678,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "onetime": { @@ -9088,7 +8687,7 @@ "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "dev": true, "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "optimist": { @@ -9097,8 +8696,8 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "0.0.8", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" } }, "option-chain": { @@ -9113,12 +8712,12 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" }, "dependencies": { "wordwrap": { @@ -9141,9 +8740,9 @@ "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "dev": true, "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" } }, "os-tmpdir": { @@ -9171,12 +8770,12 @@ "dev": true }, "p-limit": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", - "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { - "p-try": "1.0.0" + "p-try": "^1.0.0" } }, "p-locate": { @@ -9185,7 +8784,7 @@ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "p-limit": "1.2.0" + "p-limit": "^1.1.0" } }, "p-timeout": { @@ -9194,7 +8793,7 @@ "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", "dev": true, "requires": { - "p-finally": "1.0.0" + "p-finally": "^1.0.0" } }, "p-try": { @@ -9209,10 +8808,10 @@ "integrity": "sha1-eK4ybIngWk2BO2hgGXevBcANKg0=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "lodash.flattendeep": "4.4.0", - "md5-hex": "2.0.0", - "release-zalgo": "1.0.0" + "graceful-fs": "^4.1.11", + "lodash.flattendeep": "^4.4.0", + "md5-hex": "^2.0.0", + "release-zalgo": "^1.0.0" } }, "package-json": { @@ -9221,10 +8820,10 @@ "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", "dev": true, "requires": { - "got": "6.7.1", - "registry-auth-token": "3.3.2", - "registry-url": "3.1.0", - "semver": "5.5.0" + "got": "^6.7.1", + "registry-auth-token": "^3.0.1", + "registry-url": "^3.0.3", + "semver": "^5.1.0" }, "dependencies": { "got": { @@ -9233,17 +8832,17 @@ "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", "dev": true, "requires": { - "create-error-class": "3.0.2", - "duplexer3": "0.1.4", - "get-stream": "3.0.0", - "is-redirect": "1.0.0", - "is-retry-allowed": "1.1.0", - "is-stream": "1.1.0", - "lowercase-keys": "1.0.1", - "safe-buffer": "5.1.2", - "timed-out": "4.0.1", - "unzip-response": "2.0.1", - "url-parse-lax": "1.0.0" + "create-error-class": "^3.0.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-redirect": "^1.0.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "lowercase-keys": "^1.0.0", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "unzip-response": "^2.0.1", + "url-parse-lax": "^1.0.0" } } } @@ -9254,10 +8853,10 @@ "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", "dev": true, "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" } }, "parse-json": { @@ -9266,7 +8865,7 @@ "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { - "error-ex": "1.3.1" + "error-ex": "^1.2.0" } }, "parse-ms": { @@ -9328,7 +8927,7 @@ "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", "dev": true, "requires": { - "pify": "2.3.0" + "pify": "^2.0.0" }, "dependencies": { "pify": { @@ -9361,7 +8960,7 @@ "integrity": "sha1-0dpn9UglY7t89X8oauKCLs+/NnA=", "dev": true, "requires": { - "pinkie": "1.0.0" + "pinkie": "^1.0.0" } }, "pkg-conf": { @@ -9370,8 +8969,8 @@ "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", "dev": true, "requires": { - "find-up": "2.1.0", - "load-json-file": "4.0.0" + "find-up": "^2.0.0", + "load-json-file": "^4.0.0" }, "dependencies": { "load-json-file": { @@ -9380,10 +8979,10 @@ "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "parse-json": "4.0.0", - "pify": "3.0.0", - "strip-bom": "3.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" } }, "parse-json": { @@ -9392,8 +8991,8 @@ "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "dev": true, "requires": { - "error-ex": "1.3.1", - "json-parse-better-errors": "1.0.2" + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" } } } @@ -9404,7 +9003,7 @@ "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", "dev": true, "requires": { - "find-up": "2.1.0" + "find-up": "^2.1.0" } }, "plur": { @@ -9413,7 +9012,7 @@ "integrity": "sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=", "dev": true, "requires": { - "irregular-plurals": "1.4.0" + "irregular-plurals": "^1.0.0" } }, "pluralize": { @@ -9428,9 +9027,9 @@ "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.4.1", - "source-map": "0.6.1", - "supports-color": "5.4.0" + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" }, "dependencies": { "source-map": { @@ -9447,11 +9046,11 @@ "integrity": "sha512-WaWSw+Ts283o6dzxW1BxIxoaHok7aSSGx4SaR6dW62Pk31ynv9DERDieuZpPYv5XaJ+H+zdcOaJQ+PvlasAOVw==", "dev": true, "requires": { - "define-properties": "1.1.2", - "empower": "1.2.3", - "power-assert-formatter": "1.4.1", - "universal-deep-strict-equal": "1.2.2", - "xtend": "4.0.1" + "define-properties": "^1.1.2", + "empower": "^1.2.3", + "power-assert-formatter": "^1.3.1", + "universal-deep-strict-equal": "^1.2.1", + "xtend": "^4.0.0" } }, "power-assert-context-formatter": { @@ -9460,8 +9059,8 @@ "integrity": "sha1-7bo1LT7YpgMRTWZyZazOYNaJzN8=", "dev": true, "requires": { - "core-js": "2.5.6", - "power-assert-context-traversal": "1.1.1" + "core-js": "^2.0.0", + "power-assert-context-traversal": "^1.1.1" } }, "power-assert-context-reducer-ast": { @@ -9470,11 +9069,11 @@ "integrity": "sha1-SEqZ4m9Jc/+IMuXFzHVnAuYJQXQ=", "dev": true, "requires": { - "acorn": "4.0.13", - "acorn-es7-plugin": "1.1.7", - "core-js": "2.5.6", - "espurify": "1.8.0", - "estraverse": "4.2.0" + "acorn": "^4.0.0", + "acorn-es7-plugin": "^1.0.12", + "core-js": "^2.0.0", + "espurify": "^1.6.0", + "estraverse": "^4.2.0" }, "dependencies": { "acorn": { @@ -9491,8 +9090,8 @@ "integrity": "sha1-iMq8oNE7Y1nwfT0+ivppkmRXftk=", "dev": true, "requires": { - "core-js": "2.5.6", - "estraverse": "4.2.0" + "core-js": "^2.0.0", + "estraverse": "^4.1.0" } }, "power-assert-formatter": { @@ -9501,13 +9100,13 @@ "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", "dev": true, "requires": { - "core-js": "2.5.6", - "power-assert-context-formatter": "1.1.1", - "power-assert-context-reducer-ast": "1.1.2", - "power-assert-renderer-assertion": "1.1.1", - "power-assert-renderer-comparison": "1.1.1", - "power-assert-renderer-diagram": "1.1.2", - "power-assert-renderer-file": "1.1.1" + "core-js": "^2.0.0", + "power-assert-context-formatter": "^1.0.7", + "power-assert-context-reducer-ast": "^1.0.7", + "power-assert-renderer-assertion": "^1.0.7", + "power-assert-renderer-comparison": "^1.0.7", + "power-assert-renderer-diagram": "^1.0.7", + "power-assert-renderer-file": "^1.0.7" } }, "power-assert-renderer-assertion": { @@ -9516,8 +9115,8 @@ "integrity": "sha1-y/wOd+AIao+Wrz8djme57n4ozpg=", "dev": true, "requires": { - "power-assert-renderer-base": "1.1.1", - "power-assert-util-string-width": "1.1.1" + "power-assert-renderer-base": "^1.1.1", + "power-assert-util-string-width": "^1.1.1" } }, "power-assert-renderer-base": { @@ -9532,11 +9131,11 @@ "integrity": "sha1-10Odl9hRVr5OMKAPL7WnJRTOPAg=", "dev": true, "requires": { - "core-js": "2.5.6", - "diff-match-patch": "1.0.1", - "power-assert-renderer-base": "1.1.1", - "stringifier": "1.3.0", - "type-name": "2.0.2" + "core-js": "^2.0.0", + "diff-match-patch": "^1.0.0", + "power-assert-renderer-base": "^1.1.1", + "stringifier": "^1.3.0", + "type-name": "^2.0.1" } }, "power-assert-renderer-diagram": { @@ -9545,10 +9144,10 @@ "integrity": "sha1-ZV+PcRk1qbbVQbhjJ2VHF8Y3qYY=", "dev": true, "requires": { - "core-js": "2.5.6", - "power-assert-renderer-base": "1.1.1", - "power-assert-util-string-width": "1.1.1", - "stringifier": "1.3.0" + "core-js": "^2.0.0", + "power-assert-renderer-base": "^1.1.1", + "power-assert-util-string-width": "^1.1.1", + "stringifier": "^1.3.0" } }, "power-assert-renderer-file": { @@ -9557,7 +9156,7 @@ "integrity": "sha1-o34rvReMys0E5427eckv40kzxec=", "dev": true, "requires": { - "power-assert-renderer-base": "1.1.1" + "power-assert-renderer-base": "^1.1.1" } }, "power-assert-util-string-width": { @@ -9566,7 +9165,7 @@ "integrity": "sha1-vmWet5N/3S5smncmjar2S9W3xZI=", "dev": true, "requires": { - "eastasianwidth": "0.1.1" + "eastasianwidth": "^0.1.1" } }, "prelude-ls": { @@ -9588,19 +9187,18 @@ "dev": true }, "prettier": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.12.1.tgz", - "integrity": "sha1-wa0g6APndJ+vkFpAnSNn4Gu+cyU=", + "version": "1.13.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.13.5.tgz", + "integrity": "sha512-4M90mfvLz6yRf2Dhzd+xPIE6b4xkI8nHMJhsSm9IlfG17g6wujrrm7+H1X8x52tC4cSNm6HmuhCUSNe6Hd5wfw==", "dev": true }, "pretty-ms": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-3.1.0.tgz", - "integrity": "sha1-6crJx2v27lL+lC3ZxsQhMVOxKIE=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-3.2.0.tgz", + "integrity": "sha512-ZypexbfVUGTFxb0v+m1bUyy92DHe5SyYlnyY0msyms5zd3RwyvNgyxZZsXXgoyzlxjx5MiqtXUdhUfvQbe0A2Q==", "dev": true, "requires": { - "parse-ms": "1.0.1", - "plur": "2.1.2" + "parse-ms": "^1.0.0" }, "dependencies": { "parse-ms": { @@ -9639,9 +9237,9 @@ "integrity": "sha512-fQr3VQrbdzHrdaDn3XuisVoJlJNDJizHAvUXw9IuXRR8BpV2x0N7LsCxrpJkeKfPbNjiNU/V5vc008cI0TmzzQ==", "dev": true, "requires": { - "fill-keys": "1.0.2", - "module-not-found-error": "1.0.1", - "resolve": "1.5.0" + "fill-keys": "^1.0.2", + "module-not-found-error": "^1.0.0", + "resolve": "~1.5.0" }, "dependencies": { "resolve": { @@ -9650,7 +9248,7 @@ "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", "dev": true, "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } } } @@ -9676,9 +9274,9 @@ "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", "dev": true, "requires": { - "decode-uri-component": "0.2.0", - "object-assign": "4.1.1", - "strict-uri-encode": "1.1.0" + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" } }, "randomatic": { @@ -9687,9 +9285,9 @@ "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", "dev": true, "requires": { - "is-number": "4.0.0", - "kind-of": "6.0.2", - "math-random": "1.0.1" + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" }, "dependencies": { "is-number": { @@ -9707,15 +9305,15 @@ } }, "rc": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.7.tgz", - "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "requires": { - "deep-extend": "0.5.1", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" }, "dependencies": { "minimist": { @@ -9732,9 +9330,9 @@ "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", "dev": true, "requires": { - "load-json-file": "2.0.0", - "normalize-package-data": "2.4.0", - "path-type": "2.0.0" + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" } }, "read-pkg-up": { @@ -9743,8 +9341,8 @@ "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", "dev": true, "requires": { - "find-up": "2.1.0", - "read-pkg": "2.0.0" + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" } }, "readable-stream": { @@ -9752,13 +9350,13 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, "readdirp": { @@ -9767,10 +9365,10 @@ "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "minimatch": "3.0.4", - "readable-stream": "2.3.6", - "set-immediate-shim": "1.0.1" + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "readable-stream": "^2.0.2", + "set-immediate-shim": "^1.0.1" } }, "redent": { @@ -9779,8 +9377,8 @@ "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", "dev": true, "requires": { - "indent-string": "2.1.0", - "strip-indent": "1.0.1" + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" }, "dependencies": { "indent-string": { @@ -9789,7 +9387,7 @@ "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", "dev": true, "requires": { - "repeating": "2.0.1" + "repeating": "^2.0.0" } } } @@ -9812,7 +9410,7 @@ "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "dev": true, "requires": { - "is-equal-shallow": "0.1.3" + "is-equal-shallow": "^0.1.3" } }, "regexpp": { @@ -9827,9 +9425,9 @@ "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", "dev": true, "requires": { - "regenerate": "1.4.0", - "regjsgen": "0.2.0", - "regjsparser": "0.1.5" + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" } }, "registry-auth-token": { @@ -9838,8 +9436,8 @@ "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", "dev": true, "requires": { - "rc": "1.2.7", - "safe-buffer": "5.1.2" + "rc": "^1.1.6", + "safe-buffer": "^5.0.1" } }, "registry-url": { @@ -9848,7 +9446,7 @@ "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", "dev": true, "requires": { - "rc": "1.2.7" + "rc": "^1.0.1" } }, "regjsgen": { @@ -9863,7 +9461,7 @@ "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", "dev": true, "requires": { - "jsesc": "0.5.0" + "jsesc": "~0.5.0" } }, "release-zalgo": { @@ -9872,7 +9470,7 @@ "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", "dev": true, "requires": { - "es6-error": "4.1.1" + "es6-error": "^4.0.1" } }, "remove-trailing-separator": { @@ -9899,7 +9497,7 @@ "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "dev": true, "requires": { - "is-finite": "1.0.2" + "is-finite": "^1.0.0" } }, "request": { @@ -9907,26 +9505,26 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.7.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.0.3", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.2", - "safe-buffer": "5.1.2", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.6.0", - "uuid": "3.2.1" + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" } }, "require-directory": { @@ -9953,8 +9551,8 @@ "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { - "caller-path": "0.1.0", - "resolve-from": "1.0.1" + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" }, "dependencies": { "resolve-from": { @@ -9971,7 +9569,7 @@ "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", "dev": true, "requires": { - "underscore": "1.6.0" + "underscore": "~1.6.0" }, "dependencies": { "underscore": { @@ -9994,7 +9592,7 @@ "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", "dev": true, "requires": { - "resolve-from": "3.0.0" + "resolve-from": "^3.0.0" } }, "resolve-from": { @@ -10009,7 +9607,7 @@ "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", "dev": true, "requires": { - "lowercase-keys": "1.0.1" + "lowercase-keys": "^1.0.0" } }, "restore-cursor": { @@ -10018,8 +9616,8 @@ "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "dev": true, "requires": { - "onetime": "2.0.1", - "signal-exit": "3.0.2" + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" } }, "retry-axios": { @@ -10028,12 +9626,12 @@ "integrity": "sha512-jp4YlI0qyDFfXiXGhkCOliBN1G7fRH03Nqy8YdShzGqbY5/9S2x/IR6C88ls2DFkbWuL3ASkP7QD3pVrNpPgwQ==" }, "retry-request": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-3.3.1.tgz", - "integrity": "sha512-PjAmtWIxjNj4Co/6FRtBl8afRP3CxrrIAnUzb1dzydfROd+6xt7xAebFeskgQgkfFf8NmzrXIoaB3HxmswXyxw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-3.3.2.tgz", + "integrity": "sha512-WIiGp37XXDC6e7ku3LFoi7LCL/Gs9luGeeqvbPRb+Zl6OQMw4RCRfSaW+aLfE6lhz1R941UavE6Svl3Dm5xGIQ==", "requires": { - "request": "2.87.0", - "through2": "2.0.3" + "request": "^2.81.0", + "through2": "^2.0.0" } }, "right-align": { @@ -10043,7 +9641,7 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4" + "align-text": "^0.1.1" } }, "rimraf": { @@ -10052,7 +9650,7 @@ "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "run-async": { @@ -10061,7 +9659,7 @@ "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", "dev": true, "requires": { - "is-promise": "2.1.0" + "is-promise": "^2.1.0" } }, "rx-lite": { @@ -10076,7 +9674,7 @@ "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", "dev": true, "requires": { - "rx-lite": "4.0.8" + "rx-lite": "*" } }, "safe-buffer": { @@ -10087,8 +9685,7 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "samsam": { "version": "1.3.0", @@ -10102,16 +9699,16 @@ "integrity": "sha512-52ThA+Z7h6BnvpSVbURwChl10XZrps5q7ytjTwWcIe9bmJwnVP6cpEVK2NvDOUhGupoqAvNbUz3cpnJDp4+/pg==", "dev": true, "requires": { - "chalk": "2.4.1", - "htmlparser2": "3.9.2", - "lodash.clonedeep": "4.5.0", - "lodash.escaperegexp": "4.1.2", - "lodash.isplainobject": "4.0.6", - "lodash.isstring": "4.0.1", - "lodash.mergewith": "4.6.1", - "postcss": "6.0.22", - "srcset": "1.0.0", - "xtend": "4.0.1" + "chalk": "^2.3.0", + "htmlparser2": "^3.9.0", + "lodash.clonedeep": "^4.5.0", + "lodash.escaperegexp": "^4.1.2", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.mergewith": "^4.6.0", + "postcss": "^6.0.14", + "srcset": "^1.0.0", + "xtend": "^4.0.0" } }, "semver": { @@ -10126,7 +9723,7 @@ "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", "dev": true, "requires": { - "semver": "5.5.0" + "semver": "^5.0.3" } }, "serialize-error": { @@ -10153,7 +9750,7 @@ "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -10174,13 +9771,13 @@ "integrity": "sha512-pmf05hFgEZUS52AGJcsVjOjqAyJW2yo14cOwVYvzCyw7+inv06YXkLyW75WG6X6p951lzkoKh51L2sNbR9CDvw==", "dev": true, "requires": { - "@sinonjs/formatio": "2.0.0", - "diff": "3.5.0", - "lodash.get": "4.4.2", - "lolex": "2.6.0", - "nise": "1.3.3", - "supports-color": "5.4.0", - "type-detect": "4.0.8" + "@sinonjs/formatio": "^2.0.0", + "diff": "^3.1.0", + "lodash.get": "^4.4.2", + "lolex": "^2.2.0", + "nise": "^1.2.0", + "supports-color": "^5.1.0", + "type-detect": "^4.0.5" } }, "slash": { @@ -10195,7 +9792,7 @@ "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0" + "is-fullwidth-code-point": "^2.0.0" } }, "slide": { @@ -10210,7 +9807,7 @@ "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", "dev": true, "requires": { - "is-plain-obj": "1.1.0" + "is-plain-obj": "^1.0.0" } }, "source-map": { @@ -10225,8 +9822,8 @@ "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==", "dev": true, "requires": { - "buffer-from": "1.0.0", - "source-map": "0.6.1" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" }, "dependencies": { "source-map": { @@ -10243,8 +9840,8 @@ "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "dev": true, "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.0" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { @@ -10259,8 +9856,8 @@ "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { - "spdx-exceptions": "2.1.0", - "spdx-license-ids": "3.0.0" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { @@ -10270,12 +9867,11 @@ "dev": true }, "split-array-stream": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/split-array-stream/-/split-array-stream-1.0.3.tgz", - "integrity": "sha1-0rdajl4Ngk1S/eyLgiWDncLjXfo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/split-array-stream/-/split-array-stream-2.0.0.tgz", + "integrity": "sha512-hmMswlVY91WvGMxs0k8MRgq8zb2mSen4FmDNc5AFiTWtrBpdZN6nwD6kROVe4vNL+ywrvbCKsWVCnEd4riELIg==", "requires": { - "async": "2.6.1", - "is-stream-ended": "0.1.4" + "is-stream-ended": "^0.1.4" } }, "sprintf-js": { @@ -10290,23 +9886,24 @@ "integrity": "sha1-pWad4StC87HV6D7QPHEEb8SPQe8=", "dev": true, "requires": { - "array-uniq": "1.0.3", - "number-is-nan": "1.0.1" + "array-uniq": "^1.0.2", + "number-is-nan": "^1.0.0" } }, "sshpk": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", - "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" } }, "stack-utils": { @@ -10320,7 +9917,7 @@ "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.4.tgz", "integrity": "sha512-D243NJaYs/xBN2QnoiMDY7IesJFIK7gEhnvAYqJa5JvDdnh2dC4qDBwlCf0ohPpX2QRlA/4gnbnPd3rs3KxVcA==", "requires": { - "stubs": "3.0.0" + "stubs": "^3.0.0" } }, "stream-shift": { @@ -10340,19 +9937,14 @@ "integrity": "sha1-XqIRzZLSKOGEKUmQpsyXs2anfLA=", "dev": true }, - "string-format-obj": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string-format-obj/-/string-format-obj-1.1.1.tgz", - "integrity": "sha512-Mm+sROy+pHJmx0P/0Bs1uxIX6UhGJGj6xDGQZ5zh9v/SZRmLGevp+p0VJxV7lirrkAmQ2mvva/gHKpnF/pTb+Q==" - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "string_decoder": { @@ -10360,7 +9952,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.0" } }, "stringifier": { @@ -10369,9 +9961,9 @@ "integrity": "sha1-3vGDQvaTPbDy2/yaoCF1tEjBeVk=", "dev": true, "requires": { - "core-js": "2.5.6", - "traverse": "0.6.6", - "type-name": "2.0.2" + "core-js": "^2.0.0", + "traverse": "^0.6.6", + "type-name": "^2.0.1" } }, "strip-ansi": { @@ -10380,7 +9972,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" }, "dependencies": { "ansi-regex": { @@ -10403,7 +9995,7 @@ "integrity": "sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI=", "dev": true, "requires": { - "is-utf8": "0.2.1" + "is-utf8": "^0.2.1" } }, "strip-eof": { @@ -10418,7 +10010,7 @@ "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", "dev": true, "requires": { - "get-stdin": "4.0.1" + "get-stdin": "^4.0.1" } }, "strip-json-comments": { @@ -10438,16 +10030,16 @@ "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", "dev": true, "requires": { - "component-emitter": "1.2.1", - "cookiejar": "2.1.1", - "debug": "3.1.0", - "extend": "3.0.1", - "form-data": "2.3.2", - "formidable": "1.2.1", - "methods": "1.1.2", - "mime": "1.6.0", - "qs": "6.5.2", - "readable-stream": "2.3.6" + "component-emitter": "^1.2.0", + "cookiejar": "^2.1.0", + "debug": "^3.1.0", + "extend": "^3.0.0", + "form-data": "^2.3.1", + "formidable": "^1.2.0", + "methods": "^1.1.1", + "mime": "^1.4.1", + "qs": "^6.5.1", + "readable-stream": "^2.3.5" }, "dependencies": { "mime": { @@ -10464,11 +10056,11 @@ "integrity": "sha512-HZJ3geIMPgVwKk2VsmO5YHqnnJYl6bV5A9JW2uzqV43WmpgliNEYbuvukfor7URpaqpxuw3CfZ3ONdVbZjCgIA==", "dev": true, "requires": { - "arrify": "1.0.1", - "indent-string": "3.2.0", - "js-yaml": "3.11.0", - "serialize-error": "2.1.0", - "strip-ansi": "4.0.0" + "arrify": "^1.0.1", + "indent-string": "^3.2.0", + "js-yaml": "^3.10.0", + "serialize-error": "^2.1.0", + "strip-ansi": "^4.0.0" } }, "supertest": { @@ -10477,8 +10069,8 @@ "integrity": "sha1-jUu2j9GDDuBwM7HFpamkAhyWUpY=", "dev": true, "requires": { - "methods": "1.1.2", - "superagent": "3.8.3" + "methods": "~1.1.2", + "superagent": "^3.0.0" } }, "supports-color": { @@ -10487,7 +10079,7 @@ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" }, "dependencies": { "has-flag": { @@ -10510,12 +10102,12 @@ "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", "dev": true, "requires": { - "ajv": "5.5.2", - "ajv-keywords": "2.1.1", - "chalk": "2.4.1", - "lodash": "4.17.10", + "ajv": "^5.2.3", + "ajv-keywords": "^2.1.0", + "chalk": "^2.1.0", + "lodash": "^4.17.4", "slice-ansi": "1.0.0", - "string-width": "2.1.1" + "string-width": "^2.1.1" } }, "taffydb": { @@ -10530,7 +10122,7 @@ "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", "dev": true, "requires": { - "execa": "0.7.0" + "execa": "^0.7.0" } }, "text-encoding": { @@ -10556,8 +10148,8 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", "requires": { - "readable-stream": "2.3.6", - "xtend": "4.0.1" + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" } }, "time-zone": { @@ -10578,7 +10170,7 @@ "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { - "os-tmpdir": "1.0.2" + "os-tmpdir": "~1.0.2" } }, "to-fast-properties": { @@ -10592,7 +10184,7 @@ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "requires": { - "punycode": "1.4.1" + "punycode": "^1.4.1" } }, "traverse": { @@ -10624,7 +10216,7 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.0.1" } }, "tweetnacl": { @@ -10639,7 +10231,7 @@ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, "type-detect": { @@ -10657,7 +10249,8 @@ "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true }, "uglify-js": { "version": "2.8.29", @@ -10666,9 +10259,9 @@ "dev": true, "optional": true, "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" }, "dependencies": { "camelcase": { @@ -10685,9 +10278,9 @@ "dev": true, "optional": true, "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", "window-size": "0.1.0" } } @@ -10735,7 +10328,7 @@ "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", "dev": true, "requires": { - "crypto-random-string": "1.0.0" + "crypto-random-string": "^1.0.0" } }, "unique-temp-dir": { @@ -10744,8 +10337,8 @@ "integrity": "sha1-bc6VsmgcoAPuv7MEpBX5y6vMU4U=", "dev": true, "requires": { - "mkdirp": "0.5.1", - "os-tmpdir": "1.0.2", + "mkdirp": "^0.5.1", + "os-tmpdir": "^1.0.1", "uid2": "0.0.3" } }, @@ -10755,9 +10348,9 @@ "integrity": "sha1-DaSsL3PP95JMgfpN4BjKViyisKc=", "dev": true, "requires": { - "array-filter": "1.0.0", + "array-filter": "^1.0.0", "indexof": "0.0.1", - "object-keys": "1.0.11" + "object-keys": "^1.0.0" } }, "universalify": { @@ -10778,16 +10371,16 @@ "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", "dev": true, "requires": { - "boxen": "1.3.0", - "chalk": "2.4.1", - "configstore": "3.1.2", - "import-lazy": "2.1.0", - "is-ci": "1.1.0", - "is-installed-globally": "0.1.0", - "is-npm": "1.0.0", - "latest-version": "3.1.0", - "semver-diff": "2.1.0", - "xdg-basedir": "3.0.0" + "boxen": "^1.2.1", + "chalk": "^2.0.1", + "configstore": "^3.0.0", + "import-lazy": "^2.1.0", + "is-ci": "^1.0.10", + "is-installed-globally": "^0.1.0", + "is-npm": "^1.0.0", + "latest-version": "^3.0.0", + "semver-diff": "^2.0.0", + "xdg-basedir": "^3.0.0" } }, "url-parse-lax": { @@ -10796,7 +10389,7 @@ "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", "dev": true, "requires": { - "prepend-http": "1.0.4" + "prepend-http": "^1.0.1" } }, "url-to-options": { @@ -10827,8 +10420,8 @@ "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", "dev": true, "requires": { - "spdx-correct": "3.0.0", - "spdx-expression-parse": "3.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "verror": { @@ -10836,9 +10429,9 @@ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "extsprintf": "^1.2.0" } }, "well-known-symbols": { @@ -10848,12 +10441,12 @@ "dev": true }, "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -10868,7 +10461,7 @@ "integrity": "sha1-AUKk6KJD+IgsAjOqDgKBqnYVInM=", "dev": true, "requires": { - "string-width": "2.1.1" + "string-width": "^2.1.1" } }, "window-size": { @@ -10890,8 +10483,8 @@ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" }, "dependencies": { "is-fullwidth-code-point": { @@ -10900,7 +10493,7 @@ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "string-width": { @@ -10909,9 +10502,9 @@ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "strip-ansi": { @@ -10920,7 +10513,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } } } @@ -10936,7 +10529,7 @@ "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", "dev": true, "requires": { - "mkdirp": "0.5.1" + "mkdirp": "^0.5.1" } }, "write-file-atomic": { @@ -10945,9 +10538,9 @@ "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "signal-exit": "3.0.2" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" } }, "write-json-file": { @@ -10956,12 +10549,12 @@ "integrity": "sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=", "dev": true, "requires": { - "detect-indent": "5.0.0", - "graceful-fs": "4.1.11", - "make-dir": "1.3.0", - "pify": "3.0.0", - "sort-keys": "2.0.0", - "write-file-atomic": "2.3.0" + "detect-indent": "^5.0.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "pify": "^3.0.0", + "sort-keys": "^2.0.0", + "write-file-atomic": "^2.0.0" }, "dependencies": { "detect-indent": { @@ -10973,13 +10566,13 @@ } }, "write-pkg": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-3.1.0.tgz", - "integrity": "sha1-AwqZlMyZk9JbTnWp8aGSNgcpHOk=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-3.2.0.tgz", + "integrity": "sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw==", "dev": true, "requires": { - "sort-keys": "2.0.0", - "write-json-file": "2.3.0" + "sort-keys": "^2.0.0", + "write-json-file": "^2.2.0" } }, "xdg-basedir": { @@ -11016,18 +10609,18 @@ "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", "dev": true, "requires": { - "cliui": "4.1.0", - "decamelize": "1.2.0", - "find-up": "2.1.0", - "get-caller-file": "1.0.2", - "os-locale": "2.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "9.0.2" + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" }, "dependencies": { "cliui": { @@ -11036,9 +10629,9 @@ "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" } } } @@ -11049,7 +10642,7 @@ "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", "dev": true, "requires": { - "camelcase": "4.1.0" + "camelcase": "^4.1.0" }, "dependencies": { "camelcase": { diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index ce83f811328..fef79feb009 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -56,28 +56,28 @@ "test": "repo-tools test run --cmd npm -- run cover" }, "dependencies": { - "@google-cloud/common": "^0.17.0", - "arrify": "^1.0.0", + "@google-cloud/common": "^0.19.2", + "arrify": "^1.0.1", "extend": "^3.0.1", - "is": "^3.0.1", - "is-html": "^1.0.0", - "propprop": "^0.3.0" + "is": "^3.2.1", + "is-html": "^1.1.0", + "propprop": "^0.3.1" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^2.2.3", - "async": "^2.5.0", - "codecov": "^3.0.0", - "eslint": "^4.9.0", - "eslint-config-prettier": "^2.6.0", - "eslint-plugin-node": "^6.0.0", - "eslint-plugin-prettier": "^2.3.1", - "ink-docstrap": "^1.3.0", + "@google-cloud/nodejs-repo-tools": "^2.3.0", + "async": "^2.6.1", + "codecov": "^3.0.2", + "eslint": "^4.19.1", + "eslint-config-prettier": "^2.9.0", + "eslint-plugin-node": "^6.0.1", + "eslint-plugin-prettier": "^2.6.0", + "ink-docstrap": "^1.3.2", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", - "mocha": "^5.0.0", + "mocha": "^5.2.0", "nyc": "^12.0.2", - "power-assert": "^1.4.4", - "prettier": "^1.7.4", - "proxyquire": "^2.0.0" + "power-assert": "^1.5.0", + "prettier": "^1.13.5", + "proxyquire": "^2.0.1" } } diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index bcd5b7effa2..6b117143add 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -15,12 +15,12 @@ }, "dependencies": { "@google-cloud/translate": "1.1.0", - "yargs": "10.0.3" + "yargs": "11.0.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "2.2.3", - "ava": "0.23.0", - "proxyquire": "1.8.0", - "sinon": "4.0.2" + "@google-cloud/nodejs-repo-tools": "2.3.0", + "ava": "0.25.0", + "proxyquire": "2.0.1", + "sinon": "5.1.1" } } From 266f7232e67e23d1585716de0da7ce14ce28ba26 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 12 Jun 2018 13:52:30 -0700 Subject: [PATCH 097/513] fix(package): update @google-cloud/common to version 0.20.0 (#49) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index fef79feb009..83e1e7e1ac2 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -56,7 +56,7 @@ "test": "repo-tools test run --cmd npm -- run cover" }, "dependencies": { - "@google-cloud/common": "^0.19.2", + "@google-cloud/common": "^0.20.0", "arrify": "^1.0.1", "extend": "^3.0.1", "is": "^3.2.1", From d2e275c1af74490483581f353fe3f7eeb0fc2274 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 17 Jun 2018 15:48:08 -0700 Subject: [PATCH 098/513] chore: update all dependencies (#50) --- .../google-cloud-translate/package-lock.json | 174 +++++++++--------- packages/google-cloud-translate/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 91 insertions(+), 87 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 26a75b6dbf3..8e2e7967f20 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -214,21 +214,21 @@ } }, "@google-cloud/common": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.19.2.tgz", - "integrity": "sha512-CuURBaMx6vUwLFpHLCYyLJXkg6EKYcrAfhH9Fva8C2B9dJ7flT8j/R+o05OuXwj4VQYC4c8bl/hrwyO+XvAwlg==", + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.20.0.tgz", + "integrity": "sha512-OCeDhpt+Qr90GxMFi54302Maf45Nux8ymF/jXgpPNElJUsjTmSN+Vzg3WmfAY+TYG9MDL2VufjjwlM4XrcNYcw==", "requires": { "@types/duplexify": "^3.5.0", "@types/request": "^2.47.0", "arrify": "^1.0.1", "axios": "^0.18.0", - "duplexify": "^3.5.4", + "duplexify": "^3.6.0", "ent": "^2.2.0", "extend": "^3.0.1", - "google-auth-library": "^1.4.0", + "google-auth-library": "^1.6.0", "is": "^3.2.1", "pify": "^3.0.0", - "request": "^2.85.0", + "request": "^2.87.0", "retry-request": "^3.3.1", "split-array-stream": "^2.0.0", "stream-events": "^1.0.4", @@ -1947,14 +1947,14 @@ } }, "@types/node": { - "version": "10.3.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.3.2.tgz", - "integrity": "sha512-9NfEUDp3tgRhmoxzTpTo+lq+KIVFxZahuRX0LHF/9IzKHaWuoWsIrrJ61zw5cnnlGINX8lqJzXYfQTOICS5Q+A==" + "version": "10.3.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.3.3.tgz", + "integrity": "sha512-/gwCgiI2e9RzzZTKbl+am3vgNqOt7a9fJ/uxv4SqYKxenoEDNVU3KZEadlpusWhQI0A0dOrZ0T68JYKVjzmgdQ==" }, "@types/request": { - "version": "2.47.0", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.47.0.tgz", - "integrity": "sha512-/KXM5oev+nNCLIgBjkwbk8VqxmzI56woD4VUxn95O+YeQ8hJzcSmIZ1IN3WexiqBb6srzDo2bdMbsXxgXNkz5Q==", + "version": "2.47.1", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.47.1.tgz", + "integrity": "sha512-TV3XLvDjQbIeVxJ1Z3oCTDk/KuYwwcNKVwz2YaT0F5u86Prgc4syDAp6P96rkTQQ4bIdh+VswQIC9zS6NjY7/g==", "requires": { "@types/caseless": "*", "@types/form-data": "*", @@ -1968,9 +1968,9 @@ "integrity": "sha512-MDQLxNFRLasqS4UlkWMSACMKeSm1x4Q3TxzUC7KQUsh6RK1ZrQ0VEyE3yzXcBu+K8ejVj4wuX32eUG02yNp+YQ==" }, "acorn": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.6.2.tgz", - "integrity": "sha512-zUzo1E5dI2Ey8+82egfnttyMlMZ2y0D8xOCO3PNPPlYXpl8NZvF6Qk9L9BEtJs+43FqEmfBViDqc5d1ckRDguw==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", + "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", "dev": true }, "acorn-es7-plugin": { @@ -3196,18 +3196,18 @@ } }, "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", + "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", "dev": true, "requires": { - "color-name": "^1.1.1" + "color-name": "1.1.1" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=", "dev": true }, "colors": { @@ -3621,9 +3621,9 @@ } }, "eastasianwidth": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.1.1.tgz", - "integrity": "sha1-RNZW3p2kFWlEZzNTZfsxR7hXK3w=", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, "ecc-jsbn": { @@ -3644,13 +3644,25 @@ } }, "empower": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/empower/-/empower-1.2.3.tgz", - "integrity": "sha1-bw2nNEf07dg4/sXGAxOoi6XLhSs=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/empower/-/empower-1.3.0.tgz", + "integrity": "sha512-tP2WqM7QzrPguCCQEQfFFDF+6Pw6YWLQal3+GHQaV+0uIr0S+jyREQPWljE02zFCYPFYLZ3LosiRV+OzTrxPpQ==", "dev": true, "requires": { "core-js": "^2.0.0", - "empower-core": "^0.6.2" + "empower-core": "^1.2.0" + }, + "dependencies": { + "empower-core": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-1.2.0.tgz", + "integrity": "sha512-g6+K6Geyc1o6FdXs9HwrXleCFan7d66G5xSCfSF7x1mJDCes6t0om9lFQG3zOrzh3Bkb/45N0cZ5Gqsf7YrzGQ==", + "dev": true, + "requires": { + "call-signature": "0.0.2", + "core-js": "^2.0.0" + } + } } }, "empower-assert": { @@ -3808,9 +3820,9 @@ "dev": true }, "escodegen": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz", - "integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.10.0.tgz", + "integrity": "sha512-fjUOf8johsv23WuIKdNQU4P9t9jhQ4Qzx6pC2uW890OloK3Zs1ZAoCNpg/2larNF501jLl3UNy0kIRcF6VI22g==", "dev": true, "requires": { "esprima": "^3.1.3", @@ -3931,9 +3943,9 @@ }, "dependencies": { "resolve": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", - "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.0.tgz", + "integrity": "sha512-MNcwJ8/K9iJqFDBDyhcxZuDWvf/ai0GcAJWetx2Cvvcz4HLfA8j0KasWR5Z6ChcbjYZ+FaczcXjN2jrCXCjQ4w==", "dev": true, "requires": { "path-parse": "^1.0.5" @@ -4022,17 +4034,17 @@ } }, "espower-source": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/espower-source/-/espower-source-2.2.0.tgz", - "integrity": "sha1-fgBSVa5HtcE2RIZEs/PYAtUD91I=", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/espower-source/-/espower-source-2.3.0.tgz", + "integrity": "sha512-Wc4kC4zUAEV7Qt31JRPoBUc5jjowHRylml2L2VaDQ1XEbnqQofGWx+gPR03TZAPokAMl5dqyL36h3ITyMXy3iA==", "dev": true, "requires": { "acorn": "^5.0.0", "acorn-es7-plugin": "^1.0.10", "convert-source-map": "^1.1.1", "empower-assert": "^1.0.0", - "escodegen": "^1.6.1", - "espower": "^2.0.0", + "escodegen": "^1.10.0", + "espower": "^2.1.1", "estraverse": "^4.0.0", "merge-estraverse-visitors": "^1.0.0", "multi-stage-sourcemap": "^0.2.1", @@ -6492,9 +6504,9 @@ "dev": true }, "nise": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.1.tgz", - "integrity": "sha512-9JX3YwoIt3kS237scmSSOpEv7vCukVzLfwK0I0XhocDSHUANid8ZHnLEULbbSkfeMn98B2y5kphIWzZUylESRQ==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.2.tgz", + "integrity": "sha512-BxH/DxoQYYdhKgVAfqVy4pzXRZELHOIewzoesxpjYvpU+7YOalQhGNPf7wAx8pLrTNPrHRDlLOkAl8UI0ZpXjw==", "dev": true, "requires": { "@sinonjs/formatio": "^2.0.0", @@ -9041,53 +9053,45 @@ } }, "power-assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.5.0.tgz", - "integrity": "sha512-WaWSw+Ts283o6dzxW1BxIxoaHok7aSSGx4SaR6dW62Pk31ynv9DERDieuZpPYv5XaJ+H+zdcOaJQ+PvlasAOVw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.6.0.tgz", + "integrity": "sha512-nDb6a+p2C7Wj8Y2zmFtLpuv+xobXz4+bzT5s7dr0nn71tLozn7nRMQqzwbefzwZN5qOm0N7Cxhw4kXP75xboKA==", "dev": true, "requires": { "define-properties": "^1.1.2", - "empower": "^1.2.3", - "power-assert-formatter": "^1.3.1", + "empower": "^1.3.0", + "power-assert-formatter": "^1.4.1", "universal-deep-strict-equal": "^1.2.1", "xtend": "^4.0.0" } }, "power-assert-context-formatter": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-context-formatter/-/power-assert-context-formatter-1.1.1.tgz", - "integrity": "sha1-7bo1LT7YpgMRTWZyZazOYNaJzN8=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-context-formatter/-/power-assert-context-formatter-1.2.0.tgz", + "integrity": "sha512-HLNEW8Bin+BFCpk/zbyKwkEu9W8/zThIStxGo7weYcFkKgMuGCHUJhvJeBGXDZf0Qm2xis4pbnnciGZiX0EpSg==", "dev": true, "requires": { "core-js": "^2.0.0", - "power-assert-context-traversal": "^1.1.1" + "power-assert-context-traversal": "^1.2.0" } }, "power-assert-context-reducer-ast": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.1.2.tgz", - "integrity": "sha1-SEqZ4m9Jc/+IMuXFzHVnAuYJQXQ=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.2.0.tgz", + "integrity": "sha512-EgOxmZ/Lb7tw4EwSKX7ZnfC0P/qRZFEG28dx/690qvhmOJ6hgThYFm5TUWANDLK5NiNKlPBi5WekVGd2+5wPrw==", "dev": true, "requires": { - "acorn": "^4.0.0", + "acorn": "^5.0.0", "acorn-es7-plugin": "^1.0.12", "core-js": "^2.0.0", "espurify": "^1.6.0", "estraverse": "^4.2.0" - }, - "dependencies": { - "acorn": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", - "dev": true - } } }, "power-assert-context-traversal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-context-traversal/-/power-assert-context-traversal-1.1.1.tgz", - "integrity": "sha1-iMq8oNE7Y1nwfT0+ivppkmRXftk=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-context-traversal/-/power-assert-context-traversal-1.2.0.tgz", + "integrity": "sha512-NFoHU6g2umNajiP2l4qb0BRWD773Aw9uWdWYH9EQsVwIZnog5bd2YYLFCVvaxWpwNzWeEfZIon2xtyc63026pQ==", "dev": true, "requires": { "core-js": "^2.0.0", @@ -9110,13 +9114,13 @@ } }, "power-assert-renderer-assertion": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.1.1.tgz", - "integrity": "sha1-y/wOd+AIao+Wrz8djme57n4ozpg=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.2.0.tgz", + "integrity": "sha512-3F7Q1ZLmV2ZCQv7aV7NJLNK9G7QsostrhOU7U0RhEQS/0vhEqrRg2jEJl1jtUL4ZyL2dXUlaaqrmPv5r9kRvIg==", "dev": true, "requires": { "power-assert-renderer-base": "^1.1.1", - "power-assert-util-string-width": "^1.1.1" + "power-assert-util-string-width": "^1.2.0" } }, "power-assert-renderer-base": { @@ -9126,9 +9130,9 @@ "dev": true }, "power-assert-renderer-comparison": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.1.1.tgz", - "integrity": "sha1-10Odl9hRVr5OMKAPL7WnJRTOPAg=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.2.0.tgz", + "integrity": "sha512-7c3RKPDBKK4E3JqdPtYRE9cM8AyX4LC4yfTvvTYyx8zSqmT5kJnXwzR0yWQLOavACllZfwrAGQzFiXPc5sWa+g==", "dev": true, "requires": { "core-js": "^2.0.0", @@ -9139,33 +9143,33 @@ } }, "power-assert-renderer-diagram": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.1.2.tgz", - "integrity": "sha1-ZV+PcRk1qbbVQbhjJ2VHF8Y3qYY=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.2.0.tgz", + "integrity": "sha512-JZ6PC+DJPQqfU6dwSmpcoD7gNnb/5U77bU5KgNwPPa+i1Pxiz6UuDeM3EUBlhZ1HvH9tMjI60anqVyi5l2oNdg==", "dev": true, "requires": { "core-js": "^2.0.0", "power-assert-renderer-base": "^1.1.1", - "power-assert-util-string-width": "^1.1.1", + "power-assert-util-string-width": "^1.2.0", "stringifier": "^1.3.0" } }, "power-assert-renderer-file": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-renderer-file/-/power-assert-renderer-file-1.1.1.tgz", - "integrity": "sha1-o34rvReMys0E5427eckv40kzxec=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-renderer-file/-/power-assert-renderer-file-1.2.0.tgz", + "integrity": "sha512-/oaVrRbeOtGoyyd7e4IdLP/jIIUFJdqJtsYzP9/88R39CMnfF/S/rUc8ZQalENfUfQ/wQHu+XZYRMaCEZmEesg==", "dev": true, "requires": { "power-assert-renderer-base": "^1.1.1" } }, "power-assert-util-string-width": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-util-string-width/-/power-assert-util-string-width-1.1.1.tgz", - "integrity": "sha1-vmWet5N/3S5smncmjar2S9W3xZI=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-util-string-width/-/power-assert-util-string-width-1.2.0.tgz", + "integrity": "sha512-lX90G0igAW0iyORTILZ/QjZWsa1MZ6VVY3L0K86e2eKun3S4LKPH4xZIl8fdeMYLfOjkaszbNSzf1uugLeAm2A==", "dev": true, "requires": { - "eastasianwidth": "^0.1.1" + "eastasianwidth": "^0.2.0" } }, "prelude-ls": { diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 83e1e7e1ac2..783761c7008 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -76,7 +76,7 @@ "jsdoc": "^3.5.5", "mocha": "^5.2.0", "nyc": "^12.0.2", - "power-assert": "^1.5.0", + "power-assert": "^1.6.0", "prettier": "^1.13.5", "proxyquire": "^2.0.1" } diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 6b117143add..af85f10f76c 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -21,6 +21,6 @@ "@google-cloud/nodejs-repo-tools": "2.3.0", "ava": "0.25.0", "proxyquire": "2.0.1", - "sinon": "5.1.1" + "sinon": "6.0.0" } } From c0234479d682980cc684cddd9e9b4344c1a001b1 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Sun, 17 Jun 2018 15:52:35 -0700 Subject: [PATCH 099/513] chore: the ultimate fix for repo-tools EPERM (#45) --- .../.circleci/config.yml | 51 +++++++------------ 1 file changed, 17 insertions(+), 34 deletions(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 46039168b35..3f67f8f0399 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -4,25 +4,17 @@ workflows: tests: jobs: &workflow_jobs - node4: - filters: + filters: &all_commits tags: only: /.*/ - node6: - filters: - tags: - only: /.*/ + filters: *all_commits - node8: - filters: - tags: - only: /.*/ + filters: *all_commits - node9: - filters: - tags: - only: /.*/ + filters: *all_commits - node10: - filters: - tags: - only: /.*/ + filters: *all_commits - lint: requires: - node4 @@ -30,9 +22,7 @@ workflows: - node8 - node9 - node10 - filters: - tags: - only: /.*/ + filters: *all_commits - docs: requires: - node4 @@ -40,27 +30,21 @@ workflows: - node8 - node9 - node10 - filters: - tags: - only: /.*/ + filters: *all_commits - system_tests: requires: - lint - docs - filters: + filters: &master_and_releases branches: only: master - tags: + tags: &releases only: '/^v[\d.]+$/' - sample_tests: requires: - lint - docs - filters: - branches: - only: master - tags: - only: '/^v[\d.]+$/' + filters: *master_and_releases - publish_npm: requires: - system_tests @@ -68,8 +52,7 @@ workflows: filters: branches: ignore: /.*/ - tags: - only: '/^v[\d.]+$/' + tags: *releases nightly: triggers: - schedule: @@ -96,14 +79,14 @@ jobs: echo "Not a nightly build, skipping this step." fi - run: &npm_install_and_link - name: Install and link the module. - command: | + name: Install and link the module + command: |- + mkdir -p /home/node/.npm-global npm install - repo_tools="node_modules/@google-cloud/nodejs-repo-tools/bin/tools" - if ! test -x "$repo_tools"; then - chmod +x "$repo_tools" - fi npm link + chmod +x node_modules/@google-cloud/nodejs-repo-tools/bin/tools + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global - run: name: Run unit tests. command: npm test From 4150a66cabcb8328b64b8521868b3d20bf9d0121 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sat, 23 Jun 2018 14:53:37 -0700 Subject: [PATCH 100/513] chore(package): update eslint to version 5.0.0 (#53) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 783761c7008..69722a683e5 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -67,7 +67,7 @@ "@google-cloud/nodejs-repo-tools": "^2.3.0", "async": "^2.6.1", "codecov": "^3.0.2", - "eslint": "^4.19.1", + "eslint": "^5.0.0", "eslint-config-prettier": "^2.9.0", "eslint-plugin-node": "^6.0.1", "eslint-plugin-prettier": "^2.6.0", From 5251e3a05cc2e73046ec8f68b9f110b846b2a927 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 25 Jun 2018 07:06:58 -0700 Subject: [PATCH 101/513] fix: update linking for samples (#54) --- packages/google-cloud-translate/.circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 3f67f8f0399..f85e8062626 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -83,7 +83,6 @@ jobs: command: |- mkdir -p /home/node/.npm-global npm install - npm link chmod +x node_modules/@google-cloud/nodejs-repo-tools/bin/tools environment: NPM_CONFIG_PREFIX: /home/node/.npm-global @@ -121,9 +120,8 @@ jobs: name: Link the module being tested to the samples. command: | cd samples/ - npm link @google-cloud/translate npm install - cd .. + npm link ../ - run: name: Run linting. command: npm run lint From 0adf8206649df5426826b981e88c7da22aaa7665 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 25 Jun 2018 22:50:52 -0700 Subject: [PATCH 102/513] refactor: drop repo-tool as an exec wrapper (#56) --- packages/google-cloud-translate/.circleci/config.yml | 1 - packages/google-cloud-translate/package.json | 12 ++++++------ packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index f85e8062626..739dd2fdbe3 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -83,7 +83,6 @@ jobs: command: |- mkdir -p /home/node/.npm-global npm install - chmod +x node_modules/@google-cloud/nodejs-repo-tools/bin/tools environment: NPM_CONFIG_PREFIX: /home/node/.npm-global - run: diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 69722a683e5..c45f195181b 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -45,15 +45,15 @@ ], "scripts": { "cover": "nyc --reporter=lcov mocha --require intelli-espower-loader test/*.js && nyc report", - "docs": "repo-tools exec -- jsdoc -c .jsdoc.js", + "docs": "jsdoc -c .jsdoc.js", "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", - "lint": "repo-tools lint --cmd eslint -- src/ samples/ system-test/ test/", - "prettier": "repo-tools exec -- prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", + "lint": "eslint src/ samples/ system-test/ test/", + "prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", "publish-module": "node ../../scripts/publish.js translate", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "repo-tools test run --cmd mocha -- system-test/*.js --timeout 600000", - "test-no-cover": "repo-tools test run --cmd mocha -- test/*.js --no-timeouts", - "test": "repo-tools test run --cmd npm -- run cover" + "system-test": "mocha system-test/*.js --timeout 600000", + "test-no-cover": "mocha test/*.js --no-timeouts", + "test": "npm run cover" }, "dependencies": { "@google-cloud/common": "^0.20.0", diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index af85f10f76c..c042799da55 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -11,7 +11,7 @@ "scripts": { "ava": "ava -T 20s --verbose test/*.test.js ./system-test/*.test.js", "cover": "nyc --reporter=lcov --cache ava -T 20s --verbose test/*.test.js ./system-test/*.test.js && nyc report", - "test": "repo-tools test run --cmd npm -- run cover" + "test": "npm run cover" }, "dependencies": { "@google-cloud/translate": "1.1.0", From 747fb63eea67ae0ee49581f24e7207fc2a68a899 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 26 Jun 2018 21:37:28 -0700 Subject: [PATCH 103/513] chore(deps): update dependency sinon to v6.0.1 (#57) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index c042799da55..5dab901ccc6 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -21,6 +21,6 @@ "@google-cloud/nodejs-repo-tools": "2.3.0", "ava": "0.25.0", "proxyquire": "2.0.1", - "sinon": "6.0.0" + "sinon": "6.0.1" } } From 77267ba8c0fd0e4eb824fdff3958e08a4fd8e971 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 29 Jun 2018 15:40:35 -0700 Subject: [PATCH 104/513] fix(deps): update dependency yargs to v12 (#59) --- .../google-cloud-translate/samples/package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 5dab901ccc6..c2ce8b0b417 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -6,7 +6,7 @@ "author": "Google Inc.", "repository": "googleapis/nodejs-translate", "engines": { - "node": ">=4.0.0" + "node": ">=6.0.0" }, "scripts": { "ava": "ava -T 20s --verbose test/*.test.js ./system-test/*.test.js", @@ -14,13 +14,13 @@ "test": "npm run cover" }, "dependencies": { - "@google-cloud/translate": "1.1.0", - "yargs": "11.0.0" + "@google-cloud/translate": "^1.1.0", + "yargs": "^12.0.1" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "2.3.0", - "ava": "0.25.0", - "proxyquire": "2.0.1", - "sinon": "6.0.1" + "@google-cloud/nodejs-repo-tools": "^2.3.0", + "ava": "^0.25.0", + "proxyquire": "^2.0.1", + "sinon": "^6.0.1" } } From 8a58d7c9326734884de8892a3acade037aa56d09 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 2 Jul 2018 20:52:01 -0700 Subject: [PATCH 105/513] chore(deps): lock file maintenance (#60) --- .../google-cloud-translate/package-lock.json | 536 +++++++++++------- 1 file changed, 345 insertions(+), 191 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 8e2e7967f20..41feba6e040 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -72,21 +72,21 @@ } }, "@babel/code-frame": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.49.tgz", - "integrity": "sha1-vs2AVIJzREDJ0TfkbXc0DmTX9Rs=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz", + "integrity": "sha1-vXHZsZKvl435FYKdOdQJRFZDmgw=", "dev": true, "requires": { - "@babel/highlight": "7.0.0-beta.49" + "@babel/highlight": "7.0.0-beta.51" } }, "@babel/generator": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.49.tgz", - "integrity": "sha1-6c/9qROZaszseTu8JauRvBnQv3o=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.51.tgz", + "integrity": "sha1-bHV1/952HQdIXgS67cA5LG2eMPY=", "dev": true, "requires": { - "@babel/types": "7.0.0-beta.49", + "@babel/types": "7.0.0-beta.51", "jsesc": "^2.5.1", "lodash": "^4.17.5", "source-map": "^0.5.0", @@ -102,38 +102,38 @@ } }, "@babel/helper-function-name": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.49.tgz", - "integrity": "sha1-olwRGbnwNSeGcBJuAiXAMEHI3jI=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.51.tgz", + "integrity": "sha1-IbSHSiJ8+Z7K/MMKkDAtpaJkBWE=", "dev": true, "requires": { - "@babel/helper-get-function-arity": "7.0.0-beta.49", - "@babel/template": "7.0.0-beta.49", - "@babel/types": "7.0.0-beta.49" + "@babel/helper-get-function-arity": "7.0.0-beta.51", + "@babel/template": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51" } }, "@babel/helper-get-function-arity": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.49.tgz", - "integrity": "sha1-z1Aj8y0q2S0Ic3STnOwJUby1FEE=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.51.tgz", + "integrity": "sha1-MoGy0EWvlcFyzpGyCCXYXqRnZBE=", "dev": true, "requires": { - "@babel/types": "7.0.0-beta.49" + "@babel/types": "7.0.0-beta.51" } }, "@babel/helper-split-export-declaration": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.49.tgz", - "integrity": "sha1-QNeO2glo0BGxxShm5XRs+yPldUg=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.51.tgz", + "integrity": "sha1-imw/ZsTSZTUvwHdIT59ugKUauXg=", "dev": true, "requires": { - "@babel/types": "7.0.0-beta.49" + "@babel/types": "7.0.0-beta.51" } }, "@babel/highlight": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.49.tgz", - "integrity": "sha1-lr3GtD4TSCASumaRsQGEktOWIsw=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.51.tgz", + "integrity": "sha1-6IRK4loVlcz9QriWI7Q3bKBtIl0=", "dev": true, "requires": { "chalk": "^2.0.0", @@ -142,35 +142,35 @@ } }, "@babel/parser": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.0.0-beta.49.tgz", - "integrity": "sha1-lE0MW6KBK7FZ7b0iZ0Ov0mUXm9w=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.0.0-beta.51.tgz", + "integrity": "sha1-J87C30Cd9gr1gnDtj2qlVAnqhvY=", "dev": true }, "@babel/template": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.49.tgz", - "integrity": "sha1-44q+ghfLl5P0YaUwbXrXRdg+HSc=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.51.tgz", + "integrity": "sha1-lgKkCuvPNXrpZ34lMu9fyBD1+/8=", "dev": true, "requires": { - "@babel/code-frame": "7.0.0-beta.49", - "@babel/parser": "7.0.0-beta.49", - "@babel/types": "7.0.0-beta.49", + "@babel/code-frame": "7.0.0-beta.51", + "@babel/parser": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", "lodash": "^4.17.5" } }, "@babel/traverse": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.49.tgz", - "integrity": "sha1-TypzaCoYM07WYl0QCo0nMZ98LWg=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.51.tgz", + "integrity": "sha1-mB2vLOw0emIx06odnhgDsDqqpKg=", "dev": true, "requires": { - "@babel/code-frame": "7.0.0-beta.49", - "@babel/generator": "7.0.0-beta.49", - "@babel/helper-function-name": "7.0.0-beta.49", - "@babel/helper-split-export-declaration": "7.0.0-beta.49", - "@babel/parser": "7.0.0-beta.49", - "@babel/types": "7.0.0-beta.49", + "@babel/code-frame": "7.0.0-beta.51", + "@babel/generator": "7.0.0-beta.51", + "@babel/helper-function-name": "7.0.0-beta.51", + "@babel/helper-split-export-declaration": "7.0.0-beta.51", + "@babel/parser": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", "debug": "^3.1.0", "globals": "^11.1.0", "invariant": "^2.2.0", @@ -178,17 +178,17 @@ }, "dependencies": { "globals": { - "version": "11.5.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", - "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", + "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", "dev": true } } }, "@babel/types": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.49.tgz", - "integrity": "sha1-t+Oxw/TUz+Eb34yJ8e/V4WF7h6Y=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.51.tgz", + "integrity": "sha1-2AK3tUO1g2x3iqaReXq/APPZfqk=", "dev": true, "requires": { "esutils": "^2.0.2", @@ -214,9 +214,9 @@ } }, "@google-cloud/common": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.20.0.tgz", - "integrity": "sha512-OCeDhpt+Qr90GxMFi54302Maf45Nux8ymF/jXgpPNElJUsjTmSN+Vzg3WmfAY+TYG9MDL2VufjjwlM4XrcNYcw==", + "version": "0.20.3", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.20.3.tgz", + "integrity": "sha512-jt8/R4EqDTQccv5WA9AEaS65llM5+mlxsuWu57G5Os8HTIpgPbcsOVMUeIvmTrBuPUYSoRIMW8d/pvv/95n0+g==", "requires": { "@types/duplexify": "^3.5.0", "@types/request": "^2.47.0", @@ -229,7 +229,7 @@ "is": "^3.2.1", "pify": "^3.0.0", "request": "^2.87.0", - "retry-request": "^3.3.1", + "retry-request": "^4.0.0", "split-array-stream": "^2.0.0", "stream-events": "^1.0.4", "through2": "^2.0.3" @@ -1947,9 +1947,9 @@ } }, "@types/node": { - "version": "10.3.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.3.3.tgz", - "integrity": "sha512-/gwCgiI2e9RzzZTKbl+am3vgNqOt7a9fJ/uxv4SqYKxenoEDNVU3KZEadlpusWhQI0A0dOrZ0T68JYKVjzmgdQ==" + "version": "10.5.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.1.tgz", + "integrity": "sha512-AFLl1IALIuyt6oK4AYZsgWVJ/5rnyzQWud7IebaZWWV3YmgtPZkQmYio9R5Ze/2pdd7XfqF5bP+hWS11mAKoOQ==" }, "@types/request": { "version": "2.47.1", @@ -1980,20 +1980,12 @@ "dev": true }, "acorn-jsx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-4.1.1.tgz", + "integrity": "sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw==", "dev": true, "requires": { - "acorn": "^3.0.4" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", - "dev": true - } + "acorn": "^5.0.3" } }, "ajv": { @@ -2008,9 +2000,9 @@ } }, "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", "dev": true }, "align-text": { @@ -2195,9 +2187,9 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "auto-bind": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-1.2.0.tgz", - "integrity": "sha512-Zw7pZp7tztvKnWWtoII4AmqH5a2PV3ZN5F0BPRTGcc1kpRm4b6QXQnPU7Znbl6BfPfqOVOV29g4JeMqZQaqqOA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-1.2.1.tgz", + "integrity": "sha512-/W9yj1yKmBLwpexwAujeD9YHwYmRuWFGV8HWE7smQab797VeHa4/cnE2NFeDhA+E+5e/OGBI8763EhLjfZ/MXA==", "dev": true }, "ava": { @@ -2801,9 +2793,9 @@ "dev": true }, "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "optional": true, "requires": { "tweetnacl": "^0.14.3" @@ -3254,18 +3246,6 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, "concordance": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/concordance/-/concordance-3.0.0.tgz", @@ -3710,14 +3690,38 @@ "dev": true }, "error-ex": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "^0.2.1" } }, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "^1.1.1", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.1" + } + }, "es5-ext": { "version": "0.10.45", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.45.tgz", @@ -3860,55 +3864,92 @@ } }, "eslint": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", - "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.0.1.tgz", + "integrity": "sha512-D5nG2rErquLUstgUaxJlWB5+gu+U/3VDY0fk/Iuq8y9CUFy/7Y6oF4N2cR1tV8knzQvciIbfqfohd359xTLIKQ==", "dev": true, "requires": { - "ajv": "^5.3.0", - "babel-code-frame": "^6.22.0", + "ajv": "^6.5.0", + "babel-code-frame": "^6.26.0", "chalk": "^2.1.0", - "concat-stream": "^1.6.0", - "cross-spawn": "^5.1.0", + "cross-spawn": "^6.0.5", "debug": "^3.1.0", "doctrine": "^2.1.0", - "eslint-scope": "^3.7.1", + "eslint-scope": "^4.0.0", "eslint-visitor-keys": "^1.0.0", - "espree": "^3.5.4", - "esquery": "^1.0.0", + "espree": "^4.0.0", + "esquery": "^1.0.1", "esutils": "^2.0.2", "file-entry-cache": "^2.0.0", "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", - "globals": "^11.0.1", + "globals": "^11.5.0", "ignore": "^3.3.3", "imurmurhash": "^0.1.4", - "inquirer": "^3.0.6", - "is-resolvable": "^1.0.0", - "js-yaml": "^3.9.1", + "inquirer": "^5.2.0", + "is-resolvable": "^1.1.0", + "js-yaml": "^3.11.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.17.4", - "minimatch": "^3.0.2", + "lodash": "^4.17.5", + "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", "optionator": "^0.8.2", "path-is-inside": "^1.0.2", "pluralize": "^7.0.0", "progress": "^2.0.0", - "regexpp": "^1.0.1", + "regexpp": "^1.1.0", "require-uncached": "^1.0.3", - "semver": "^5.3.0", + "semver": "^5.5.0", + "string.prototype.matchall": "^2.0.0", "strip-ansi": "^4.0.0", - "strip-json-comments": "~2.0.1", - "table": "4.0.2", - "text-table": "~0.2.0" + "strip-json-comments": "^2.0.1", + "table": "^4.0.3", + "text-table": "^0.2.0" }, "dependencies": { + "ajv": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", + "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.1" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, "globals": { - "version": "11.5.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", - "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", + "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true } } @@ -3943,9 +3984,9 @@ }, "dependencies": { "resolve": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.0.tgz", - "integrity": "sha512-MNcwJ8/K9iJqFDBDyhcxZuDWvf/ai0GcAJWetx2Cvvcz4HLfA8j0KasWR5Z6ChcbjYZ+FaczcXjN2jrCXCjQ4w==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", "dev": true, "requires": { "path-parse": "^1.0.5" @@ -3954,9 +3995,9 @@ } }, "eslint-plugin-prettier": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz", - "integrity": "sha512-floiaI4F7hRkTrFe8V2ItOK97QYrX75DjmdzmVITZoAP6Cn06oEDPQRsO6MlHEP/u2SxI3xQ52Kpjw6j5WGfeQ==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.1.tgz", + "integrity": "sha512-wNZ2z0oVCWnf+3BSI7roS+z4gGu2AwcPKUek+SlLZMZg+X0KbZLsB2knul7fd0K3iuIp402HIYzm4f2+OyfXxA==", "dev": true, "requires": { "fast-diff": "^1.1.1", @@ -3964,9 +4005,9 @@ } }, "eslint-scope": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", - "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -4053,13 +4094,13 @@ } }, "espree": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-4.0.0.tgz", + "integrity": "sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg==", "dev": true, "requires": { - "acorn": "^5.5.0", - "acorn-jsx": "^3.0.0" + "acorn": "^5.6.0", + "acorn-jsx": "^4.1.1" } }, "esprima": { @@ -4894,6 +4935,12 @@ } } }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "function-name-support": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/function-name-support/-/function-name-support-0.2.0.tgz", @@ -5164,6 +5211,15 @@ "har-schema": "^2.0.0" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -5191,6 +5247,12 @@ "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", "dev": true }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, "has-to-string-tag-x": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", @@ -5223,9 +5285,9 @@ } }, "hosted-git-info": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.1.tgz", + "integrity": "sha512-Ba4+0M4YvIDUUsprMjhVTU1yN9F2/LJSAl69ZpzaLT4l4j5mwTS6jqqW9Ojvj6lKz/veqPzpJBqGbXspOb533A==", "dev": true }, "html-tags": { @@ -5295,9 +5357,9 @@ } }, "ignore": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz", - "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==", + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", "dev": true }, "ignore-by-default": { @@ -5372,22 +5434,21 @@ } }, "inquirer": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", + "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", "dev": true, "requires": { "ansi-escapes": "^3.0.0", "chalk": "^2.0.0", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", - "external-editor": "^2.0.4", + "external-editor": "^2.1.0", "figures": "^2.0.0", "lodash": "^4.3.0", "mute-stream": "0.0.7", "run-async": "^2.2.0", - "rx-lite": "^4.0.8", - "rx-lite-aggregates": "^4.0.8", + "rxjs": "^5.5.2", "string-width": "^2.1.0", "strip-ansi": "^4.0.0", "through": "^2.3.6" @@ -5467,6 +5528,12 @@ "builtin-modules": "^1.0.0" } }, + "is-callable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "dev": true + }, "is-ci": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.1.0.tgz", @@ -5476,6 +5543,12 @@ "ci-info": "^1.0.0" } }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, "is-dotfile": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", @@ -5647,6 +5720,15 @@ "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", "dev": true }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", @@ -5670,6 +5752,12 @@ "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -5719,16 +5807,16 @@ "dev": true }, "istanbul-lib-instrument": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-2.2.0.tgz", - "integrity": "sha512-ozQGtlIw+/a/F3n6QwWiuuyRAPp64+g2GVsKYsIez0sgIEzkU5ZpL2uZ5pmAzbEJ82anlRaPlOQZzkRXspgJyg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-2.3.0.tgz", + "integrity": "sha512-Ie1LGWJVCFDDJKKH4g1ffpFcZTEXEd6ay5l9fE8539y4qPErJnzo4psnGzDH92tcKvdUDdbxrKySYIbt6zB9hw==", "dev": true, "requires": { - "@babel/generator": "7.0.0-beta.49", - "@babel/parser": "7.0.0-beta.49", - "@babel/template": "7.0.0-beta.49", - "@babel/traverse": "7.0.0-beta.49", - "@babel/types": "7.0.0-beta.49", + "@babel/generator": "7.0.0-beta.51", + "@babel/parser": "7.0.0-beta.51", + "@babel/template": "7.0.0-beta.51", + "@babel/traverse": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", "istanbul-lib-coverage": "^2.0.0", "semver": "^5.5.0" } @@ -6503,6 +6591,12 @@ "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", "dev": true }, + "nice-try": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", + "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==", + "dev": true + }, "nise": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.2.tgz", @@ -8641,9 +8735,9 @@ "dev": true }, "object-keys": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", - "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", "dev": true }, "object.omit": { @@ -9034,9 +9128,9 @@ "dev": true }, "postcss": { - "version": "6.0.22", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", - "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, "requires": { "chalk": "^2.4.1", @@ -9191,9 +9285,9 @@ "dev": true }, "prettier": { - "version": "1.13.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.13.5.tgz", - "integrity": "sha512-4M90mfvLz6yRf2Dhzd+xPIE6b4xkI8nHMJhsSm9IlfG17g6wujrrm7+H1X8x52tC4cSNm6HmuhCUSNe6Hd5wfw==", + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.13.7.tgz", + "integrity": "sha512-KIU72UmYPGk4MujZGYMFwinB7lOf2LsDNGSOC8ufevsrPLISrZbNJlWstRi3m0AMuszbH+EFSQ/r6w56RSPK6w==", "dev": true }, "pretty-ms": { @@ -9417,6 +9511,15 @@ "is-equal-shallow": "^0.1.3" } }, + "regexp.prototype.flags": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", + "integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==", + "dev": true, + "requires": { + "define-properties": "^1.1.2" + } + }, "regexpp": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", @@ -9630,11 +9733,10 @@ "integrity": "sha512-jp4YlI0qyDFfXiXGhkCOliBN1G7fRH03Nqy8YdShzGqbY5/9S2x/IR6C88ls2DFkbWuL3ASkP7QD3pVrNpPgwQ==" }, "retry-request": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-3.3.2.tgz", - "integrity": "sha512-WIiGp37XXDC6e7ku3LFoi7LCL/Gs9luGeeqvbPRb+Zl6OQMw4RCRfSaW+aLfE6lhz1R941UavE6Svl3Dm5xGIQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz", + "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==", "requires": { - "request": "^2.81.0", "through2": "^2.0.0" } }, @@ -9666,19 +9768,21 @@ "is-promise": "^2.1.0" } }, - "rx-lite": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", - "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", - "dev": true - }, - "rx-lite-aggregates": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", - "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "rxjs": { + "version": "5.5.11", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.11.tgz", + "integrity": "sha512-3bjO7UwWfA2CV7lmwYMBzj4fQ6Cq+ftHc2MvUe+WMS7wcdJ1LosDWmdjPQanYp2dBRj572p7PeU81JUxHKOcBA==", "dev": true, "requires": { - "rx-lite": "*" + "symbol-observable": "1.0.1" + }, + "dependencies": { + "symbol-observable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", + "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", + "dev": true + } } }, "safe-buffer": { @@ -9951,6 +10055,19 @@ "strip-ansi": "^4.0.0" } }, + "string.prototype.matchall": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-2.0.0.tgz", + "integrity": "sha512-WoZ+B2ypng1dp4iFLF2kmZlwwlE19gmjgKuhL1FJfDgCREWb3ye3SDVHSzLH6bxfnvYmkCxbzkmWcQZHA4P//Q==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.10.0", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "regexp.prototype.flags": "^1.2.0" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -10101,17 +10218,43 @@ "dev": true }, "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", + "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", "dev": true, "requires": { - "ajv": "^5.2.3", - "ajv-keywords": "^2.1.0", + "ajv": "^6.0.1", + "ajv-keywords": "^3.0.0", "chalk": "^2.1.0", "lodash": "^4.17.4", "slice-ansi": "1.0.0", "string-width": "^2.1.1" + }, + "dependencies": { + "ajv": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", + "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.1" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + } } }, "taffydb": { @@ -10250,12 +10393,6 @@ "integrity": "sha1-7+fUEj2KxSr/9/QMfk3sUmYAj7Q=", "dev": true }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, "uglify-js": { "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", @@ -10358,9 +10495,9 @@ } }, "universalify": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", - "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, "unzip-response": { @@ -10387,6 +10524,23 @@ "xdg-basedir": "^3.0.0" } }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, "url-parse-lax": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", @@ -10414,9 +10568,9 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "uuid": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", - "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, "validate-npm-package-license": { "version": "3.0.3", From 3215b081c7a820fcf0ac408ac6c71b2a7a22a411 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 3 Jul 2018 09:40:36 -0700 Subject: [PATCH 106/513] chore(deps): lock file maintenance (#61) --- packages/google-cloud-translate/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 41feba6e040..c49c7596891 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -5529,9 +5529,9 @@ } }, "is-callable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", - "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", "dev": true }, "is-ci": { From 26403beaaea1240c9a127e7a4e1b009d19c90cee Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 9 Jul 2018 19:41:17 -0700 Subject: [PATCH 107/513] chore(deps): lock file maintenance (#65) --- .../google-cloud-translate/package-lock.json | 81 +++++++++++-------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index c49c7596891..36bf79739a2 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -1947,9 +1947,9 @@ } }, "@types/node": { - "version": "10.5.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.1.tgz", - "integrity": "sha512-AFLl1IALIuyt6oK4AYZsgWVJ/5rnyzQWud7IebaZWWV3YmgtPZkQmYio9R5Ze/2pdd7XfqF5bP+hWS11mAKoOQ==" + "version": "10.5.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.2.tgz", + "integrity": "sha512-m9zXmifkZsMHZBOyxZWilMwmTlpC8x5Ty360JKTiXvlXZfBWYpsg9ZZvP/Ye+iZUh+Q+MxDLjItVTWIsfwz+8Q==" }, "@types/request": { "version": "2.47.1", @@ -3177,14 +3177,15 @@ "dev": true }, "codecov": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.2.tgz", - "integrity": "sha512-9ljtIROIjPIUmMRqO+XuDITDoV8xRrZmA0jcEq6p2hg2+wY9wGmLfreAZGIL72IzUfdEDZaU8+Vjidg1fBQ8GQ==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.4.tgz", + "integrity": "sha512-KJyzHdg9B8U9LxXa7hS6jnEW5b1cNckLYc2YpnJ1nEFiOW+/iSzDHp+5MYEIQd9fN3/tC6WmGZmYiwxzkuGp/A==", "dev": true, "requires": { - "argv": "0.0.2", - "request": "^2.81.0", - "urlgrey": "0.4.4" + "argv": "^0.0.2", + "ignore-walk": "^3.0.1", + "request": "^2.87.0", + "urlgrey": "^0.4.4" } }, "color-convert": { @@ -3864,9 +3865,9 @@ } }, "eslint": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.0.1.tgz", - "integrity": "sha512-D5nG2rErquLUstgUaxJlWB5+gu+U/3VDY0fk/Iuq8y9CUFy/7Y6oF4N2cR1tV8knzQvciIbfqfohd359xTLIKQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.1.0.tgz", + "integrity": "sha512-DyH6JsoA1KzA5+OSWFjg56DFJT+sDLO0yokaPZ9qY0UEmYrPA1gEX/G1MnVkmRDsksG4H1foIVz2ZXXM3hHYvw==", "dev": true, "requires": { "ajv": "^6.5.0", @@ -3876,6 +3877,7 @@ "debug": "^3.1.0", "doctrine": "^2.1.0", "eslint-scope": "^4.0.0", + "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", "espree": "^4.0.0", "esquery": "^1.0.1", @@ -3883,7 +3885,7 @@ "file-entry-cache": "^2.0.0", "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", - "globals": "^11.5.0", + "globals": "^11.7.0", "ignore": "^3.3.3", "imurmurhash": "^0.1.4", "inquirer": "^5.2.0", @@ -3995,9 +3997,9 @@ } }, "eslint-plugin-prettier": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.1.tgz", - "integrity": "sha512-wNZ2z0oVCWnf+3BSI7roS+z4gGu2AwcPKUek+SlLZMZg+X0KbZLsB2knul7fd0K3iuIp402HIYzm4f2+OyfXxA==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.2.tgz", + "integrity": "sha512-tGek5clmW5swrAx1mdPYM8oThrBE83ePh7LeseZHBWfHVGrHPhKn7Y5zgRMbU/9D5Td9K4CEmUPjGxA7iw98Og==", "dev": true, "requires": { "fast-diff": "^1.1.1", @@ -4014,6 +4016,12 @@ "estraverse": "^4.1.1" } }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, "eslint-visitor-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", @@ -4330,9 +4338,9 @@ "dev": true }, "follow-redirects": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.0.tgz", - "integrity": "sha512-fdrt472/9qQ6Kgjvb935ig6vJCuofpBUD14f9Vb+SLlm7xIe4Qva5gey8EKtv8lp7ahE1wilg3xL1znpVGtZIA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.1.tgz", + "integrity": "sha512-v9GI1hpaqq1ZZR6pBD1+kI7O24PhDvNGNodjS3MdcEqyrahCp8zbtpv+2B/krUnSmUH80lbAS7MrdeK5IylgKg==", "requires": { "debug": "^3.1.0" } @@ -5285,9 +5293,9 @@ } }, "hosted-git-info": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.1.tgz", - "integrity": "sha512-Ba4+0M4YvIDUUsprMjhVTU1yN9F2/LJSAl69ZpzaLT4l4j5mwTS6jqqW9Ojvj6lKz/veqPzpJBqGbXspOb533A==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", "dev": true }, "html-tags": { @@ -5368,6 +5376,15 @@ "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, + "ignore-walk": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, "import-lazy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", @@ -5801,15 +5818,15 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "istanbul-lib-coverage": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.0.tgz", - "integrity": "sha512-yMSw5xLIbdaxiVXHk3amfNM2WeBxLrwH/BCyZ9HvA/fylwziAIJOG2rKqWyLqEJqwKT725vxxqidv+SyynnGAA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", + "integrity": "sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA==", "dev": true }, "istanbul-lib-instrument": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-2.3.0.tgz", - "integrity": "sha512-Ie1LGWJVCFDDJKKH4g1ffpFcZTEXEd6ay5l9fE8539y4qPErJnzo4psnGzDH92tcKvdUDdbxrKySYIbt6zB9hw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-2.3.1.tgz", + "integrity": "sha512-h9Vg3nfbxrF0PK0kZiNiMAyL8zXaLiBP/BXniaKSwVvAi1TaumYV2b0wPdmy1CRX3irYbYD1p4Wjbv4uyECiiQ==", "dev": true, "requires": { "@babel/generator": "7.0.0-beta.51", @@ -5817,7 +5834,7 @@ "@babel/template": "7.0.0-beta.51", "@babel/traverse": "7.0.0-beta.51", "@babel/types": "7.0.0-beta.51", - "istanbul-lib-coverage": "^2.0.0", + "istanbul-lib-coverage": "^2.0.1", "semver": "^5.5.0" } }, @@ -6177,9 +6194,9 @@ "dev": true }, "lolex": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.0.tgz", - "integrity": "sha512-uJkH2e0BVfU5KOJUevbTOtpDduooSarH5PopO+LfM/vZf8Z9sJzODqKev804JYM2i++ktJfUmC1le4LwFQ1VMg==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.1.tgz", + "integrity": "sha512-Oo2Si3RMKV3+lV5MsSWplDQFoTClz/24S0MMHYcgGWWmFXr6TMlqcqk/l1GtH+d5wLBwNRiqGnwDRMirtFalJw==", "dev": true }, "longest": { From 7046884b882fe2bf64efe591761a51cd0487a90d Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 9 Jul 2018 22:55:46 -0700 Subject: [PATCH 108/513] fix: drop support for node.js 4.x and 9.x (#64) * fix: drop support for node.js 4.x and 9.x * fix my blunder * moar fixing --- .../.circleci/config.yml | 40 ++++--------------- packages/google-cloud-translate/package.json | 2 +- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 739dd2fdbe3..3d637f7b35f 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -3,32 +3,24 @@ workflows: version: 2 tests: jobs: &workflow_jobs - - node4: + - node6: filters: &all_commits tags: only: /.*/ - - node6: - filters: *all_commits - node8: filters: *all_commits - - node9: - filters: *all_commits - node10: filters: *all_commits - lint: requires: - - node4 - node6 - node8 - - node9 - node10 filters: *all_commits - docs: requires: - - node4 - node6 - node8 - - node9 - node10 filters: *all_commits - system_tests: @@ -62,9 +54,9 @@ workflows: only: master jobs: *workflow_jobs jobs: - node4: + node6: docker: - - image: 'node:4' + - image: 'node:6' steps: &unit_tests_steps - checkout - run: &remove_package_lock @@ -85,25 +77,13 @@ jobs: npm install environment: NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Run unit tests. - command: npm test - - run: - name: Submit coverage data to codecov. - command: node_modules/.bin/codecov - when: always - node6: - docker: - - image: 'node:6' - steps: *unit_tests_steps + - run: npm test + - run: node_modules/.bin/codecov + node8: docker: - image: 'node:8' steps: *unit_tests_steps - node9: - docker: - - image: 'node:9' - steps: *unit_tests_steps node10: docker: - image: 'node:10' @@ -186,9 +166,5 @@ jobs: - image: 'node:8' steps: - checkout - - run: - name: Set NPM authentication. - command: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc' - - run: - name: Publish the module to npm. - command: npm publish + - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc' + - run: npm publish diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c45f195181b..7981d33dd3d 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "author": "Google Inc.", "engines": { - "node": ">=4.0.0" + "node": ">=6.0.0" }, "repository": "googleapis/nodejs-translate", "main": "./src/index.js", From 4b55f02f5a15698ebedc0ee3b81f0fa0ec40baf8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 10 Jul 2018 08:07:22 -0700 Subject: [PATCH 109/513] chore(deps): lock file maintenance (#66) --- packages/google-cloud-translate/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 36bf79739a2..749e8476283 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -4118,9 +4118,9 @@ "dev": true }, "espurify": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.0.tgz", - "integrity": "sha512-jdkJG9jswjKCCDmEridNUuIQei9algr+o66ZZ19610ZoBsiWLRsQGNYS4HGez3Z/DsR0lhANGAqiwBUclPuNag==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.1.tgz", + "integrity": "sha512-ZDko6eY/o+D/gHCWyHTU85mKDgYcS4FJj7S+YD6WIInm7GQ6AnOjmcL4+buFV/JOztVLELi/7MmuGU5NHta0Mg==", "dev": true, "requires": { "core-js": "^2.0.0" From ca5add0f898757542354e579aa95c79ce35d07fd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 10 Jul 2018 09:41:27 -0700 Subject: [PATCH 110/513] chore(deps): lock file maintenance (#67) --- packages/google-cloud-translate/package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 749e8476283..2af294bcf39 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -6206,12 +6206,12 @@ "dev": true }, "loose-envify": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", - "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dev": true, "requires": { - "js-tokens": "^3.0.0" + "js-tokens": "^3.0.0 || ^4.0.0" } }, "loud-rejection": { From 0171b97d3e5050def5fea8c3c7de9f7ef651fea9 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 10 Jul 2018 11:44:35 -0700 Subject: [PATCH 111/513] feat: convert to TypeScript (#63) --- .../.circleci/config.yml | 8 +- packages/google-cloud-translate/.clang-format | 3 + packages/google-cloud-translate/.gitignore | 1 + .../google-cloud-translate/package-lock.json | 333 ++++++++++- packages/google-cloud-translate/package.json | 38 +- packages/google-cloud-translate/src/index.js | 526 ------------------ packages/google-cloud-translate/src/index.ts | 522 +++++++++++++++++ .../{translate.js => translate.ts} | 7 +- .../test/{index.js => index.ts} | 139 ++--- .../google-cloud-translate/test/mocha.opts | 4 + packages/google-cloud-translate/tsconfig.json | 17 + packages/google-cloud-translate/tslint.json | 3 + 12 files changed, 958 insertions(+), 643 deletions(-) create mode 100644 packages/google-cloud-translate/.clang-format delete mode 100644 packages/google-cloud-translate/src/index.js create mode 100644 packages/google-cloud-translate/src/index.ts rename packages/google-cloud-translate/system-test/{translate.js => translate.ts} (97%) rename packages/google-cloud-translate/test/{index.js => index.ts} (83%) create mode 100644 packages/google-cloud-translate/test/mocha.opts create mode 100644 packages/google-cloud-translate/tsconfig.json create mode 100644 packages/google-cloud-translate/tslint.json diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 3d637f7b35f..a48eadc54b9 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -79,7 +79,7 @@ jobs: NPM_CONFIG_PREFIX: /home/node/.npm-global - run: npm test - run: node_modules/.bin/codecov - + node8: docker: - image: 'node:8' @@ -99,11 +99,9 @@ jobs: name: Link the module being tested to the samples. command: | cd samples/ - npm install npm link ../ - - run: - name: Run linting. - command: npm run lint + npm install + - run: npm run lint docs: docker: - image: 'node:8' diff --git a/packages/google-cloud-translate/.clang-format b/packages/google-cloud-translate/.clang-format new file mode 100644 index 00000000000..7d6cf97e108 --- /dev/null +++ b/packages/google-cloud-translate/.clang-format @@ -0,0 +1,3 @@ +Language: JavaScript +BasedOnStyle: Google +ColumnLimit: 80 \ No newline at end of file diff --git a/packages/google-cloud-translate/.gitignore b/packages/google-cloud-translate/.gitignore index b7d407606fb..193fd9da619 100644 --- a/packages/google-cloud-translate/.gitignore +++ b/packages/google-cloud-translate/.gitignore @@ -7,3 +7,4 @@ out/ system-test/secrets.js system-test/*key.json *.lock +build diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 2af294bcf39..2ae9aef1b45 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -1925,6 +1925,12 @@ "samsam": "1.3.0" } }, + "@types/arrify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/arrify/-/arrify-1.0.4.tgz", + "integrity": "sha512-63nK8r8jvEVJ1r0ENaY9neB1wDzPHFYAzKiIxPawuzcijEX8XeOywwPL8fkSCwiTIYop9MSh+TKy9L2ZzTXV6g==", + "dev": true + }, "@types/caseless": { "version": "0.12.1", "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.1.tgz", @@ -1938,6 +1944,12 @@ "@types/node": "*" } }, + "@types/extend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/extend/-/extend-3.0.0.tgz", + "integrity": "sha512-Eo8NQCbgjlMPQarlFAE3vpyCvFda4dg1Ob5ZJb6BJI9x4NAZVWowyMNB8GJJDgDI4lr2oqiQvXlPB0Fn1NoXnQ==", + "dev": true + }, "@types/form-data": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", @@ -1946,6 +1958,18 @@ "@types/node": "*" } }, + "@types/is": { + "version": "0.0.20", + "resolved": "https://registry.npmjs.org/@types/is/-/is-0.0.20.tgz", + "integrity": "sha512-013vMJ4cpYRm1GavhN8HqSKRWD/txm2BLcy/Qw9hAoSNJwp60ezLH+/QlX3JouGTPJcmxvbDUWGANxjS52jRaw==", + "dev": true + }, + "@types/mocha": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.4.tgz", + "integrity": "sha512-XMHApnKWI0jvXU5gLcSTsRjJBpSzP0BG+2oGv98JFyS4a5R0tRy0oshHBRndb3BuHb9AwDKaUL8Ja7GfUvsG4g==", + "dev": true + }, "@types/node": { "version": "10.5.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.2.tgz", @@ -2158,23 +2182,6 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "dev": true, - "requires": { - "lodash": "^4.17.10" - }, - "dependencies": { - "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", - "dev": true - } - } - }, "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", @@ -3068,6 +3075,25 @@ "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, + "clang-format": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/clang-format/-/clang-format-1.2.3.tgz", + "integrity": "sha512-x90Hac4ERacGDcZSvHKK58Ga0STuMD+Doi5g0iG2zf7wlJef5Huvhs/3BvMRFxwRYyYSdl6mpQNrtfMxE8MQzw==", + "dev": true, + "requires": { + "async": "^1.5.2", + "glob": "^7.0.0", + "resolve": "^1.1.6" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + } + } + }, "clean-stack": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-1.3.0.tgz", @@ -3402,6 +3428,16 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + } + }, "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", @@ -5176,6 +5212,195 @@ "pify": "^3.0.0" } }, + "gts": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/gts/-/gts-0.7.1.tgz", + "integrity": "sha512-7yMBk3+SmyL4+047vIXOAUWlNfbIkuPH0UnhQYzurM8yj1ufiVH++BdBpZY7AP6/wytvzq7PuVzqAXbk5isn2A==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "clang-format": "1.2.3", + "inquirer": "^6.0.0", + "meow": "^5.0.0", + "pify": "^3.0.0", + "rimraf": "^2.6.2", + "tslint": "^5.9.1", + "update-notifier": "^2.5.0", + "write-file-atomic": "^2.3.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "chardet": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.5.0.tgz", + "integrity": "sha512-9ZTaoBaePSCFvNlNGrsyI8ZVACP2svUtq0DkM7t4K2ClAa96sqOIRjAzDTc8zXzFt1cZR46rRzLTiHFSJ+Qw0g==", + "dev": true + }, + "external-editor": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.0.tgz", + "integrity": "sha512-mpkfj0FEdxrIhOC04zk85X7StNtr0yXnG7zCb+8ikO8OJi2jsHh5YGoknNTyXgsbHOf1WOOcVU3kPFWT2WgCkQ==", + "dev": true, + "requires": { + "chardet": "^0.5.0", + "iconv-lite": "^0.4.22", + "tmp": "^0.0.33" + } + }, + "inquirer": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.0.0.tgz", + "integrity": "sha512-tISQWRwtcAgrz+SHPhTH7d3e73k31gsOy6i1csonLc0u1dVK/wYvuOnFeiWqC5OXFIYbmrIFInef31wbT8MEJg==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.0", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.1.0", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "meow": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "rxjs": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.1.tgz", + "integrity": "sha512-OwMxHxmnmHTUpgO+V7dZChf3Tixf4ih95cmXjzzadULziVl/FKhHScGLj4goEw9weePVOH2Q0+GcCBUhKCZc/g==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, "handlebars": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", @@ -5219,6 +5444,12 @@ "har-schema": "^2.0.0" } }, + "hard-rejection": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-1.0.0.tgz", + "integrity": "sha1-jztHbI4vIhvtc8ZGQP4hfXF9rDY=", + "dev": true + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -6506,6 +6737,16 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -9394,6 +9635,12 @@ "strict-uri-encode": "^1.0.0" } }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, "randomatic": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", @@ -10375,6 +10622,52 @@ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "tslint": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.10.0.tgz", + "integrity": "sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=", + "dev": true, + "requires": { + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.7.0", + "minimatch": "^3.0.4", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.12.1" + }, + "dependencies": { + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + } + } + }, + "tsutils": { + "version": "2.27.2", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.27.2.tgz", + "integrity": "sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -10410,6 +10703,12 @@ "integrity": "sha1-7+fUEj2KxSr/9/QMfk3sUmYAj7Q=", "dev": true }, + "typescript": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", + "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "dev": true + }, "uglify-js": { "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7981d33dd3d..32cf461eb37 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -8,9 +8,10 @@ "node": ">=6.0.0" }, "repository": "googleapis/nodejs-translate", - "main": "./src/index.js", + "main": "build/src/index.js", + "types": "build/src/index.d.ts", "files": [ - "src", + "build/src", "AUTHORS", "CONTRIBUTORS", "LICENSE" @@ -44,19 +45,24 @@ "greenkeeper[bot] " ], "scripts": { - "cover": "nyc --reporter=lcov mocha --require intelli-espower-loader test/*.js && nyc report", + "cover": "nyc --reporter=lcov mocha build/test && nyc report", "docs": "jsdoc -c .jsdoc.js", "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", - "lint": "eslint src/ samples/ system-test/ test/", - "prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", - "publish-module": "node ../../scripts/publish.js translate", + "lint": "eslint samples/", + "prettier": "prettier --write samples/*.js samples/*/*.js", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha system-test/*.js --timeout 600000", - "test-no-cover": "mocha test/*.js --no-timeouts", - "test": "npm run cover" + "system-test": "mocha build/system-test --timeout 600000", + "test-no-cover": "mocha build/test", + "test": "npm run cover", + "check": "gts check", + "clean": "gts clean", + "compile": "tsc -p .", + "fix": "gts fix", + "prepare": "npm run compile", + "pretest": "npm run compile" }, "dependencies": { - "@google-cloud/common": "^0.20.0", + "@google-cloud/common": "^0.20.3", "arrify": "^1.0.1", "extend": "^3.0.1", "is": "^3.2.1", @@ -65,12 +71,18 @@ }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^2.3.0", - "async": "^2.6.1", + "@types/arrify": "^1.0.4", + "@types/extend": "^3.0.0", + "@types/is": "0.0.20", + "@types/mocha": "^5.2.4", + "@types/request": "^2.47.1", "codecov": "^3.0.2", "eslint": "^5.0.0", "eslint-config-prettier": "^2.9.0", "eslint-plugin-node": "^6.0.1", "eslint-plugin-prettier": "^2.6.0", + "gts": "^0.7.1", + "hard-rejection": "^1.0.0", "ink-docstrap": "^1.3.2", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", @@ -78,6 +90,8 @@ "nyc": "^12.0.2", "power-assert": "^1.6.0", "prettier": "^1.13.5", - "proxyquire": "^2.0.1" + "proxyquire": "^2.0.1", + "source-map-support": "^0.5.6", + "typescript": "~2.9.1" } } diff --git a/packages/google-cloud-translate/src/index.js b/packages/google-cloud-translate/src/index.js deleted file mode 100644 index e71f18be8c5..00000000000 --- a/packages/google-cloud-translate/src/index.js +++ /dev/null @@ -1,526 +0,0 @@ -/*! - * Copyright 2015 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -var arrify = require('arrify'); -var common = require('@google-cloud/common'); -var extend = require('extend'); -var is = require('is'); -var isHtml = require('is-html'); -var prop = require('propprop'); -var util = require('util'); - -var PKG = require('../package.json'); - -/** - * @typedef {object} ClientConfig - * @property {string} [projectId] The project ID from the Google Developer's - * Console, e.g. 'grape-spaceship-123'. We will also check the environment - * variable `GCLOUD_PROJECT` for your project ID. If your app is running in - * an environment which supports {@link https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application Application Default Credentials}, - * your project ID will be detected automatically. - * @property {string} [key] An API key. You should prefer using a Service - * Account key file instead of an API key. - * @property {string} [keyFilename] Full path to the a .json, .pem, or .p12 key - * downloaded from the Google Developers Console. If you provide a path to a - * JSON file, the `projectId` option above is not necessary. NOTE: .pem and - * .p12 require you to specify the `email` option as well. - * @property {string} [email] Account email address. Required when using a .pem - * or .p12 keyFilename. - * @property {object} [credentials] Credentials object. - * @property {string} [credentials.client_email] - * @property {string} [credentials.private_key] - * @property {boolean} [autoRetry=true] Automatically retry requests if the - * response is related to rate limits or certain intermittent server errors. - * We will exponentially backoff subsequent requests by default. - * @property {number} [maxRetries=3] Maximum number of automatic retries - * attempted before returning the error. - * @property {Constructor} [promise] Custom promise module to use instead of - * native Promises. - */ - -/** - * With [Google Translate](https://cloud.google.com/translate), you can - * dynamically translate text between thousands of language pairs. - * - * The Google Translate API lets websites and programs integrate with Google - * Translate programmatically. - * - * @class - * - * @see [Getting Started]{@link https://cloud.google.com/translate/v2/getting_started} - * @see [Identifying your application to Google]{@link https://cloud.google.com/translate/v2/using_rest#auth} - * - * @param {ClientConfig} [options] Configuration options. - * - * @example - * //- - * //

Custom Translate API

- * // - * // The environment variable, `GOOGLE_CLOUD_TRANSLATE_ENDPOINT`, is honored as - * // a custom backend which our library will send requests to. - * //- - * - * @example include:samples/quickstart.js - * region_tag:translate_quickstart - * Full quickstart example: - */ -function Translate(options) { - if (!(this instanceof Translate)) { - return new Translate(options); - } - - options = common.util.normalizeArguments(this, options, { - projectIdRequired: false, - }); - - var baseUrl = 'https://translation.googleapis.com/language/translate/v2'; - - if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { - baseUrl = process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT.replace(/\/+$/, ''); - } - - if (options.key) { - this.options = options; - this.key = options.key; - } - - var config = { - baseUrl: baseUrl, - scopes: ['https://www.googleapis.com/auth/cloud-platform'], - packageJson: require('../package.json'), - projectIdRequired: false, - }; - - common.Service.call(this, config, options); -} - -util.inherits(Translate, common.Service); - -/** - * @typedef {array} DetectResponse - * @property {object|object[]} 0 The detection results. - * @property {string} 0.language The language code matched from the input. - * @property {number} [0.confidence] A float 0 - 1. The higher the number, the - * higher the confidence in language detection. Note, this is not always - * returned from the API. - * @property {object} 1 The full API response. - */ -/** - * @callback DetectCallback - * @param {?Error} err Request error, if any. - * @param {object|object[]} results The detection results. - * @param {string} results.language The language code matched from the input. - * @param {number} [results.confidence] A float 0 - 1. The higher the number, the - * higher the confidence in language detection. Note, this is not always - * returned from the API. - * @param {object} apiResponse The full API response. - */ -/** - * Detect the language used in a string or multiple strings. - * - * @see [Detect Language]{@link https://cloud.google.com/translate/v2/using_rest#detect-language} - * - * @param {string|string[]} input - The source string input. - * @param {DetectCallback} [callback] Callback function. - * @returns {Promise} - * - * @example - * const Translate = require('@google-cloud/translate'); - * - * const translate = new Translate(); - * - * //- - * // Detect the language from a single string input. - * //- - * translate.detect('Hello', function(err, results) { - * if (!err) { - * // results = { - * // language: 'en', - * // confidence: 1, - * // input: 'Hello' - * // } - * } - * }); - * - * //- - * // Detect the languages used in multiple strings. Note that the results are - * // now provied as an array. - * //- - * translate.detect([ - * 'Hello', - * 'Hola' - * ], function(err, results) { - * if (!err) { - * // results = [ - * // { - * // language: 'en', - * // confidence: 1, - * // input: 'Hello' - * // }, - * // { - * // language: 'es', - * // confidence: 1, - * // input: 'Hola' - * // } - * // ] - * } - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * translate.detect('Hello').then(function(data) { - * var results = data[0]; - * var apiResponse = data[2]; - * }); - * - * @example include:samples/translate.js - * region_tag:translate_detect_language - * Here's a full example: - */ -Translate.prototype.detect = function(input, callback) { - var inputIsArray = Array.isArray(input); - input = arrify(input); - - this.request( - { - method: 'POST', - uri: '/detect', - json: { - q: input, - }, - }, - function(err, resp) { - if (err) { - callback(err, null, resp); - return; - } - - var results = resp.data.detections.map(function(detection, index) { - var result = extend({}, detection[0], { - input: input[index], - }); - - // Deprecated. - delete result.isReliable; - - return result; - }); - - if (input.length === 1 && !inputIsArray) { - results = results[0]; - } - - callback(null, results, resp); - } - ); -}; - -/** - * @typedef {array} GetLanguagesResponse - * @property {object[]} 0 The languages supported by the API. - * @property {string} 0.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) - * language code. - * @property {string} 0.name The language name. This can be translated into your - * preferred language with the `target` option. - * @property {object} 1 The full API response. - */ -/** - * @callback GetLanguagesCallback - * @param {?Error} err Request error, if any. - * @param {object[]} results The languages supported by the API. - * @param {string} results.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) - * language code. - * @param {string} results.name The language name. This can be translated into your - * preferred language with the `target` option. - * @param {object} apiResponse The full API response. - */ -/** - * Get an array of all supported languages. - * - * @see [Discovering Supported Languages]{@link https://cloud.google.com/translate/v2/discovering-supported-languages-with-rest} - * - * @param {string} [target] Get the language names in a language other than - * English. - * @param {GetLanguagesCallback} [callback] Callback function. - * @returns {Promise} - * - * @example include:samples/translate.js - * region_tag:translate_list_codes - * Gets the language names in English: - * - * @example include:samples/translate.js - * region_tag:translate_list_language_names - * Gets the language names in a langauge other than English: - */ -Translate.prototype.getLanguages = function(target, callback) { - if (is.fn(target)) { - callback = target; - target = 'en'; - } - - var reqOpts = { - uri: '/languages', - useQuerystring: true, - qs: {}, - }; - - if (target && is.string(target)) { - reqOpts.qs.target = target; - } - - this.request(reqOpts, function(err, resp) { - if (err) { - callback(err, null, resp); - return; - } - - var languages = resp.data.languages.map(function(language) { - return { - code: language.language, - name: language.name, - }; - }); - - callback(null, languages, resp); - }); -}; - -/** - * Translate request options. - * - * @typedef {object} TranslateRequest - * @property {string} [format] Set the text's format as `html` or `text`. - * If not provided, we will try to auto-detect if the text given is HTML. If - * not, we set the format as `text`. - * @property {string} [from] The ISO 639-1 language code the source input - * is written in. - * @property {string} [model] Set the model type requested for this - * translation. Please refer to the upstream documentation for possible - * values. - * @property {string} to The ISO 639-1 language code to translate the - * input to. - */ -/** - * @typedef {array} TranslateResponse - * @property {object|object[]} 0 If a single string input was given, a single - * translation is given. Otherwise, it is an array of translations. - * @property {object} 1 The full API response. - */ -/** - * @callback TranslateCallback - * @param {?Error} err Request error, if any. - * @param {object|object[]} translations If a single string input was given, a - * single translation is given. Otherwise, it is an array of translations. - * @param {object} apiResponse The full API response. - */ -/** - * Translate a string or multiple strings into another language. - * - * @see [Translate Text](https://cloud.google.com/translate/v2/using_rest#Translate) - * - * @throws {Error} If `options` is provided as an object without a `to` - * property. - * - * @param {string|string[]} input The source string input. - * @param {string|TranslateRequest} [options] If a string, it is interpreted as the - * target ISO 639-1 language code to translate the source input to. (e.g. - * `en` for English). If an object, you may also specify the source - * language. - * @param {TranslateCallback} [callback] Callback function. - * @returns {Promise} - * - * @example - * //- - * // Pass a string and a language code to get the translation. - * //- - * translate.translate('Hello', 'es', function(err, translation) { - * if (!err) { - * // translation = 'Hola' - * } - * }); - * - * //- - * // The source language is auto-detected by default. To manually set it, - * // provide an object. - * //- - * var options = { - * from: 'en', - * to: 'es' - * }; - * - * translate.translate('Hello', options, function(err, translation) { - * if (!err) { - * // translation = 'Hola' - * } - * }); - * - * //- - * // Translate multiple strings of input. Note that the results are - * // now provied as an array. - * //- - * var input = [ - * 'Hello', - * 'How are you today?' - * ]; - * - * translate.translate(input, 'es', function(err, translations) { - * if (!err) { - * // translations = [ - * // 'Hola', - * // 'Como estas hoy?' - * // ] - * } - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * translate.translate('Hello', 'es').then(function(data) { - * var translation = data[0]; - * var apiResponse = data[1]; - * }); - * - * @example include:samples/translate.js - * region_tag:translate_translate_text - * Full translation example: - * - * @example include:samples/translate.js - * region_tag:translate_text_with_model - * Translation using the premium model: - */ -Translate.prototype.translate = function(input, options, callback) { - var inputIsArray = Array.isArray(input); - input = arrify(input); - - var body = { - q: input, - format: options.format || (isHtml(input[0]) ? 'html' : 'text'), - }; - - if (is.string(options)) { - body.target = options; - } else { - if (options.from) { - body.source = options.from; - } - - if (options.to) { - body.target = options.to; - } - - if (options.model) { - body.model = options.model; - } - } - - if (!body.target) { - throw new Error('A target language is required to perform a translation.'); - } - - this.request( - { - method: 'POST', - uri: '', - json: body, - }, - function(err, resp) { - if (err) { - callback(err, null, resp); - return; - } - - var translations = resp.data.translations.map(prop('translatedText')); - - if (body.q.length === 1 && !inputIsArray) { - translations = translations[0]; - } - - callback(err, translations, resp); - } - ); -}; - -/** - * A custom request implementation. Requests to this API may optionally use an - * API key for an application, not a bearer token from a service account. This - * means it is possible to skip the `makeAuthenticatedRequest` portion of the - * typical request lifecycle, and manually authenticate the request here. - * - * @private - * - * @param {object} reqOpts - Request options that are passed to `request`. - * @param {function} callback - The callback function passed to `request`. - */ -Translate.prototype.request = function(reqOpts, callback) { - if (!this.key) { - common.Service.prototype.request.call(this, reqOpts, callback); - return; - } - - reqOpts.uri = this.baseUrl + reqOpts.uri; - - reqOpts = extend(true, {}, reqOpts, { - qs: { - key: this.key, - }, - headers: { - 'User-Agent': common.util.getUserAgentFromPackageJson(PKG), - }, - }); - - common.util.makeRequest(reqOpts, this.options, callback); -}; - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -common.util.promisifyAll(Translate); - -/** - * The `@google-cloud/translate` package has a single default export, the - * {@link Translate} class. - * - * See {@link Storage} and {@link ClientConfig} for client methods and - * configuration options. - * - * @module {constructor} @google-cloud/translate - * @alias nodejs-translate - * - * @example Install the client library with npm: - * npm install --save @google-cloud/translate - * - * @example Import the client library: - * const Translate = require('@google-cloud/translate'); - * - * @example Create a client that uses Application Default Credentials (ADC): - * const client = new Translate(); - * - * @example Create a client with explicit credentials: - * const client = new Translate({ - * projectId: 'your-project-id', - * keyFilename: '/path/to/keyfile.json', - * }); - * - * @example include:samples/quickstart.js - * region_tag:translate_quickstart - * Full quickstart example: - */ -module.exports = Translate; diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts new file mode 100644 index 00000000000..85eaaa8c834 --- /dev/null +++ b/packages/google-cloud-translate/src/index.ts @@ -0,0 +1,522 @@ +/*! + * Copyright 2015 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +import * as arrify from 'arrify'; +import * as common from '@google-cloud/common'; +import * as extend from 'extend'; +import * as is from 'is'; +import * as isHtml from 'is-html'; +import * as prop from 'propprop'; +import { DecorateRequestOptions, BodyResponseCallback } from '@google-cloud/common/build/src/util'; +import * as r from 'request'; + + +const PKG = require('../../package.json'); + +/** + * @typedef {object} ClientConfig + * @property {string} [projectId] The project ID from the Google Developer's + * Console, e.g. 'grape-spaceship-123'. We will also check the environment + * variable `GCLOUD_PROJECT` for your project ID. If your app is running in + * an environment which supports {@link https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application Application Default Credentials}, + * your project ID will be detected automatically. + * @property {string} [key] An API key. You should prefer using a Service + * Account key file instead of an API key. + * @property {string} [keyFilename] Full path to the a .json, .pem, or .p12 key + * downloaded from the Google Developers Console. If you provide a path to a + * JSON file, the `projectId` option above is not necessary. NOTE: .pem and + * .p12 require you to specify the `email` option as well. + * @property {string} [email] Account email address. Required when using a .pem + * or .p12 keyFilename. + * @property {object} [credentials] Credentials object. + * @property {string} [credentials.client_email] + * @property {string} [credentials.private_key] + * @property {boolean} [autoRetry=true] Automatically retry requests if the + * response is related to rate limits or certain intermittent server errors. + * We will exponentially backoff subsequent requests by default. + * @property {number} [maxRetries=3] Maximum number of automatic retries + * attempted before returning the error. + * @property {Constructor} [promise] Custom promise module to use instead of + * native Promises. + */ + +/** + * With [Google Translate](https://cloud.google.com/translate), you can + * dynamically translate text between thousands of language pairs. + * + * The Google Translate API lets websites and programs integrate with Google + * Translate programmatically. + * + * @class + * + * @see [Getting Started]{@link https://cloud.google.com/translate/v2/getting_started} + * @see [Identifying your application to Google]{@link https://cloud.google.com/translate/v2/using_rest#auth} + * + * @param {ClientConfig} [options] Configuration options. + * + * @example + * //- + * //

Custom Translate API

+ * // + * // The environment variable, `GOOGLE_CLOUD_TRANSLATE_ENDPOINT`, is honored as + * // a custom backend which our library will send requests to. + * //- + * + * @example include:samples/quickstart.js + * region_tag:translate_quickstart + * Full quickstart example: + */ +export class Translate extends common.Service { + options; + key; + constructor(options?) { + let baseUrl = 'https://translation.googleapis.com/language/translate/v2'; + + if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { + baseUrl = process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT.replace(/\/+$/, ''); + } + + const config = { + baseUrl, + scopes: ['https://www.googleapis.com/auth/cloud-platform'], + packageJson: require('../../package.json'), + projectIdRequired: false, + }; + + super(config, options); + + if (options.key) { + this.options = options; + this.key = options.key; + } + } + + /** + * @typedef {array} DetectResponse + * @property {object|object[]} 0 The detection results. + * @property {string} 0.language The language code matched from the input. + * @property {number} [0.confidence] A float 0 - 1. The higher the number, the + * higher the confidence in language detection. Note, this is not always + * returned from the API. + * @property {object} 1 The full API response. + */ + /** + * @callback DetectCallback + * @param {?Error} err Request error, if any. + * @param {object|object[]} results The detection results. + * @param {string} results.language The language code matched from the input. + * @param {number} [results.confidence] A float 0 - 1. The higher the number, the + * higher the confidence in language detection. Note, this is not always + * returned from the API. + * @param {object} apiResponse The full API response. + */ + /** + * Detect the language used in a string or multiple strings. + * + * @see [Detect Language]{@link https://cloud.google.com/translate/v2/using_rest#detect-language} + * + * @param {string|string[]} input - The source string input. + * @param {DetectCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const Translate = require('@google-cloud/translate'); + * + * const translate = new Translate(); + * + * //- + * // Detect the language from a single string input. + * //- + * translate.detect('Hello', function(err, results) { + * if (!err) { + * // results = { + * // language: 'en', + * // confidence: 1, + * // input: 'Hello' + * // } + * } + * }); + * + * //- + * // Detect the languages used in multiple strings. Note that the results are + * // now provied as an array. + * //- + * translate.detect([ + * 'Hello', + * 'Hola' + * ], function(err, results) { + * if (!err) { + * // results = [ + * // { + * // language: 'en', + * // confidence: 1, + * // input: 'Hello' + * // }, + * // { + * // language: 'es', + * // confidence: 1, + * // input: 'Hola' + * // } + * // ] + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * translate.detect('Hello').then(function(data) { + * var results = data[0]; + * var apiResponse = data[2]; + * }); + * + * @example include:samples/translate.js + * region_tag:translate_detect_language + * Here's a full example: + */ + detect(input, callback) { + const inputIsArray = Array.isArray(input); + input = arrify(input); + + this.request( + { + method: 'POST', + uri: '/detect', + json: { + q: input, + }, + }, + function (err, resp) { + if (err) { + callback(err, null, resp); + return; + } + + let results = resp.data.detections.map(function (detection, index) { + const result = extend({}, detection[0], { + input: input[index], + }); + + // Deprecated. + delete result.isReliable; + + return result; + }); + + if (input.length === 1 && !inputIsArray) { + results = results[0]; + } + + callback(null, results, resp); + } + ); + } + + /** + * @typedef {array} GetLanguagesResponse + * @property {object[]} 0 The languages supported by the API. + * @property {string} 0.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * language code. + * @property {string} 0.name The language name. This can be translated into your + * preferred language with the `target` option. + * @property {object} 1 The full API response. + */ + /** + * @callback GetLanguagesCallback + * @param {?Error} err Request error, if any. + * @param {object[]} results The languages supported by the API. + * @param {string} results.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * language code. + * @param {string} results.name The language name. This can be translated into your + * preferred language with the `target` option. + * @param {object} apiResponse The full API response. + */ + /** + * Get an array of all supported languages. + * + * @see [Discovering Supported Languages]{@link https://cloud.google.com/translate/v2/discovering-supported-languages-with-rest} + * + * @param {string} [target] Get the language names in a language other than + * English. + * @param {GetLanguagesCallback} [callback] Callback function. + * @returns {Promise} + * + * @example include:samples/translate.js + * region_tag:translate_list_codes + * Gets the language names in English: + * + * @example include:samples/translate.js + * region_tag:translate_list_language_names + * Gets the language names in a langauge other than English: + */ + getLanguages(target, callback?) { + if (is.fn(target)) { + callback = target; + target = 'en'; + } + + const reqOpts = { + uri: '/languages', + useQuerystring: true, + qs: {} as any, + }; + + if (target && is.string(target)) { + reqOpts.qs.target = target; + } + + this.request(reqOpts, function (err, resp) { + if (err) { + callback(err, null, resp); + return; + } + + const languages = resp.data.languages.map(function (language) { + return { + code: language.language, + name: language.name, + }; + }); + + callback(null, languages, resp); + }); + } + + /** + * Translate request options. + * + * @typedef {object} TranslateRequest + * @property {string} [format] Set the text's format as `html` or `text`. + * If not provided, we will try to auto-detect if the text given is HTML. If + * not, we set the format as `text`. + * @property {string} [from] The ISO 639-1 language code the source input + * is written in. + * @property {string} [model] Set the model type requested for this + * translation. Please refer to the upstream documentation for possible + * values. + * @property {string} to The ISO 639-1 language code to translate the + * input to. + */ + /** + * @typedef {array} TranslateResponse + * @property {object|object[]} 0 If a single string input was given, a single + * translation is given. Otherwise, it is an array of translations. + * @property {object} 1 The full API response. + */ + /** + * @callback TranslateCallback + * @param {?Error} err Request error, if any. + * @param {object|object[]} translations If a single string input was given, a + * single translation is given. Otherwise, it is an array of translations. + * @param {object} apiResponse The full API response. + */ + /** + * Translate a string or multiple strings into another language. + * + * @see [Translate Text](https://cloud.google.com/translate/v2/using_rest#Translate) + * + * @throws {Error} If `options` is provided as an object without a `to` + * property. + * + * @param {string|string[]} input The source string input. + * @param {string|TranslateRequest} [options] If a string, it is interpreted as the + * target ISO 639-1 language code to translate the source input to. (e.g. + * `en` for English). If an object, you may also specify the source + * language. + * @param {TranslateCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * //- + * // Pass a string and a language code to get the translation. + * //- + * translate.translate('Hello', 'es', function(err, translation) { + * if (!err) { + * // translation = 'Hola' + * } + * }); + * + * //- + * // The source language is auto-detected by default. To manually set it, + * // provide an object. + * //- + * var options = { + * from: 'en', + * to: 'es' + * }; + * + * translate.translate('Hello', options, function(err, translation) { + * if (!err) { + * // translation = 'Hola' + * } + * }); + * + * //- + * // Translate multiple strings of input. Note that the results are + * // now provied as an array. + * //- + * var input = [ + * 'Hello', + * 'How are you today?' + * ]; + * + * translate.translate(input, 'es', function(err, translations) { + * if (!err) { + * // translations = [ + * // 'Hola', + * // 'Como estas hoy?' + * // ] + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * translate.translate('Hello', 'es').then(function(data) { + * var translation = data[0]; + * var apiResponse = data[1]; + * }); + * + * @example include:samples/translate.js + * region_tag:translate_translate_text + * Full translation example: + * + * @example include:samples/translate.js + * region_tag:translate_text_with_model + * Translation using the premium model: + */ + translate(input, options, callback) { + const inputIsArray = Array.isArray(input); + input = arrify(input); + + const body: any = { + q: input, + format: options.format || (isHtml(input[0]) ? 'html' : 'text'), + }; + + if (is.string(options)) { + body.target = options; + } else { + if (options.from) { + body.source = options.from; + } + + if (options.to) { + body.target = options.to; + } + + if (options.model) { + body.model = options.model; + } + } + + if (!body.target) { + throw new Error('A target language is required to perform a translation.'); + } + + this.request( + { + method: 'POST', + uri: '', + json: body, + }, + function (err, resp) { + if (err) { + callback(err, null, resp); + return; + } + + let translations = resp.data.translations.map(prop('translatedText')); + + if (body.q.length === 1 && !inputIsArray) { + translations = translations[0]; + } + + callback(err, translations, resp); + } + ); + } + + /** + * A custom request implementation. Requests to this API may optionally use an + * API key for an application, not a bearer token from a service account. This + * means it is possible to skip the `makeAuthenticatedRequest` portion of the + * typical request lifecycle, and manually authenticate the request here. + * + * @private + * + * @param {object} reqOpts - Request options that are passed to `request`. + * @param {function} callback - The callback function passed to `request`. + */ + request(reqOpts: DecorateRequestOptions): Promise; + request(reqOpts: DecorateRequestOptions, callback: BodyResponseCallback): void; + request(reqOpts: DecorateRequestOptions, callback?: BodyResponseCallback): void|Promise { + if (!this.key) { + super.request(reqOpts, callback!); + return; + } + + reqOpts.uri = this.baseUrl + reqOpts.uri; + reqOpts = extend(true, {}, reqOpts, { + qs: { + key: this.key, + }, + headers: { + 'User-Agent': common.util.getUserAgentFromPackageJson(PKG), + }, + }); + + common.util.makeRequest(reqOpts, this.options, callback!); + } +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +common.util.promisifyAll(Translate, { exclude: ['request']}); + +/** + * The `@google-cloud/translate` package has a single default export, the + * {@link Translate} class. + * + * See {@link Storage} and {@link ClientConfig} for client methods and + * configuration options. + * + * @module {constructor} @google-cloud/translate + * @alias nodejs-translate + * + * @example Install the client library with npm: + * npm install --save @google-cloud/translate + * + * @example Import the client library: + * const Translate = require('@google-cloud/translate'); + * + * @example Create a client that uses Application Default Credentials (ADC): + * const client = new Translate(); + * + * @example Create a client with explicit credentials: + * const client = new Translate({ + * projectId: 'your-project-id', + * keyFilename: '/path/to/keyfile.json', + * }); + * + * @example include:samples/quickstart.js + * region_tag:translate_quickstart + * Full quickstart example: + */ diff --git a/packages/google-cloud-translate/system-test/translate.js b/packages/google-cloud-translate/system-test/translate.ts similarity index 97% rename from packages/google-cloud-translate/system-test/translate.js rename to packages/google-cloud-translate/system-test/translate.ts index 1504ac5c948..3f641d1fcc9 100644 --- a/packages/google-cloud-translate/system-test/translate.js +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -16,10 +16,9 @@ 'use strict'; -var assert = require('assert'); -var prop = require('propprop'); - -var Translate = require('../'); +import * as assert from 'assert'; +import * as prop from 'propprop'; +import {Translate} from '../src'; var API_KEY = process.env.TRANSLATE_API_KEY; diff --git a/packages/google-cloud-translate/test/index.js b/packages/google-cloud-translate/test/index.ts similarity index 83% rename from packages/google-cloud-translate/test/index.js rename to packages/google-cloud-translate/test/index.ts index 76913a6f4f5..19a10bcbf3c 100644 --- a/packages/google-cloud-translate/test/index.js +++ b/packages/google-cloud-translate/test/index.ts @@ -16,48 +16,50 @@ 'use strict'; -var assert = require('assert'); -var extend = require('extend'); -var proxyquire = require('proxyquire'); -var util = require('@google-cloud/common').util; - -var makeRequestOverride; -var promisified = false; -var fakeUtil = extend({}, util, { - makeRequest: function() { +import * as assert from 'assert'; +import * as extend from 'extend'; +import * as proxyquire from 'proxyquire'; +import {util} from '@google-cloud/common'; + +const pkgJson = require('../../package.json'); + +let makeRequestOverride; +let promisified = false; +const fakeUtil = extend({}, util, { + makeRequest() { if (makeRequestOverride) { return makeRequestOverride.apply(null, arguments); } return util.makeRequest.apply(null, arguments); }, - promisifyAll: function(Class) { + promisifyAll(Class) { if (Class.name === 'Translate') { promisified = true; } }, }); -var originalFakeUtil = extend(true, {}, fakeUtil); +const originalFakeUtil = extend(true, {}, fakeUtil); function FakeService() { this.calledWith_ = arguments; } describe('Translate', function() { - var OPTIONS = { + const OPTIONS = { projectId: 'test-project', }; - var Translate; - var translate; + let Translate; + let translate; before(function() { - Translate = proxyquire('../', { + Translate = proxyquire('../src', { '@google-cloud/common': { util: fakeUtil, Service: FakeService, }, - }); + }).Translate; }); beforeEach(function() { @@ -72,43 +74,22 @@ describe('Translate', function() { assert(promisified); }); - it('should work without new', function() { - assert.doesNotThrow(function() { - Translate(OPTIONS); - }); - }); - - it('should normalize the arguments', function() { - var normalizeArgumentsCalled = false; - var options = {}; - - fakeUtil.normalizeArguments = function(context, options_, config) { - normalizeArgumentsCalled = true; - assert.strictEqual(options_, options); - assert.strictEqual(config.projectIdRequired, false); - return options_; - }; - - new Translate(options); - assert.strictEqual(normalizeArgumentsCalled, true); - }); - it('should inherit from Service', function() { assert(translate instanceof FakeService); - var calledWith = translate.calledWith_[0]; - var baseUrl = 'https://translation.googleapis.com/language/translate/v2'; + const calledWith = translate.calledWith_[0]; + const baseUrl = 'https://translation.googleapis.com/language/translate/v2'; assert.strictEqual(calledWith.baseUrl, baseUrl); assert.deepEqual(calledWith.scopes, [ 'https://www.googleapis.com/auth/cloud-platform', ]); - assert.deepEqual(calledWith.packageJson, require('../package.json')); + assert.deepEqual(calledWith.packageJson, pkgJson); assert.strictEqual(calledWith.projectIdRequired, false); }); describe('Using an API Key', function() { - var KEY_OPTIONS = { + const KEY_OPTIONS = { key: 'api-key', }; @@ -117,8 +98,8 @@ describe('Translate', function() { }); it('should localize the options', function() { - var options = {key: '...'}; - var translate = new Translate(options); + const options = {key: '...'}; + const translate = new Translate(options); assert.strictEqual(translate.options.key, options.key); }); @@ -128,8 +109,8 @@ describe('Translate', function() { }); describe('GOOGLE_CLOUD_TRANSLATE_ENDPOINT', function() { - var CUSTOM_ENDPOINT = '...'; - var translate; + const CUSTOM_ENDPOINT = '...'; + let translate; before(function() { process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT = CUSTOM_ENDPOINT; @@ -141,18 +122,18 @@ describe('Translate', function() { }); it('should correctly set the baseUrl', function() { - var baseUrl = translate.calledWith_[0].baseUrl; + const baseUrl = translate.calledWith_[0].baseUrl; assert.strictEqual(baseUrl, CUSTOM_ENDPOINT); }); it('should remove trailing slashes', function() { - var expectedBaseUrl = 'http://localhost:8080'; + const expectedBaseUrl = 'http://localhost:8080'; process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT = 'http://localhost:8080//'; - var translate = new Translate(OPTIONS); - var baseUrl = translate.calledWith_[0].baseUrl; + const translate = new Translate(OPTIONS); + const baseUrl = translate.calledWith_[0].baseUrl; assert.strictEqual(baseUrl, expectedBaseUrl); }); @@ -160,7 +141,7 @@ describe('Translate', function() { }); describe('detect', function() { - var INPUT = 'input'; + const INPUT = 'input'; it('should make the correct API request', function(done) { translate.request = function(reqOpts) { @@ -174,8 +155,8 @@ describe('Translate', function() { }); describe('error', function() { - var error = new Error('Error.'); - var apiResponse = {}; + const error = new Error('Error.'); + const apiResponse = {}; beforeEach(function() { translate.request = function(reqOpts, callback) { @@ -194,7 +175,7 @@ describe('Translate', function() { }); describe('success', function() { - var apiResponse = { + const apiResponse = { data: { detections: [ [ @@ -208,9 +189,9 @@ describe('Translate', function() { }, }; - var originalApiResponse = extend({}, apiResponse); + const originalApiResponse = extend({}, apiResponse); - var expectedResults = { + const expectedResults = { a: 'b', c: 'd', input: INPUT, @@ -278,8 +259,8 @@ describe('Translate', function() { }); describe('error', function() { - var error = new Error('Error.'); - var apiResponse = {}; + const error = new Error('Error.'); + const apiResponse = {}; beforeEach(function() { translate.request = function(reqOpts, callback) { @@ -298,7 +279,7 @@ describe('Translate', function() { }); describe('success', function() { - var apiResponse = { + const apiResponse = { data: { languages: [ { @@ -313,7 +294,7 @@ describe('Translate', function() { }, }; - var expectedResults = [ + const expectedResults = [ { code: 'en', name: 'English', @@ -342,12 +323,12 @@ describe('Translate', function() { }); describe('translate', function() { - var INPUT = 'Hello'; - var INPUT_HTML = 'Hello'; - var SOURCE_LANG_CODE = 'en'; - var TARGET_LANG_CODE = 'es'; + const INPUT = 'Hello'; + const INPUT_HTML = 'Hello'; + const SOURCE_LANG_CODE = 'en'; + const TARGET_LANG_CODE = 'es'; - var OPTIONS = { + const OPTIONS = { from: SOURCE_LANG_CODE, to: TARGET_LANG_CODE, }; @@ -408,7 +389,7 @@ describe('Translate', function() { }); it('should allow overriding the format', function(done) { - var options = extend({}, OPTIONS, { + const options = extend({}, OPTIONS, { format: 'custom format', }); @@ -423,7 +404,7 @@ describe('Translate', function() { describe('options.model', function() { it('should set the model option when available', function(done) { - var fakeOptions = { + const fakeOptions = { model: 'nmt', to: 'es', }; @@ -454,8 +435,8 @@ describe('Translate', function() { }); describe('error', function() { - var error = new Error('Error.'); - var apiResponse = {}; + const error = new Error('Error.'); + const apiResponse = {}; beforeEach(function() { translate.request = function(reqOpts, callback) { @@ -474,7 +455,7 @@ describe('Translate', function() { }); describe('success', function() { - var apiResponse = { + const apiResponse = { data: { translations: [ { @@ -486,7 +467,7 @@ describe('Translate', function() { }, }; - var expectedResults = apiResponse.data.translations[0].translatedText; + const expectedResults = apiResponse.data.translations[0].translatedText; beforeEach(function() { translate.request = function(reqOpts, callback) { @@ -504,7 +485,7 @@ describe('Translate', function() { }); it('should execute callback with multiple results', function(done) { - var input = [INPUT, INPUT]; + const input = [INPUT, INPUT]; translate.translate(input, OPTIONS, function(err, translations) { assert.ifError(err); assert.deepEqual(translations, [expectedResults]); @@ -524,7 +505,7 @@ describe('Translate', function() { describe('request', function() { describe('OAuth mode', function() { - var request; + let request; beforeEach(function() { request = FakeService.prototype.request; @@ -535,7 +516,7 @@ describe('Translate', function() { }); it('should make the correct request', function(done) { - var fakeOptions = { + const fakeOptions = { uri: '/test', a: 'b', json: { @@ -553,7 +534,7 @@ describe('Translate', function() { }); describe('API key mode', function() { - var KEY_OPTIONS = { + const KEY_OPTIONS = { key: 'api-key', }; @@ -562,16 +543,16 @@ describe('Translate', function() { }); it('should make the correct request', function(done) { - var userAgent = 'user-agent/0.0.0'; + const userAgent = 'user-agent/0.0.0'; - var getUserAgentFn = fakeUtil.getUserAgentFromPackageJson; + const getUserAgentFn = fakeUtil.getUserAgentFromPackageJson; fakeUtil.getUserAgentFromPackageJson = function(packageJson) { fakeUtil.getUserAgentFromPackageJson = getUserAgentFn; - assert.deepEqual(packageJson, require('../package.json')); + assert.deepEqual(packageJson, pkgJson); return userAgent; }; - var reqOpts = { + const reqOpts = { uri: '/test', a: 'b', c: 'd', @@ -581,7 +562,7 @@ describe('Translate', function() { }, }; - var expectedReqOpts = extend(true, {}, reqOpts, { + const expectedReqOpts = extend(true, {}, reqOpts, { qs: { key: translate.key, }, diff --git a/packages/google-cloud-translate/test/mocha.opts b/packages/google-cloud-translate/test/mocha.opts new file mode 100644 index 00000000000..0f2b2e99425 --- /dev/null +++ b/packages/google-cloud-translate/test/mocha.opts @@ -0,0 +1,4 @@ +--require hard-rejection/register +--require source-map-support/register +--require intelli-espower-loader +--timeout 10000 diff --git a/packages/google-cloud-translate/tsconfig.json b/packages/google-cloud-translate/tsconfig.json new file mode 100644 index 00000000000..45d3f30784b --- /dev/null +++ b/packages/google-cloud-translate/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "noImplicitAny": false, + "esModuleInterop": false, + "allowSyntheticDefaultImports": false, + "noImplicitThis": false + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts" + ] +} diff --git a/packages/google-cloud-translate/tslint.json b/packages/google-cloud-translate/tslint.json new file mode 100644 index 00000000000..617dc975bae --- /dev/null +++ b/packages/google-cloud-translate/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "gts/tslint.json" +} From f916e6d0c111b339fc895a16fae141410bc6da47 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 11 Jul 2018 12:09:12 -0400 Subject: [PATCH 112/513] docs: fix small typos (#71) --- packages/google-cloud-translate/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 85eaaa8c834..d7fc9da0087 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -154,7 +154,7 @@ export class Translate extends common.Service { * * //- * // Detect the languages used in multiple strings. Note that the results are - * // now provied as an array. + * // now provided as an array. * //- * translate.detect([ * 'Hello', @@ -261,7 +261,7 @@ export class Translate extends common.Service { * * @example include:samples/translate.js * region_tag:translate_list_language_names - * Gets the language names in a langauge other than English: + * Gets the language names in a language other than English: */ getLanguages(target, callback?) { if (is.fn(target)) { @@ -367,7 +367,7 @@ export class Translate extends common.Service { * * //- * // Translate multiple strings of input. Note that the results are - * // now provied as an array. + * // now provided as an array. * //- * var input = [ * 'Hello', From 5f1ef21e2b9e261d316de23a4a83d3712286567d Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 11 Jul 2018 15:34:47 -0400 Subject: [PATCH 113/513] docs: fix link (#72) --- packages/google-cloud-translate/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index d7fc9da0087..d969b8a8d5b 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -495,7 +495,7 @@ common.util.promisifyAll(Translate, { exclude: ['request']}); * The `@google-cloud/translate` package has a single default export, the * {@link Translate} class. * - * See {@link Storage} and {@link ClientConfig} for client methods and + * See {@link Translate} and {@link ClientConfig} for client methods and * configuration options. * * @module {constructor} @google-cloud/translate From 0c136d44f06c9d7836b0f54e3c3609a416ec5046 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 16 Jul 2018 19:10:06 -0700 Subject: [PATCH 114/513] chore(deps): lock file maintenance (#74) --- .../google-cloud-translate/package-lock.json | 1404 ++++++++++++----- 1 file changed, 1049 insertions(+), 355 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 2ae9aef1b45..155f7b506f0 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -236,59 +236,59 @@ } }, "@google-cloud/nodejs-repo-tools": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.3.0.tgz", - "integrity": "sha512-c8dIGESnNkmM88duFxGHvMQP5QKPgp/sfJq0QhC6+gOcJC7/PKjqd0PkmgPPeIgVl6SXy5Zf/KLbxnJUVgNT1Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.3.1.tgz", + "integrity": "sha512-yIOn92sjHwpF/eORQWjv7QzQPcESSRCsZshdmeX40RGRlB0+HPODRDghZq0GiCqe6zpIYZvKmiKiYd3u52P/7Q==", "dev": true, "requires": { "ava": "0.25.0", "colors": "1.1.2", "fs-extra": "5.0.0", - "got": "8.2.0", + "got": "8.3.0", "handlebars": "4.0.11", "lodash": "4.17.5", - "nyc": "11.4.1", + "nyc": "11.7.2", "proxyquire": "1.8.0", "semver": "^5.5.0", - "sinon": "4.3.0", + "sinon": "6.0.1", "string": "3.3.3", - "supertest": "3.0.0", + "supertest": "3.1.0", "yargs": "11.0.0", - "yargs-parser": "9.0.2" + "yargs-parser": "10.1.0" }, "dependencies": { "nyc": { - "version": "11.4.1", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.4.1.tgz", - "integrity": "sha512-5eCZpvaksFVjP2rt1r60cfXmt3MUtsQDw8bAzNqNEr4WLvUMLgiVENMf/B9bE9YAX0mGVvaGA3v9IS9ekNqB1Q==", + "version": "11.7.2", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.7.2.tgz", + "integrity": "sha512-gBt7qwsR1vryYfglVjQRx1D+AtMZW5NbUKxb+lZe8SN8KsheGCPGWEsSC9AGQG+r2+te1+10uPHUCahuqm1nGQ==", "dev": true, "requires": { "archy": "^1.0.0", "arrify": "^1.0.1", "caching-transform": "^1.0.0", - "convert-source-map": "^1.3.0", + "convert-source-map": "^1.5.1", "debug-log": "^1.0.1", "default-require-extensions": "^1.0.0", "find-cache-dir": "^0.1.1", "find-up": "^2.1.0", "foreground-child": "^1.5.3", "glob": "^7.0.6", - "istanbul-lib-coverage": "^1.1.1", + "istanbul-lib-coverage": "^1.1.2", "istanbul-lib-hook": "^1.1.0", - "istanbul-lib-instrument": "^1.9.1", - "istanbul-lib-report": "^1.1.2", - "istanbul-lib-source-maps": "^1.2.2", - "istanbul-reports": "^1.1.3", + "istanbul-lib-instrument": "^1.10.0", + "istanbul-lib-report": "^1.1.3", + "istanbul-lib-source-maps": "^1.2.3", + "istanbul-reports": "^1.4.0", "md5-hex": "^1.2.0", - "merge-source-map": "^1.0.2", - "micromatch": "^2.3.11", + "merge-source-map": "^1.1.0", + "micromatch": "^3.1.10", "mkdirp": "^0.5.0", "resolve-from": "^2.0.0", - "rimraf": "^2.5.4", + "rimraf": "^2.6.2", "signal-exit": "^3.0.1", "spawn-wrap": "^1.4.2", - "test-exclude": "^4.1.1", - "yargs": "^10.0.3", + "test-exclude": "^4.2.0", + "yargs": "11.1.0", "yargs-parser": "^8.0.0" }, "dependencies": { @@ -331,20 +331,22 @@ "dev": true }, "arr-diff": { - "version": "2.0.0", + "version": "4.0.0", "bundled": true, - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } + "dev": true }, "arr-flatten": { "version": "1.1.0", "bundled": true, "dev": true }, + "arr-union": { + "version": "3.1.0", + "bundled": true, + "dev": true + }, "array-unique": { - "version": "0.2.1", + "version": "0.3.2", "bundled": true, "dev": true }, @@ -353,11 +355,21 @@ "bundled": true, "dev": true }, + "assign-symbols": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, "async": { "version": "1.5.2", "bundled": true, "dev": true }, + "atob": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, "babel-code-frame": { "version": "6.26.0", "bundled": true, @@ -369,7 +381,7 @@ } }, "babel-generator": { - "version": "6.26.0", + "version": "6.26.1", "bundled": true, "dev": true, "requires": { @@ -379,7 +391,7 @@ "detect-indent": "^4.0.0", "jsesc": "^1.3.0", "lodash": "^4.17.4", - "source-map": "^0.5.6", + "source-map": "^0.5.7", "trim-right": "^1.0.1" } }, @@ -449,8 +461,63 @@ "bundled": true, "dev": true }, + "base": { + "version": "0.11.2", + "bundled": true, + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, "brace-expansion": { - "version": "1.1.8", + "version": "1.1.11", "bundled": true, "dev": true, "requires": { @@ -459,13 +526,30 @@ } }, "braces": { - "version": "1.8.5", + "version": "2.3.2", "bundled": true, "dev": true, "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "builtin-modules": { @@ -473,6 +557,22 @@ "bundled": true, "dev": true }, + "cache-base": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, "caching-transform": { "version": "1.0.1", "bundled": true, @@ -511,6 +611,27 @@ "supports-color": "^2.0.0" } }, + "class-utils": { + "version": "0.3.6", + "bundled": true, + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "cliui": { "version": "2.1.0", "bundled": true, @@ -535,11 +656,25 @@ "bundled": true, "dev": true }, + "collection-visit": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, "commondir": { "version": "1.0.1", "bundled": true, "dev": true }, + "component-emitter": { + "version": "1.2.1", + "bundled": true, + "dev": true + }, "concat-map": { "version": "0.0.1", "bundled": true, @@ -550,8 +685,13 @@ "bundled": true, "dev": true }, + "copy-descriptor": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, "core-js": { - "version": "2.5.3", + "version": "2.5.6", "bundled": true, "dev": true }, @@ -582,6 +722,11 @@ "bundled": true, "dev": true }, + "decode-uri-component": { + "version": "0.2.0", + "bundled": true, + "dev": true + }, "default-require-extensions": { "version": "1.0.0", "bundled": true, @@ -590,6 +735,48 @@ "strip-bom": "^2.0.0" } }, + "define-property": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, "detect-indent": { "version": "4.0.0", "bundled": true, @@ -643,44 +830,139 @@ } }, "expand-brackets": { - "version": "0.1.5", + "version": "2.1.4", "bundled": true, "dev": true, "requires": { - "is-posix-bracket": "^0.1.0" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, - "expand-range": { - "version": "1.8.2", + "extend-shallow": { + "version": "3.0.2", "bundled": true, "dev": true, "requires": { - "fill-range": "^2.1.0" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } } }, "extglob": { - "version": "0.3.2", + "version": "2.0.4", "bundled": true, "dev": true, "requires": { - "is-extglob": "^1.0.0" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } } }, - "filename-regex": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, "fill-range": { - "version": "2.2.3", + "version": "4.0.0", "bundled": true, "dev": true, "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^1.1.3", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "find-cache-dir": { @@ -706,21 +988,21 @@ "bundled": true, "dev": true }, - "for-own": { - "version": "0.1.5", + "foreground-child": { + "version": "1.5.6", "bundled": true, "dev": true, "requires": { - "for-in": "^1.0.1" + "cross-spawn": "^4", + "signal-exit": "^3.0.0" } }, - "foreground-child": { - "version": "1.5.6", + "fragment-cache": { + "version": "0.2.1", "bundled": true, "dev": true, "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" + "map-cache": "^0.2.2" } }, "fs.realpath": { @@ -738,6 +1020,11 @@ "bundled": true, "dev": true }, + "get-value": { + "version": "2.0.6", + "bundled": true, + "dev": true + }, "glob": { "version": "7.1.2", "bundled": true, @@ -751,23 +1038,6 @@ "path-is-absolute": "^1.0.0" } }, - "glob-base": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - } - }, - "glob-parent": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, "globals": { "version": "9.18.0", "bundled": true, @@ -812,8 +1082,37 @@ "bundled": true, "dev": true }, + "has-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "hosted-git-info": { - "version": "2.5.0", + "version": "2.6.0", "bundled": true, "dev": true }, @@ -837,7 +1136,7 @@ "dev": true }, "invariant": { - "version": "2.2.2", + "version": "2.2.4", "bundled": true, "dev": true, "requires": { @@ -849,8 +1148,16 @@ "bundled": true, "dev": true }, - "is-arrayish": { - "version": "0.2.1", + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-arrayish": { + "version": "0.2.1", "bundled": true, "dev": true }, @@ -867,17 +1174,29 @@ "builtin-modules": "^1.0.0" } }, - "is-dotfile": { - "version": "1.0.3", + "is-data-descriptor": { + "version": "0.1.4", "bundled": true, - "dev": true + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } }, - "is-equal-shallow": { - "version": "0.1.3", + "is-descriptor": { + "version": "0.1.6", "bundled": true, "dev": true, "requires": { - "is-primitive": "^2.0.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true + } } }, "is-extendable": { @@ -885,11 +1204,6 @@ "bundled": true, "dev": true }, - "is-extglob": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, "is-finite": { "version": "1.0.2", "bundled": true, @@ -899,39 +1213,41 @@ } }, "is-fullwidth-code-point": { - "version": "1.0.0", + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "is-number": { + "version": "3.0.0", "bundled": true, "dev": true, "requires": { - "number-is-nan": "^1.0.0" + "kind-of": "^3.0.2" } }, - "is-glob": { - "version": "2.0.1", + "is-odd": { + "version": "2.0.0", "bundled": true, "dev": true, "requires": { - "is-extglob": "^1.0.0" + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "bundled": true, + "dev": true + } } }, - "is-number": { - "version": "2.1.0", + "is-plain-object": { + "version": "2.0.4", "bundled": true, "dev": true, "requires": { - "kind-of": "^3.0.2" + "isobject": "^3.0.1" } }, - "is-posix-bracket": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, "is-stream": { "version": "1.1.0", "bundled": true, @@ -942,6 +1258,11 @@ "bundled": true, "dev": true }, + "is-windows": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, "isarray": { "version": "1.0.0", "bundled": true, @@ -953,15 +1274,12 @@ "dev": true }, "isobject": { - "version": "2.1.0", + "version": "3.0.1", "bundled": true, - "dev": true, - "requires": { - "isarray": "1.0.0" - } + "dev": true }, "istanbul-lib-coverage": { - "version": "1.1.1", + "version": "1.2.0", "bundled": true, "dev": true }, @@ -974,7 +1292,7 @@ } }, "istanbul-lib-instrument": { - "version": "1.9.1", + "version": "1.10.1", "bundled": true, "dev": true, "requires": { @@ -983,16 +1301,16 @@ "babel-traverse": "^6.18.0", "babel-types": "^6.18.0", "babylon": "^6.18.0", - "istanbul-lib-coverage": "^1.1.1", + "istanbul-lib-coverage": "^1.2.0", "semver": "^5.3.0" } }, "istanbul-lib-report": { - "version": "1.1.2", + "version": "1.1.3", "bundled": true, "dev": true, "requires": { - "istanbul-lib-coverage": "^1.1.1", + "istanbul-lib-coverage": "^1.1.2", "mkdirp": "^0.5.1", "path-parse": "^1.0.5", "supports-color": "^3.1.2" @@ -1009,12 +1327,12 @@ } }, "istanbul-lib-source-maps": { - "version": "1.2.2", + "version": "1.2.3", "bundled": true, "dev": true, "requires": { "debug": "^3.1.0", - "istanbul-lib-coverage": "^1.1.1", + "istanbul-lib-coverage": "^1.1.2", "mkdirp": "^0.5.1", "rimraf": "^2.6.1", "source-map": "^0.5.3" @@ -1031,7 +1349,7 @@ } }, "istanbul-reports": { - "version": "1.1.3", + "version": "1.4.0", "bundled": true, "dev": true, "requires": { @@ -1099,7 +1417,7 @@ } }, "lodash": { - "version": "4.17.4", + "version": "4.17.10", "bundled": true, "dev": true }, @@ -1117,7 +1435,7 @@ } }, "lru-cache": { - "version": "4.1.1", + "version": "4.1.3", "bundled": true, "dev": true, "requires": { @@ -1125,6 +1443,19 @@ "yallist": "^2.1.2" } }, + "map-cache": { + "version": "0.2.2", + "bundled": true, + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, "md5-hex": { "version": "1.3.0", "bundled": true, @@ -1147,35 +1478,49 @@ } }, "merge-source-map": { - "version": "1.0.4", + "version": "1.1.0", "bundled": true, "dev": true, "requires": { - "source-map": "^0.5.6" + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } } }, "micromatch": { - "version": "2.3.11", - "bundled": true, - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" + "version": "3.1.10", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } } }, "mimic-fn": { - "version": "1.1.0", + "version": "1.2.0", "bundled": true, "dev": true }, @@ -1192,6 +1537,25 @@ "bundled": true, "dev": true }, + "mixin-deep": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "mkdirp": { "version": "0.5.1", "bundled": true, @@ -1205,6 +1569,32 @@ "bundled": true, "dev": true }, + "nanomatch": { + "version": "1.2.9", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, "normalize-package-data": { "version": "2.4.0", "bundled": true, @@ -1216,14 +1606,6 @@ "validate-npm-package-license": "^3.0.1" } }, - "normalize-path": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, "npm-run-path": { "version": "2.0.2", "bundled": true, @@ -1242,13 +1624,40 @@ "bundled": true, "dev": true }, - "object.omit": { - "version": "2.0.1", + "object-copy": { + "version": "0.1.0", "bundled": true, "dev": true, "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "isobject": "^3.0.1" } }, "once": { @@ -1289,9 +1698,12 @@ "dev": true }, "p-limit": { - "version": "1.1.0", + "version": "1.2.0", "bundled": true, - "dev": true + "dev": true, + "requires": { + "p-try": "^1.0.0" + } }, "p-locate": { "version": "2.0.0", @@ -1301,16 +1713,10 @@ "p-limit": "^1.1.0" } }, - "parse-glob": { - "version": "3.0.4", + "p-try": { + "version": "1.0.0", "bundled": true, - "dev": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - } + "dev": true }, "parse-json": { "version": "2.2.0", @@ -1320,6 +1726,11 @@ "error-ex": "^1.2.0" } }, + "pascalcase": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, "path-exists": { "version": "2.1.0", "bundled": true, @@ -1390,8 +1801,8 @@ } } }, - "preserve": { - "version": "0.2.0", + "posix-character-classes": { + "version": "0.1.1", "bundled": true, "dev": true }, @@ -1400,43 +1811,6 @@ "bundled": true, "dev": true }, - "randomatic": { - "version": "1.1.7", - "bundled": true, - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "read-pkg": { "version": "1.1.0", "bundled": true, @@ -1472,19 +1846,15 @@ "bundled": true, "dev": true }, - "regex-cache": { - "version": "0.4.4", + "regex-not": { + "version": "1.0.2", "bundled": true, "dev": true, "requires": { - "is-equal-shallow": "^0.1.3" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, - "remove-trailing-separator": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, "repeat-element": { "version": "1.1.2", "bundled": true, @@ -1518,6 +1888,16 @@ "bundled": true, "dev": true }, + "resolve-url": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "ret": { + "version": "0.1.15", + "bundled": true, + "dev": true + }, "right-align": { "version": "0.1.3", "bundled": true, @@ -1527,49 +1907,187 @@ "align-text": "^0.1.1" } }, - "rimraf": { - "version": "2.6.2", + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-regex": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "set-value": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true + }, + "slide": { + "version": "1.1.6", + "bundled": true, + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", "bundled": true, "dev": true, "requires": { - "glob": "^7.0.5" + "kind-of": "^3.2.0" } }, - "semver": { - "version": "5.4.1", - "bundled": true, - "dev": true - }, - "set-blocking": { - "version": "2.0.0", + "source-map": { + "version": "0.5.7", "bundled": true, "dev": true }, - "shebang-command": { - "version": "1.2.0", + "source-map-resolve": { + "version": "0.5.1", "bundled": true, "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "atob": "^2.0.0", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" } }, - "shebang-regex": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "slide": { - "version": "1.1.6", - "bundled": true, - "dev": true - }, - "source-map": { - "version": "0.5.7", + "source-map-url": { + "version": "0.4.0", "bundled": true, "dev": true }, @@ -1587,23 +2105,60 @@ } }, "spdx-correct": { - "version": "1.0.2", + "version": "3.0.0", "bundled": true, "dev": true, "requires": { - "spdx-license-ids": "^1.0.2" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, - "spdx-expression-parse": { - "version": "1.0.4", + "spdx-exceptions": { + "version": "2.1.0", "bundled": true, "dev": true }, + "spdx-expression-parse": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "spdx-license-ids": { - "version": "1.2.2", + "version": "3.0.0", "bundled": true, "dev": true }, + "split-string": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "static-extend": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "string-width": { "version": "2.1.1", "bundled": true, @@ -1618,11 +2173,6 @@ "bundled": true, "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, "strip-ansi": { "version": "4.0.0", "bundled": true, @@ -1660,12 +2210,12 @@ "dev": true }, "test-exclude": { - "version": "4.1.1", + "version": "4.2.1", "bundled": true, "dev": true, "requires": { "arrify": "^1.0.1", - "micromatch": "^2.3.11", + "micromatch": "^3.1.8", "object-assign": "^4.1.0", "read-pkg-up": "^1.0.1", "require-main-filename": "^1.0.1" @@ -1676,6 +2226,34 @@ "bundled": true, "dev": true }, + "to-object-path": { + "version": "0.3.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "to-regex": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, "trim-right": { "version": "1.0.1", "bundled": true, @@ -1712,13 +2290,101 @@ "dev": true, "optional": true }, + "union-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unset-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "bundled": true, + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "bundled": true, + "dev": true + } + } + }, + "urix": { + "version": "0.1.0", + "bundled": true, + "dev": true + }, + "use": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, "validate-npm-package-license": { - "version": "3.0.1", + "version": "3.0.3", "bundled": true, "dev": true, "requires": { - "spdx-correct": "~1.0.0", - "spdx-expression-parse": "~1.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "which": { @@ -1754,6 +2420,14 @@ "strip-ansi": "^3.0.1" }, "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, "string-width": { "version": "1.0.2", "bundled": true, @@ -1792,11 +2466,11 @@ "dev": true }, "yargs": { - "version": "10.0.3", + "version": "11.1.0", "bundled": true, "dev": true, "requires": { - "cliui": "^3.2.0", + "cliui": "^4.0.0", "decamelize": "^1.1.1", "find-up": "^2.1.0", "get-caller-file": "^1.0.1", @@ -1807,35 +2481,49 @@ "string-width": "^2.0.0", "which-module": "^2.0.0", "y18n": "^3.2.1", - "yargs-parser": "^8.0.0" + "yargs-parser": "^9.0.2" }, "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "bundled": true, + "dev": true + }, "cliui": { - "version": "3.2.0", + "version": "4.1.0", "bundled": true, "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - } + } + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "yargs-parser": { + "version": "9.0.2", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "^4.1.0" } } } }, "yargs-parser": { - "version": "8.0.0", + "version": "8.1.0", "bundled": true, "dev": true, "requires": { @@ -1965,9 +2653,9 @@ "dev": true }, "@types/mocha": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.4.tgz", - "integrity": "sha512-XMHApnKWI0jvXU5gLcSTsRjJBpSzP0BG+2oGv98JFyS4a5R0tRy0oshHBRndb3BuHb9AwDKaUL8Ja7GfUvsG4g==", + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", + "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", "dev": true }, "@types/node": { @@ -2182,6 +2870,12 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", @@ -3084,14 +3778,6 @@ "async": "^1.5.2", "glob": "^7.0.0", "resolve": "^1.1.6" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - } } }, "clean-stack": { @@ -3244,9 +3930,9 @@ } }, "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.16.0.tgz", + "integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==", "dev": true }, "common-path-prefix": { @@ -3861,9 +4547,9 @@ "dev": true }, "escodegen": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.10.0.tgz", - "integrity": "sha512-fjUOf8johsv23WuIKdNQU4P9t9jhQ4Qzx6pC2uW890OloK3Zs1ZAoCNpg/2larNF501jLl3UNy0kIRcF6VI22g==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", + "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", "dev": true, "requires": { "esprima": "^3.1.3", @@ -4148,9 +4834,9 @@ } }, "esprima": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "espurify": { @@ -5008,9 +5694,9 @@ } }, "get-caller-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", "dev": true }, "get-port": { @@ -5147,9 +5833,9 @@ } }, "got": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/got/-/got-8.2.0.tgz", - "integrity": "sha512-giadqJpXIwjY+ZsuWys8p2yjZGhOHiU4hiJHjS/oeCxw1u8vANQz3zPlrxW2Zw/siCXsSMI3hvzWGcnFyujyAg==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/got/-/got-8.3.0.tgz", + "integrity": "sha512-kBNy/S2CGwrYgDSec5KTWGKUvupwkkTVAjIsVFF2shXO13xpZdFP4d4kxa//CLX2tN/rV0aYwK8vY6UKWGn2vQ==", "dev": true, "requires": { "@sindresorhus/is": "^0.7.0", @@ -5162,7 +5848,7 @@ "isurl": "^1.0.0-alpha5", "lowercase-keys": "^1.0.0", "mimic-response": "^1.0.0", - "p-cancelable": "^0.3.0", + "p-cancelable": "^0.4.0", "p-timeout": "^2.0.1", "pify": "^3.0.0", "safe-buffer": "^5.1.1", @@ -5370,9 +6056,9 @@ } }, "rxjs": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.1.tgz", - "integrity": "sha512-OwMxHxmnmHTUpgO+V7dZChf3Tixf4ih95cmXjzzadULziVl/FKhHScGLj4goEw9weePVOH2Q0+GcCBUhKCZc/g==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.2.tgz", + "integrity": "sha512-0MI8+mkKAXZUF9vMrEoPnaoHkfzBPP4IGwUYRJhIRJF6/w3uByO1e91bEHn8zd43RdkTMKiooYKmwz7RH6zfOQ==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -5389,15 +6075,6 @@ "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", "dev": true - }, - "yargs-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", - "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } } } }, @@ -5413,12 +6090,6 @@ "uglify-js": "^2.6" }, "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, "source-map": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", @@ -6717,9 +7388,9 @@ "dev": true }, "mimic-response": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.0.tgz", - "integrity": "sha1-3z02Uqc/3ta5sLJBRub9BSNTRY4=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", "dev": true }, "minimatch": { @@ -6773,6 +7444,14 @@ "minimatch": "3.0.4", "mkdirp": "0.5.1", "supports-color": "5.4.0" + }, + "dependencies": { + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + } } }, "module-not-found-error": { @@ -9116,9 +9795,9 @@ "dev": true }, "p-cancelable": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", - "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", + "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==", "dev": true }, "p-finally": { @@ -10138,18 +10817,18 @@ "dev": true }, "sinon": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-4.3.0.tgz", - "integrity": "sha512-pmf05hFgEZUS52AGJcsVjOjqAyJW2yo14cOwVYvzCyw7+inv06YXkLyW75WG6X6p951lzkoKh51L2sNbR9CDvw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-6.0.1.tgz", + "integrity": "sha512-rfszhNcfamK2+ofIPi9XqeH89pH7KGDcAtM+F9CsjHXOK3jzWG99vyhyD2V+r7s4IipmWcWUFYq4ftZ9/Eu2Wg==", "dev": true, "requires": { "@sinonjs/formatio": "^2.0.0", - "diff": "^3.1.0", + "diff": "^3.5.0", "lodash.get": "^4.4.2", - "lolex": "^2.2.0", - "nise": "^1.2.0", - "supports-color": "^5.1.0", - "type-detect": "^4.0.5" + "lolex": "^2.4.2", + "nise": "^1.3.3", + "supports-color": "^5.4.0", + "type-detect": "^4.0.8" } }, "slash": { @@ -10410,9 +11089,9 @@ "integrity": "sha1-6NK6H6nJBXAwPAMLaQD31fiavls=" }, "superagent": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", - "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.2.tgz", + "integrity": "sha512-gVH4QfYHcY3P0f/BZzavLreHW3T1v7hG9B+hpMQotGQqurOvhv87GcMCd6LWySmBuf+BDR44TQd0aISjVHLeNQ==", "dev": true, "requires": { "component-emitter": "^1.2.0", @@ -10420,11 +11099,11 @@ "debug": "^3.1.0", "extend": "^3.0.0", "form-data": "^2.3.1", - "formidable": "^1.2.0", + "formidable": "^1.1.1", "methods": "^1.1.1", "mime": "^1.4.1", "qs": "^6.5.1", - "readable-stream": "^2.3.5" + "readable-stream": "^2.0.5" }, "dependencies": { "mime": { @@ -10449,13 +11128,13 @@ } }, "supertest": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/supertest/-/supertest-3.0.0.tgz", - "integrity": "sha1-jUu2j9GDDuBwM7HFpamkAhyWUpY=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-3.1.0.tgz", + "integrity": "sha512-O44AMnmJqx294uJQjfUmEyYOg7d9mylNFsMw/Wkz4evKd1njyPrtCN+U6ZIC7sKtfEVQhfTqFFijlXx8KP/Czw==", "dev": true, "requires": { "methods": "~1.1.2", - "superagent": "^3.0.0" + "superagent": "3.8.2" } }, "supports-color": { @@ -10629,9 +11308,9 @@ "dev": true }, "tslint": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.10.0.tgz", - "integrity": "sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.11.0.tgz", + "integrity": "sha1-mPMMAurjzecAYgHkwzywi0hYHu0=", "dev": true, "requires": { "babel-code-frame": "^6.22.0", @@ -10645,7 +11324,7 @@ "resolve": "^1.3.2", "semver": "^5.3.0", "tslib": "^1.8.0", - "tsutils": "^2.12.1" + "tsutils": "^2.27.2" }, "dependencies": { "resolve": { @@ -11097,6 +11776,12 @@ "yargs-parser": "^9.0.2" }, "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -11107,13 +11792,22 @@ "strip-ansi": "^4.0.0", "wrap-ansi": "^2.0.0" } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } } } }, "yargs-parser": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", - "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", "dev": true, "requires": { "camelcase": "^4.1.0" From fa98108713544a751b752dc536b7bf84cbae7597 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 18 Jul 2018 11:20:22 -0700 Subject: [PATCH 115/513] chore(deps): update dependency eslint-plugin-node to v7 (#75) --- .../google-cloud-translate/package-lock.json | 78 +++++++++++++++---- packages/google-cloud-translate/package.json | 2 +- 2 files changed, 63 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 155f7b506f0..6f69a834d1d 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -296,6 +296,7 @@ "version": "0.1.4", "bundled": true, "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -1424,7 +1425,8 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "loose-envify": { "version": "1.3.1", @@ -2722,6 +2724,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -4695,18 +4698,44 @@ } } }, + "eslint-plugin-es": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.3.1.tgz", + "integrity": "sha512-9XcVyZiQRVeFjqHw8qHNDAZcQLqaHlOGGpeYqzYh8S4JYCWTCO3yzyen8yVmA5PratfzTRWDwCOFphtDEG+w/w==", + "dev": true, + "requires": { + "eslint-utils": "^1.3.0", + "regexpp": "^2.0.0" + }, + "dependencies": { + "regexpp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.0.tgz", + "integrity": "sha512-g2FAVtR8Uh8GO1Nv5wpxW7VFVwHcCEr4wyA8/MHiRkO8uHoR5ntAA8Uq3P1vvMTX/BeQiRVSpDGLd+Wn5HNOTA==", + "dev": true + } + } + }, "eslint-plugin-node": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz", - "integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-7.0.1.tgz", + "integrity": "sha512-lfVw3TEqThwq0j2Ba/Ckn2ABdwmL5dkOgAux1rvOk6CO7A6yGyPI2+zIxN6FyNkp1X1X/BSvKOceD6mBWSj4Yw==", "dev": true, "requires": { - "ignore": "^3.3.6", + "eslint-plugin-es": "^1.3.1", + "eslint-utils": "^1.3.1", + "ignore": "^4.0.2", "minimatch": "^3.0.4", - "resolve": "^1.3.3", - "semver": "^5.4.1" + "resolve": "^1.8.1", + "semver": "^5.5.0" }, "dependencies": { + "ignore": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.2.tgz", + "integrity": "sha512-uoxnT7PYpyEnsja+yX+7v49B7LXxmzDJ2JALqHH3oEGzpM2U1IGcbfnOr8Dt57z3B/UWs7/iAgPFbmye8m4I0g==", + "dev": true + }, "resolve": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", @@ -5177,12 +5206,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5197,17 +5228,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -5324,7 +5358,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -5336,6 +5371,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5350,6 +5386,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5357,12 +5394,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -5381,6 +5420,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -5461,7 +5501,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -5473,6 +5514,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -5594,6 +5636,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -7105,7 +7148,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true + "dev": true, + "optional": true }, "loose-envify": { "version": "1.4.0", @@ -7646,6 +7690,7 @@ "version": "0.1.4", "bundled": true, "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -8588,7 +8633,8 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "lru-cache": { "version": "4.1.3", diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 32cf461eb37..d6167884c39 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -79,7 +79,7 @@ "codecov": "^3.0.2", "eslint": "^5.0.0", "eslint-config-prettier": "^2.9.0", - "eslint-plugin-node": "^6.0.1", + "eslint-plugin-node": "^7.0.0", "eslint-plugin-prettier": "^2.6.0", "gts": "^0.7.1", "hard-rejection": "^1.0.0", From 10db3bbb7abd5dd68bc0c24c89e95e955bde18bf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 24 Jul 2018 10:05:03 -0700 Subject: [PATCH 116/513] chore(deps): lock file maintenance (#76) --- .../google-cloud-translate/package-lock.json | 92 +++++++------------ 1 file changed, 33 insertions(+), 59 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 6f69a834d1d..8783e2dc928 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -236,9 +236,9 @@ } }, "@google-cloud/nodejs-repo-tools": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.3.1.tgz", - "integrity": "sha512-yIOn92sjHwpF/eORQWjv7QzQPcESSRCsZshdmeX40RGRlB0+HPODRDghZq0GiCqe6zpIYZvKmiKiYd3u52P/7Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.3.2.tgz", + "integrity": "sha512-Zah0wZcVifSpKIy5ulTFyGpHYAA8h/biYy8X7J2UvaXga5XlyruKrXo2K1VmBxB9MDPXa0Duz8M003pe2Ras3w==", "dev": true, "requires": { "ava": "0.25.0", @@ -296,7 +296,6 @@ "version": "0.1.4", "bundled": true, "dev": true, - "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -1425,8 +1424,7 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "loose-envify": { "version": "1.3.1", @@ -2724,7 +2722,6 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, - "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -4590,9 +4587,9 @@ } }, "eslint": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.1.0.tgz", - "integrity": "sha512-DyH6JsoA1KzA5+OSWFjg56DFJT+sDLO0yokaPZ9qY0UEmYrPA1gEX/G1MnVkmRDsksG4H1foIVz2ZXXM3hHYvw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.2.0.tgz", + "integrity": "sha512-zlggW1qp7/TBjwLfouRoY7eWXrXwJZFqCdIxxh0/LVB/QuuKuIMkzyUZEcDo6LBadsry5JcEMxIqd3H/66CXVg==", "dev": true, "requires": { "ajv": "^6.5.0", @@ -4611,7 +4608,7 @@ "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", "globals": "^11.7.0", - "ignore": "^3.3.3", + "ignore": "^4.0.2", "imurmurhash": "^0.1.4", "inquirer": "^5.2.0", "is-resolvable": "^1.1.0", @@ -4730,12 +4727,6 @@ "semver": "^5.5.0" }, "dependencies": { - "ignore": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.2.tgz", - "integrity": "sha512-uoxnT7PYpyEnsja+yX+7v49B7LXxmzDJ2JALqHH3oEGzpM2U1IGcbfnOr8Dt57z3B/UWs7/iAgPFbmye8m4I0g==", - "dev": true - }, "resolve": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", @@ -4951,9 +4942,9 @@ } }, "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "external-editor": { "version": "2.2.0", @@ -5206,14 +5197,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5228,20 +5217,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -5358,8 +5344,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -5371,7 +5356,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5386,7 +5370,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5394,14 +5377,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -5420,7 +5401,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -5501,8 +5481,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -5514,7 +5493,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -5636,7 +5614,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -6310,9 +6287,9 @@ } }, "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.2.tgz", + "integrity": "sha512-uoxnT7PYpyEnsja+yX+7v49B7LXxmzDJ2JALqHH3oEGzpM2U1IGcbfnOr8Dt57z3B/UWs7/iAgPFbmye8m4I0g==", "dev": true }, "ignore-by-default": { @@ -7148,8 +7125,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true, - "optional": true + "dev": true }, "loose-envify": { "version": "1.4.0", @@ -7413,16 +7389,16 @@ "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==" }, "mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + "version": "1.35.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", + "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==" }, "mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "version": "2.1.19", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", + "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", "requires": { - "mime-db": "~1.33.0" + "mime-db": "~1.35.0" } }, "mimic-fn": { @@ -7690,7 +7666,6 @@ "version": "0.1.4", "bundled": true, "dev": true, - "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -8633,8 +8608,7 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "lru-cache": { "version": "4.1.3", @@ -11385,9 +11359,9 @@ } }, "tsutils": { - "version": "2.27.2", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.27.2.tgz", - "integrity": "sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg==", + "version": "2.28.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.28.0.tgz", + "integrity": "sha512-bh5nAtW0tuhvOJnx1GLRn5ScraRLICGyJV5wJhtRWOLsxW70Kk5tZtpK3O/hW6LDnqKS9mlUMPZj9fEMJ0gxqA==", "dev": true, "requires": { "tslib": "^1.8.1" From fa71386815615646269a22d7aefe48704d79272c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 24 Jul 2018 14:17:32 -0700 Subject: [PATCH 117/513] chore(deps): lock file maintenance (#77) --- packages/google-cloud-translate/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 8783e2dc928..3b9d1c09719 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -11359,9 +11359,9 @@ } }, "tsutils": { - "version": "2.28.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.28.0.tgz", - "integrity": "sha512-bh5nAtW0tuhvOJnx1GLRn5ScraRLICGyJV5wJhtRWOLsxW70Kk5tZtpK3O/hW6LDnqKS9mlUMPZj9fEMJ0gxqA==", + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", "dev": true, "requires": { "tslib": "^1.8.1" From 6c0130374147b496c450cb50b9e02361fbe9a6c3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 24 Jul 2018 21:45:09 -0700 Subject: [PATCH 118/513] chore(deps): update dependency gts to ^0.8.0 (#73) --- .../google-cloud-translate/package-lock.json | 46 +++++++++++++------ packages/google-cloud-translate/package.json | 2 +- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 3b9d1c09719..0a7f5409f33 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -296,6 +296,7 @@ "version": "0.1.4", "bundled": true, "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -1424,7 +1425,8 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "loose-envify": { "version": "1.3.1", @@ -2722,6 +2724,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -5197,12 +5200,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5217,17 +5222,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -5344,7 +5352,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -5356,6 +5365,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5370,6 +5380,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5377,12 +5388,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -5401,6 +5414,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -5481,7 +5495,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -5493,6 +5508,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -5614,6 +5630,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -5919,9 +5936,9 @@ } }, "gts": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/gts/-/gts-0.7.1.tgz", - "integrity": "sha512-7yMBk3+SmyL4+047vIXOAUWlNfbIkuPH0UnhQYzurM8yj1ufiVH++BdBpZY7AP6/wytvzq7PuVzqAXbk5isn2A==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/gts/-/gts-0.8.0.tgz", + "integrity": "sha512-VB9LQLFR+10cJhDBLYu9i2t7vTkewTXeBJbvw5+M2LqGgjiaKIUTIFbVBLjIknDpuaRpAzVcvhiHWy/30c09jg==", "dev": true, "requires": { "chalk": "^2.4.1", @@ -7125,7 +7142,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true + "dev": true, + "optional": true }, "loose-envify": { "version": "1.4.0", @@ -7666,6 +7684,7 @@ "version": "0.1.4", "bundled": true, "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -8608,7 +8627,8 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "lru-cache": { "version": "4.1.3", diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index d6167884c39..b1f92d38236 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -81,7 +81,7 @@ "eslint-config-prettier": "^2.9.0", "eslint-plugin-node": "^7.0.0", "eslint-plugin-prettier": "^2.6.0", - "gts": "^0.7.1", + "gts": "^0.8.0", "hard-rejection": "^1.0.0", "ink-docstrap": "^1.3.2", "intelli-espower-loader": "^1.0.1", From 490a0829ea6592930cc9a30d32a1f7280d01ad69 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 30 Jul 2018 07:51:51 -0700 Subject: [PATCH 119/513] chore: require node 8 for samples (#79) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index c2ce8b0b417..0d59c797f2d 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -6,7 +6,7 @@ "author": "Google Inc.", "repository": "googleapis/nodejs-translate", "engines": { - "node": ">=6.0.0" + "node": ">=8" }, "scripts": { "ava": "ava -T 20s --verbose test/*.test.js ./system-test/*.test.js", From 3fb4cb552ba8cf934cfa36b3226fb91dfbde3aeb Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 30 Jul 2018 10:22:02 -0700 Subject: [PATCH 120/513] chore: enable linting and arrow functions (#80) --- .../google-cloud-translate/package-lock.json | 1894 +++++++++++------ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/src/index.ts | 158 +- packages/google-cloud-translate/test/index.ts | 218 +- packages/google-cloud-translate/tsconfig.json | 6 +- 5 files changed, 1433 insertions(+), 845 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 0a7f5409f33..190e7fab26f 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -236,9 +236,9 @@ } }, "@google-cloud/nodejs-repo-tools": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.3.2.tgz", - "integrity": "sha512-Zah0wZcVifSpKIy5ulTFyGpHYAA8h/biYy8X7J2UvaXga5XlyruKrXo2K1VmBxB9MDPXa0Duz8M003pe2Ras3w==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.3.3.tgz", + "integrity": "sha512-aow6Os43uhdgshSe/fr43ESHNl/kHhikim9AOqIMUzEb6mip6H4d8GFKgpO/yoqUUTIhCN3sbpkKktMI5mOQHw==", "dev": true, "requires": { "ava": "0.25.0", @@ -294,9 +294,9 @@ "dependencies": { "align-text": { "version": "0.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, - "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -305,22 +305,26 @@ }, "amdefine": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true }, "ansi-regex": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { "version": "2.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, "append-transform": { "version": "0.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", + "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=", "dev": true, "requires": { "default-require-extensions": "^1.0.0" @@ -328,52 +332,62 @@ }, "archy": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, "arr-diff": { "version": "4.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", "dev": true }, "arr-flatten": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true }, "arr-union": { "version": "3.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, "array-unique": { "version": "0.3.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, "arrify": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "assign-symbols": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, "async": { "version": "1.5.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, "atob": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", "dev": true }, "babel-code-frame": { "version": "6.26.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { "chalk": "^1.1.3", @@ -383,7 +397,8 @@ }, "babel-generator": { "version": "6.26.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "dev": true, "requires": { "babel-messages": "^6.23.0", @@ -398,7 +413,8 @@ }, "babel-messages": { "version": "6.23.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", "dev": true, "requires": { "babel-runtime": "^6.22.0" @@ -406,7 +422,8 @@ }, "babel-runtime": { "version": "6.26.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { "core-js": "^2.4.0", @@ -415,7 +432,8 @@ }, "babel-template": { "version": "6.26.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", "dev": true, "requires": { "babel-runtime": "^6.26.0", @@ -427,7 +445,8 @@ }, "babel-traverse": { "version": "6.26.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", "dev": true, "requires": { "babel-code-frame": "^6.26.0", @@ -443,7 +462,8 @@ }, "babel-types": { "version": "6.26.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "dev": true, "requires": { "babel-runtime": "^6.26.0", @@ -454,17 +474,20 @@ }, "babylon": { "version": "6.18.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", "dev": true }, "balanced-match": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "base": { "version": "0.11.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { "cache-base": "^1.0.1", @@ -478,7 +501,8 @@ "dependencies": { "define-property": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { "is-descriptor": "^1.0.0" @@ -486,7 +510,8 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -494,7 +519,8 @@ }, "is-data-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -502,7 +528,8 @@ }, "is-descriptor": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -512,14 +539,16 @@ }, "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } }, "brace-expansion": { "version": "1.1.11", - "bundled": true, + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -528,7 +557,8 @@ }, "braces": { "version": "2.3.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { "arr-flatten": "^1.1.0", @@ -545,7 +575,8 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -555,12 +586,14 @@ }, "builtin-modules": { "version": "1.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, "cache-base": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, "requires": { "collection-visit": "^1.0.0", @@ -576,7 +609,8 @@ }, "caching-transform": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", + "integrity": "sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE=", "dev": true, "requires": { "md5-hex": "^1.2.0", @@ -586,13 +620,15 @@ }, "camelcase": { "version": "1.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", "dev": true, "optional": true }, "center-align": { "version": "0.1.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", "dev": true, "optional": true, "requires": { @@ -602,7 +638,8 @@ }, "chalk": { "version": "1.1.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { "ansi-styles": "^2.2.1", @@ -614,7 +651,8 @@ }, "class-utils": { "version": "0.3.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, "requires": { "arr-union": "^3.1.0", @@ -625,7 +663,8 @@ "dependencies": { "define-property": { "version": "0.2.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -635,7 +674,8 @@ }, "cliui": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", "dev": true, "optional": true, "requires": { @@ -646,7 +686,8 @@ "dependencies": { "wordwrap": { "version": "0.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", "dev": true, "optional": true } @@ -654,12 +695,14 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, "collection-visit": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, "requires": { "map-visit": "^1.0.0", @@ -668,37 +711,44 @@ }, "commondir": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, "component-emitter": { "version": "1.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", "dev": true }, "concat-map": { "version": "0.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "convert-source-map": { "version": "1.5.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", "dev": true }, "copy-descriptor": { "version": "0.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, "core-js": { "version": "2.5.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.6.tgz", + "integrity": "sha512-lQUVfQi0aLix2xpyjrrJEvfuYCqPc/HwmTKsC/VNf8q0zsjX7SQZtp4+oRONN5Tsur9GDETPjj+Ub2iDiGZfSQ==", "dev": true }, "cross-spawn": { "version": "4.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", + "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", "dev": true, "requires": { "lru-cache": "^4.0.1", @@ -707,7 +757,8 @@ }, "debug": { "version": "2.6.9", - "bundled": true, + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -715,22 +766,26 @@ }, "debug-log": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", + "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=", "dev": true }, "decamelize": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "decode-uri-component": { "version": "0.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, "default-require-extensions": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", + "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", "dev": true, "requires": { "strip-bom": "^2.0.0" @@ -738,7 +793,8 @@ }, "define-property": { "version": "2.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "dev": true, "requires": { "is-descriptor": "^1.0.2", @@ -747,7 +803,8 @@ "dependencies": { "is-accessor-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -755,7 +812,8 @@ }, "is-data-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -763,7 +821,8 @@ }, "is-descriptor": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -773,14 +832,16 @@ }, "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } }, "detect-indent": { "version": "4.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", "dev": true, "requires": { "repeating": "^2.0.0" @@ -788,7 +849,8 @@ }, "error-ex": { "version": "1.3.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", "dev": true, "requires": { "is-arrayish": "^0.2.1" @@ -796,17 +858,20 @@ }, "escape-string-regexp": { "version": "1.0.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, "esutils": { "version": "2.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, "execa": { "version": "0.7.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "dev": true, "requires": { "cross-spawn": "^5.0.1", @@ -820,7 +885,8 @@ "dependencies": { "cross-spawn": { "version": "5.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { "lru-cache": "^4.0.1", @@ -832,7 +898,8 @@ }, "expand-brackets": { "version": "2.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { "debug": "^2.3.3", @@ -846,7 +913,8 @@ "dependencies": { "define-property": { "version": "0.2.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -854,7 +922,8 @@ }, "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -864,7 +933,8 @@ }, "extend-shallow": { "version": "3.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { "assign-symbols": "^1.0.0", @@ -873,7 +943,8 @@ "dependencies": { "is-extendable": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -883,7 +954,8 @@ }, "extglob": { "version": "2.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { "array-unique": "^0.3.2", @@ -898,7 +970,8 @@ "dependencies": { "define-property": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { "is-descriptor": "^1.0.0" @@ -906,7 +979,8 @@ }, "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -914,7 +988,8 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -922,7 +997,8 @@ }, "is-data-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -930,7 +1006,8 @@ }, "is-descriptor": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -940,14 +1017,16 @@ }, "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } }, "fill-range": { "version": "4.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -958,7 +1037,8 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -968,7 +1048,8 @@ }, "find-cache-dir": { "version": "0.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", + "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", "dev": true, "requires": { "commondir": "^1.0.1", @@ -978,7 +1059,8 @@ }, "find-up": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { "locate-path": "^2.0.0" @@ -986,12 +1068,14 @@ }, "for-in": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, "foreground-child": { "version": "1.5.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", + "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", "dev": true, "requires": { "cross-spawn": "^4", @@ -1000,7 +1084,8 @@ }, "fragment-cache": { "version": "0.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { "map-cache": "^0.2.2" @@ -1008,27 +1093,32 @@ }, "fs.realpath": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, "get-caller-file": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", "dev": true }, "get-stream": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "dev": true }, "get-value": { "version": "2.0.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, "glob": { "version": "7.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1041,17 +1131,20 @@ }, "globals": { "version": "9.18.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true }, "graceful-fs": { "version": "4.1.11", - "bundled": true, + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, "handlebars": { "version": "4.0.11", - "bundled": true, + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", "dev": true, "requires": { "async": "^1.4.0", @@ -1062,7 +1155,8 @@ "dependencies": { "source-map": { "version": "0.4.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { "amdefine": ">=0.0.4" @@ -1072,7 +1166,8 @@ }, "has-ansi": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -1080,12 +1175,14 @@ }, "has-flag": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", "dev": true }, "has-value": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, "requires": { "get-value": "^2.0.6", @@ -1095,7 +1192,8 @@ }, "has-values": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "dev": true, "requires": { "is-number": "^3.0.0", @@ -1104,7 +1202,8 @@ "dependencies": { "kind-of": { "version": "4.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -1114,17 +1213,20 @@ }, "hosted-git-info": { "version": "2.6.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", "dev": true }, "imurmurhash": { "version": "0.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, "inflight": { "version": "1.0.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { "once": "^1.3.0", @@ -1133,12 +1235,14 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "invariant": { "version": "2.2.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "dev": true, "requires": { "loose-envify": "^1.0.0" @@ -1146,12 +1250,14 @@ }, "invert-kv": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", "dev": true }, "is-accessor-descriptor": { "version": "0.1.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { "kind-of": "^3.0.2" @@ -1159,17 +1265,20 @@ }, "is-arrayish": { "version": "0.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, "is-buffer": { "version": "1.1.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, "is-builtin-module": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { "builtin-modules": "^1.0.0" @@ -1177,7 +1286,8 @@ }, "is-data-descriptor": { "version": "0.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { "kind-of": "^3.0.2" @@ -1185,7 +1295,8 @@ }, "is-descriptor": { "version": "0.1.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { "is-accessor-descriptor": "^0.1.6", @@ -1195,19 +1306,22 @@ "dependencies": { "kind-of": { "version": "5.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true } } }, "is-extendable": { "version": "0.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", "dev": true }, "is-finite": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -1215,12 +1329,14 @@ }, "is-fullwidth-code-point": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "is-number": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { "kind-of": "^3.0.2" @@ -1228,7 +1344,8 @@ }, "is-odd": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", "dev": true, "requires": { "is-number": "^4.0.0" @@ -1236,14 +1353,16 @@ "dependencies": { "is-number": { "version": "4.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", "dev": true } } }, "is-plain-object": { "version": "2.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { "isobject": "^3.0.1" @@ -1251,42 +1370,50 @@ }, "is-stream": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, "is-utf8": { "version": "0.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", "dev": true }, "is-windows": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, "isarray": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "isexe": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "isobject": { "version": "3.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, "istanbul-lib-coverage": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz", + "integrity": "sha512-GvgM/uXRwm+gLlvkWHTjDAvwynZkL9ns15calTrmhGgowlwJBbWMYzWbKqE2DT6JDP1AFXKa+Zi0EkqNCUqY0A==", "dev": true }, "istanbul-lib-hook": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.1.0.tgz", + "integrity": "sha512-U3qEgwVDUerZ0bt8cfl3dSP3S6opBoOtk3ROO5f2EfBr/SRiD9FQqzwaZBqFORu8W7O0EXpai+k7kxHK13beRg==", "dev": true, "requires": { "append-transform": "^0.4.0" @@ -1294,7 +1421,8 @@ }, "istanbul-lib-instrument": { "version": "1.10.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz", + "integrity": "sha512-1dYuzkOCbuR5GRJqySuZdsmsNKPL3PTuyPevQfoCXJePT9C8y1ga75neU+Tuy9+yS3G/dgx8wgOmp2KLpgdoeQ==", "dev": true, "requires": { "babel-generator": "^6.18.0", @@ -1308,7 +1436,8 @@ }, "istanbul-lib-report": { "version": "1.1.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.3.tgz", + "integrity": "sha512-D4jVbMDtT2dPmloPJS/rmeP626N5Pr3Rp+SovrPn1+zPChGHcggd/0sL29jnbm4oK9W0wHjCRsdch9oLd7cm6g==", "dev": true, "requires": { "istanbul-lib-coverage": "^1.1.2", @@ -1319,7 +1448,8 @@ "dependencies": { "supports-color": { "version": "3.2.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", "dev": true, "requires": { "has-flag": "^1.0.0" @@ -1329,7 +1459,8 @@ }, "istanbul-lib-source-maps": { "version": "1.2.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.3.tgz", + "integrity": "sha512-fDa0hwU/5sDXwAklXgAoCJCOsFsBplVQ6WBldz5UwaqOzmDhUK4nfuR7/G//G2lERlblUNJB8P6e8cXq3a7MlA==", "dev": true, "requires": { "debug": "^3.1.0", @@ -1341,7 +1472,8 @@ "dependencies": { "debug": { "version": "3.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" @@ -1351,7 +1483,8 @@ }, "istanbul-reports": { "version": "1.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.4.0.tgz", + "integrity": "sha512-OPzVo1fPZ2H+owr8q/LYKLD+vquv9Pj4F+dj808MdHbuQLD7S4ACRjcX+0Tne5Vxt2lxXvdZaL7v+FOOAV281w==", "dev": true, "requires": { "handlebars": "^4.0.3" @@ -1359,17 +1492,20 @@ }, "js-tokens": { "version": "3.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, "jsesc": { "version": "1.3.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", "dev": true }, "kind-of": { "version": "3.2.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -1377,13 +1513,15 @@ }, "lazy-cache": { "version": "1.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", "dev": true, "optional": true }, "lcid": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { "invert-kv": "^1.0.0" @@ -1391,7 +1529,8 @@ }, "load-json-file": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -1403,7 +1542,8 @@ }, "locate-path": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { "p-locate": "^2.0.0", @@ -1412,25 +1552,28 @@ "dependencies": { "path-exists": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true } } }, "lodash": { "version": "4.17.10", - "bundled": true, + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", "dev": true }, "longest": { "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true }, "loose-envify": { "version": "1.3.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", "dev": true, "requires": { "js-tokens": "^3.0.0" @@ -1438,7 +1581,8 @@ }, "lru-cache": { "version": "4.1.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "dev": true, "requires": { "pseudomap": "^1.0.2", @@ -1447,12 +1591,14 @@ }, "map-cache": { "version": "0.2.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, "map-visit": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, "requires": { "object-visit": "^1.0.0" @@ -1460,7 +1606,8 @@ }, "md5-hex": { "version": "1.3.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", + "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", "dev": true, "requires": { "md5-o-matic": "^0.1.1" @@ -1468,12 +1615,14 @@ }, "md5-o-matic": { "version": "0.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", + "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", "dev": true }, "mem": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "dev": true, "requires": { "mimic-fn": "^1.0.0" @@ -1481,7 +1630,8 @@ }, "merge-source-map": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", + "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", "dev": true, "requires": { "source-map": "^0.6.1" @@ -1489,14 +1639,16 @@ "dependencies": { "source-map": { "version": "0.6.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, "micromatch": { "version": "3.1.10", - "bundled": true, + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -1516,19 +1668,22 @@ "dependencies": { "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } }, "mimic-fn": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "minimatch": { "version": "3.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -1536,12 +1691,14 @@ }, "minimist": { "version": "0.0.8", - "bundled": true, + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mixin-deep": { "version": "1.3.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "dev": true, "requires": { "for-in": "^1.0.2", @@ -1550,7 +1707,8 @@ "dependencies": { "is-extendable": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -1560,7 +1718,8 @@ }, "mkdirp": { "version": "0.5.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" @@ -1568,12 +1727,14 @@ }, "ms": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, "nanomatch": { "version": "1.2.9", - "bundled": true, + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -1592,14 +1753,16 @@ "dependencies": { "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } }, "normalize-package-data": { "version": "2.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { "hosted-git-info": "^2.1.4", @@ -1610,7 +1773,8 @@ }, "npm-run-path": { "version": "2.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { "path-key": "^2.0.0" @@ -1618,17 +1782,20 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "object-assign": { "version": "4.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, "object-copy": { "version": "0.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, "requires": { "copy-descriptor": "^0.1.0", @@ -1638,7 +1805,8 @@ "dependencies": { "define-property": { "version": "0.2.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -1648,7 +1816,8 @@ }, "object-visit": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { "isobject": "^3.0.0" @@ -1656,7 +1825,8 @@ }, "object.pick": { "version": "1.3.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, "requires": { "isobject": "^3.0.1" @@ -1664,7 +1834,8 @@ }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" @@ -1672,7 +1843,8 @@ }, "optimist": { "version": "0.6.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { "minimist": "~0.0.1", @@ -1681,12 +1853,14 @@ }, "os-homedir": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, "os-locale": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "dev": true, "requires": { "execa": "^0.7.0", @@ -1696,12 +1870,14 @@ }, "p-finally": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true }, "p-limit": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", "dev": true, "requires": { "p-try": "^1.0.0" @@ -1709,7 +1885,8 @@ }, "p-locate": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { "p-limit": "^1.1.0" @@ -1717,12 +1894,14 @@ }, "p-try": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, "parse-json": { "version": "2.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { "error-ex": "^1.2.0" @@ -1730,12 +1909,14 @@ }, "pascalcase": { "version": "0.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, "path-exists": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { "pinkie-promise": "^2.0.0" @@ -1743,22 +1924,26 @@ }, "path-is-absolute": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, "path-key": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, "path-parse": { "version": "1.0.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", "dev": true }, "path-type": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -1768,17 +1953,20 @@ }, "pify": { "version": "2.3.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, "pinkie": { "version": "2.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { "pinkie": "^2.0.0" @@ -1786,7 +1974,8 @@ }, "pkg-dir": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", "dev": true, "requires": { "find-up": "^1.0.0" @@ -1794,7 +1983,8 @@ "dependencies": { "find-up": { "version": "1.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { "path-exists": "^2.0.0", @@ -1805,17 +1995,20 @@ }, "posix-character-classes": { "version": "0.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, "pseudomap": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, "read-pkg": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { "load-json-file": "^1.0.0", @@ -1825,7 +2018,8 @@ }, "read-pkg-up": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { "find-up": "^1.0.0", @@ -1834,7 +2028,8 @@ "dependencies": { "find-up": { "version": "1.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { "path-exists": "^2.0.0", @@ -1845,12 +2040,14 @@ }, "regenerator-runtime": { "version": "0.11.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, "regex-not": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, "requires": { "extend-shallow": "^3.0.2", @@ -1859,17 +2056,20 @@ }, "repeat-element": { "version": "1.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", "dev": true }, "repeat-string": { "version": "1.6.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, "repeating": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "dev": true, "requires": { "is-finite": "^1.0.0" @@ -1877,32 +2077,38 @@ }, "require-directory": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, "require-main-filename": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, "resolve-from": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=", "dev": true }, "resolve-url": { "version": "0.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, "ret": { "version": "0.1.15", - "bundled": true, + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, "right-align": { "version": "0.1.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", "dev": true, "optional": true, "requires": { @@ -1911,7 +2117,8 @@ }, "rimraf": { "version": "2.6.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { "glob": "^7.0.5" @@ -1919,7 +2126,8 @@ }, "safe-regex": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { "ret": "~0.1.10" @@ -1927,17 +2135,20 @@ }, "semver": { "version": "5.5.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true }, "set-blocking": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, "set-value": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -1948,7 +2159,8 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -1958,7 +2170,8 @@ }, "shebang-command": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { "shebang-regex": "^1.0.0" @@ -1966,22 +2179,26 @@ }, "shebang-regex": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, "signal-exit": { "version": "3.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, "slide": { "version": "1.1.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", "dev": true }, "snapdragon": { "version": "0.8.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "dev": true, "requires": { "base": "^0.11.1", @@ -1996,7 +2213,8 @@ "dependencies": { "define-property": { "version": "0.2.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -2004,7 +2222,8 @@ }, "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -2014,7 +2233,8 @@ }, "snapdragon-node": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, "requires": { "define-property": "^1.0.0", @@ -2024,7 +2244,8 @@ "dependencies": { "define-property": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { "is-descriptor": "^1.0.0" @@ -2032,7 +2253,8 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -2040,7 +2262,8 @@ }, "is-data-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -2048,7 +2271,8 @@ }, "is-descriptor": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -2058,14 +2282,16 @@ }, "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } }, "snapdragon-util": { "version": "3.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, "requires": { "kind-of": "^3.2.0" @@ -2073,12 +2299,14 @@ }, "source-map": { "version": "0.5.7", - "bundled": true, + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, "source-map-resolve": { "version": "0.5.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", + "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", "dev": true, "requires": { "atob": "^2.0.0", @@ -2090,12 +2318,14 @@ }, "source-map-url": { "version": "0.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, "spawn-wrap": { "version": "1.4.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.2.tgz", + "integrity": "sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg==", "dev": true, "requires": { "foreground-child": "^1.5.6", @@ -2108,7 +2338,8 @@ }, "spdx-correct": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -2117,12 +2348,14 @@ }, "spdx-exceptions": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", "dev": true }, "spdx-expression-parse": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -2131,12 +2364,14 @@ }, "spdx-license-ids": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", "dev": true }, "split-string": { "version": "3.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, "requires": { "extend-shallow": "^3.0.0" @@ -2144,7 +2379,8 @@ }, "static-extend": { "version": "0.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, "requires": { "define-property": "^0.2.5", @@ -2153,7 +2389,8 @@ "dependencies": { "define-property": { "version": "0.2.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -2163,7 +2400,8 @@ }, "string-width": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -2172,12 +2410,14 @@ "dependencies": { "ansi-regex": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "strip-ansi": { "version": "4.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { "ansi-regex": "^3.0.0" @@ -2187,7 +2427,8 @@ }, "strip-ansi": { "version": "3.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -2195,7 +2436,8 @@ }, "strip-bom": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "dev": true, "requires": { "is-utf8": "^0.2.0" @@ -2203,17 +2445,20 @@ }, "strip-eof": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, "supports-color": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, "test-exclude": { "version": "4.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.2.1.tgz", + "integrity": "sha512-qpqlP/8Zl+sosLxBcVKl9vYy26T9NPalxSzzCP/OY6K7j938ui2oKgo+kRZYfxAeIpLqpbVnsHq1tyV70E4lWQ==", "dev": true, "requires": { "arrify": "^1.0.1", @@ -2225,12 +2470,14 @@ }, "to-fast-properties": { "version": "1.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", "dev": true }, "to-object-path": { "version": "0.3.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, "requires": { "kind-of": "^3.0.2" @@ -2238,7 +2485,8 @@ }, "to-regex": { "version": "3.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "dev": true, "requires": { "define-property": "^2.0.2", @@ -2249,7 +2497,8 @@ }, "to-regex-range": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { "is-number": "^3.0.0", @@ -2258,12 +2507,14 @@ }, "trim-right": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, "uglify-js": { "version": "2.8.29", - "bundled": true, + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", "dev": true, "optional": true, "requires": { @@ -2274,7 +2525,8 @@ "dependencies": { "yargs": { "version": "3.10.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", "dev": true, "optional": true, "requires": { @@ -2288,13 +2540,15 @@ }, "uglify-to-browserify": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", "dev": true, "optional": true }, "union-value": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "dev": true, "requires": { "arr-union": "^3.1.0", @@ -2305,7 +2559,8 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -2313,7 +2568,8 @@ }, "set-value": { "version": "0.4.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -2326,7 +2582,8 @@ }, "unset-value": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, "requires": { "has-value": "^0.3.1", @@ -2335,7 +2592,8 @@ "dependencies": { "has-value": { "version": "0.3.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { "get-value": "^2.0.3", @@ -2345,7 +2603,8 @@ "dependencies": { "isobject": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", "dev": true, "requires": { "isarray": "1.0.0" @@ -2355,19 +2614,22 @@ }, "has-values": { "version": "0.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", "dev": true } } }, "urix": { "version": "0.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "dev": true }, "use": { "version": "3.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", + "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", "dev": true, "requires": { "kind-of": "^6.0.2" @@ -2375,14 +2637,16 @@ "dependencies": { "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } }, "validate-npm-package-license": { "version": "3.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -2391,7 +2655,8 @@ }, "which": { "version": "1.3.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -2399,23 +2664,27 @@ }, "which-module": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, "window-size": { "version": "0.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", "dev": true, "optional": true }, "wordwrap": { "version": "0.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", "dev": true }, "wrap-ansi": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { "string-width": "^1.0.1", @@ -2424,7 +2693,8 @@ "dependencies": { "is-fullwidth-code-point": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -2432,7 +2702,8 @@ }, "string-width": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -2444,12 +2715,14 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "write-file-atomic": { "version": "1.3.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", "dev": true, "requires": { "graceful-fs": "^4.1.11", @@ -2459,17 +2732,20 @@ }, "y18n": { "version": "3.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", "dev": true }, "yallist": { "version": "2.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true }, "yargs": { "version": "11.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", "dev": true, "requires": { "cliui": "^4.0.0", @@ -2488,17 +2764,20 @@ "dependencies": { "ansi-regex": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "camelcase": { "version": "4.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true }, "cliui": { "version": "4.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { "string-width": "^2.1.1", @@ -2508,7 +2787,8 @@ }, "strip-ansi": { "version": "4.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { "ansi-regex": "^3.0.0" @@ -2516,7 +2796,8 @@ }, "yargs-parser": { "version": "9.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", "dev": true, "requires": { "camelcase": "^4.1.0" @@ -2526,7 +2807,8 @@ }, "yargs-parser": { "version": "8.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz", + "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", "dev": true, "requires": { "camelcase": "^4.1.0" @@ -2534,7 +2816,8 @@ "dependencies": { "camelcase": { "version": "4.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true } } @@ -2661,9 +2944,9 @@ "dev": true }, "@types/node": { - "version": "10.5.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.2.tgz", - "integrity": "sha512-m9zXmifkZsMHZBOyxZWilMwmTlpC8x5Ty360JKTiXvlXZfBWYpsg9ZZvP/Ye+iZUh+Q+MxDLjItVTWIsfwz+8Q==" + "version": "10.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.4.tgz", + "integrity": "sha512-8TqvB0ReZWwtcd3LXq3YSrBoLyXFgBX/sBZfGye9+YS8zH7/g+i6QRIuiDmwBoTzcQ/pk89nZYTYU4c5akKkzw==" }, "@types/request": { "version": "2.47.1", @@ -2724,7 +3007,6 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, - "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -4333,12 +4615,13 @@ "dev": true }, "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "optional": true, "requires": { - "jsbn": "~0.1.0" + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "ecdsa-sig-formatter": { @@ -5172,24 +5455,28 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "aproba": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", "dev": true, "optional": true, "requires": { @@ -5199,15 +5486,15 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "brace-expansion": { "version": "1.1.11", - "bundled": true, + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5215,37 +5502,40 @@ }, "chownr": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true }, "concat-map": { "version": "0.0.1", - "bundled": true, - "dev": true, - "optional": true + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true }, "core-util-is": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "2.6.9", - "bundled": true, + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "optional": true, "requires": { @@ -5254,25 +5544,29 @@ }, "deep-extend": { "version": "0.5.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz", + "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, "requires": { @@ -5281,13 +5575,15 @@ }, "fs.realpath": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, "requires": { @@ -5303,7 +5599,8 @@ }, "glob": { "version": "7.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "optional": true, "requires": { @@ -5317,13 +5614,15 @@ }, "has-unicode": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.21", - "bundled": true, + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.21.tgz", + "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", "dev": true, "optional": true, "requires": { @@ -5332,7 +5631,8 @@ }, "ignore-walk": { "version": "3.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, "requires": { @@ -5341,7 +5641,8 @@ }, "inflight": { "version": "1.0.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, "requires": { @@ -5351,51 +5652,53 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "dev": true, - "optional": true + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true }, "ini": { "version": "1.3.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } }, "isarray": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "dev": true, - "optional": true + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true }, "minipass": { "version": "2.2.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz", + "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -5403,7 +5706,8 @@ }, "minizlib": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.1.0.tgz", + "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", "dev": true, "optional": true, "requires": { @@ -5412,22 +5716,24 @@ }, "mkdirp": { "version": "0.5.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true, "optional": true }, "needle": { "version": "2.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.0.tgz", + "integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==", "dev": true, "optional": true, "requires": { @@ -5438,7 +5744,8 @@ }, "node-pre-gyp": { "version": "0.10.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz", + "integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==", "dev": true, "optional": true, "requires": { @@ -5456,7 +5763,8 @@ }, "nopt": { "version": "4.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, "requires": { @@ -5466,13 +5774,15 @@ }, "npm-bundled": { "version": "1.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.3.tgz", + "integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.1.10", - "bundled": true, + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.10.tgz", + "integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==", "dev": true, "optional": true, "requires": { @@ -5482,7 +5792,8 @@ }, "npmlog": { "version": "4.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, "requires": { @@ -5494,40 +5805,44 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true }, "object-assign": { "version": "4.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, - "optional": true, "requires": { "wrappy": "1" } }, "os-homedir": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, "requires": { @@ -5537,19 +5852,22 @@ }, "path-is-absolute": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { "version": "1.2.7", - "bundled": true, + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.7.tgz", + "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", "dev": true, "optional": true, "requires": { @@ -5561,7 +5879,8 @@ "dependencies": { "minimist": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true } @@ -5569,7 +5888,8 @@ }, "readable-stream": { "version": "2.3.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, "requires": { @@ -5584,7 +5904,8 @@ }, "rimraf": { "version": "2.6.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "optional": true, "requires": { @@ -5593,44 +5914,50 @@ }, "safe-buffer": { "version": "5.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", "dev": true }, "safer-buffer": { "version": "2.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.5.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -5639,7 +5966,8 @@ }, "string_decoder": { "version": "1.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, "requires": { @@ -5648,7 +5976,8 @@ }, "strip-ansi": { "version": "3.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -5656,13 +5985,15 @@ }, "strip-json-comments": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.1.tgz", + "integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==", "dev": true, "optional": true, "requires": { @@ -5677,13 +6008,15 @@ }, "util-deprecate": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", + "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", "dev": true, "optional": true, "requires": { @@ -5692,12 +6025,14 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "yallist": { "version": "3.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", + "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", "dev": true } } @@ -6763,9 +7098,9 @@ "dev": true }, "istanbul-lib-instrument": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-2.3.1.tgz", - "integrity": "sha512-h9Vg3nfbxrF0PK0kZiNiMAyL8zXaLiBP/BXniaKSwVvAi1TaumYV2b0wPdmy1CRX3irYbYD1p4Wjbv4uyECiiQ==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-2.3.2.tgz", + "integrity": "sha512-l7TD/VnBsIB2OJvSyxaLW/ab1+92dxZNH9wLH7uHPPioy3JZ8tnx2UXUdKmdkgmP2EFPzg64CToUP6dAS3U32Q==", "dev": true, "requires": { "@babel/generator": "7.0.0-beta.51", @@ -7142,8 +7477,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true, - "optional": true + "dev": true }, "loose-envify": { "version": "1.4.0", @@ -7682,9 +8016,9 @@ "dependencies": { "align-text": { "version": "0.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, - "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -7693,17 +8027,20 @@ }, "amdefine": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true }, "ansi-regex": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "append-transform": { "version": "0.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", + "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=", "dev": true, "requires": { "default-require-extensions": "^1.0.0" @@ -7711,57 +8048,68 @@ }, "archy": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, "arr-diff": { "version": "4.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", "dev": true }, "arr-flatten": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", "dev": true }, "arr-union": { "version": "3.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, "array-unique": { "version": "0.3.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, "arrify": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "assign-symbols": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, "async": { "version": "1.5.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, "atob": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", "dev": true }, "balanced-match": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "base": { "version": "0.11.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", "dev": true, "requires": { "cache-base": "^1.0.1", @@ -7775,7 +8123,8 @@ "dependencies": { "define-property": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { "is-descriptor": "^1.0.0" @@ -7783,7 +8132,8 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -7791,7 +8141,8 @@ }, "is-data-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -7799,7 +8150,8 @@ }, "is-descriptor": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -7809,14 +8161,16 @@ }, "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", "dev": true } } }, "brace-expansion": { "version": "1.1.11", - "bundled": true, + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -7825,7 +8179,8 @@ }, "braces": { "version": "2.3.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha1-WXn9PxTNUxVl5fot8av/8d+u5yk=", "dev": true, "requires": { "arr-flatten": "^1.1.0", @@ -7842,7 +8197,8 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -7852,12 +8208,14 @@ }, "builtin-modules": { "version": "1.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, "cache-base": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", "dev": true, "requires": { "collection-visit": "^1.0.0", @@ -7873,7 +8231,8 @@ }, "caching-transform": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", + "integrity": "sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE=", "dev": true, "requires": { "md5-hex": "^1.2.0", @@ -7883,13 +8242,15 @@ }, "camelcase": { "version": "1.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", "dev": true, "optional": true }, "center-align": { "version": "0.1.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", "dev": true, "optional": true, "requires": { @@ -7899,7 +8260,8 @@ }, "class-utils": { "version": "0.3.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", "dev": true, "requires": { "arr-union": "^3.1.0", @@ -7910,7 +8272,8 @@ "dependencies": { "define-property": { "version": "0.2.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -7920,7 +8283,8 @@ }, "cliui": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", "dev": true, "optional": true, "requires": { @@ -7931,7 +8295,8 @@ "dependencies": { "wordwrap": { "version": "0.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", "dev": true, "optional": true } @@ -7939,12 +8304,14 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, "collection-visit": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, "requires": { "map-visit": "^1.0.0", @@ -7953,32 +8320,38 @@ }, "commondir": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, "component-emitter": { "version": "1.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", "dev": true }, "concat-map": { "version": "0.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "convert-source-map": { "version": "1.5.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", "dev": true }, "copy-descriptor": { "version": "0.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, "cross-spawn": { "version": "4.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", + "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", "dev": true, "requires": { "lru-cache": "^4.0.1", @@ -7987,7 +8360,8 @@ }, "debug": { "version": "3.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", "dev": true, "requires": { "ms": "2.0.0" @@ -7995,22 +8369,26 @@ }, "debug-log": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", + "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=", "dev": true }, "decamelize": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "decode-uri-component": { "version": "0.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, "default-require-extensions": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", + "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", "dev": true, "requires": { "strip-bom": "^2.0.0" @@ -8018,7 +8396,8 @@ }, "define-property": { "version": "2.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha1-1Flono1lS6d+AqgX+HENcCyxbp0=", "dev": true, "requires": { "is-descriptor": "^1.0.2", @@ -8027,7 +8406,8 @@ "dependencies": { "is-accessor-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -8035,7 +8415,8 @@ }, "is-data-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -8043,7 +8424,8 @@ }, "is-descriptor": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -8053,14 +8435,16 @@ }, "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", "dev": true } } }, "error-ex": { "version": "1.3.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", "dev": true, "requires": { "is-arrayish": "^0.2.1" @@ -8068,7 +8452,8 @@ }, "execa": { "version": "0.7.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "dev": true, "requires": { "cross-spawn": "^5.0.1", @@ -8082,7 +8467,8 @@ "dependencies": { "cross-spawn": { "version": "5.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { "lru-cache": "^4.0.1", @@ -8094,7 +8480,8 @@ }, "expand-brackets": { "version": "2.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { "debug": "^2.3.3", @@ -8108,7 +8495,8 @@ "dependencies": { "debug": { "version": "2.6.9", - "bundled": true, + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -8116,7 +8504,8 @@ }, "define-property": { "version": "0.2.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -8124,7 +8513,8 @@ }, "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -8134,7 +8524,8 @@ }, "extend-shallow": { "version": "3.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { "assign-symbols": "^1.0.0", @@ -8143,7 +8534,8 @@ "dependencies": { "is-extendable": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -8153,7 +8545,8 @@ }, "extglob": { "version": "2.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha1-rQD+TcYSqSMuhxhxHcXLWrAoVUM=", "dev": true, "requires": { "array-unique": "^0.3.2", @@ -8168,7 +8561,8 @@ "dependencies": { "define-property": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { "is-descriptor": "^1.0.0" @@ -8176,7 +8570,8 @@ }, "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -8184,7 +8579,8 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -8192,7 +8588,8 @@ }, "is-data-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -8200,7 +8597,8 @@ }, "is-descriptor": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -8210,14 +8608,16 @@ }, "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", "dev": true } } }, "fill-range": { "version": "4.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -8228,7 +8628,8 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -8238,7 +8639,8 @@ }, "find-cache-dir": { "version": "0.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", + "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", "dev": true, "requires": { "commondir": "^1.0.1", @@ -8248,7 +8650,8 @@ }, "find-up": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { "locate-path": "^2.0.0" @@ -8256,12 +8659,14 @@ }, "for-in": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, "foreground-child": { "version": "1.5.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", + "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", "dev": true, "requires": { "cross-spawn": "^4", @@ -8270,7 +8675,8 @@ }, "fragment-cache": { "version": "0.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { "map-cache": "^0.2.2" @@ -8278,27 +8684,32 @@ }, "fs.realpath": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, "get-caller-file": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", "dev": true }, "get-stream": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "dev": true }, "get-value": { "version": "2.0.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, "glob": { "version": "7.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -8311,12 +8722,14 @@ }, "graceful-fs": { "version": "4.1.11", - "bundled": true, + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, "handlebars": { "version": "4.0.11", - "bundled": true, + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", "dev": true, "requires": { "async": "^1.4.0", @@ -8327,7 +8740,8 @@ "dependencies": { "source-map": { "version": "0.4.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { "amdefine": ">=0.0.4" @@ -8337,7 +8751,8 @@ }, "has-value": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, "requires": { "get-value": "^2.0.6", @@ -8347,7 +8762,8 @@ }, "has-values": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "dev": true, "requires": { "is-number": "^3.0.0", @@ -8356,7 +8772,8 @@ "dependencies": { "kind-of": { "version": "4.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -8366,17 +8783,20 @@ }, "hosted-git-info": { "version": "2.6.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha1-IyNbKasjDFdqqw1PE/wEawsDgiI=", "dev": true }, "imurmurhash": { "version": "0.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, "inflight": { "version": "1.0.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { "once": "^1.3.0", @@ -8385,17 +8805,20 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "invert-kv": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", "dev": true }, "is-accessor-descriptor": { "version": "0.1.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { "kind-of": "^3.0.2" @@ -8403,17 +8826,20 @@ }, "is-arrayish": { "version": "0.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, "is-buffer": { "version": "1.1.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", "dev": true }, "is-builtin-module": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { "builtin-modules": "^1.0.0" @@ -8421,7 +8847,8 @@ }, "is-data-descriptor": { "version": "0.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { "kind-of": "^3.0.2" @@ -8429,7 +8856,8 @@ }, "is-descriptor": { "version": "0.1.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", "dev": true, "requires": { "is-accessor-descriptor": "^0.1.6", @@ -8439,24 +8867,28 @@ "dependencies": { "kind-of": { "version": "5.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", "dev": true } } }, "is-extendable": { "version": "0.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "is-number": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { "kind-of": "^3.0.2" @@ -8464,7 +8896,8 @@ }, "is-odd": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha1-dkZiRnH9fqVYzNmieVGC8pWPGyQ=", "dev": true, "requires": { "is-number": "^4.0.0" @@ -8472,14 +8905,16 @@ "dependencies": { "is-number": { "version": "4.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha1-ACbjf1RU1z41bf5lZGmYZ8an8P8=", "dev": true } } }, "is-plain-object": { "version": "2.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", "dev": true, "requires": { "isobject": "^3.0.1" @@ -8487,42 +8922,50 @@ }, "is-stream": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, "is-utf8": { "version": "0.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", "dev": true }, "is-windows": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha1-0YUOuXkezRjmGCzhKjDzlmNLsZ0=", "dev": true }, "isarray": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "isexe": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "isobject": { "version": "3.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, "istanbul-lib-coverage": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz", + "integrity": "sha1-99jy5CuX43/nlhFMsPnWi146Q0E=", "dev": true }, "istanbul-lib-hook": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.1.0.tgz", + "integrity": "sha1-hTjZcDcss3FtU+VVI91UtVeo2Js=", "dev": true, "requires": { "append-transform": "^0.4.0" @@ -8530,7 +8973,8 @@ }, "istanbul-lib-report": { "version": "1.1.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.3.tgz", + "integrity": "sha1-LfEhiMD6d5kMDSF20tC6M5QYglk=", "dev": true, "requires": { "istanbul-lib-coverage": "^1.1.2", @@ -8541,12 +8985,14 @@ "dependencies": { "has-flag": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", "dev": true }, "supports-color": { "version": "3.2.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", "dev": true, "requires": { "has-flag": "^1.0.0" @@ -8556,7 +9002,8 @@ }, "istanbul-lib-source-maps": { "version": "1.2.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz", + "integrity": "sha1-/+a+Tnq4bTYD5CkNVJkLFFBvybE=", "dev": true, "requires": { "debug": "^3.1.0", @@ -8568,7 +9015,8 @@ }, "istanbul-reports": { "version": "1.4.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.4.1.tgz", + "integrity": "sha1-Ty6OkoqnoF0dpsQn1AmLJlXsczQ=", "dev": true, "requires": { "handlebars": "^4.0.3" @@ -8576,7 +9024,8 @@ }, "kind-of": { "version": "3.2.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -8584,13 +9033,15 @@ }, "lazy-cache": { "version": "1.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", "dev": true, "optional": true }, "lcid": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { "invert-kv": "^1.0.0" @@ -8598,7 +9049,8 @@ }, "load-json-file": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -8610,7 +9062,8 @@ }, "locate-path": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { "p-locate": "^2.0.0", @@ -8619,20 +9072,22 @@ "dependencies": { "path-exists": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true } } }, "longest": { "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true }, "lru-cache": { "version": "4.1.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha1-oRdc80lt/IQ2wVbDNLSVWZK85pw=", "dev": true, "requires": { "pseudomap": "^1.0.2", @@ -8641,12 +9096,14 @@ }, "map-cache": { "version": "0.2.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, "map-visit": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, "requires": { "object-visit": "^1.0.0" @@ -8654,7 +9111,8 @@ }, "md5-hex": { "version": "1.3.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", + "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", "dev": true, "requires": { "md5-o-matic": "^0.1.1" @@ -8662,12 +9120,14 @@ }, "md5-o-matic": { "version": "0.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", + "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", "dev": true }, "mem": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "dev": true, "requires": { "mimic-fn": "^1.0.0" @@ -8675,7 +9135,8 @@ }, "merge-source-map": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", + "integrity": "sha1-L93n5gIJOfcJBqaPLXrmheTIxkY=", "dev": true, "requires": { "source-map": "^0.6.1" @@ -8683,14 +9144,16 @@ "dependencies": { "source-map": { "version": "0.6.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true } } }, "micromatch": { "version": "3.1.10", - "bundled": true, + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha1-cIWbyVyYQJUvNZoGij/En57PrCM=", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -8710,19 +9173,22 @@ "dependencies": { "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", "dev": true } } }, "mimic-fn": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha1-ggyGo5M0ZA6ZUWkovQP8qIBX0CI=", "dev": true }, "minimatch": { "version": "3.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -8730,12 +9196,14 @@ }, "minimist": { "version": "0.0.8", - "bundled": true, + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mixin-deep": { "version": "1.3.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha1-pJ5yaNzhoNlpjkUybFYm3zVD0P4=", "dev": true, "requires": { "for-in": "^1.0.2", @@ -8744,7 +9212,8 @@ "dependencies": { "is-extendable": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -8754,7 +9223,8 @@ }, "mkdirp": { "version": "0.5.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" @@ -8762,12 +9232,14 @@ }, "ms": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, "nanomatch": { "version": "1.2.9", - "bundled": true, + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha1-h59xUMstq3pHElkGbBBO7m4Pp8I=", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -8786,14 +9258,16 @@ "dependencies": { "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", "dev": true } } }, "normalize-package-data": { "version": "2.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", "dev": true, "requires": { "hosted-git-info": "^2.1.4", @@ -8804,7 +9278,8 @@ }, "npm-run-path": { "version": "2.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { "path-key": "^2.0.0" @@ -8812,17 +9287,20 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "object-assign": { "version": "4.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, "object-copy": { "version": "0.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, "requires": { "copy-descriptor": "^0.1.0", @@ -8832,7 +9310,8 @@ "dependencies": { "define-property": { "version": "0.2.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -8842,7 +9321,8 @@ }, "object-visit": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { "isobject": "^3.0.0" @@ -8850,7 +9330,8 @@ }, "object.pick": { "version": "1.3.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, "requires": { "isobject": "^3.0.1" @@ -8858,7 +9339,8 @@ }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" @@ -8866,7 +9348,8 @@ }, "optimist": { "version": "0.6.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { "minimist": "~0.0.1", @@ -8875,12 +9358,14 @@ }, "os-homedir": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, "os-locale": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha1-QrwpAKa1uL0XN2yOiCtlr8zyS/I=", "dev": true, "requires": { "execa": "^0.7.0", @@ -8890,12 +9375,14 @@ }, "p-finally": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true }, "p-limit": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "integrity": "sha1-DpK2vty1nwIsE9DxlJ3ILRWQnxw=", "dev": true, "requires": { "p-try": "^1.0.0" @@ -8903,7 +9390,8 @@ }, "p-locate": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { "p-limit": "^1.1.0" @@ -8911,12 +9399,14 @@ }, "p-try": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, "parse-json": { "version": "2.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { "error-ex": "^1.2.0" @@ -8924,12 +9414,14 @@ }, "pascalcase": { "version": "0.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, "path-exists": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { "pinkie-promise": "^2.0.0" @@ -8937,22 +9429,26 @@ }, "path-is-absolute": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, "path-key": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, "path-parse": { "version": "1.0.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", "dev": true }, "path-type": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -8962,17 +9458,20 @@ }, "pify": { "version": "2.3.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, "pinkie": { "version": "2.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { "pinkie": "^2.0.0" @@ -8980,7 +9479,8 @@ }, "pkg-dir": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", "dev": true, "requires": { "find-up": "^1.0.0" @@ -8988,7 +9488,8 @@ "dependencies": { "find-up": { "version": "1.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { "path-exists": "^2.0.0", @@ -8999,17 +9500,20 @@ }, "posix-character-classes": { "version": "0.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, "pseudomap": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, "read-pkg": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { "load-json-file": "^1.0.0", @@ -9019,7 +9523,8 @@ }, "read-pkg-up": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { "find-up": "^1.0.0", @@ -9028,7 +9533,8 @@ "dependencies": { "find-up": { "version": "1.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { "path-exists": "^2.0.0", @@ -9039,7 +9545,8 @@ }, "regex-not": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha1-H07OJ+ALC2XgJHpoEOaoXYOldSw=", "dev": true, "requires": { "extend-shallow": "^3.0.2", @@ -9048,42 +9555,50 @@ }, "repeat-element": { "version": "1.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", "dev": true }, "repeat-string": { "version": "1.6.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, "require-directory": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, "require-main-filename": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, "resolve-from": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=", "dev": true }, "resolve-url": { "version": "0.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, "ret": { "version": "0.1.15", - "bundled": true, + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha1-uKSCXVvbH8P29Twrwz+BOIaBx7w=", "dev": true }, "right-align": { "version": "0.1.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", "dev": true, "optional": true, "requires": { @@ -9092,7 +9607,8 @@ }, "rimraf": { "version": "2.6.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=", "dev": true, "requires": { "glob": "^7.0.5" @@ -9100,7 +9616,8 @@ }, "safe-regex": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { "ret": "~0.1.10" @@ -9108,17 +9625,20 @@ }, "semver": { "version": "5.5.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha1-3Eu8emyp2Rbe5dQ1FvAJK1j3uKs=", "dev": true }, "set-blocking": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, "set-value": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha1-ca5KiPD+77v1LR6mBPP7MV67YnQ=", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -9129,7 +9649,8 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -9139,7 +9660,8 @@ }, "shebang-command": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { "shebang-regex": "^1.0.0" @@ -9147,22 +9669,26 @@ }, "shebang-regex": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, "signal-exit": { "version": "3.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, "slide": { "version": "1.1.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", "dev": true }, "snapdragon": { "version": "0.8.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha1-ZJIufFZbDhQgS6GqfWlkJ40lGC0=", "dev": true, "requires": { "base": "^0.11.1", @@ -9177,7 +9703,8 @@ "dependencies": { "debug": { "version": "2.6.9", - "bundled": true, + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -9185,7 +9712,8 @@ }, "define-property": { "version": "0.2.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -9193,7 +9721,8 @@ }, "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -9203,7 +9732,8 @@ }, "snapdragon-node": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", "dev": true, "requires": { "define-property": "^1.0.0", @@ -9213,7 +9743,8 @@ "dependencies": { "define-property": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { "is-descriptor": "^1.0.0" @@ -9221,7 +9752,8 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -9229,7 +9761,8 @@ }, "is-data-descriptor": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -9237,7 +9770,8 @@ }, "is-descriptor": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -9247,14 +9781,16 @@ }, "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", "dev": true } } }, "snapdragon-util": { "version": "3.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", "dev": true, "requires": { "kind-of": "^3.2.0" @@ -9262,12 +9798,14 @@ }, "source-map": { "version": "0.5.7", - "bundled": true, + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, "source-map-resolve": { "version": "0.5.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha1-cuLMNAlVQ+Q7LGKyxMENSpBU8lk=", "dev": true, "requires": { "atob": "^2.1.1", @@ -9279,12 +9817,14 @@ }, "source-map-url": { "version": "0.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, "spawn-wrap": { "version": "1.4.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.2.tgz", + "integrity": "sha1-z/WOc6giRhe2Vhq9wyWG6gyCJIw=", "dev": true, "requires": { "foreground-child": "^1.5.6", @@ -9297,7 +9837,8 @@ }, "spdx-correct": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha1-BaW01xU6GVvJLDxCW2nzsqlSTII=", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -9306,12 +9847,14 @@ }, "spdx-exceptions": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha1-LHrmEFbHFKW5ubKyr30xHvXHj+k=", "dev": true }, "spdx-expression-parse": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha1-meEZt6XaAOBUkcn6M4t5BII7QdA=", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -9320,12 +9863,14 @@ }, "spdx-license-ids": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha1-enzShHDMbToc/m1miG9rxDDTrIc=", "dev": true }, "split-string": { "version": "3.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", "dev": true, "requires": { "extend-shallow": "^3.0.0" @@ -9333,7 +9878,8 @@ }, "static-extend": { "version": "0.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, "requires": { "define-property": "^0.2.5", @@ -9342,7 +9888,8 @@ "dependencies": { "define-property": { "version": "0.2.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -9352,7 +9899,8 @@ }, "string-width": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -9361,7 +9909,8 @@ }, "strip-ansi": { "version": "4.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { "ansi-regex": "^3.0.0" @@ -9369,7 +9918,8 @@ }, "strip-bom": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "dev": true, "requires": { "is-utf8": "^0.2.0" @@ -9377,12 +9927,14 @@ }, "strip-eof": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, "test-exclude": { "version": "4.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.2.1.tgz", + "integrity": "sha1-36Ii8DSAvKaSB8pyizfXS0X3JPo=", "dev": true, "requires": { "arrify": "^1.0.1", @@ -9394,7 +9946,8 @@ }, "to-object-path": { "version": "0.3.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, "requires": { "kind-of": "^3.0.2" @@ -9402,7 +9955,8 @@ }, "to-regex": { "version": "3.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha1-E8/dmzNlUvMLUfM6iuG0Knp1mc4=", "dev": true, "requires": { "define-property": "^2.0.2", @@ -9413,7 +9967,8 @@ }, "to-regex-range": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { "is-number": "^3.0.0", @@ -9422,7 +9977,8 @@ }, "uglify-js": { "version": "2.8.29", - "bundled": true, + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", "dev": true, "optional": true, "requires": { @@ -9433,7 +9989,8 @@ "dependencies": { "yargs": { "version": "3.10.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", "dev": true, "optional": true, "requires": { @@ -9447,13 +10004,15 @@ }, "uglify-to-browserify": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", "dev": true, "optional": true }, "union-value": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "dev": true, "requires": { "arr-union": "^3.1.0", @@ -9464,7 +10023,8 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -9472,7 +10032,8 @@ }, "set-value": { "version": "0.4.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -9485,7 +10046,8 @@ }, "unset-value": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, "requires": { "has-value": "^0.3.1", @@ -9494,7 +10056,8 @@ "dependencies": { "has-value": { "version": "0.3.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { "get-value": "^2.0.3", @@ -9504,7 +10067,8 @@ "dependencies": { "isobject": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", "dev": true, "requires": { "isarray": "1.0.0" @@ -9514,19 +10078,22 @@ }, "has-values": { "version": "0.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", "dev": true } } }, "urix": { "version": "0.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "dev": true }, "use": { "version": "3.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", + "integrity": "sha1-FHFr8D/f79AwQK71jYtLhfOnxUQ=", "dev": true, "requires": { "kind-of": "^6.0.2" @@ -9534,14 +10101,16 @@ "dependencies": { "kind-of": { "version": "6.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", "dev": true } } }, "validate-npm-package-license": { "version": "3.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha1-gWQ7y+8b3+zUYjeT3EZIlIupgzg=", "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -9550,7 +10119,8 @@ }, "which": { "version": "1.3.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha1-pFBD1U9YBTFtqNYvn1CRjT2nCwo=", "dev": true, "requires": { "isexe": "^2.0.0" @@ -9558,23 +10128,27 @@ }, "which-module": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, "window-size": { "version": "0.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", "dev": true, "optional": true }, "wordwrap": { "version": "0.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", "dev": true }, "wrap-ansi": { "version": "2.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { "string-width": "^1.0.1", @@ -9583,12 +10157,14 @@ "dependencies": { "ansi-regex": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -9596,7 +10172,8 @@ }, "string-width": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -9606,7 +10183,8 @@ }, "strip-ansi": { "version": "3.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -9616,12 +10194,14 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "write-file-atomic": { "version": "1.3.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", "dev": true, "requires": { "graceful-fs": "^4.1.11", @@ -9631,17 +10211,20 @@ }, "y18n": { "version": "3.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", "dev": true }, "yallist": { "version": "2.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true }, "yargs": { "version": "11.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha1-kLhpk07W6HERXqL/WLA/RyTtLXc=", "dev": true, "requires": { "cliui": "^4.0.0", @@ -9660,12 +10243,14 @@ "dependencies": { "camelcase": { "version": "4.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true }, "cliui": { "version": "4.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha1-NIQi2+gtgAswIu709qwQvy5NG0k=", "dev": true, "requires": { "string-width": "^2.1.1", @@ -9675,7 +10260,8 @@ }, "yargs-parser": { "version": "9.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", "dev": true, "requires": { "camelcase": "^4.1.0" @@ -9685,7 +10271,8 @@ }, "yargs-parser": { "version": "8.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz", + "integrity": "sha1-8TdqM7Ziml0GN4KUTacyYx6WaVA=", "dev": true, "requires": { "camelcase": "^4.1.0" @@ -9693,7 +10280,8 @@ "dependencies": { "camelcase": { "version": "4.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true } } @@ -10262,9 +10850,9 @@ "dev": true }, "prettier": { - "version": "1.13.7", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.13.7.tgz", - "integrity": "sha512-KIU72UmYPGk4MujZGYMFwinB7lOf2LsDNGSOC8ufevsrPLISrZbNJlWstRi3m0AMuszbH+EFSQ/r6w56RSPK6w==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.0.tgz", + "integrity": "sha512-KtQ2EGaUwf2EyDfp1fxyEb0PqGKakVm0WyXwDt6u+cAoxbO2Z2CwKvOe3+b4+F2IlO9lYHi1kqFuRM70ddBnow==", "dev": true }, "pretty-ms": { diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index b1f92d38236..83fd91019cd 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -48,7 +48,7 @@ "cover": "nyc --reporter=lcov mocha build/test && nyc report", "docs": "jsdoc -c .jsdoc.js", "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", - "lint": "eslint samples/", + "lint": "npm run check && eslint samples/", "prettier": "prettier --write samples/*.js samples/*/*.js", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha build/system-test --timeout 600000", diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index d969b8a8d5b..bb49ded72de 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -22,10 +22,9 @@ import * as extend from 'extend'; import * as is from 'is'; import * as isHtml from 'is-html'; import * as prop from 'propprop'; -import { DecorateRequestOptions, BodyResponseCallback } from '@google-cloud/common/build/src/util'; +import {DecorateRequestOptions, BodyResponseCallback} from '@google-cloud/common/build/src/util'; import * as r from 'request'; - const PKG = require('../../package.json'); /** @@ -33,8 +32,10 @@ const PKG = require('../../package.json'); * @property {string} [projectId] The project ID from the Google Developer's * Console, e.g. 'grape-spaceship-123'. We will also check the environment * variable `GCLOUD_PROJECT` for your project ID. If your app is running in - * an environment which supports {@link https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application Application Default Credentials}, - * your project ID will be detected automatically. + * an environment which supports {@link + * https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application + * Application Default Credentials}, your project ID will be detected + * automatically. * @property {string} [key] An API key. You should prefer using a Service * Account key file instead of an API key. * @property {string} [keyFilename] Full path to the a .json, .pem, or .p12 key @@ -142,7 +143,7 @@ export class Translate extends common.Service { * //- * // Detect the language from a single string input. * //- - * translate.detect('Hello', function(err, results) { + * translate.detect('Hello', (err, results) => { * if (!err) { * // results = { * // language: 'en', @@ -159,7 +160,7 @@ export class Translate extends common.Service { * translate.detect([ * 'Hello', * 'Hola' - * ], function(err, results) { + * ], (err, results) => { * if (!err) { * // results = [ * // { @@ -179,7 +180,7 @@ export class Translate extends common.Service { * //- * // If the callback is omitted, we'll return a Promise. * //- - * translate.detect('Hello').then(function(data) { + * translate.detect('Hello').then((data) => { * var results = data[0]; * var apiResponse = data[2]; * }); @@ -193,37 +194,36 @@ export class Translate extends common.Service { input = arrify(input); this.request( - { - method: 'POST', - uri: '/detect', - json: { - q: input, + { + method: 'POST', + uri: '/detect', + json: { + q: input, + }, }, - }, - function (err, resp) { - if (err) { - callback(err, null, resp); - return; - } - - let results = resp.data.detections.map(function (detection, index) { - const result = extend({}, detection[0], { - input: input[index], - }); + (err, resp) => { + if (err) { + callback(err, null, resp); + return; + } - // Deprecated. - delete result.isReliable; + let results = resp.data.detections.map((detection, index) => { + const result = extend({}, detection[0], { + input: input[index], + }); - return result; - }); + // Deprecated. + delete result.isReliable; - if (input.length === 1 && !inputIsArray) { - results = results[0]; - } + return result; + }); - callback(null, results, resp); - } - ); + if (input.length === 1 && !inputIsArray) { + results = results[0]; + } + + callback(null, results, resp); + }); } /** @@ -272,20 +272,20 @@ export class Translate extends common.Service { const reqOpts = { uri: '/languages', useQuerystring: true, - qs: {} as any, - }; + qs: {}, + } as DecorateRequestOptions; if (target && is.string(target)) { reqOpts.qs.target = target; } - this.request(reqOpts, function (err, resp) { + this.request(reqOpts, (err, resp) => { if (err) { callback(err, null, resp); return; } - const languages = resp.data.languages.map(function (language) { + const languages = resp.data.languages.map(language => { return { code: language.language, name: language.name, @@ -301,8 +301,8 @@ export class Translate extends common.Service { * * @typedef {object} TranslateRequest * @property {string} [format] Set the text's format as `html` or `text`. - * If not provided, we will try to auto-detect if the text given is HTML. If - * not, we set the format as `text`. + * If not provided, we will try to auto-detect if the text given is HTML. + * If not, we set the format as `text`. * @property {string} [from] The ISO 639-1 language code the source input * is written in. * @property {string} [model] Set the model type requested for this @@ -344,7 +344,7 @@ export class Translate extends common.Service { * //- * // Pass a string and a language code to get the translation. * //- - * translate.translate('Hello', 'es', function(err, translation) { + * translate.translate('Hello', 'es', (err, translation) => { * if (!err) { * // translation = 'Hola' * } @@ -359,7 +359,7 @@ export class Translate extends common.Service { * to: 'es' * }; * - * translate.translate('Hello', options, function(err, translation) { + * translate.translate('Hello', options, (err, translation) => { * if (!err) { * // translation = 'Hola' * } @@ -374,7 +374,7 @@ export class Translate extends common.Service { * 'How are you today?' * ]; * - * translate.translate(input, 'es', function(err, translations) { + * translate.translate(input, 'es', (err, translations) => { * if (!err) { * // translations = [ * // 'Hola', @@ -386,7 +386,7 @@ export class Translate extends common.Service { * //- * // If the callback is omitted, we'll return a Promise. * //- - * translate.translate('Hello', 'es').then(function(data) { + * translate.translate('Hello', 'es').then((data) => { * var translation = data[0]; * var apiResponse = data[1]; * }); @@ -403,7 +403,7 @@ export class Translate extends common.Service { const inputIsArray = Array.isArray(input); input = arrify(input); - const body: any = { + const body: {[index: string]: string} = { q: input, format: options.format || (isHtml(input[0]) ? 'html' : 'text'), }; @@ -425,30 +425,30 @@ export class Translate extends common.Service { } if (!body.target) { - throw new Error('A target language is required to perform a translation.'); + throw new Error( + 'A target language is required to perform a translation.'); } this.request( - { - method: 'POST', - uri: '', - json: body, - }, - function (err, resp) { - if (err) { - callback(err, null, resp); - return; - } + { + method: 'POST', + uri: '', + json: body, + }, + (err, resp) => { + if (err) { + callback(err, null, resp); + return; + } - let translations = resp.data.translations.map(prop('translatedText')); + let translations = resp.data.translations.map(prop('translatedText')); - if (body.q.length === 1 && !inputIsArray) { - translations = translations[0]; - } + if (body.q.length === 1 && !inputIsArray) { + translations = translations[0]; + } - callback(err, translations, resp); - } - ); + callback(err, translations, resp); + }); } /** @@ -463,8 +463,10 @@ export class Translate extends common.Service { * @param {function} callback - The callback function passed to `request`. */ request(reqOpts: DecorateRequestOptions): Promise; - request(reqOpts: DecorateRequestOptions, callback: BodyResponseCallback): void; - request(reqOpts: DecorateRequestOptions, callback?: BodyResponseCallback): void|Promise { + request(reqOpts: DecorateRequestOptions, callback: BodyResponseCallback): + void; + request(reqOpts: DecorateRequestOptions, callback?: BodyResponseCallback): + void|Promise { if (!this.key) { super.request(reqOpts, callback!); return; @@ -485,11 +487,11 @@ export class Translate extends common.Service { } /*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -common.util.promisifyAll(Translate, { exclude: ['request']}); + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +common.util.promisifyAll(Translate, {exclude: ['request']}); /** * The `@google-cloud/translate` package has a single default export, the @@ -501,19 +503,21 @@ common.util.promisifyAll(Translate, { exclude: ['request']}); * @module {constructor} @google-cloud/translate * @alias nodejs-translate * - * @example Install the client library with npm: - * npm install --save @google-cloud/translate + * @example Install the client library with npm: npm install --save + * @google-cloud/translate * * @example Import the client library: * const Translate = require('@google-cloud/translate'); * - * @example Create a client that uses Application Default Credentials (ADC): - * const client = new Translate(); + * @example Create a client that uses Application Default Credentials + * (ADC): const client = new Translate(); * - * @example Create a client with explicit credentials: - * const client = new Translate({ - * projectId: 'your-project-id', - * keyFilename: '/path/to/keyfile.json', + * @example Create a client with explicit credentials: const client + * = new Translate({ projectId: 'your-project-id', keyFilename: + * '/path/to/keyfile.json', * }); * * @example include:samples/quickstart.js diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index 19a10bcbf3c..95b88efdc3a 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -33,8 +33,8 @@ const fakeUtil = extend({}, util, { return util.makeRequest.apply(null, arguments); }, - promisifyAll(Class) { - if (Class.name === 'Translate') { + promisifyAll(c) { + if (c.name === 'Translate') { promisified = true; } }, @@ -45,40 +45,42 @@ function FakeService() { this.calledWith_ = arguments; } -describe('Translate', function() { +describe('Translate', () => { const OPTIONS = { projectId: 'test-project', }; + // tslint:disable-next-line variable-name let Translate; let translate; - before(function() { + before(() => { Translate = proxyquire('../src', { - '@google-cloud/common': { - util: fakeUtil, - Service: FakeService, - }, - }).Translate; + '@google-cloud/common': { + util: fakeUtil, + Service: FakeService, + }, + }).Translate; }); - beforeEach(function() { + beforeEach(() => { extend(fakeUtil, originalFakeUtil); makeRequestOverride = null; translate = new Translate(OPTIONS); }); - describe('instantiation', function() { - it('should promisify all the things', function() { + describe('instantiation', () => { + it('should promisify all the things', () => { assert(promisified); }); - it('should inherit from Service', function() { + it('should inherit from Service', () => { assert(translate instanceof FakeService); const calledWith = translate.calledWith_[0]; - const baseUrl = 'https://translation.googleapis.com/language/translate/v2'; + const baseUrl = + 'https://translation.googleapis.com/language/translate/v2'; assert.strictEqual(calledWith.baseUrl, baseUrl); assert.deepEqual(calledWith.scopes, [ @@ -88,46 +90,46 @@ describe('Translate', function() { assert.strictEqual(calledWith.projectIdRequired, false); }); - describe('Using an API Key', function() { + describe('Using an API Key', () => { const KEY_OPTIONS = { key: 'api-key', }; - beforeEach(function() { + beforeEach(() => { translate = new Translate(KEY_OPTIONS); }); - it('should localize the options', function() { + it('should localize the options', () => { const options = {key: '...'}; const translate = new Translate(options); assert.strictEqual(translate.options.key, options.key); }); - it('should localize the api key', function() { + it('should localize the api key', () => { assert.strictEqual(translate.key, KEY_OPTIONS.key); }); }); - describe('GOOGLE_CLOUD_TRANSLATE_ENDPOINT', function() { + describe('GOOGLE_CLOUD_TRANSLATE_ENDPOINT', () => { const CUSTOM_ENDPOINT = '...'; let translate; - before(function() { + before(() => { process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT = CUSTOM_ENDPOINT; translate = new Translate(OPTIONS); }); - after(function() { + after(() => { delete process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT; }); - it('should correctly set the baseUrl', function() { + it('should correctly set the baseUrl', () => { const baseUrl = translate.calledWith_[0].baseUrl; assert.strictEqual(baseUrl, CUSTOM_ENDPOINT); }); - it('should remove trailing slashes', function() { + it('should remove trailing slashes', () => { const expectedBaseUrl = 'http://localhost:8080'; process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT = 'http://localhost:8080//'; @@ -140,11 +142,11 @@ describe('Translate', function() { }); }); - describe('detect', function() { + describe('detect', () => { const INPUT = 'input'; - it('should make the correct API request', function(done) { - translate.request = function(reqOpts) { + it('should make the correct API request', done => { + translate.request = reqOpts => { assert.strictEqual(reqOpts.uri, '/detect'); assert.strictEqual(reqOpts.method, 'POST'); assert.deepEqual(reqOpts.json, {q: [INPUT]}); @@ -154,18 +156,18 @@ describe('Translate', function() { translate.detect(INPUT, assert.ifError); }); - describe('error', function() { + describe('error', () => { const error = new Error('Error.'); const apiResponse = {}; - beforeEach(function() { - translate.request = function(reqOpts, callback) { + beforeEach(() => { + translate.request = (reqOpts, callback) => { callback(error, apiResponse); }; }); - it('should execute callback with error & API resp', function(done) { - translate.detect(INPUT, function(err, results, apiResponse_) { + it('should execute callback with error & API resp', done => { + translate.detect(INPUT, (err, results, apiResponse_) => { assert.strictEqual(err, error); assert.strictEqual(results, null); assert.strictEqual(apiResponse_, apiResponse); @@ -174,7 +176,7 @@ describe('Translate', function() { }); }); - describe('success', function() { + describe('success', () => { const apiResponse = { data: { detections: [ @@ -197,14 +199,14 @@ describe('Translate', function() { input: INPUT, }; - beforeEach(function() { - translate.request = function(reqOpts, callback) { + beforeEach(() => { + translate.request = (reqOpts, callback) => { callback(null, apiResponse); }; }); - it('should execute callback with results & API response', function(done) { - translate.detect(INPUT, function(err, results, apiResponse_) { + it('should execute callback with results & API response', done => { + translate.detect(INPUT, (err, results, apiResponse_) => { assert.ifError(err); assert.deepEqual(results, expectedResults); assert.strictEqual(apiResponse_, apiResponse); @@ -213,16 +215,16 @@ describe('Translate', function() { }); }); - it('should execute callback with multiple results', function(done) { - translate.detect([INPUT, INPUT], function(err, results) { + it('should execute callback with multiple results', done => { + translate.detect([INPUT, INPUT], (err, results) => { assert.ifError(err); assert.deepEqual(results, [expectedResults]); done(); }); }); - it('should return an array if input was an array', function(done) { - translate.detect([INPUT], function(err, results, apiResponse_) { + it('should return an array if input was an array', done => { + translate.detect([INPUT], (err, results, apiResponse_) => { assert.ifError(err); assert.deepEqual(results, [expectedResults]); assert.strictEqual(apiResponse_, apiResponse); @@ -233,9 +235,9 @@ describe('Translate', function() { }); }); - describe('getLanguages', function() { - it('should make the correct API request', function(done) { - translate.request = function(reqOpts) { + describe('getLanguages', () => { + it('should make the correct API request', done => { + translate.request = reqOpts => { assert.strictEqual(reqOpts.uri, '/languages'); assert.deepEqual(reqOpts.qs, { target: 'en', @@ -246,8 +248,8 @@ describe('Translate', function() { translate.getLanguages(assert.ifError); }); - it('should make the correct API request with target', function(done) { - translate.request = function(reqOpts) { + it('should make the correct API request with target', done => { + translate.request = reqOpts => { assert.strictEqual(reqOpts.uri, '/languages'); assert.deepEqual(reqOpts.qs, { target: 'es', @@ -258,18 +260,18 @@ describe('Translate', function() { translate.getLanguages('es', assert.ifError); }); - describe('error', function() { + describe('error', () => { const error = new Error('Error.'); const apiResponse = {}; - beforeEach(function() { - translate.request = function(reqOpts, callback) { + beforeEach(() => { + translate.request = (reqOpts, callback) => { callback(error, apiResponse); }; }); - it('should exec callback with error & API response', function(done) { - translate.getLanguages(function(err, languages, apiResponse_) { + it('should exec callback with error & API response', done => { + translate.getLanguages((err, languages, apiResponse_) => { assert.strictEqual(err, error); assert.strictEqual(languages, null); assert.strictEqual(apiResponse_, apiResponse); @@ -278,7 +280,7 @@ describe('Translate', function() { }); }); - describe('success', function() { + describe('success', () => { const apiResponse = { data: { languages: [ @@ -305,14 +307,14 @@ describe('Translate', function() { }, ]; - beforeEach(function() { - translate.request = function(reqOpts, callback) { + beforeEach(() => { + translate.request = (reqOpts, callback) => { callback(null, apiResponse); }; }); - it('should exec callback with languages', function(done) { - translate.getLanguages(function(err, languages, apiResponse_) { + it('should exec callback with languages', done => { + translate.getLanguages((err, languages, apiResponse_) => { assert.ifError(err); assert.deepEqual(languages, expectedResults); assert.strictEqual(apiResponse_, apiResponse); @@ -322,7 +324,7 @@ describe('Translate', function() { }); }); - describe('translate', function() { + describe('translate', () => { const INPUT = 'Hello'; const INPUT_HTML = 'Hello'; const SOURCE_LANG_CODE = 'en'; @@ -333,9 +335,9 @@ describe('Translate', function() { to: TARGET_LANG_CODE, }; - describe('options = target langauge', function() { - it('should make the correct API request', function(done) { - translate.request = function(reqOpts) { + describe('options = target langauge', () => { + it('should make the correct API request', done => { + translate.request = reqOpts => { assert.strictEqual(reqOpts.json.target, TARGET_LANG_CODE); done(); }; @@ -344,34 +346,32 @@ describe('Translate', function() { }); }); - describe('options = { source & target }', function() { - it('should throw if `to` is not provided', function() { - assert.throws(function() { + describe('options = { source & target }', () => { + it('should throw if `to` is not provided', () => { + assert.throws(() => { translate.translate(INPUT, {from: SOURCE_LANG_CODE}, util.noop); }, /A target language is required to perform a translation\./); }); - it('should make the correct API request', function(done) { - translate.request = function(reqOpts) { + it('should make the correct API request', done => { + translate.request = reqOpts => { assert.strictEqual(reqOpts.json.source, SOURCE_LANG_CODE); assert.strictEqual(reqOpts.json.target, TARGET_LANG_CODE); done(); }; translate.translate( - INPUT, - { - from: SOURCE_LANG_CODE, - to: TARGET_LANG_CODE, - }, - assert.ifError - ); + INPUT, { + from: SOURCE_LANG_CODE, + to: TARGET_LANG_CODE, + }, + assert.ifError); }); }); - describe('options.format', function() { - it('should default to text', function(done) { - translate.request = function(reqOpts) { + describe('options.format', () => { + it('should default to text', done => { + translate.request = reqOpts => { assert.strictEqual(reqOpts.json.format, 'text'); done(); }; @@ -379,8 +379,8 @@ describe('Translate', function() { translate.translate(INPUT, OPTIONS, assert.ifError); }); - it('should recognize HTML', function(done) { - translate.request = function(reqOpts) { + it('should recognize HTML', done => { + translate.request = reqOpts => { assert.strictEqual(reqOpts.json.format, 'html'); done(); }; @@ -388,12 +388,12 @@ describe('Translate', function() { translate.translate(INPUT_HTML, OPTIONS, assert.ifError); }); - it('should allow overriding the format', function(done) { + it('should allow overriding the format', done => { const options = extend({}, OPTIONS, { format: 'custom format', }); - translate.request = function(reqOpts) { + translate.request = reqOpts => { assert.strictEqual(reqOpts.json.format, options.format); done(); }; @@ -402,14 +402,14 @@ describe('Translate', function() { }); }); - describe('options.model', function() { - it('should set the model option when available', function(done) { + describe('options.model', () => { + it('should set the model option when available', done => { const fakeOptions = { model: 'nmt', to: 'es', }; - translate.request = function(reqOpts) { + translate.request = reqOpts => { assert.strictEqual(reqOpts.json.model, 'nmt'); done(); }; @@ -418,8 +418,8 @@ describe('Translate', function() { }); }); - it('should make the correct API request', function(done) { - translate.request = function(reqOpts) { + it('should make the correct API request', done => { + translate.request = reqOpts => { assert.strictEqual(reqOpts.uri, ''); assert.strictEqual(reqOpts.method, 'POST'); assert.deepEqual(reqOpts.json, { @@ -434,18 +434,18 @@ describe('Translate', function() { translate.translate(INPUT, OPTIONS, assert.ifError); }); - describe('error', function() { + describe('error', () => { const error = new Error('Error.'); const apiResponse = {}; - beforeEach(function() { - translate.request = function(reqOpts, callback) { + beforeEach(() => { + translate.request = (reqOpts, callback) => { callback(error, apiResponse); }; }); - it('should exec callback with error & API response', function(done) { - translate.translate(INPUT, OPTIONS, function(err, translations, resp) { + it('should exec callback with error & API response', done => { + translate.translate(INPUT, OPTIONS, (err, translations, resp) => { assert.strictEqual(err, error); assert.strictEqual(translations, null); assert.strictEqual(resp, apiResponse); @@ -454,7 +454,7 @@ describe('Translate', function() { }); }); - describe('success', function() { + describe('success', () => { const apiResponse = { data: { translations: [ @@ -469,14 +469,14 @@ describe('Translate', function() { const expectedResults = apiResponse.data.translations[0].translatedText; - beforeEach(function() { - translate.request = function(reqOpts, callback) { + beforeEach(() => { + translate.request = (reqOpts, callback) => { callback(null, apiResponse); }; }); - it('should execute callback with results & API response', function(done) { - translate.translate(INPUT, OPTIONS, function(err, translations, resp) { + it('should execute callback with results & API response', done => { + translate.translate(INPUT, OPTIONS, (err, translations, resp) => { assert.ifError(err); assert.deepEqual(translations, expectedResults); assert.strictEqual(resp, apiResponse); @@ -484,17 +484,17 @@ describe('Translate', function() { }); }); - it('should execute callback with multiple results', function(done) { + it('should execute callback with multiple results', done => { const input = [INPUT, INPUT]; - translate.translate(input, OPTIONS, function(err, translations) { + translate.translate(input, OPTIONS, (err, translations) => { assert.ifError(err); assert.deepEqual(translations, [expectedResults]); done(); }); }); - it('should return an array if input was an array', function(done) { - translate.translate([INPUT], OPTIONS, function(err, translations) { + it('should return an array if input was an array', done => { + translate.translate([INPUT], OPTIONS, (err, translations) => { assert.ifError(err); assert.deepEqual(translations, [expectedResults]); done(); @@ -503,19 +503,19 @@ describe('Translate', function() { }); }); - describe('request', function() { - describe('OAuth mode', function() { + describe('request', () => { + describe('OAuth mode', () => { let request; - beforeEach(function() { + beforeEach(() => { request = FakeService.prototype.request; }); - afterEach(function() { + afterEach(() => { FakeService.prototype.request = request; }); - it('should make the correct request', function(done) { + it('should make the correct request', done => { const fakeOptions = { uri: '/test', a: 'b', @@ -524,7 +524,7 @@ describe('Translate', function() { }, }; - FakeService.prototype.request = function(reqOpts, callback) { + FakeService.prototype.request = (reqOpts, callback) => { assert.strictEqual(reqOpts, fakeOptions); callback(); }; @@ -533,20 +533,20 @@ describe('Translate', function() { }); }); - describe('API key mode', function() { + describe('API key mode', () => { const KEY_OPTIONS = { key: 'api-key', }; - beforeEach(function() { + beforeEach(() => { translate = new Translate(KEY_OPTIONS); }); - it('should make the correct request', function(done) { + it('should make the correct request', done => { const userAgent = 'user-agent/0.0.0'; const getUserAgentFn = fakeUtil.getUserAgentFromPackageJson; - fakeUtil.getUserAgentFromPackageJson = function(packageJson) { + fakeUtil.getUserAgentFromPackageJson = (packageJson) => { fakeUtil.getUserAgentFromPackageJson = getUserAgentFn; assert.deepEqual(packageJson, pkgJson); return userAgent; @@ -573,10 +573,10 @@ describe('Translate', function() { expectedReqOpts.uri = translate.baseUrl + reqOpts.uri; - makeRequestOverride = function(reqOpts, options, callback) { + makeRequestOverride = (reqOpts, options, callback) => { assert.deepEqual(reqOpts, expectedReqOpts); assert.strictEqual(options, translate.options); - callback(); // done() + callback(); // done() }; translate.request(reqOpts, done); diff --git a/packages/google-cloud-translate/tsconfig.json b/packages/google-cloud-translate/tsconfig.json index 45d3f30784b..75ad3f24557 100644 --- a/packages/google-cloud-translate/tsconfig.json +++ b/packages/google-cloud-translate/tsconfig.json @@ -4,14 +4,10 @@ "rootDir": ".", "outDir": "build", "noImplicitAny": false, - "esModuleInterop": false, - "allowSyntheticDefaultImports": false, "noImplicitThis": false }, "include": [ "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts" + "test/*.ts" ] } From 952b7875c5188215702aeac739cf39d86ed5272d Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 30 Jul 2018 15:25:34 -0700 Subject: [PATCH 121/513] chore: assert.deelEqual => assert.deepStrictEqual (#81) --- .../system-test/translate.ts | 4 +-- packages/google-cloud-translate/test/index.ts | 34 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 3f641d1fcc9..5fd8938bada 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -129,7 +129,7 @@ describe('translate', function() { return language.code === 'en'; })[0]; - assert.deepEqual(englishResult, { + assert.deepStrictEqual(englishResult, { code: 'en', name: 'English', }); @@ -146,7 +146,7 @@ describe('translate', function() { return language.code === 'en'; })[0]; - assert.deepEqual(englishResult, { + assert.deepStrictEqual(englishResult, { code: 'en', name: 'inglés', }); diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index 95b88efdc3a..bfecaa3deb4 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -83,10 +83,10 @@ describe('Translate', () => { 'https://translation.googleapis.com/language/translate/v2'; assert.strictEqual(calledWith.baseUrl, baseUrl); - assert.deepEqual(calledWith.scopes, [ + assert.deepStrictEqual(calledWith.scopes, [ 'https://www.googleapis.com/auth/cloud-platform', ]); - assert.deepEqual(calledWith.packageJson, pkgJson); + assert.deepStrictEqual(calledWith.packageJson, pkgJson); assert.strictEqual(calledWith.projectIdRequired, false); }); @@ -149,7 +149,7 @@ describe('Translate', () => { translate.request = reqOpts => { assert.strictEqual(reqOpts.uri, '/detect'); assert.strictEqual(reqOpts.method, 'POST'); - assert.deepEqual(reqOpts.json, {q: [INPUT]}); + assert.deepStrictEqual(reqOpts.json, {q: [INPUT]}); done(); }; @@ -208,9 +208,9 @@ describe('Translate', () => { it('should execute callback with results & API response', done => { translate.detect(INPUT, (err, results, apiResponse_) => { assert.ifError(err); - assert.deepEqual(results, expectedResults); + assert.deepStrictEqual(results, expectedResults); assert.strictEqual(apiResponse_, apiResponse); - assert.deepEqual(apiResponse_, originalApiResponse); + assert.deepStrictEqual(apiResponse_, originalApiResponse); done(); }); }); @@ -218,7 +218,7 @@ describe('Translate', () => { it('should execute callback with multiple results', done => { translate.detect([INPUT, INPUT], (err, results) => { assert.ifError(err); - assert.deepEqual(results, [expectedResults]); + assert.deepStrictEqual(results, [expectedResults]); done(); }); }); @@ -226,9 +226,9 @@ describe('Translate', () => { it('should return an array if input was an array', done => { translate.detect([INPUT], (err, results, apiResponse_) => { assert.ifError(err); - assert.deepEqual(results, [expectedResults]); + assert.deepStrictEqual(results, [expectedResults]); assert.strictEqual(apiResponse_, apiResponse); - assert.deepEqual(apiResponse_, originalApiResponse); + assert.deepStrictEqual(apiResponse_, originalApiResponse); done(); }); }); @@ -239,7 +239,7 @@ describe('Translate', () => { it('should make the correct API request', done => { translate.request = reqOpts => { assert.strictEqual(reqOpts.uri, '/languages'); - assert.deepEqual(reqOpts.qs, { + assert.deepStrictEqual(reqOpts.qs, { target: 'en', }); done(); @@ -251,7 +251,7 @@ describe('Translate', () => { it('should make the correct API request with target', done => { translate.request = reqOpts => { assert.strictEqual(reqOpts.uri, '/languages'); - assert.deepEqual(reqOpts.qs, { + assert.deepStrictEqual(reqOpts.qs, { target: 'es', }); done(); @@ -316,7 +316,7 @@ describe('Translate', () => { it('should exec callback with languages', done => { translate.getLanguages((err, languages, apiResponse_) => { assert.ifError(err); - assert.deepEqual(languages, expectedResults); + assert.deepStrictEqual(languages, expectedResults); assert.strictEqual(apiResponse_, apiResponse); done(); }); @@ -422,7 +422,7 @@ describe('Translate', () => { translate.request = reqOpts => { assert.strictEqual(reqOpts.uri, ''); assert.strictEqual(reqOpts.method, 'POST'); - assert.deepEqual(reqOpts.json, { + assert.deepStrictEqual(reqOpts.json, { q: [INPUT], format: 'text', source: SOURCE_LANG_CODE, @@ -478,7 +478,7 @@ describe('Translate', () => { it('should execute callback with results & API response', done => { translate.translate(INPUT, OPTIONS, (err, translations, resp) => { assert.ifError(err); - assert.deepEqual(translations, expectedResults); + assert.deepStrictEqual(translations, expectedResults); assert.strictEqual(resp, apiResponse); done(); }); @@ -488,7 +488,7 @@ describe('Translate', () => { const input = [INPUT, INPUT]; translate.translate(input, OPTIONS, (err, translations) => { assert.ifError(err); - assert.deepEqual(translations, [expectedResults]); + assert.deepStrictEqual(translations, [expectedResults]); done(); }); }); @@ -496,7 +496,7 @@ describe('Translate', () => { it('should return an array if input was an array', done => { translate.translate([INPUT], OPTIONS, (err, translations) => { assert.ifError(err); - assert.deepEqual(translations, [expectedResults]); + assert.deepStrictEqual(translations, [expectedResults]); done(); }); }); @@ -548,7 +548,7 @@ describe('Translate', () => { const getUserAgentFn = fakeUtil.getUserAgentFromPackageJson; fakeUtil.getUserAgentFromPackageJson = (packageJson) => { fakeUtil.getUserAgentFromPackageJson = getUserAgentFn; - assert.deepEqual(packageJson, pkgJson); + assert.deepStrictEqual(packageJson, pkgJson); return userAgent; }; @@ -574,7 +574,7 @@ describe('Translate', () => { expectedReqOpts.uri = translate.baseUrl + reqOpts.uri; makeRequestOverride = (reqOpts, options, callback) => { - assert.deepEqual(reqOpts, expectedReqOpts); + assert.deepStrictEqual(reqOpts, expectedReqOpts); assert.strictEqual(options, translate.options); callback(); // done() }; From dffd4041734185b56bf2c1c4aced739a0aaa991a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 30 Jul 2018 15:39:16 -0700 Subject: [PATCH 122/513] chore: move mocha options to mocha.opts (#78) --- packages/google-cloud-translate/test/mocha.opts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-translate/test/mocha.opts b/packages/google-cloud-translate/test/mocha.opts index 0f2b2e99425..bcb4e04e492 100644 --- a/packages/google-cloud-translate/test/mocha.opts +++ b/packages/google-cloud-translate/test/mocha.opts @@ -2,3 +2,4 @@ --require source-map-support/register --require intelli-espower-loader --timeout 10000 + From 34472934a4640dca8759da878be37c1141547f0c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 30 Jul 2018 18:45:12 -0700 Subject: [PATCH 123/513] chore(deps): lock file maintenance (#83) --- .../google-cloud-translate/package-lock.json | 1821 ++++++----------- 1 file changed, 607 insertions(+), 1214 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 190e7fab26f..2118115f878 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -294,8 +294,7 @@ "dependencies": { "align-text": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "bundled": true, "dev": true, "requires": { "kind-of": "^3.0.2", @@ -305,26 +304,22 @@ }, "amdefine": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "bundled": true, "dev": true }, "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "bundled": true, "dev": true }, "ansi-styles": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "bundled": true, "dev": true }, "append-transform": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", - "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=", + "bundled": true, "dev": true, "requires": { "default-require-extensions": "^1.0.0" @@ -332,62 +327,52 @@ }, "archy": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "bundled": true, "dev": true }, "arr-diff": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "bundled": true, "dev": true }, "arr-flatten": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "bundled": true, "dev": true }, "arr-union": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "bundled": true, "dev": true }, "array-unique": { "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "bundled": true, "dev": true }, "arrify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "bundled": true, "dev": true }, "assign-symbols": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "bundled": true, "dev": true }, "async": { "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "bundled": true, "dev": true }, "atob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", - "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", + "bundled": true, "dev": true }, "babel-code-frame": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "bundled": true, "dev": true, "requires": { "chalk": "^1.1.3", @@ -397,8 +382,7 @@ }, "babel-generator": { "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "bundled": true, "dev": true, "requires": { "babel-messages": "^6.23.0", @@ -413,8 +397,7 @@ }, "babel-messages": { "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "bundled": true, "dev": true, "requires": { "babel-runtime": "^6.22.0" @@ -422,8 +405,7 @@ }, "babel-runtime": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "bundled": true, "dev": true, "requires": { "core-js": "^2.4.0", @@ -432,8 +414,7 @@ }, "babel-template": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "bundled": true, "dev": true, "requires": { "babel-runtime": "^6.26.0", @@ -445,8 +426,7 @@ }, "babel-traverse": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "bundled": true, "dev": true, "requires": { "babel-code-frame": "^6.26.0", @@ -462,8 +442,7 @@ }, "babel-types": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "bundled": true, "dev": true, "requires": { "babel-runtime": "^6.26.0", @@ -474,20 +453,17 @@ }, "babylon": { "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "bundled": true, "dev": true }, "balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "bundled": true, "dev": true }, "base": { "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "bundled": true, "dev": true, "requires": { "cache-base": "^1.0.1", @@ -501,8 +477,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^1.0.0" @@ -510,8 +485,7 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -519,8 +493,7 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -528,8 +501,7 @@ }, "is-descriptor": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -539,16 +511,14 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "bundled": true, "dev": true } } }, "brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "bundled": true, "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -557,8 +527,7 @@ }, "braces": { "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "bundled": true, "dev": true, "requires": { "arr-flatten": "^1.1.0", @@ -575,8 +544,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -586,14 +554,12 @@ }, "builtin-modules": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "bundled": true, "dev": true }, "cache-base": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "bundled": true, "dev": true, "requires": { "collection-visit": "^1.0.0", @@ -609,8 +575,7 @@ }, "caching-transform": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", - "integrity": "sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE=", + "bundled": true, "dev": true, "requires": { "md5-hex": "^1.2.0", @@ -620,15 +585,13 @@ }, "camelcase": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "bundled": true, "dev": true, "optional": true }, "center-align": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -638,8 +601,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "bundled": true, "dev": true, "requires": { "ansi-styles": "^2.2.1", @@ -651,8 +613,7 @@ }, "class-utils": { "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "bundled": true, "dev": true, "requires": { "arr-union": "^3.1.0", @@ -663,8 +624,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -674,8 +634,7 @@ }, "cliui": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -686,8 +645,7 @@ "dependencies": { "wordwrap": { "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "bundled": true, "dev": true, "optional": true } @@ -695,14 +653,12 @@ }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "bundled": true, "dev": true }, "collection-visit": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "bundled": true, "dev": true, "requires": { "map-visit": "^1.0.0", @@ -711,44 +667,37 @@ }, "commondir": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "bundled": true, "dev": true }, "component-emitter": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "bundled": true, "dev": true }, "concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "bundled": true, "dev": true }, "convert-source-map": { "version": "1.5.1", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", - "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "bundled": true, "dev": true }, "copy-descriptor": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "bundled": true, "dev": true }, "core-js": { "version": "2.5.6", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.6.tgz", - "integrity": "sha512-lQUVfQi0aLix2xpyjrrJEvfuYCqPc/HwmTKsC/VNf8q0zsjX7SQZtp4+oRONN5Tsur9GDETPjj+Ub2iDiGZfSQ==", + "bundled": true, "dev": true }, "cross-spawn": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", - "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "bundled": true, "dev": true, "requires": { "lru-cache": "^4.0.1", @@ -757,8 +706,7 @@ }, "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "bundled": true, "dev": true, "requires": { "ms": "2.0.0" @@ -766,26 +714,22 @@ }, "debug-log": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", - "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=", + "bundled": true, "dev": true }, "decamelize": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "bundled": true, "dev": true }, "decode-uri-component": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "bundled": true, "dev": true }, "default-require-extensions": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", - "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", + "bundled": true, "dev": true, "requires": { "strip-bom": "^2.0.0" @@ -793,8 +737,7 @@ }, "define-property": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^1.0.2", @@ -803,8 +746,7 @@ "dependencies": { "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -812,8 +754,7 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -821,8 +762,7 @@ }, "is-descriptor": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -832,16 +772,14 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "bundled": true, "dev": true } } }, "detect-indent": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "bundled": true, "dev": true, "requires": { "repeating": "^2.0.0" @@ -849,8 +787,7 @@ }, "error-ex": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "bundled": true, "dev": true, "requires": { "is-arrayish": "^0.2.1" @@ -858,20 +795,17 @@ }, "escape-string-regexp": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "bundled": true, "dev": true }, "esutils": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "bundled": true, "dev": true }, "execa": { "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "bundled": true, "dev": true, "requires": { "cross-spawn": "^5.0.1", @@ -885,8 +819,7 @@ "dependencies": { "cross-spawn": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "bundled": true, "dev": true, "requires": { "lru-cache": "^4.0.1", @@ -898,8 +831,7 @@ }, "expand-brackets": { "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "bundled": true, "dev": true, "requires": { "debug": "^2.3.3", @@ -913,8 +845,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -922,8 +853,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -933,8 +863,7 @@ }, "extend-shallow": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "bundled": true, "dev": true, "requires": { "assign-symbols": "^1.0.0", @@ -943,8 +872,7 @@ "dependencies": { "is-extendable": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "bundled": true, "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -954,8 +882,7 @@ }, "extglob": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "bundled": true, "dev": true, "requires": { "array-unique": "^0.3.2", @@ -970,8 +897,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^1.0.0" @@ -979,8 +905,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -988,8 +913,7 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -997,8 +921,7 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -1006,8 +929,7 @@ }, "is-descriptor": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -1017,16 +939,14 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "bundled": true, "dev": true } } }, "fill-range": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "bundled": true, "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -1037,8 +957,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -1048,8 +967,7 @@ }, "find-cache-dir": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", - "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", + "bundled": true, "dev": true, "requires": { "commondir": "^1.0.1", @@ -1059,8 +977,7 @@ }, "find-up": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "bundled": true, "dev": true, "requires": { "locate-path": "^2.0.0" @@ -1068,14 +985,12 @@ }, "for-in": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "bundled": true, "dev": true }, "foreground-child": { "version": "1.5.6", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", - "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", + "bundled": true, "dev": true, "requires": { "cross-spawn": "^4", @@ -1084,8 +999,7 @@ }, "fragment-cache": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "bundled": true, "dev": true, "requires": { "map-cache": "^0.2.2" @@ -1093,32 +1007,27 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "bundled": true, "dev": true }, "get-caller-file": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "bundled": true, "dev": true }, "get-stream": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "bundled": true, "dev": true }, "get-value": { "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "bundled": true, "dev": true }, "glob": { "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "bundled": true, "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1131,20 +1040,17 @@ }, "globals": { "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "bundled": true, "dev": true }, "graceful-fs": { "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "bundled": true, "dev": true }, "handlebars": { "version": "4.0.11", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", - "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "bundled": true, "dev": true, "requires": { "async": "^1.4.0", @@ -1155,8 +1061,7 @@ "dependencies": { "source-map": { "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "bundled": true, "dev": true, "requires": { "amdefine": ">=0.0.4" @@ -1166,8 +1071,7 @@ }, "has-ansi": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "bundled": true, "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -1175,14 +1079,12 @@ }, "has-flag": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "bundled": true, "dev": true }, "has-value": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "bundled": true, "dev": true, "requires": { "get-value": "^2.0.6", @@ -1192,8 +1094,7 @@ }, "has-values": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "bundled": true, "dev": true, "requires": { "is-number": "^3.0.0", @@ -1202,8 +1103,7 @@ "dependencies": { "kind-of": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "bundled": true, "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -1213,20 +1113,17 @@ }, "hosted-git-info": { "version": "2.6.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "bundled": true, "dev": true }, "imurmurhash": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "bundled": true, "dev": true }, "inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "bundled": true, "dev": true, "requires": { "once": "^1.3.0", @@ -1235,14 +1132,12 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "bundled": true, "dev": true }, "invariant": { "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "bundled": true, "dev": true, "requires": { "loose-envify": "^1.0.0" @@ -1250,14 +1145,12 @@ }, "invert-kv": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "bundled": true, "dev": true }, "is-accessor-descriptor": { "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "bundled": true, "dev": true, "requires": { "kind-of": "^3.0.2" @@ -1265,20 +1158,17 @@ }, "is-arrayish": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "bundled": true, "dev": true }, "is-buffer": { "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "bundled": true, "dev": true }, "is-builtin-module": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "bundled": true, "dev": true, "requires": { "builtin-modules": "^1.0.0" @@ -1286,8 +1176,7 @@ }, "is-data-descriptor": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "bundled": true, "dev": true, "requires": { "kind-of": "^3.0.2" @@ -1295,8 +1184,7 @@ }, "is-descriptor": { "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "^0.1.6", @@ -1306,22 +1194,19 @@ "dependencies": { "kind-of": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "bundled": true, "dev": true } } }, "is-extendable": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "bundled": true, "dev": true }, "is-finite": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "bundled": true, "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -1329,14 +1214,12 @@ }, "is-fullwidth-code-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "bundled": true, "dev": true }, "is-number": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "bundled": true, "dev": true, "requires": { "kind-of": "^3.0.2" @@ -1344,8 +1227,7 @@ }, "is-odd": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", - "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", + "bundled": true, "dev": true, "requires": { "is-number": "^4.0.0" @@ -1353,16 +1235,14 @@ "dependencies": { "is-number": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "bundled": true, "dev": true } } }, "is-plain-object": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "bundled": true, "dev": true, "requires": { "isobject": "^3.0.1" @@ -1370,50 +1250,42 @@ }, "is-stream": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "bundled": true, "dev": true }, "is-utf8": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "bundled": true, "dev": true }, "is-windows": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "bundled": true, "dev": true }, "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "bundled": true, "dev": true }, "isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "bundled": true, "dev": true }, "isobject": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "bundled": true, "dev": true }, "istanbul-lib-coverage": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz", - "integrity": "sha512-GvgM/uXRwm+gLlvkWHTjDAvwynZkL9ns15calTrmhGgowlwJBbWMYzWbKqE2DT6JDP1AFXKa+Zi0EkqNCUqY0A==", + "bundled": true, "dev": true }, "istanbul-lib-hook": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.1.0.tgz", - "integrity": "sha512-U3qEgwVDUerZ0bt8cfl3dSP3S6opBoOtk3ROO5f2EfBr/SRiD9FQqzwaZBqFORu8W7O0EXpai+k7kxHK13beRg==", + "bundled": true, "dev": true, "requires": { "append-transform": "^0.4.0" @@ -1421,8 +1293,7 @@ }, "istanbul-lib-instrument": { "version": "1.10.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz", - "integrity": "sha512-1dYuzkOCbuR5GRJqySuZdsmsNKPL3PTuyPevQfoCXJePT9C8y1ga75neU+Tuy9+yS3G/dgx8wgOmp2KLpgdoeQ==", + "bundled": true, "dev": true, "requires": { "babel-generator": "^6.18.0", @@ -1436,8 +1307,7 @@ }, "istanbul-lib-report": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.3.tgz", - "integrity": "sha512-D4jVbMDtT2dPmloPJS/rmeP626N5Pr3Rp+SovrPn1+zPChGHcggd/0sL29jnbm4oK9W0wHjCRsdch9oLd7cm6g==", + "bundled": true, "dev": true, "requires": { "istanbul-lib-coverage": "^1.1.2", @@ -1448,8 +1318,7 @@ "dependencies": { "supports-color": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "bundled": true, "dev": true, "requires": { "has-flag": "^1.0.0" @@ -1459,8 +1328,7 @@ }, "istanbul-lib-source-maps": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.3.tgz", - "integrity": "sha512-fDa0hwU/5sDXwAklXgAoCJCOsFsBplVQ6WBldz5UwaqOzmDhUK4nfuR7/G//G2lERlblUNJB8P6e8cXq3a7MlA==", + "bundled": true, "dev": true, "requires": { "debug": "^3.1.0", @@ -1472,8 +1340,7 @@ "dependencies": { "debug": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "bundled": true, "dev": true, "requires": { "ms": "2.0.0" @@ -1483,8 +1350,7 @@ }, "istanbul-reports": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.4.0.tgz", - "integrity": "sha512-OPzVo1fPZ2H+owr8q/LYKLD+vquv9Pj4F+dj808MdHbuQLD7S4ACRjcX+0Tne5Vxt2lxXvdZaL7v+FOOAV281w==", + "bundled": true, "dev": true, "requires": { "handlebars": "^4.0.3" @@ -1492,20 +1358,17 @@ }, "js-tokens": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "bundled": true, "dev": true }, "jsesc": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "bundled": true, "dev": true }, "kind-of": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "bundled": true, "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -1513,15 +1376,13 @@ }, "lazy-cache": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "bundled": true, "dev": true, "optional": true }, "lcid": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "bundled": true, "dev": true, "requires": { "invert-kv": "^1.0.0" @@ -1529,8 +1390,7 @@ }, "load-json-file": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "bundled": true, "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -1542,8 +1402,7 @@ }, "locate-path": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "bundled": true, "dev": true, "requires": { "p-locate": "^2.0.0", @@ -1552,28 +1411,24 @@ "dependencies": { "path-exists": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "bundled": true, "dev": true } } }, "lodash": { "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "bundled": true, "dev": true }, "longest": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "bundled": true, "dev": true }, "loose-envify": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", - "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "bundled": true, "dev": true, "requires": { "js-tokens": "^3.0.0" @@ -1581,8 +1436,7 @@ }, "lru-cache": { "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "bundled": true, "dev": true, "requires": { "pseudomap": "^1.0.2", @@ -1591,14 +1445,12 @@ }, "map-cache": { "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "bundled": true, "dev": true }, "map-visit": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "bundled": true, "dev": true, "requires": { "object-visit": "^1.0.0" @@ -1606,8 +1458,7 @@ }, "md5-hex": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", - "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", + "bundled": true, "dev": true, "requires": { "md5-o-matic": "^0.1.1" @@ -1615,14 +1466,12 @@ }, "md5-o-matic": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", - "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", + "bundled": true, "dev": true }, "mem": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "bundled": true, "dev": true, "requires": { "mimic-fn": "^1.0.0" @@ -1630,8 +1479,7 @@ }, "merge-source-map": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "bundled": true, "dev": true, "requires": { "source-map": "^0.6.1" @@ -1639,16 +1487,14 @@ "dependencies": { "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "bundled": true, "dev": true } } }, "micromatch": { "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "bundled": true, "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -1668,22 +1514,19 @@ "dependencies": { "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "bundled": true, "dev": true } } }, "mimic-fn": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "bundled": true, "dev": true }, "minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "bundled": true, "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -1691,14 +1534,12 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "bundled": true, "dev": true }, "mixin-deep": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "bundled": true, "dev": true, "requires": { "for-in": "^1.0.2", @@ -1707,8 +1548,7 @@ "dependencies": { "is-extendable": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "bundled": true, "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -1718,8 +1558,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "bundled": true, "dev": true, "requires": { "minimist": "0.0.8" @@ -1727,14 +1566,12 @@ }, "ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "bundled": true, "dev": true }, "nanomatch": { "version": "1.2.9", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", - "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "bundled": true, "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -1753,16 +1590,14 @@ "dependencies": { "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "bundled": true, "dev": true } } }, "normalize-package-data": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "bundled": true, "dev": true, "requires": { "hosted-git-info": "^2.1.4", @@ -1773,8 +1608,7 @@ }, "npm-run-path": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "bundled": true, "dev": true, "requires": { "path-key": "^2.0.0" @@ -1782,20 +1616,17 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "bundled": true, "dev": true }, "object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "bundled": true, "dev": true }, "object-copy": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "bundled": true, "dev": true, "requires": { "copy-descriptor": "^0.1.0", @@ -1805,8 +1636,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -1816,8 +1646,7 @@ }, "object-visit": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "bundled": true, "dev": true, "requires": { "isobject": "^3.0.0" @@ -1825,8 +1654,7 @@ }, "object.pick": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "bundled": true, "dev": true, "requires": { "isobject": "^3.0.1" @@ -1834,8 +1662,7 @@ }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "bundled": true, "dev": true, "requires": { "wrappy": "1" @@ -1843,8 +1670,7 @@ }, "optimist": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "bundled": true, "dev": true, "requires": { "minimist": "~0.0.1", @@ -1853,14 +1679,12 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "bundled": true, "dev": true }, "os-locale": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "bundled": true, "dev": true, "requires": { "execa": "^0.7.0", @@ -1870,14 +1694,12 @@ }, "p-finally": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "bundled": true, "dev": true }, "p-limit": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", - "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "bundled": true, "dev": true, "requires": { "p-try": "^1.0.0" @@ -1885,8 +1707,7 @@ }, "p-locate": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "bundled": true, "dev": true, "requires": { "p-limit": "^1.1.0" @@ -1894,14 +1715,12 @@ }, "p-try": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "bundled": true, "dev": true }, "parse-json": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "bundled": true, "dev": true, "requires": { "error-ex": "^1.2.0" @@ -1909,14 +1728,12 @@ }, "pascalcase": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "bundled": true, "dev": true }, "path-exists": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "bundled": true, "dev": true, "requires": { "pinkie-promise": "^2.0.0" @@ -1924,26 +1741,22 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "bundled": true, "dev": true }, "path-key": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "bundled": true, "dev": true }, "path-parse": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "bundled": true, "dev": true }, "path-type": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "bundled": true, "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -1953,20 +1766,17 @@ }, "pify": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "bundled": true, "dev": true }, "pinkie": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "bundled": true, "dev": true }, "pinkie-promise": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "bundled": true, "dev": true, "requires": { "pinkie": "^2.0.0" @@ -1974,8 +1784,7 @@ }, "pkg-dir": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", - "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "bundled": true, "dev": true, "requires": { "find-up": "^1.0.0" @@ -1983,8 +1792,7 @@ "dependencies": { "find-up": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "bundled": true, "dev": true, "requires": { "path-exists": "^2.0.0", @@ -1995,20 +1803,17 @@ }, "posix-character-classes": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "bundled": true, "dev": true }, "pseudomap": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "bundled": true, "dev": true }, "read-pkg": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "bundled": true, "dev": true, "requires": { "load-json-file": "^1.0.0", @@ -2018,8 +1823,7 @@ }, "read-pkg-up": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "bundled": true, "dev": true, "requires": { "find-up": "^1.0.0", @@ -2028,8 +1832,7 @@ "dependencies": { "find-up": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "bundled": true, "dev": true, "requires": { "path-exists": "^2.0.0", @@ -2040,14 +1843,12 @@ }, "regenerator-runtime": { "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "bundled": true, "dev": true }, "regex-not": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "bundled": true, "dev": true, "requires": { "extend-shallow": "^3.0.2", @@ -2056,20 +1857,17 @@ }, "repeat-element": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "bundled": true, "dev": true }, "repeat-string": { "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "bundled": true, "dev": true }, "repeating": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "bundled": true, "dev": true, "requires": { "is-finite": "^1.0.0" @@ -2077,38 +1875,32 @@ }, "require-directory": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "bundled": true, "dev": true }, "require-main-filename": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "bundled": true, "dev": true }, "resolve-from": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", - "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=", + "bundled": true, "dev": true }, "resolve-url": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "bundled": true, "dev": true }, "ret": { "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "bundled": true, "dev": true }, "right-align": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -2117,8 +1909,7 @@ }, "rimraf": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "bundled": true, "dev": true, "requires": { "glob": "^7.0.5" @@ -2126,8 +1917,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "bundled": true, "dev": true, "requires": { "ret": "~0.1.10" @@ -2135,20 +1925,17 @@ }, "semver": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "bundled": true, "dev": true }, "set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "bundled": true, "dev": true }, "set-value": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "bundled": true, "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -2159,8 +1946,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -2170,8 +1956,7 @@ }, "shebang-command": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "bundled": true, "dev": true, "requires": { "shebang-regex": "^1.0.0" @@ -2179,26 +1964,22 @@ }, "shebang-regex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "bundled": true, "dev": true }, "signal-exit": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "bundled": true, "dev": true }, "slide": { "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "bundled": true, "dev": true }, "snapdragon": { "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "bundled": true, "dev": true, "requires": { "base": "^0.11.1", @@ -2213,8 +1994,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -2222,8 +2002,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -2233,8 +2012,7 @@ }, "snapdragon-node": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "bundled": true, "dev": true, "requires": { "define-property": "^1.0.0", @@ -2244,8 +2022,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^1.0.0" @@ -2253,8 +2030,7 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -2262,8 +2038,7 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -2271,8 +2046,7 @@ }, "is-descriptor": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -2282,16 +2056,14 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "bundled": true, "dev": true } } }, "snapdragon-util": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "bundled": true, "dev": true, "requires": { "kind-of": "^3.2.0" @@ -2299,14 +2071,12 @@ }, "source-map": { "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "bundled": true, "dev": true }, "source-map-resolve": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", - "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", + "bundled": true, "dev": true, "requires": { "atob": "^2.0.0", @@ -2318,14 +2088,12 @@ }, "source-map-url": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "bundled": true, "dev": true }, "spawn-wrap": { "version": "1.4.2", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.2.tgz", - "integrity": "sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg==", + "bundled": true, "dev": true, "requires": { "foreground-child": "^1.5.6", @@ -2338,8 +2106,7 @@ }, "spdx-correct": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "bundled": true, "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -2348,14 +2115,12 @@ }, "spdx-exceptions": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "bundled": true, "dev": true }, "spdx-expression-parse": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "bundled": true, "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -2364,14 +2129,12 @@ }, "spdx-license-ids": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "bundled": true, "dev": true }, "split-string": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "bundled": true, "dev": true, "requires": { "extend-shallow": "^3.0.0" @@ -2379,8 +2142,7 @@ }, "static-extend": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "bundled": true, "dev": true, "requires": { "define-property": "^0.2.5", @@ -2389,8 +2151,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -2400,8 +2161,7 @@ }, "string-width": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "bundled": true, "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -2410,14 +2170,12 @@ "dependencies": { "ansi-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "bundled": true, "dev": true }, "strip-ansi": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "bundled": true, "dev": true, "requires": { "ansi-regex": "^3.0.0" @@ -2427,8 +2185,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "bundled": true, "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -2436,8 +2193,7 @@ }, "strip-bom": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "bundled": true, "dev": true, "requires": { "is-utf8": "^0.2.0" @@ -2445,20 +2201,17 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "bundled": true, "dev": true }, "supports-color": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "bundled": true, "dev": true }, "test-exclude": { "version": "4.2.1", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.2.1.tgz", - "integrity": "sha512-qpqlP/8Zl+sosLxBcVKl9vYy26T9NPalxSzzCP/OY6K7j938ui2oKgo+kRZYfxAeIpLqpbVnsHq1tyV70E4lWQ==", + "bundled": true, "dev": true, "requires": { "arrify": "^1.0.1", @@ -2470,14 +2223,12 @@ }, "to-fast-properties": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "bundled": true, "dev": true }, "to-object-path": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "bundled": true, "dev": true, "requires": { "kind-of": "^3.0.2" @@ -2485,8 +2236,7 @@ }, "to-regex": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "bundled": true, "dev": true, "requires": { "define-property": "^2.0.2", @@ -2497,8 +2247,7 @@ }, "to-regex-range": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "bundled": true, "dev": true, "requires": { "is-number": "^3.0.0", @@ -2507,14 +2256,12 @@ }, "trim-right": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "bundled": true, "dev": true }, "uglify-js": { "version": "2.8.29", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", - "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -2525,8 +2272,7 @@ "dependencies": { "yargs": { "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -2540,15 +2286,13 @@ }, "uglify-to-browserify": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "bundled": true, "dev": true, "optional": true }, "union-value": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "bundled": true, "dev": true, "requires": { "arr-union": "^3.1.0", @@ -2559,8 +2303,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -2568,8 +2311,7 @@ }, "set-value": { "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "bundled": true, "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -2582,8 +2324,7 @@ }, "unset-value": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "bundled": true, "dev": true, "requires": { "has-value": "^0.3.1", @@ -2592,8 +2333,7 @@ "dependencies": { "has-value": { "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "bundled": true, "dev": true, "requires": { "get-value": "^2.0.3", @@ -2603,8 +2343,7 @@ "dependencies": { "isobject": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "bundled": true, "dev": true, "requires": { "isarray": "1.0.0" @@ -2614,22 +2353,19 @@ }, "has-values": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "bundled": true, "dev": true } } }, "urix": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "bundled": true, "dev": true }, "use": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", - "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.2" @@ -2637,16 +2373,14 @@ "dependencies": { "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "bundled": true, "dev": true } } }, "validate-npm-package-license": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "bundled": true, "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -2655,8 +2389,7 @@ }, "which": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "bundled": true, "dev": true, "requires": { "isexe": "^2.0.0" @@ -2664,27 +2397,23 @@ }, "which-module": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "bundled": true, "dev": true }, "window-size": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "bundled": true, "dev": true, "optional": true }, "wordwrap": { "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "bundled": true, "dev": true }, "wrap-ansi": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "bundled": true, "dev": true, "requires": { "string-width": "^1.0.1", @@ -2693,8 +2422,7 @@ "dependencies": { "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "bundled": true, "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -2702,8 +2430,7 @@ }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "bundled": true, "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -2715,14 +2442,12 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "bundled": true, "dev": true }, "write-file-atomic": { "version": "1.3.4", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", - "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "bundled": true, "dev": true, "requires": { "graceful-fs": "^4.1.11", @@ -2732,20 +2457,17 @@ }, "y18n": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "bundled": true, "dev": true }, "yallist": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "bundled": true, "dev": true }, "yargs": { "version": "11.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", - "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", + "bundled": true, "dev": true, "requires": { "cliui": "^4.0.0", @@ -2764,20 +2486,17 @@ "dependencies": { "ansi-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "bundled": true, "dev": true }, "camelcase": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "bundled": true, "dev": true }, "cliui": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "bundled": true, "dev": true, "requires": { "string-width": "^2.1.1", @@ -2787,8 +2506,7 @@ }, "strip-ansi": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "bundled": true, "dev": true, "requires": { "ansi-regex": "^3.0.0" @@ -2796,8 +2514,7 @@ }, "yargs-parser": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", - "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "bundled": true, "dev": true, "requires": { "camelcase": "^4.1.0" @@ -2807,8 +2524,7 @@ }, "yargs-parser": { "version": "8.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz", - "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", + "bundled": true, "dev": true, "requires": { "camelcase": "^4.1.0" @@ -2816,8 +2532,7 @@ "dependencies": { "camelcase": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "bundled": true, "dev": true } } @@ -5455,28 +5170,24 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "bundled": true, "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "bundled": true, "dev": true }, "aproba": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "bundled": true, "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", - "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5486,14 +5197,12 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "bundled": true, "dev": true }, "brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "bundled": true, "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -5502,40 +5211,34 @@ }, "chownr": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", - "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", + "bundled": true, "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "bundled": true, "dev": true }, "concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "bundled": true, "dev": true }, "console-control-strings": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "bundled": true, "dev": true }, "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "bundled": true, "dev": true, "optional": true }, "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5544,29 +5247,25 @@ }, "deep-extend": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz", - "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", + "bundled": true, "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "bundled": true, "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "bundled": true, "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5575,15 +5274,13 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "bundled": true, "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5599,8 +5296,7 @@ }, "glob": { "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5614,15 +5310,13 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "bundled": true, "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.21", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.21.tgz", - "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5631,8 +5325,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5641,8 +5334,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5652,21 +5344,18 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "bundled": true, "dev": true }, "ini": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "bundled": true, "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "bundled": true, "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -5674,15 +5363,13 @@ }, "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "bundled": true, "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "bundled": true, "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -5690,14 +5377,12 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "bundled": true, "dev": true }, "minipass": { "version": "2.2.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz", - "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", + "bundled": true, "dev": true, "requires": { "safe-buffer": "^5.1.1", @@ -5706,8 +5391,7 @@ }, "minizlib": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.1.0.tgz", - "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5716,8 +5400,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "bundled": true, "dev": true, "requires": { "minimist": "0.0.8" @@ -5725,15 +5408,13 @@ }, "ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "bundled": true, "dev": true, "optional": true }, "needle": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.0.tgz", - "integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5744,8 +5425,7 @@ }, "node-pre-gyp": { "version": "0.10.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz", - "integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5763,8 +5443,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5774,15 +5453,13 @@ }, "npm-bundled": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.3.tgz", - "integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==", + "bundled": true, "dev": true, "optional": true }, "npm-packlist": { "version": "1.1.10", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.10.tgz", - "integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5792,8 +5469,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5805,21 +5481,18 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "bundled": true, "dev": true }, "object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "bundled": true, "dev": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "bundled": true, "dev": true, "requires": { "wrappy": "1" @@ -5827,22 +5500,19 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "bundled": true, "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "bundled": true, "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5852,22 +5522,19 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "bundled": true, "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "bundled": true, "dev": true, "optional": true }, "rc": { "version": "1.2.7", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.7.tgz", - "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5879,8 +5546,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "bundled": true, "dev": true, "optional": true } @@ -5888,8 +5554,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5904,8 +5569,7 @@ }, "rimraf": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5914,49 +5578,42 @@ }, "safe-buffer": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "bundled": true, "dev": true }, "safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "bundled": true, "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "bundled": true, "dev": true, "optional": true }, "semver": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "bundled": true, "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "bundled": true, "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "bundled": true, "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "bundled": true, "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -5966,8 +5623,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -5976,8 +5632,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "bundled": true, "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -5985,15 +5640,13 @@ }, "strip-json-comments": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "bundled": true, "dev": true, "optional": true }, "tar": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.1.tgz", - "integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -6008,15 +5661,13 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "bundled": true, "dev": true, "optional": true }, "wide-align": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", - "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -6025,14 +5676,12 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "bundled": true, "dev": true }, "yallist": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", - "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", + "bundled": true, "dev": true } } @@ -8016,8 +7665,7 @@ "dependencies": { "align-text": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "bundled": true, "dev": true, "requires": { "kind-of": "^3.0.2", @@ -8027,20 +7675,17 @@ }, "amdefine": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "bundled": true, "dev": true }, "ansi-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "bundled": true, "dev": true }, "append-transform": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", - "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=", + "bundled": true, "dev": true, "requires": { "default-require-extensions": "^1.0.0" @@ -8048,68 +7693,57 @@ }, "archy": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "bundled": true, "dev": true }, "arr-diff": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "bundled": true, "dev": true }, "arr-flatten": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", + "bundled": true, "dev": true }, "arr-union": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "bundled": true, "dev": true }, "array-unique": { "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "bundled": true, "dev": true }, "arrify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "bundled": true, "dev": true }, "assign-symbols": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "bundled": true, "dev": true }, "async": { "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "bundled": true, "dev": true }, "atob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", - "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", + "bundled": true, "dev": true }, "balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "bundled": true, "dev": true }, "base": { "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", + "bundled": true, "dev": true, "requires": { "cache-base": "^1.0.1", @@ -8123,8 +7757,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^1.0.0" @@ -8132,8 +7765,7 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -8141,8 +7773,7 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -8150,8 +7781,7 @@ }, "is-descriptor": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", + "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -8161,16 +7791,14 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", + "bundled": true, "dev": true } } }, "brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", + "bundled": true, "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -8179,8 +7807,7 @@ }, "braces": { "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha1-WXn9PxTNUxVl5fot8av/8d+u5yk=", + "bundled": true, "dev": true, "requires": { "arr-flatten": "^1.1.0", @@ -8197,8 +7824,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -8208,14 +7834,12 @@ }, "builtin-modules": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "bundled": true, "dev": true }, "cache-base": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", + "bundled": true, "dev": true, "requires": { "collection-visit": "^1.0.0", @@ -8231,8 +7855,7 @@ }, "caching-transform": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", - "integrity": "sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE=", + "bundled": true, "dev": true, "requires": { "md5-hex": "^1.2.0", @@ -8242,15 +7865,13 @@ }, "camelcase": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "bundled": true, "dev": true, "optional": true }, "center-align": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -8260,8 +7881,7 @@ }, "class-utils": { "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", + "bundled": true, "dev": true, "requires": { "arr-union": "^3.1.0", @@ -8272,8 +7892,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -8283,8 +7902,7 @@ }, "cliui": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -8295,8 +7913,7 @@ "dependencies": { "wordwrap": { "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "bundled": true, "dev": true, "optional": true } @@ -8304,14 +7921,12 @@ }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "bundled": true, "dev": true }, "collection-visit": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "bundled": true, "dev": true, "requires": { "map-visit": "^1.0.0", @@ -8320,38 +7935,32 @@ }, "commondir": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "bundled": true, "dev": true }, "component-emitter": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "bundled": true, "dev": true }, "concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "bundled": true, "dev": true }, "convert-source-map": { "version": "1.5.1", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", - "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "bundled": true, "dev": true }, "copy-descriptor": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "bundled": true, "dev": true }, "cross-spawn": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", - "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "bundled": true, "dev": true, "requires": { "lru-cache": "^4.0.1", @@ -8360,8 +7969,7 @@ }, "debug": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "bundled": true, "dev": true, "requires": { "ms": "2.0.0" @@ -8369,26 +7977,22 @@ }, "debug-log": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", - "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=", + "bundled": true, "dev": true }, "decamelize": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "bundled": true, "dev": true }, "decode-uri-component": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "bundled": true, "dev": true }, "default-require-extensions": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", - "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", + "bundled": true, "dev": true, "requires": { "strip-bom": "^2.0.0" @@ -8396,8 +8000,7 @@ }, "define-property": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha1-1Flono1lS6d+AqgX+HENcCyxbp0=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^1.0.2", @@ -8406,8 +8009,7 @@ "dependencies": { "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -8415,8 +8017,7 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -8424,8 +8025,7 @@ }, "is-descriptor": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", + "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -8435,16 +8035,14 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", + "bundled": true, "dev": true } } }, "error-ex": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "bundled": true, "dev": true, "requires": { "is-arrayish": "^0.2.1" @@ -8452,8 +8050,7 @@ }, "execa": { "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "bundled": true, "dev": true, "requires": { "cross-spawn": "^5.0.1", @@ -8467,8 +8064,7 @@ "dependencies": { "cross-spawn": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "bundled": true, "dev": true, "requires": { "lru-cache": "^4.0.1", @@ -8480,8 +8076,7 @@ }, "expand-brackets": { "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "bundled": true, "dev": true, "requires": { "debug": "^2.3.3", @@ -8495,8 +8090,7 @@ "dependencies": { "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "bundled": true, "dev": true, "requires": { "ms": "2.0.0" @@ -8504,8 +8098,7 @@ }, "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -8513,8 +8106,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -8524,8 +8116,7 @@ }, "extend-shallow": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "bundled": true, "dev": true, "requires": { "assign-symbols": "^1.0.0", @@ -8534,8 +8125,7 @@ "dependencies": { "is-extendable": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", + "bundled": true, "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -8545,8 +8135,7 @@ }, "extglob": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha1-rQD+TcYSqSMuhxhxHcXLWrAoVUM=", + "bundled": true, "dev": true, "requires": { "array-unique": "^0.3.2", @@ -8561,8 +8150,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^1.0.0" @@ -8570,8 +8158,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -8579,8 +8166,7 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -8588,8 +8174,7 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -8597,8 +8182,7 @@ }, "is-descriptor": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", + "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -8608,16 +8192,14 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", + "bundled": true, "dev": true } } }, "fill-range": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "bundled": true, "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -8628,8 +8210,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -8639,8 +8220,7 @@ }, "find-cache-dir": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", - "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", + "bundled": true, "dev": true, "requires": { "commondir": "^1.0.1", @@ -8650,8 +8230,7 @@ }, "find-up": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "bundled": true, "dev": true, "requires": { "locate-path": "^2.0.0" @@ -8659,14 +8238,12 @@ }, "for-in": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "bundled": true, "dev": true }, "foreground-child": { "version": "1.5.6", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", - "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", + "bundled": true, "dev": true, "requires": { "cross-spawn": "^4", @@ -8675,8 +8252,7 @@ }, "fragment-cache": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "bundled": true, "dev": true, "requires": { "map-cache": "^0.2.2" @@ -8684,32 +8260,27 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "bundled": true, "dev": true }, "get-caller-file": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "bundled": true, "dev": true }, "get-stream": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "bundled": true, "dev": true }, "get-value": { "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "bundled": true, "dev": true }, "glob": { "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", + "bundled": true, "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -8722,14 +8293,12 @@ }, "graceful-fs": { "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "bundled": true, "dev": true }, "handlebars": { "version": "4.0.11", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", - "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "bundled": true, "dev": true, "requires": { "async": "^1.4.0", @@ -8740,8 +8309,7 @@ "dependencies": { "source-map": { "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "bundled": true, "dev": true, "requires": { "amdefine": ">=0.0.4" @@ -8751,8 +8319,7 @@ }, "has-value": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "bundled": true, "dev": true, "requires": { "get-value": "^2.0.6", @@ -8762,8 +8329,7 @@ }, "has-values": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "bundled": true, "dev": true, "requires": { "is-number": "^3.0.0", @@ -8772,8 +8338,7 @@ "dependencies": { "kind-of": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "bundled": true, "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -8783,20 +8348,17 @@ }, "hosted-git-info": { "version": "2.6.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha1-IyNbKasjDFdqqw1PE/wEawsDgiI=", + "bundled": true, "dev": true }, "imurmurhash": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "bundled": true, "dev": true }, "inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "bundled": true, "dev": true, "requires": { "once": "^1.3.0", @@ -8805,20 +8367,17 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "bundled": true, "dev": true }, "invert-kv": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "bundled": true, "dev": true }, "is-accessor-descriptor": { "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "bundled": true, "dev": true, "requires": { "kind-of": "^3.0.2" @@ -8826,20 +8385,17 @@ }, "is-arrayish": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "bundled": true, "dev": true }, "is-buffer": { "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", + "bundled": true, "dev": true }, "is-builtin-module": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "bundled": true, "dev": true, "requires": { "builtin-modules": "^1.0.0" @@ -8847,8 +8403,7 @@ }, "is-data-descriptor": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "bundled": true, "dev": true, "requires": { "kind-of": "^3.0.2" @@ -8856,8 +8411,7 @@ }, "is-descriptor": { "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "^0.1.6", @@ -8867,28 +8421,24 @@ "dependencies": { "kind-of": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", + "bundled": true, "dev": true } } }, "is-extendable": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "bundled": true, "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "bundled": true, "dev": true }, "is-number": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "bundled": true, "dev": true, "requires": { "kind-of": "^3.0.2" @@ -8896,8 +8446,7 @@ }, "is-odd": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", - "integrity": "sha1-dkZiRnH9fqVYzNmieVGC8pWPGyQ=", + "bundled": true, "dev": true, "requires": { "is-number": "^4.0.0" @@ -8905,16 +8454,14 @@ "dependencies": { "is-number": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha1-ACbjf1RU1z41bf5lZGmYZ8an8P8=", + "bundled": true, "dev": true } } }, "is-plain-object": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", + "bundled": true, "dev": true, "requires": { "isobject": "^3.0.1" @@ -8922,50 +8469,42 @@ }, "is-stream": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "bundled": true, "dev": true }, "is-utf8": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "bundled": true, "dev": true }, "is-windows": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha1-0YUOuXkezRjmGCzhKjDzlmNLsZ0=", + "bundled": true, "dev": true }, "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "bundled": true, "dev": true }, "isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "bundled": true, "dev": true }, "isobject": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "bundled": true, "dev": true }, "istanbul-lib-coverage": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz", - "integrity": "sha1-99jy5CuX43/nlhFMsPnWi146Q0E=", + "bundled": true, "dev": true }, "istanbul-lib-hook": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.1.0.tgz", - "integrity": "sha1-hTjZcDcss3FtU+VVI91UtVeo2Js=", + "bundled": true, "dev": true, "requires": { "append-transform": "^0.4.0" @@ -8973,8 +8512,7 @@ }, "istanbul-lib-report": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.3.tgz", - "integrity": "sha1-LfEhiMD6d5kMDSF20tC6M5QYglk=", + "bundled": true, "dev": true, "requires": { "istanbul-lib-coverage": "^1.1.2", @@ -8985,14 +8523,12 @@ "dependencies": { "has-flag": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "bundled": true, "dev": true }, "supports-color": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "bundled": true, "dev": true, "requires": { "has-flag": "^1.0.0" @@ -9002,8 +8538,7 @@ }, "istanbul-lib-source-maps": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz", - "integrity": "sha1-/+a+Tnq4bTYD5CkNVJkLFFBvybE=", + "bundled": true, "dev": true, "requires": { "debug": "^3.1.0", @@ -9015,8 +8550,7 @@ }, "istanbul-reports": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.4.1.tgz", - "integrity": "sha1-Ty6OkoqnoF0dpsQn1AmLJlXsczQ=", + "bundled": true, "dev": true, "requires": { "handlebars": "^4.0.3" @@ -9024,8 +8558,7 @@ }, "kind-of": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "bundled": true, "dev": true, "requires": { "is-buffer": "^1.1.5" @@ -9033,15 +8566,13 @@ }, "lazy-cache": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "bundled": true, "dev": true, "optional": true }, "lcid": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "bundled": true, "dev": true, "requires": { "invert-kv": "^1.0.0" @@ -9049,8 +8580,7 @@ }, "load-json-file": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "bundled": true, "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -9062,8 +8592,7 @@ }, "locate-path": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "bundled": true, "dev": true, "requires": { "p-locate": "^2.0.0", @@ -9072,22 +8601,19 @@ "dependencies": { "path-exists": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "bundled": true, "dev": true } } }, "longest": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "bundled": true, "dev": true }, "lru-cache": { "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha1-oRdc80lt/IQ2wVbDNLSVWZK85pw=", + "bundled": true, "dev": true, "requires": { "pseudomap": "^1.0.2", @@ -9096,14 +8622,12 @@ }, "map-cache": { "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "bundled": true, "dev": true }, "map-visit": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "bundled": true, "dev": true, "requires": { "object-visit": "^1.0.0" @@ -9111,8 +8635,7 @@ }, "md5-hex": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", - "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", + "bundled": true, "dev": true, "requires": { "md5-o-matic": "^0.1.1" @@ -9120,14 +8643,12 @@ }, "md5-o-matic": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", - "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", + "bundled": true, "dev": true }, "mem": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "bundled": true, "dev": true, "requires": { "mimic-fn": "^1.0.0" @@ -9135,8 +8656,7 @@ }, "merge-source-map": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha1-L93n5gIJOfcJBqaPLXrmheTIxkY=", + "bundled": true, "dev": true, "requires": { "source-map": "^0.6.1" @@ -9144,16 +8664,14 @@ "dependencies": { "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "bundled": true, "dev": true } } }, "micromatch": { "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha1-cIWbyVyYQJUvNZoGij/En57PrCM=", + "bundled": true, "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -9173,22 +8691,19 @@ "dependencies": { "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", + "bundled": true, "dev": true } } }, "mimic-fn": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha1-ggyGo5M0ZA6ZUWkovQP8qIBX0CI=", + "bundled": true, "dev": true }, "minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "bundled": true, "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -9196,14 +8711,12 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "bundled": true, "dev": true }, "mixin-deep": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha1-pJ5yaNzhoNlpjkUybFYm3zVD0P4=", + "bundled": true, "dev": true, "requires": { "for-in": "^1.0.2", @@ -9212,8 +8725,7 @@ "dependencies": { "is-extendable": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", + "bundled": true, "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -9223,8 +8735,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "bundled": true, "dev": true, "requires": { "minimist": "0.0.8" @@ -9232,14 +8743,12 @@ }, "ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "bundled": true, "dev": true }, "nanomatch": { "version": "1.2.9", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", - "integrity": "sha1-h59xUMstq3pHElkGbBBO7m4Pp8I=", + "bundled": true, "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -9258,16 +8767,14 @@ "dependencies": { "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", + "bundled": true, "dev": true } } }, "normalize-package-data": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", + "bundled": true, "dev": true, "requires": { "hosted-git-info": "^2.1.4", @@ -9278,8 +8785,7 @@ }, "npm-run-path": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "bundled": true, "dev": true, "requires": { "path-key": "^2.0.0" @@ -9287,20 +8793,17 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "bundled": true, "dev": true }, "object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "bundled": true, "dev": true }, "object-copy": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "bundled": true, "dev": true, "requires": { "copy-descriptor": "^0.1.0", @@ -9310,8 +8813,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -9321,8 +8823,7 @@ }, "object-visit": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "bundled": true, "dev": true, "requires": { "isobject": "^3.0.0" @@ -9330,8 +8831,7 @@ }, "object.pick": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "bundled": true, "dev": true, "requires": { "isobject": "^3.0.1" @@ -9339,8 +8839,7 @@ }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "bundled": true, "dev": true, "requires": { "wrappy": "1" @@ -9348,8 +8847,7 @@ }, "optimist": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "bundled": true, "dev": true, "requires": { "minimist": "~0.0.1", @@ -9358,14 +8856,12 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "bundled": true, "dev": true }, "os-locale": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha1-QrwpAKa1uL0XN2yOiCtlr8zyS/I=", + "bundled": true, "dev": true, "requires": { "execa": "^0.7.0", @@ -9375,14 +8871,12 @@ }, "p-finally": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "bundled": true, "dev": true }, "p-limit": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", - "integrity": "sha1-DpK2vty1nwIsE9DxlJ3ILRWQnxw=", + "bundled": true, "dev": true, "requires": { "p-try": "^1.0.0" @@ -9390,8 +8884,7 @@ }, "p-locate": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "bundled": true, "dev": true, "requires": { "p-limit": "^1.1.0" @@ -9399,14 +8892,12 @@ }, "p-try": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "bundled": true, "dev": true }, "parse-json": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "bundled": true, "dev": true, "requires": { "error-ex": "^1.2.0" @@ -9414,14 +8905,12 @@ }, "pascalcase": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "bundled": true, "dev": true }, "path-exists": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "bundled": true, "dev": true, "requires": { "pinkie-promise": "^2.0.0" @@ -9429,26 +8918,22 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "bundled": true, "dev": true }, "path-key": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "bundled": true, "dev": true }, "path-parse": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "bundled": true, "dev": true }, "path-type": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "bundled": true, "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -9458,20 +8943,17 @@ }, "pify": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "bundled": true, "dev": true }, "pinkie": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "bundled": true, "dev": true }, "pinkie-promise": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "bundled": true, "dev": true, "requires": { "pinkie": "^2.0.0" @@ -9479,8 +8961,7 @@ }, "pkg-dir": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", - "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "bundled": true, "dev": true, "requires": { "find-up": "^1.0.0" @@ -9488,8 +8969,7 @@ "dependencies": { "find-up": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "bundled": true, "dev": true, "requires": { "path-exists": "^2.0.0", @@ -9500,20 +8980,17 @@ }, "posix-character-classes": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "bundled": true, "dev": true }, "pseudomap": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "bundled": true, "dev": true }, "read-pkg": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "bundled": true, "dev": true, "requires": { "load-json-file": "^1.0.0", @@ -9523,8 +9000,7 @@ }, "read-pkg-up": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "bundled": true, "dev": true, "requires": { "find-up": "^1.0.0", @@ -9533,8 +9009,7 @@ "dependencies": { "find-up": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "bundled": true, "dev": true, "requires": { "path-exists": "^2.0.0", @@ -9545,8 +9020,7 @@ }, "regex-not": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha1-H07OJ+ALC2XgJHpoEOaoXYOldSw=", + "bundled": true, "dev": true, "requires": { "extend-shallow": "^3.0.2", @@ -9555,50 +9029,42 @@ }, "repeat-element": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "bundled": true, "dev": true }, "repeat-string": { "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "bundled": true, "dev": true }, "require-directory": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "bundled": true, "dev": true }, "require-main-filename": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "bundled": true, "dev": true }, "resolve-from": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", - "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=", + "bundled": true, "dev": true }, "resolve-url": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "bundled": true, "dev": true }, "ret": { "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha1-uKSCXVvbH8P29Twrwz+BOIaBx7w=", + "bundled": true, "dev": true }, "right-align": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9607,8 +9073,7 @@ }, "rimraf": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=", + "bundled": true, "dev": true, "requires": { "glob": "^7.0.5" @@ -9616,8 +9081,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "bundled": true, "dev": true, "requires": { "ret": "~0.1.10" @@ -9625,20 +9089,17 @@ }, "semver": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha1-3Eu8emyp2Rbe5dQ1FvAJK1j3uKs=", + "bundled": true, "dev": true }, "set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "bundled": true, "dev": true }, "set-value": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha1-ca5KiPD+77v1LR6mBPP7MV67YnQ=", + "bundled": true, "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -9649,8 +9110,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -9660,8 +9120,7 @@ }, "shebang-command": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "bundled": true, "dev": true, "requires": { "shebang-regex": "^1.0.0" @@ -9669,26 +9128,22 @@ }, "shebang-regex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "bundled": true, "dev": true }, "signal-exit": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "bundled": true, "dev": true }, "slide": { "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "bundled": true, "dev": true }, "snapdragon": { "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha1-ZJIufFZbDhQgS6GqfWlkJ40lGC0=", + "bundled": true, "dev": true, "requires": { "base": "^0.11.1", @@ -9703,8 +9158,7 @@ "dependencies": { "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "bundled": true, "dev": true, "requires": { "ms": "2.0.0" @@ -9712,8 +9166,7 @@ }, "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -9721,8 +9174,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -9732,8 +9184,7 @@ }, "snapdragon-node": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", + "bundled": true, "dev": true, "requires": { "define-property": "^1.0.0", @@ -9743,8 +9194,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^1.0.0" @@ -9752,8 +9202,7 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -9761,8 +9210,7 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.0" @@ -9770,8 +9218,7 @@ }, "is-descriptor": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", + "bundled": true, "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -9781,16 +9228,14 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", + "bundled": true, "dev": true } } }, "snapdragon-util": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", + "bundled": true, "dev": true, "requires": { "kind-of": "^3.2.0" @@ -9798,14 +9243,12 @@ }, "source-map": { "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "bundled": true, "dev": true }, "source-map-resolve": { "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha1-cuLMNAlVQ+Q7LGKyxMENSpBU8lk=", + "bundled": true, "dev": true, "requires": { "atob": "^2.1.1", @@ -9817,14 +9260,12 @@ }, "source-map-url": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "bundled": true, "dev": true }, "spawn-wrap": { "version": "1.4.2", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.2.tgz", - "integrity": "sha1-z/WOc6giRhe2Vhq9wyWG6gyCJIw=", + "bundled": true, "dev": true, "requires": { "foreground-child": "^1.5.6", @@ -9837,8 +9278,7 @@ }, "spdx-correct": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha1-BaW01xU6GVvJLDxCW2nzsqlSTII=", + "bundled": true, "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -9847,14 +9287,12 @@ }, "spdx-exceptions": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha1-LHrmEFbHFKW5ubKyr30xHvXHj+k=", + "bundled": true, "dev": true }, "spdx-expression-parse": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha1-meEZt6XaAOBUkcn6M4t5BII7QdA=", + "bundled": true, "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -9863,14 +9301,12 @@ }, "spdx-license-ids": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha1-enzShHDMbToc/m1miG9rxDDTrIc=", + "bundled": true, "dev": true }, "split-string": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", + "bundled": true, "dev": true, "requires": { "extend-shallow": "^3.0.0" @@ -9878,8 +9314,7 @@ }, "static-extend": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "bundled": true, "dev": true, "requires": { "define-property": "^0.2.5", @@ -9888,8 +9323,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "bundled": true, "dev": true, "requires": { "is-descriptor": "^0.1.0" @@ -9899,8 +9333,7 @@ }, "string-width": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", + "bundled": true, "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -9909,8 +9342,7 @@ }, "strip-ansi": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "bundled": true, "dev": true, "requires": { "ansi-regex": "^3.0.0" @@ -9918,8 +9350,7 @@ }, "strip-bom": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "bundled": true, "dev": true, "requires": { "is-utf8": "^0.2.0" @@ -9927,14 +9358,12 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "bundled": true, "dev": true }, "test-exclude": { "version": "4.2.1", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.2.1.tgz", - "integrity": "sha1-36Ii8DSAvKaSB8pyizfXS0X3JPo=", + "bundled": true, "dev": true, "requires": { "arrify": "^1.0.1", @@ -9946,8 +9375,7 @@ }, "to-object-path": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "bundled": true, "dev": true, "requires": { "kind-of": "^3.0.2" @@ -9955,8 +9383,7 @@ }, "to-regex": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha1-E8/dmzNlUvMLUfM6iuG0Knp1mc4=", + "bundled": true, "dev": true, "requires": { "define-property": "^2.0.2", @@ -9967,8 +9394,7 @@ }, "to-regex-range": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "bundled": true, "dev": true, "requires": { "is-number": "^3.0.0", @@ -9977,8 +9403,7 @@ }, "uglify-js": { "version": "2.8.29", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", - "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9989,8 +9414,7 @@ "dependencies": { "yargs": { "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -10004,15 +9428,13 @@ }, "uglify-to-browserify": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "bundled": true, "dev": true, "optional": true }, "union-value": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "bundled": true, "dev": true, "requires": { "arr-union": "^3.1.0", @@ -10023,8 +9445,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "bundled": true, "dev": true, "requires": { "is-extendable": "^0.1.0" @@ -10032,8 +9453,7 @@ }, "set-value": { "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "bundled": true, "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -10046,8 +9466,7 @@ }, "unset-value": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "bundled": true, "dev": true, "requires": { "has-value": "^0.3.1", @@ -10056,8 +9475,7 @@ "dependencies": { "has-value": { "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "bundled": true, "dev": true, "requires": { "get-value": "^2.0.3", @@ -10067,8 +9485,7 @@ "dependencies": { "isobject": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "bundled": true, "dev": true, "requires": { "isarray": "1.0.0" @@ -10078,22 +9495,19 @@ }, "has-values": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "bundled": true, "dev": true } } }, "urix": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "bundled": true, "dev": true }, "use": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", - "integrity": "sha1-FHFr8D/f79AwQK71jYtLhfOnxUQ=", + "bundled": true, "dev": true, "requires": { "kind-of": "^6.0.2" @@ -10101,16 +9515,14 @@ "dependencies": { "kind-of": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", + "bundled": true, "dev": true } } }, "validate-npm-package-license": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha1-gWQ7y+8b3+zUYjeT3EZIlIupgzg=", + "bundled": true, "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -10119,8 +9531,7 @@ }, "which": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha1-pFBD1U9YBTFtqNYvn1CRjT2nCwo=", + "bundled": true, "dev": true, "requires": { "isexe": "^2.0.0" @@ -10128,27 +9539,23 @@ }, "which-module": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "bundled": true, "dev": true }, "window-size": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "bundled": true, "dev": true, "optional": true }, "wordwrap": { "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "bundled": true, "dev": true }, "wrap-ansi": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "bundled": true, "dev": true, "requires": { "string-width": "^1.0.1", @@ -10157,14 +9564,12 @@ "dependencies": { "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "bundled": true, "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "bundled": true, "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -10172,8 +9577,7 @@ }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "bundled": true, "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -10183,8 +9587,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "bundled": true, "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -10194,14 +9597,12 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "bundled": true, "dev": true }, "write-file-atomic": { "version": "1.3.4", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", - "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "bundled": true, "dev": true, "requires": { "graceful-fs": "^4.1.11", @@ -10211,20 +9612,17 @@ }, "y18n": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "bundled": true, "dev": true }, "yallist": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "bundled": true, "dev": true }, "yargs": { "version": "11.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", - "integrity": "sha1-kLhpk07W6HERXqL/WLA/RyTtLXc=", + "bundled": true, "dev": true, "requires": { "cliui": "^4.0.0", @@ -10243,14 +9641,12 @@ "dependencies": { "camelcase": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "bundled": true, "dev": true }, "cliui": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha1-NIQi2+gtgAswIu709qwQvy5NG0k=", + "bundled": true, "dev": true, "requires": { "string-width": "^2.1.1", @@ -10260,8 +9656,7 @@ }, "yargs-parser": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", - "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "bundled": true, "dev": true, "requires": { "camelcase": "^4.1.0" @@ -10271,8 +9666,7 @@ }, "yargs-parser": { "version": "8.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz", - "integrity": "sha1-8TdqM7Ziml0GN4KUTacyYx6WaVA=", + "bundled": true, "dev": true, "requires": { "camelcase": "^4.1.0" @@ -10280,8 +9674,7 @@ "dependencies": { "camelcase": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "bundled": true, "dev": true } } From 89865cc02094847a754c76b61061711f0d78956d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 30 Jul 2018 20:17:18 -0700 Subject: [PATCH 124/513] chore(deps): update dependency typescript to v3 (#82) --- .../google-cloud-translate/package-lock.json | 46 +++++++++++++------ packages/google-cloud-translate/package.json | 2 +- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 2118115f878..25510fbd583 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -296,6 +296,7 @@ "version": "0.1.4", "bundled": true, "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -1424,7 +1425,8 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "loose-envify": { "version": "1.3.1", @@ -2722,6 +2724,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -5198,12 +5201,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5218,17 +5223,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -5345,7 +5353,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -5357,6 +5366,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5371,6 +5381,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5378,12 +5389,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -5402,6 +5415,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -5482,7 +5496,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -5494,6 +5509,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -5615,6 +5631,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -7126,7 +7143,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true + "dev": true, + "optional": true }, "loose-envify": { "version": "1.4.0", @@ -7667,6 +7685,7 @@ "version": "0.1.4", "bundled": true, "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -8609,7 +8628,8 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "lru-cache": { "version": "4.1.3", @@ -11404,9 +11424,9 @@ "dev": true }, "typescript": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", - "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.1.tgz", + "integrity": "sha512-zQIMOmC+372pC/CCVLqnQ0zSBiY7HHodU7mpQdjiZddek4GMj31I3dUJ7gAs9o65X7mnRma6OokOkc6f9jjfBg==", "dev": true }, "uglify-js": { diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 83fd91019cd..af8b2d08ffb 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -92,6 +92,6 @@ "prettier": "^1.13.5", "proxyquire": "^2.0.1", "source-map-support": "^0.5.6", - "typescript": "~2.9.1" + "typescript": "~3.0.0" } } From 5b052e7894fae73d71d2423c908cb40ea2f32aec Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 30 Jul 2018 21:29:34 -0700 Subject: [PATCH 125/513] chore(deps): lock file maintenance (#84) --- .../google-cloud-translate/package-lock.json | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 25510fbd583..fbac5e453cd 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -296,7 +296,6 @@ "version": "0.1.4", "bundled": true, "dev": true, - "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -1425,8 +1424,7 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "loose-envify": { "version": "1.3.1", @@ -2724,7 +2722,6 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, - "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -5201,14 +5198,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5223,20 +5218,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -5353,8 +5345,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -5366,7 +5357,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5381,7 +5371,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5389,14 +5378,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -5415,7 +5402,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -5496,8 +5482,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -5509,7 +5494,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -5631,7 +5615,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -7143,8 +7126,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true, - "optional": true + "dev": true }, "loose-envify": { "version": "1.4.0", @@ -7685,7 +7667,6 @@ "version": "0.1.4", "bundled": true, "dev": true, - "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -8628,8 +8609,7 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "lru-cache": { "version": "4.1.3", From 02edd642b38c439be11e3a3baaf573876f4ada3c Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 2 Aug 2018 05:12:02 -0700 Subject: [PATCH 126/513] remove that whitespace (#85) --- packages/google-cloud-translate/test/mocha.opts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/test/mocha.opts b/packages/google-cloud-translate/test/mocha.opts index bcb4e04e492..8c60795e047 100644 --- a/packages/google-cloud-translate/test/mocha.opts +++ b/packages/google-cloud-translate/test/mocha.opts @@ -2,4 +2,4 @@ --require source-map-support/register --require intelli-espower-loader --timeout 10000 - +--throw-deprecation From 8f37f8740028f3996535e420f20f2361f6287a4f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 5 Aug 2018 08:07:43 -0700 Subject: [PATCH 127/513] chore: remove propprop, clean up (#87) --- packages/google-cloud-translate/package.json | 6 +- packages/google-cloud-translate/src/index.ts | 18 ++--- .../system-test/translate.ts | 69 +++++++++---------- packages/google-cloud-translate/tsconfig.json | 3 +- 4 files changed, 47 insertions(+), 49 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index af8b2d08ffb..b90d3939a29 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -59,15 +59,15 @@ "compile": "tsc -p .", "fix": "gts fix", "prepare": "npm run compile", - "pretest": "npm run compile" + "pretest": "npm run compile", + "presystem-test": "npm run compile" }, "dependencies": { "@google-cloud/common": "^0.20.3", "arrify": "^1.0.1", "extend": "^3.0.1", "is": "^3.2.1", - "is-html": "^1.1.0", - "propprop": "^0.3.1" + "is-html": "^1.1.0" }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^2.3.0", diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index bb49ded72de..4902d6d9498 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -21,7 +21,6 @@ import * as common from '@google-cloud/common'; import * as extend from 'extend'; import * as is from 'is'; import * as isHtml from 'is-html'; -import * as prop from 'propprop'; import {DecorateRequestOptions, BodyResponseCallback} from '@google-cloud/common/build/src/util'; import * as r from 'request'; @@ -84,8 +83,9 @@ const PKG = require('../../package.json'); */ export class Translate extends common.Service { options; - key; + key?: string; constructor(options?) { + options = options || {}; let baseUrl = 'https://translation.googleapis.com/language/translate/v2'; if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { @@ -181,8 +181,8 @@ export class Translate extends common.Service { * // If the callback is omitted, we'll return a Promise. * //- * translate.detect('Hello').then((data) => { - * var results = data[0]; - * var apiResponse = data[2]; + * const results = data[0]; + * const apiResponse = data[2]; * }); * * @example include:samples/translate.js @@ -354,7 +354,7 @@ export class Translate extends common.Service { * // The source language is auto-detected by default. To manually set it, * // provide an object. * //- - * var options = { + * const options = { * from: 'en', * to: 'es' * }; @@ -369,7 +369,7 @@ export class Translate extends common.Service { * // Translate multiple strings of input. Note that the results are * // now provided as an array. * //- - * var input = [ + * const input = [ * 'Hello', * 'How are you today?' * ]; @@ -387,8 +387,8 @@ export class Translate extends common.Service { * // If the callback is omitted, we'll return a Promise. * //- * translate.translate('Hello', 'es').then((data) => { - * var translation = data[0]; - * var apiResponse = data[1]; + * const translation = data[0]; + * const apiResponse = data[1]; * }); * * @example include:samples/translate.js @@ -441,7 +441,7 @@ export class Translate extends common.Service { return; } - let translations = resp.data.translations.map(prop('translatedText')); + let translations = resp.data.translations.map(x => x.translatedText); if (body.q.length === 1 && !inputIsArray) { translations = translations[0]; diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 5fd8938bada..a3261fd6124 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -17,16 +17,15 @@ 'use strict'; import * as assert from 'assert'; -import * as prop from 'propprop'; import {Translate} from '../src'; -var API_KEY = process.env.TRANSLATE_API_KEY; +const API_KEY = process.env.TRANSLATE_API_KEY; -describe('translate', function() { - var translate = new Translate(); +describe('translate', () => { + let translate = new Translate(); - describe('detecting language from input', function() { - var INPUT = [ + describe('detecting language from input', () => { + const INPUT = [ { input: 'Hello!', expectedLanguage: 'en', @@ -37,10 +36,10 @@ describe('translate', function() { }, ]; - it('should detect a langauge', function(done) { - var input = INPUT.map(prop('input')); + it('should detect a langauge', (done) => { + const input = INPUT.map(x => x.input); - translate.detect(input, function(err, results) { + translate.detect(input, (err, results) => { assert.ifError(err); assert.strictEqual(results[0].language, INPUT[0].expectedLanguage); assert.strictEqual(results[1].language, INPUT[1].expectedLanguage); @@ -49,8 +48,8 @@ describe('translate', function() { }); }); - describe('translations', function() { - var INPUT = [ + describe('translations', () => { + const INPUT = [ { input: 'Hello!', expectedTranslation: 'Hola', @@ -68,10 +67,10 @@ describe('translate', function() { return input.replace(/^\W|\W*$/g, ''); } - it('should translate input', function(done) { - var input = INPUT.map(prop('input')); + it('should translate input', (done) => { + const input = INPUT.map(x => x.input); - translate.translate(input, 'es', function(err, results) { + translate.translate(input, 'es', (err, results) => { assert.ifError(err); results = results.map(removeSymbols); assert.strictEqual(results[0], INPUT[0].expectedTranslation); @@ -80,15 +79,15 @@ describe('translate', function() { }); }); - it('should translate input with from and to options', function(done) { - var input = INPUT.map(prop('input')); + it('should translate input with from and to options', (done) => { + const input = INPUT.map(x => x.input); - var opts = { + const opts = { from: 'en', to: 'es', }; - translate.translate(input, opts, function(err, results) { + translate.translate(input, opts, (err, results) => { assert.ifError(err); results = results.map(removeSymbols); assert.strictEqual(results[0], INPUT[0].expectedTranslation); @@ -97,35 +96,33 @@ describe('translate', function() { }); }); - it('should autodetect HTML', function(done) { - var input = '' + INPUT[0].input + ''; + it('should autodetect HTML', (done) => { + const input = '' + INPUT[0].input + ''; - var opts = { + const opts = { from: 'en', to: 'es', }; - translate.translate(input, opts, function(err, results) { + translate.translate(input, opts, (err, results) => { assert.ifError(err); - var translation = results.split(/<\/*body>/g)[1].trim(); + const translation = results.split(/<\/*body>/g)[1].trim(); assert.strictEqual( - removeSymbols(translation), - INPUT[0].expectedTranslation - ); + removeSymbols(translation), INPUT[0].expectedTranslation); done(); }); }); }); - describe('supported languages', function() { - it('should get a list of supported languages', function(done) { - translate.getLanguages(function(err, languages) { + describe('supported languages', () => { + it('should get a list of supported languages', (done) => { + translate.getLanguages((err, languages) => { assert.ifError(err); - var englishResult = languages.filter(function(language) { + const englishResult = languages.filter((language) => { return language.code === 'en'; })[0]; @@ -138,11 +135,11 @@ describe('translate', function() { }); }); - it('should accept a target language', function(done) { - translate.getLanguages('es', function(err, languages) { + it('should accept a target language', (done) => { + translate.getLanguages('es', (err, languages) => { assert.ifError(err); - var englishResult = languages.filter(function(language) { + const englishResult = languages.filter((language) => { return language.code === 'en'; })[0]; @@ -156,12 +153,12 @@ describe('translate', function() { }); }); - (API_KEY ? describe : describe.skip)('authentication', function() { - beforeEach(function() { + (API_KEY ? describe : describe.skip)('authentication', () => { + beforeEach(() => { translate = new Translate({key: API_KEY}); }); - it('should use an API key to authenticate', function(done) { + it('should use an API key to authenticate', (done) => { translate.getLanguages(done); }); }); diff --git a/packages/google-cloud-translate/tsconfig.json b/packages/google-cloud-translate/tsconfig.json index 75ad3f24557..1942ae08fa2 100644 --- a/packages/google-cloud-translate/tsconfig.json +++ b/packages/google-cloud-translate/tsconfig.json @@ -8,6 +8,7 @@ }, "include": [ "src/*.ts", - "test/*.ts" + "test/*.ts", + "system-test/*.ts" ] } From c47fb33b77a7508769025a8e25f60d04bb1d30db Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 6 Aug 2018 19:07:47 -0700 Subject: [PATCH 128/513] chore(deps): lock file maintenance (#88) --- .../google-cloud-translate/package-lock.json | 90 +++++++++---------- 1 file changed, 40 insertions(+), 50 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index fbac5e453cd..88b77dc8ad9 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -2659,9 +2659,9 @@ "dev": true }, "@types/node": { - "version": "10.5.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.4.tgz", - "integrity": "sha512-8TqvB0ReZWwtcd3LXq3YSrBoLyXFgBX/sBZfGye9+YS8zH7/g+i6QRIuiDmwBoTzcQ/pk89nZYTYU4c5akKkzw==" + "version": "10.5.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.7.tgz", + "integrity": "sha512-VkKcfuitP+Nc/TaTFH0B8qNmn+6NbI6crLkQonbedViVz7O2w8QV/GERPlkJ4bg42VGHiEWa31CoTOPs1q6z1w==" }, "@types/request": { "version": "2.47.1", @@ -2861,9 +2861,12 @@ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" }, "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } }, "assert-plus": { "version": "1.0.0", @@ -3003,9 +3006,9 @@ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", - "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" }, "axios": { "version": "0.18.0", @@ -3576,9 +3579,9 @@ "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, "buffer-from": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", - "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, "builtin-modules": { @@ -3930,9 +3933,9 @@ } }, "commander": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.16.0.tgz", - "integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==", + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.0.tgz", + "integrity": "sha512-477o1hdVORiFlZxw8wgsXYCef3lh0zl/OV0FTftqiDxJSWw6dPQ2ipS4k20J2qBcsmsmLKSyr2iFrf9e3JGi4w==", "dev": true }, "common-path-prefix": { @@ -4588,9 +4591,9 @@ } }, "eslint": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.2.0.tgz", - "integrity": "sha512-zlggW1qp7/TBjwLfouRoY7eWXrXwJZFqCdIxxh0/LVB/QuuKuIMkzyUZEcDo6LBadsry5JcEMxIqd3H/66CXVg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.3.0.tgz", + "integrity": "sha512-N/tCqlMKkyNvAvLu+zI9AqDasnSLt00K+Hu8kdsERliC9jYEc8ck12XtjvOXrBKu8fK6RrBcN9bat6Xk++9jAg==", "dev": true, "requires": { "ajv": "^6.5.0", @@ -4624,7 +4627,7 @@ "path-is-inside": "^1.0.2", "pluralize": "^7.0.0", "progress": "^2.0.0", - "regexpp": "^1.1.0", + "regexpp": "^2.0.0", "require-uncached": "^1.0.3", "semver": "^5.5.0", "string.prototype.matchall": "^2.0.0", @@ -4704,14 +4707,6 @@ "requires": { "eslint-utils": "^1.3.0", "regexpp": "^2.0.0" - }, - "dependencies": { - "regexpp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.0.tgz", - "integrity": "sha512-g2FAVtR8Uh8GO1Nv5wpxW7VFVwHcCEr4wyA8/MHiRkO8uHoR5ntAA8Uq3P1vvMTX/BeQiRVSpDGLd+Wn5HNOTA==", - "dev": true - } } }, "eslint-plugin-node": { @@ -5081,9 +5076,9 @@ "dev": true }, "follow-redirects": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.1.tgz", - "integrity": "sha512-v9GI1hpaqq1ZZR6pBD1+kI7O24PhDvNGNodjS3MdcEqyrahCp8zbtpv+2B/krUnSmUH80lbAS7MrdeK5IylgKg==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.2.tgz", + "integrity": "sha512-kssLorP/9acIdpQ2udQVTiCS5LQmdEz9mvdIfDcl1gYX2tPKFADHSyFdvJS040XdFsPzemWtgI3q8mFVCxtX8A==", "requires": { "debug": "^3.1.0" } @@ -6288,9 +6283,9 @@ } }, "ignore": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.2.tgz", - "integrity": "sha512-uoxnT7PYpyEnsja+yX+7v49B7LXxmzDJ2JALqHH3oEGzpM2U1IGcbfnOr8Dt57z3B/UWs7/iAgPFbmye8m4I0g==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.3.tgz", + "integrity": "sha512-Z/vAH2GGIEATQnBVXMclE2IGV6i0GyVngKThcGZ5kHgHMxLo9Ow2+XHRq1aEKEej5vOF1TPJNbvX6J/anT0M7A==", "dev": true }, "ignore-by-default": { @@ -9963,9 +9958,9 @@ "dev": true }, "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "path-to-regexp": { @@ -10282,11 +10277,6 @@ "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", "dev": true }, - "propprop": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/propprop/-/propprop-0.3.1.tgz", - "integrity": "sha1-oEmjVouJZEAGfRXY7J8zc15XAXg=" - }, "proxyquire": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-2.0.1.tgz", @@ -10485,9 +10475,9 @@ } }, "regexpp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", - "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.0.tgz", + "integrity": "sha512-g2FAVtR8Uh8GO1Nv5wpxW7VFVwHcCEr4wyA8/MHiRkO8uHoR5ntAA8Uq3P1vvMTX/BeQiRVSpDGLd+Wn5HNOTA==", "dev": true }, "regexpu-core": { @@ -10766,9 +10756,9 @@ "dev": true }, "sanitize-html": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.18.2.tgz", - "integrity": "sha512-52ThA+Z7h6BnvpSVbURwChl10XZrps5q7ytjTwWcIe9bmJwnVP6cpEVK2NvDOUhGupoqAvNbUz3cpnJDp4+/pg==", + "version": "1.18.4", + "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.18.4.tgz", + "integrity": "sha512-hjyDYCYrQuhnEjq+5lenLlIfdPBtnZ7z0DkQOC8YGxvkuOInH+1SrkNTj30t4f2/SSv9c5kLniB+uCIpBvYuew==", "dev": true, "requires": { "chalk": "^2.3.0", @@ -11589,9 +11579,9 @@ "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, "validate-npm-package-license": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { "spdx-correct": "^3.0.0", From 06ca4f8297bbc52ea22c83f93f1be1b15832a2cb Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 7 Aug 2018 09:12:40 -0700 Subject: [PATCH 129/513] chore: use promisify and upgrade common (#90) --- .../google-cloud-translate/package-lock.json | 26 +++++++------------ packages/google-cloud-translate/package.json | 3 ++- packages/google-cloud-translate/src/index.ts | 11 ++++---- packages/google-cloud-translate/test/index.ts | 16 +++++++----- 4 files changed, 27 insertions(+), 29 deletions(-) diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json index 88b77dc8ad9..189a9e9aa3f 100644 --- a/packages/google-cloud-translate/package-lock.json +++ b/packages/google-cloud-translate/package-lock.json @@ -214,10 +214,11 @@ } }, "@google-cloud/common": { - "version": "0.20.3", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.20.3.tgz", - "integrity": "sha512-jt8/R4EqDTQccv5WA9AEaS65llM5+mlxsuWu57G5Os8HTIpgPbcsOVMUeIvmTrBuPUYSoRIMW8d/pvv/95n0+g==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.21.0.tgz", + "integrity": "sha512-oJxKimj3Rf9U4R/LOPAirBPnbHUBykY6NUpf2vPKNAW9yLrNgYwOk5ZZiiXWQ6Zy2WodGEDo2b75JZLk8kyheg==", "requires": { + "@google-cloud/promisify": "^0.3.0", "@types/duplexify": "^3.5.0", "@types/request": "^2.47.0", "arrify": "^1.0.1", @@ -230,7 +231,6 @@ "pify": "^3.0.0", "request": "^2.87.0", "retry-request": "^4.0.0", - "split-array-stream": "^2.0.0", "stream-events": "^1.0.4", "through2": "^2.0.3" } @@ -2552,6 +2552,11 @@ } } }, + "@google-cloud/promisify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.3.0.tgz", + "integrity": "sha512-5xfpwK9iIAwZrKtG+SnEKZkgnce9Hsew1dkeYNyP/slAxTIdS9wjSUJ5Waq/dfsYphkHSGyH6F9lwqJlD5Zsyw==" + }, "@ladjs/time-require": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/@ladjs/time-require/-/time-require-0.1.4.tgz", @@ -6682,11 +6687,6 @@ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, - "is-stream-ended": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", - "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" - }, "is-symbol": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", @@ -10928,14 +10928,6 @@ "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", "dev": true }, - "split-array-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/split-array-stream/-/split-array-stream-2.0.0.tgz", - "integrity": "sha512-hmMswlVY91WvGMxs0k8MRgq8zb2mSen4FmDNc5AFiTWtrBpdZN6nwD6kROVe4vNL+ywrvbCKsWVCnEd4riELIg==", - "requires": { - "is-stream-ended": "^0.1.4" - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index b90d3939a29..925d0d95f7b 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -63,7 +63,8 @@ "presystem-test": "npm run compile" }, "dependencies": { - "@google-cloud/common": "^0.20.3", + "@google-cloud/common": "^0.21.0", + "@google-cloud/promisify": "^0.3.0", "arrify": "^1.0.1", "extend": "^3.0.1", "is": "^3.2.1", diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 4902d6d9498..79c1230cd7a 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -17,7 +17,8 @@ 'use strict'; import * as arrify from 'arrify'; -import * as common from '@google-cloud/common'; +import {Service, util} from '@google-cloud/common'; +import {promisifyAll} from '@google-cloud/promisify'; import * as extend from 'extend'; import * as is from 'is'; import * as isHtml from 'is-html'; @@ -81,7 +82,7 @@ const PKG = require('../../package.json'); * region_tag:translate_quickstart * Full quickstart example: */ -export class Translate extends common.Service { +export class Translate extends Service { options; key?: string; constructor(options?) { @@ -478,11 +479,11 @@ export class Translate extends common.Service { key: this.key, }, headers: { - 'User-Agent': common.util.getUserAgentFromPackageJson(PKG), + 'User-Agent': util.getUserAgentFromPackageJson(PKG), }, }); - common.util.makeRequest(reqOpts, this.options, callback!); + util.makeRequest(reqOpts, this.options, callback!); } } @@ -491,7 +492,7 @@ export class Translate extends common.Service { * All async methods (except for streams) will return a Promise in the event * that a callback is omitted. */ -common.util.promisifyAll(Translate, {exclude: ['request']}); +promisifyAll(Translate, {exclude: ['request']}); /** * The `@google-cloud/translate` package has a single default export, the diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index bfecaa3deb4..caae77725a0 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -20,24 +20,27 @@ import * as assert from 'assert'; import * as extend from 'extend'; import * as proxyquire from 'proxyquire'; import {util} from '@google-cloud/common'; +import * as pfy from '@google-cloud/promisify'; const pkgJson = require('../../package.json'); let makeRequestOverride; let promisified = false; +const fakePromisify = extend({}, pfy, { + promisifyAll(c) { + if (c.name === 'Translate') { + promisified = true; + } + }, +}); + const fakeUtil = extend({}, util, { makeRequest() { if (makeRequestOverride) { return makeRequestOverride.apply(null, arguments); } - return util.makeRequest.apply(null, arguments); }, - promisifyAll(c) { - if (c.name === 'Translate') { - promisified = true; - } - }, }); const originalFakeUtil = extend(true, {}, fakeUtil); @@ -60,6 +63,7 @@ describe('Translate', () => { util: fakeUtil, Service: FakeService, }, + '@google-cloud/promisify': fakePromisify }).Translate; }); From 7a1c077a45ebaaba2502b058b0428e8e279cd2c0 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 7 Aug 2018 14:19:09 -0700 Subject: [PATCH 130/513] chore: ignore package-lock.json (#91) --- .../.circleci/config.yml | 17 +- .../.circleci/get_workflow_name.py | 67 - packages/google-cloud-translate/.gitignore | 1 + .../google-cloud-translate/package-lock.json | 11828 ---------------- 4 files changed, 2 insertions(+), 11911 deletions(-) delete mode 100644 packages/google-cloud-translate/.circleci/get_workflow_name.py delete mode 100644 packages/google-cloud-translate/package-lock.json diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index a48eadc54b9..6d9812795c9 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -58,18 +58,7 @@ jobs: docker: - image: 'node:6' steps: &unit_tests_steps - - checkout - - run: &remove_package_lock - name: Remove package-lock.json if needed. - command: | - WORKFLOW_NAME=`python .circleci/get_workflow_name.py` - echo "Workflow name: $WORKFLOW_NAME" - if [ "$WORKFLOW_NAME" = "nightly" ]; then - echo "Nightly build detected, removing package-lock.json." - rm -f package-lock.json samples/package-lock.json - else - echo "Not a nightly build, skipping this step." - fi + - checkout - run: &npm_install_and_link name: Install and link the module command: |- @@ -93,7 +82,6 @@ jobs: - image: 'node:8' steps: - checkout - - run: *remove_package_lock - run: *npm_install_and_link - run: &samples_npm_install_and_link name: Link the module being tested to the samples. @@ -107,7 +95,6 @@ jobs: - image: 'node:8' steps: - checkout - - run: *remove_package_lock - run: *npm_install_and_link - run: name: Build documentation. @@ -117,7 +104,6 @@ jobs: - image: 'node:8' steps: - checkout - - run: *remove_package_lock - run: name: Decrypt credentials. command: | @@ -142,7 +128,6 @@ jobs: - image: 'node:8' steps: - checkout - - run: *remove_package_lock - run: name: Decrypt credentials. command: | diff --git a/packages/google-cloud-translate/.circleci/get_workflow_name.py b/packages/google-cloud-translate/.circleci/get_workflow_name.py deleted file mode 100644 index ff6b58fd24f..00000000000 --- a/packages/google-cloud-translate/.circleci/get_workflow_name.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2018 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. - -""" -Get workflow name for the current build using CircleCI API. -Would be great if this information is available in one of -CircleCI environment variables, but it's not there. -https://circleci.ideas.aha.io/ideas/CCI-I-295 -""" - -import json -import os -import sys -import urllib2 - - -def main(): - try: - username = os.environ['CIRCLE_PROJECT_USERNAME'] - reponame = os.environ['CIRCLE_PROJECT_REPONAME'] - build_num = os.environ['CIRCLE_BUILD_NUM'] - except: - sys.stderr.write( - 'Looks like we are not inside CircleCI container. Exiting...\n') - return 1 - - try: - request = urllib2.Request( - "https://circleci.com/api/v1.1/project/github/%s/%s/%s" % - (username, reponame, build_num), - headers={"Accept": "application/json"}) - contents = urllib2.urlopen(request).read() - except: - sys.stderr.write('Cannot query CircleCI API. Exiting...\n') - return 1 - - try: - build_info = json.loads(contents) - except: - sys.stderr.write( - 'Cannot parse JSON received from CircleCI API. Exiting...\n') - return 1 - - try: - workflow_name = build_info['workflows']['workflow_name'] - except: - sys.stderr.write( - 'Cannot get workflow name from CircleCI build info. Exiting...\n') - return 1 - - print workflow_name - return 0 - - -retval = main() -exit(retval) diff --git a/packages/google-cloud-translate/.gitignore b/packages/google-cloud-translate/.gitignore index 193fd9da619..d0ac5fa36cb 100644 --- a/packages/google-cloud-translate/.gitignore +++ b/packages/google-cloud-translate/.gitignore @@ -8,3 +8,4 @@ system-test/secrets.js system-test/*key.json *.lock build +package-lock.json diff --git a/packages/google-cloud-translate/package-lock.json b/packages/google-cloud-translate/package-lock.json deleted file mode 100644 index 189a9e9aa3f..00000000000 --- a/packages/google-cloud-translate/package-lock.json +++ /dev/null @@ -1,11828 +0,0 @@ -{ - "name": "@google-cloud/translate", - "version": "1.1.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@ava/babel-plugin-throws-helper": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@ava/babel-plugin-throws-helper/-/babel-plugin-throws-helper-2.0.0.tgz", - "integrity": "sha1-L8H+PCEacQcaTsp7j3r1hCzRrnw=", - "dev": true - }, - "@ava/babel-preset-stage-4": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@ava/babel-preset-stage-4/-/babel-preset-stage-4-1.1.0.tgz", - "integrity": "sha512-oWqTnIGXW3k72UFidXzW0ONlO7hnO9x02S/QReJ7NBGeiBH9cUHY9+EfV6C8PXC6YJH++WrliEq03wMSJGNZFg==", - "dev": true, - "requires": { - "babel-plugin-check-es2015-constants": "^6.8.0", - "babel-plugin-syntax-trailing-function-commas": "^6.20.0", - "babel-plugin-transform-async-to-generator": "^6.16.0", - "babel-plugin-transform-es2015-destructuring": "^6.19.0", - "babel-plugin-transform-es2015-function-name": "^6.9.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.18.0", - "babel-plugin-transform-es2015-parameters": "^6.21.0", - "babel-plugin-transform-es2015-spread": "^6.8.0", - "babel-plugin-transform-es2015-sticky-regex": "^6.8.0", - "babel-plugin-transform-es2015-unicode-regex": "^6.11.0", - "babel-plugin-transform-exponentiation-operator": "^6.8.0", - "package-hash": "^1.2.0" - }, - "dependencies": { - "md5-hex": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", - "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", - "dev": true, - "requires": { - "md5-o-matic": "^0.1.1" - } - }, - "package-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-1.2.0.tgz", - "integrity": "sha1-AD5WzVe3NqbtYRTMK4FUJnJ3DkQ=", - "dev": true, - "requires": { - "md5-hex": "^1.3.0" - } - } - } - }, - "@ava/babel-preset-transform-test-files": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@ava/babel-preset-transform-test-files/-/babel-preset-transform-test-files-3.0.0.tgz", - "integrity": "sha1-ze0RlqjY2TgaUJJAq5LpGl7Aafc=", - "dev": true, - "requires": { - "@ava/babel-plugin-throws-helper": "^2.0.0", - "babel-plugin-espower": "^2.3.2" - } - }, - "@ava/write-file-atomic": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ava/write-file-atomic/-/write-file-atomic-2.2.0.tgz", - "integrity": "sha512-BTNB3nGbEfJT+69wuqXFr/bQH7Vr7ihx2xGOMNqPgDGhwspoZhiWumDDZNjBy7AScmqS5CELIOGtPVXESyrnDA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "slide": "^1.1.5" - } - }, - "@babel/code-frame": { - "version": "7.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz", - "integrity": "sha1-vXHZsZKvl435FYKdOdQJRFZDmgw=", - "dev": true, - "requires": { - "@babel/highlight": "7.0.0-beta.51" - } - }, - "@babel/generator": { - "version": "7.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.51.tgz", - "integrity": "sha1-bHV1/952HQdIXgS67cA5LG2eMPY=", - "dev": true, - "requires": { - "@babel/types": "7.0.0-beta.51", - "jsesc": "^2.5.1", - "lodash": "^4.17.5", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - }, - "dependencies": { - "jsesc": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", - "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", - "dev": true - } - } - }, - "@babel/helper-function-name": { - "version": "7.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.51.tgz", - "integrity": "sha1-IbSHSiJ8+Z7K/MMKkDAtpaJkBWE=", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "7.0.0-beta.51", - "@babel/template": "7.0.0-beta.51", - "@babel/types": "7.0.0-beta.51" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.51.tgz", - "integrity": "sha1-MoGy0EWvlcFyzpGyCCXYXqRnZBE=", - "dev": true, - "requires": { - "@babel/types": "7.0.0-beta.51" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.51.tgz", - "integrity": "sha1-imw/ZsTSZTUvwHdIT59ugKUauXg=", - "dev": true, - "requires": { - "@babel/types": "7.0.0-beta.51" - } - }, - "@babel/highlight": { - "version": "7.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.51.tgz", - "integrity": "sha1-6IRK4loVlcz9QriWI7Q3bKBtIl0=", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^3.0.0" - } - }, - "@babel/parser": { - "version": "7.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.0.0-beta.51.tgz", - "integrity": "sha1-J87C30Cd9gr1gnDtj2qlVAnqhvY=", - "dev": true - }, - "@babel/template": { - "version": "7.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.51.tgz", - "integrity": "sha1-lgKkCuvPNXrpZ34lMu9fyBD1+/8=", - "dev": true, - "requires": { - "@babel/code-frame": "7.0.0-beta.51", - "@babel/parser": "7.0.0-beta.51", - "@babel/types": "7.0.0-beta.51", - "lodash": "^4.17.5" - } - }, - "@babel/traverse": { - "version": "7.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.51.tgz", - "integrity": "sha1-mB2vLOw0emIx06odnhgDsDqqpKg=", - "dev": true, - "requires": { - "@babel/code-frame": "7.0.0-beta.51", - "@babel/generator": "7.0.0-beta.51", - "@babel/helper-function-name": "7.0.0-beta.51", - "@babel/helper-split-export-declaration": "7.0.0-beta.51", - "@babel/parser": "7.0.0-beta.51", - "@babel/types": "7.0.0-beta.51", - "debug": "^3.1.0", - "globals": "^11.1.0", - "invariant": "^2.2.0", - "lodash": "^4.17.5" - }, - "dependencies": { - "globals": { - "version": "11.7.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", - "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", - "dev": true - } - } - }, - "@babel/types": { - "version": "7.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.51.tgz", - "integrity": "sha1-2AK3tUO1g2x3iqaReXq/APPZfqk=", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.5", - "to-fast-properties": "^2.0.0" - }, - "dependencies": { - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - } - } - }, - "@concordance/react": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@concordance/react/-/react-1.0.0.tgz", - "integrity": "sha512-htrsRaQX8Iixlsek8zQU7tE8wcsTQJ5UhZkSPEA8slCDAisKpC/2VgU/ucPn32M5/LjGGXRaUEKvEw1Wiuu4zQ==", - "dev": true, - "requires": { - "arrify": "^1.0.1" - } - }, - "@google-cloud/common": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.21.0.tgz", - "integrity": "sha512-oJxKimj3Rf9U4R/LOPAirBPnbHUBykY6NUpf2vPKNAW9yLrNgYwOk5ZZiiXWQ6Zy2WodGEDo2b75JZLk8kyheg==", - "requires": { - "@google-cloud/promisify": "^0.3.0", - "@types/duplexify": "^3.5.0", - "@types/request": "^2.47.0", - "arrify": "^1.0.1", - "axios": "^0.18.0", - "duplexify": "^3.6.0", - "ent": "^2.2.0", - "extend": "^3.0.1", - "google-auth-library": "^1.6.0", - "is": "^3.2.1", - "pify": "^3.0.0", - "request": "^2.87.0", - "retry-request": "^4.0.0", - "stream-events": "^1.0.4", - "through2": "^2.0.3" - } - }, - "@google-cloud/nodejs-repo-tools": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.3.3.tgz", - "integrity": "sha512-aow6Os43uhdgshSe/fr43ESHNl/kHhikim9AOqIMUzEb6mip6H4d8GFKgpO/yoqUUTIhCN3sbpkKktMI5mOQHw==", - "dev": true, - "requires": { - "ava": "0.25.0", - "colors": "1.1.2", - "fs-extra": "5.0.0", - "got": "8.3.0", - "handlebars": "4.0.11", - "lodash": "4.17.5", - "nyc": "11.7.2", - "proxyquire": "1.8.0", - "semver": "^5.5.0", - "sinon": "6.0.1", - "string": "3.3.3", - "supertest": "3.1.0", - "yargs": "11.0.0", - "yargs-parser": "10.1.0" - }, - "dependencies": { - "nyc": { - "version": "11.7.2", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.7.2.tgz", - "integrity": "sha512-gBt7qwsR1vryYfglVjQRx1D+AtMZW5NbUKxb+lZe8SN8KsheGCPGWEsSC9AGQG+r2+te1+10uPHUCahuqm1nGQ==", - "dev": true, - "requires": { - "archy": "^1.0.0", - "arrify": "^1.0.1", - "caching-transform": "^1.0.0", - "convert-source-map": "^1.5.1", - "debug-log": "^1.0.1", - "default-require-extensions": "^1.0.0", - "find-cache-dir": "^0.1.1", - "find-up": "^2.1.0", - "foreground-child": "^1.5.3", - "glob": "^7.0.6", - "istanbul-lib-coverage": "^1.1.2", - "istanbul-lib-hook": "^1.1.0", - "istanbul-lib-instrument": "^1.10.0", - "istanbul-lib-report": "^1.1.3", - "istanbul-lib-source-maps": "^1.2.3", - "istanbul-reports": "^1.4.0", - "md5-hex": "^1.2.0", - "merge-source-map": "^1.1.0", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.0", - "resolve-from": "^2.0.0", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.1", - "spawn-wrap": "^1.4.2", - "test-exclude": "^4.2.0", - "yargs": "11.1.0", - "yargs-parser": "^8.0.0" - }, - "dependencies": { - "align-text": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2", - "longest": "^1.0.1", - "repeat-string": "^1.5.2" - } - }, - "amdefine": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "bundled": true, - "dev": true - }, - "append-transform": { - "version": "0.4.0", - "bundled": true, - "dev": true, - "requires": { - "default-require-extensions": "^1.0.0" - } - }, - "archy": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "arr-diff": { - "version": "4.0.0", - "bundled": true, - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "bundled": true, - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "bundled": true, - "dev": true - }, - "arrify": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "async": { - "version": "1.5.2", - "bundled": true, - "dev": true - }, - "atob": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "babel-code-frame": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - } - }, - "babel-generator": { - "version": "6.26.1", - "bundled": true, - "dev": true, - "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" - } - }, - "babel-messages": { - "version": "6.23.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-runtime": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "babel-template": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - } - }, - "babel-types": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - } - }, - "babylon": { - "version": "6.18.0", - "bundled": true, - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "base": { - "version": "0.11.2", - "bundled": true, - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "builtin-modules": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "cache-base": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "caching-transform": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "md5-hex": "^1.2.0", - "mkdirp": "^0.5.1", - "write-file-atomic": "^1.1.4" - } - }, - "camelcase": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true - }, - "center-align": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" - } - }, - "chalk": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "class-utils": { - "version": "0.3.6", - "bundled": true, - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "cliui": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "commondir": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "component-emitter": { - "version": "1.2.1", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "convert-source-map": { - "version": "1.5.1", - "bundled": true, - "dev": true - }, - "copy-descriptor": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "core-js": { - "version": "2.5.6", - "bundled": true, - "dev": true - }, - "cross-spawn": { - "version": "4.0.2", - "bundled": true, - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" - } - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "debug-log": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "decamelize": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "bundled": true, - "dev": true - }, - "default-require-extensions": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "strip-bom": "^2.0.0" - } - }, - "define-property": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "detect-indent": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "error-ex": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "esutils": { - "version": "2.0.2", - "bundled": true, - "dev": true - }, - "execa": { - "version": "0.7.0", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "bundled": true, - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "bundled": true, - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "extend-shallow": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "fill-range": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "find-cache-dir": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "requires": { - "commondir": "^1.0.1", - "mkdirp": "^0.5.1", - "pkg-dir": "^1.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "for-in": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "foreground-child": { - "version": "1.5.6", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" - } - }, - "fragment-cache": { - "version": "0.2.1", - "bundled": true, - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "get-caller-file": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "get-value": { - "version": "2.0.6", - "bundled": true, - "dev": true - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "globals": { - "version": "9.18.0", - "bundled": true, - "dev": true - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "handlebars": { - "version": "4.0.11", - "bundled": true, - "dev": true, - "requires": { - "async": "^1.4.0", - "optimist": "^0.6.1", - "source-map": "^0.4.4", - "uglify-js": "^2.6" - }, - "dependencies": { - "source-map": { - "version": "0.4.4", - "bundled": true, - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "has-ansi": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "has-flag": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "has-value": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hosted-git-info": { - "version": "2.6.0", - "bundled": true, - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "bundled": true, - "dev": true - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "invariant": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, - "invert-kv": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-arrayish": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "is-buffer": { - "version": "1.1.6", - "bundled": true, - "dev": true - }, - "is-builtin-module": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "bundled": true, - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "is-finite": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "is-number": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-odd": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "bundled": true, - "dev": true - } - } - }, - "is-plain-object": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-stream": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "is-utf8": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "isexe": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, - "istanbul-lib-coverage": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "istanbul-lib-hook": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "append-transform": "^0.4.0" - } - }, - "istanbul-lib-instrument": { - "version": "1.10.1", - "bundled": true, - "dev": true, - "requires": { - "babel-generator": "^6.18.0", - "babel-template": "^6.16.0", - "babel-traverse": "^6.18.0", - "babel-types": "^6.18.0", - "babylon": "^6.18.0", - "istanbul-lib-coverage": "^1.2.0", - "semver": "^5.3.0" - } - }, - "istanbul-lib-report": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "requires": { - "istanbul-lib-coverage": "^1.1.2", - "mkdirp": "^0.5.1", - "path-parse": "^1.0.5", - "supports-color": "^3.1.2" - }, - "dependencies": { - "supports-color": { - "version": "3.2.3", - "bundled": true, - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "1.2.3", - "bundled": true, - "dev": true, - "requires": { - "debug": "^3.1.0", - "istanbul-lib-coverage": "^1.1.2", - "mkdirp": "^0.5.1", - "rimraf": "^2.6.1", - "source-map": "^0.5.3" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "istanbul-reports": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "handlebars": "^4.0.3" - } - }, - "js-tokens": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "jsesc": { - "version": "1.3.0", - "bundled": true, - "dev": true - }, - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "lazy-cache": { - "version": "1.0.4", - "bundled": true, - "dev": true, - "optional": true - }, - "lcid": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "dependencies": { - "path-exists": { - "version": "3.0.0", - "bundled": true, - "dev": true - } - } - }, - "lodash": { - "version": "4.17.10", - "bundled": true, - "dev": true - }, - "longest": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "loose-envify": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "js-tokens": "^3.0.0" - } - }, - "lru-cache": { - "version": "4.1.3", - "bundled": true, - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "map-cache": { - "version": "0.2.2", - "bundled": true, - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "md5-hex": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "md5-o-matic": "^0.1.1" - } - }, - "md5-o-matic": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "mem": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "merge-source-map": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } - } - }, - "micromatch": { - "version": "3.1.10", - "bundled": true, - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "mimic-fn": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "mixin-deep": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "nanomatch": { - "version": "1.2.9", - "bundled": true, - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-odd": "^2.0.0", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "normalize-package-data": { - "version": "2.4.0", - "bundled": true, - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "object-visit": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.pick": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optimist": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "os-locale": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - } - }, - "p-finally": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "p-limit": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "parse-json": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "pascalcase": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "path-exists": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "path-key": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "path-parse": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "path-type": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "bundled": true, - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "bundled": true, - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "pkg-dir": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "find-up": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - } - } - }, - "posix-character-classes": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "read-pkg": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - } - } - }, - "regenerator-runtime": { - "version": "0.11.1", - "bundled": true, - "dev": true - }, - "regex-not": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "repeat-element": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "bundled": true, - "dev": true - }, - "repeating": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "require-directory": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "resolve-from": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "ret": { - "version": "0.1.15", - "bundled": true, - "dev": true - }, - "right-align": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-regex": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "set-value": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "shebang-command": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "slide": { - "version": "1.1.6", - "bundled": true, - "dev": true - }, - "snapdragon": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.2.0" - } - }, - "source-map": { - "version": "0.5.7", - "bundled": true, - "dev": true - }, - "source-map-resolve": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "atob": "^2.0.0", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "bundled": true, - "dev": true - }, - "spawn-wrap": { - "version": "1.4.2", - "bundled": true, - "dev": true, - "requires": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.2", - "which": "^1.3.0" - } - }, - "spdx-correct": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.1.0", - "bundled": true, - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "split-string": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "static-extend": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "string-width": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-eof": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "supports-color": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "test-exclude": { - "version": "4.2.1", - "bundled": true, - "dev": true, - "requires": { - "arrify": "^1.0.1", - "micromatch": "^3.1.8", - "object-assign": "^4.1.0", - "read-pkg-up": "^1.0.1", - "require-main-filename": "^1.0.1" - } - }, - "to-fast-properties": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "to-regex": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "trim-right": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "uglify-js": { - "version": "2.8.29", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" - }, - "dependencies": { - "yargs": { - "version": "3.10.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - } - } - } - }, - "uglify-to-browserify": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "union-value": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "unset-value": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "bundled": true, - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "bundled": true, - "dev": true - } - } - }, - "urix": { - "version": "0.1.0", - "bundled": true, - "dev": true - }, - "use": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "validate-npm-package-license": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "which": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "window-size": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "wordwrap": { - "version": "0.0.3", - "bundled": true, - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "write-file-atomic": { - "version": "1.3.4", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "slide": "^1.1.5" - } - }, - "y18n": { - "version": "3.2.1", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "2.1.2", - "bundled": true, - "dev": true - }, - "yargs": { - "version": "11.1.0", - "bundled": true, - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "camelcase": { - "version": "4.1.0", - "bundled": true, - "dev": true - }, - "cliui": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "yargs-parser": { - "version": "9.0.2", - "bundled": true, - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } - } - } - }, - "yargs-parser": { - "version": "8.1.0", - "bundled": true, - "dev": true, - "requires": { - "camelcase": "^4.1.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "bundled": true, - "dev": true - } - } - } - } - }, - "proxyquire": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-1.8.0.tgz", - "integrity": "sha1-AtUUpb7ZhvBMuyCTrxZ0FTX3ntw=", - "dev": true, - "requires": { - "fill-keys": "^1.0.2", - "module-not-found-error": "^1.0.0", - "resolve": "~1.1.7" - } - } - } - }, - "@google-cloud/promisify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.3.0.tgz", - "integrity": "sha512-5xfpwK9iIAwZrKtG+SnEKZkgnce9Hsew1dkeYNyP/slAxTIdS9wjSUJ5Waq/dfsYphkHSGyH6F9lwqJlD5Zsyw==" - }, - "@ladjs/time-require": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@ladjs/time-require/-/time-require-0.1.4.tgz", - "integrity": "sha512-weIbJqTMfQ4r1YX85u54DKfjLZs2jwn1XZ6tIOP/pFgMwhIN5BAtaCp/1wn9DzyLsDR9tW0R2NIePcVJ45ivQQ==", - "dev": true, - "requires": { - "chalk": "^0.4.0", - "date-time": "^0.1.1", - "pretty-ms": "^0.2.1", - "text-table": "^0.2.0" - }, - "dependencies": { - "ansi-styles": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", - "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", - "dev": true - }, - "chalk": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", - "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", - "dev": true, - "requires": { - "ansi-styles": "~1.0.0", - "has-color": "~0.1.0", - "strip-ansi": "~0.1.0" - } - }, - "pretty-ms": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-0.2.2.tgz", - "integrity": "sha1-2oeaaC/zOjcBEEbxPWJ/Z8c7hPY=", - "dev": true, - "requires": { - "parse-ms": "^0.1.0" - } - }, - "strip-ansi": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", - "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", - "dev": true - } - } - }, - "@sindresorhus/is": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", - "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==", - "dev": true - }, - "@sinonjs/formatio": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", - "integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==", - "dev": true, - "requires": { - "samsam": "1.3.0" - } - }, - "@types/arrify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@types/arrify/-/arrify-1.0.4.tgz", - "integrity": "sha512-63nK8r8jvEVJ1r0ENaY9neB1wDzPHFYAzKiIxPawuzcijEX8XeOywwPL8fkSCwiTIYop9MSh+TKy9L2ZzTXV6g==", - "dev": true - }, - "@types/caseless": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.1.tgz", - "integrity": "sha512-FhlMa34NHp9K5MY1Uz8yb+ZvuX0pnvn3jScRSNAb75KHGB8d3rEU6hqMs3Z2vjuytcMfRg6c5CHMc3wtYyD2/A==" - }, - "@types/duplexify": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@types/duplexify/-/duplexify-3.5.0.tgz", - "integrity": "sha512-+aZCCdxuR/Q6n58CBkXyqGqimIqpYUcFLfBXagXv7e9TdJUevqkKhzopBuRz3RB064sQxnJnhttHOkK/O93Ouw==", - "requires": { - "@types/node": "*" - } - }, - "@types/extend": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/extend/-/extend-3.0.0.tgz", - "integrity": "sha512-Eo8NQCbgjlMPQarlFAE3vpyCvFda4dg1Ob5ZJb6BJI9x4NAZVWowyMNB8GJJDgDI4lr2oqiQvXlPB0Fn1NoXnQ==", - "dev": true - }, - "@types/form-data": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", - "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", - "requires": { - "@types/node": "*" - } - }, - "@types/is": { - "version": "0.0.20", - "resolved": "https://registry.npmjs.org/@types/is/-/is-0.0.20.tgz", - "integrity": "sha512-013vMJ4cpYRm1GavhN8HqSKRWD/txm2BLcy/Qw9hAoSNJwp60ezLH+/QlX3JouGTPJcmxvbDUWGANxjS52jRaw==", - "dev": true - }, - "@types/mocha": { - "version": "5.2.5", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", - "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", - "dev": true - }, - "@types/node": { - "version": "10.5.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.7.tgz", - "integrity": "sha512-VkKcfuitP+Nc/TaTFH0B8qNmn+6NbI6crLkQonbedViVz7O2w8QV/GERPlkJ4bg42VGHiEWa31CoTOPs1q6z1w==" - }, - "@types/request": { - "version": "2.47.1", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.47.1.tgz", - "integrity": "sha512-TV3XLvDjQbIeVxJ1Z3oCTDk/KuYwwcNKVwz2YaT0F5u86Prgc4syDAp6P96rkTQQ4bIdh+VswQIC9zS6NjY7/g==", - "requires": { - "@types/caseless": "*", - "@types/form-data": "*", - "@types/node": "*", - "@types/tough-cookie": "*" - } - }, - "@types/tough-cookie": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.3.tgz", - "integrity": "sha512-MDQLxNFRLasqS4UlkWMSACMKeSm1x4Q3TxzUC7KQUsh6RK1ZrQ0VEyE3yzXcBu+K8ejVj4wuX32eUG02yNp+YQ==" - }, - "acorn": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", - "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", - "dev": true - }, - "acorn-es7-plugin": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz", - "integrity": "sha1-8u4fMiipDurRJF+asZIusucdM2s=", - "dev": true - }, - "acorn-jsx": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-4.1.1.tgz", - "integrity": "sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw==", - "dev": true, - "requires": { - "acorn": "^5.0.3" - } - }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" - } - }, - "ajv-keywords": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", - "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", - "dev": true - }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", - "dev": true, - "requires": { - "kind-of": "^3.0.2", - "longest": "^1.0.1", - "repeat-string": "^1.5.2" - } - }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true - }, - "ansi-align": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", - "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", - "dev": true, - "requires": { - "string-width": "^2.0.0" - } - }, - "ansi-escapes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", - "dev": true, - "requires": { - "micromatch": "^2.1.5", - "normalize-path": "^2.0.0" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "argv": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz", - "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=", - "dev": true - }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, - "arr-exclude": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/arr-exclude/-/arr-exclude-1.0.0.tgz", - "integrity": "sha1-38fC5VKicHI8zaBM8xKMjL/lxjE=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "array-differ": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", - "dev": true - }, - "array-filter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", - "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", - "dev": true - }, - "array-find": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz", - "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=", - "dev": true - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "auto-bind": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-1.2.1.tgz", - "integrity": "sha512-/W9yj1yKmBLwpexwAujeD9YHwYmRuWFGV8HWE7smQab797VeHa4/cnE2NFeDhA+E+5e/OGBI8763EhLjfZ/MXA==", - "dev": true - }, - "ava": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/ava/-/ava-0.25.0.tgz", - "integrity": "sha512-4lGNJCf6xL8SvsKVEKxEE46se7JAUIAZoKHw9itTQuwcsydhpAMkBs5gOOiWiwt0JKNIuXWc2/r4r8ZdcNrBEw==", - "dev": true, - "requires": { - "@ava/babel-preset-stage-4": "^1.1.0", - "@ava/babel-preset-transform-test-files": "^3.0.0", - "@ava/write-file-atomic": "^2.2.0", - "@concordance/react": "^1.0.0", - "@ladjs/time-require": "^0.1.4", - "ansi-escapes": "^3.0.0", - "ansi-styles": "^3.1.0", - "arr-flatten": "^1.0.1", - "array-union": "^1.0.1", - "array-uniq": "^1.0.2", - "arrify": "^1.0.0", - "auto-bind": "^1.1.0", - "ava-init": "^0.2.0", - "babel-core": "^6.17.0", - "babel-generator": "^6.26.0", - "babel-plugin-syntax-object-rest-spread": "^6.13.0", - "bluebird": "^3.0.0", - "caching-transform": "^1.0.0", - "chalk": "^2.0.1", - "chokidar": "^1.4.2", - "clean-stack": "^1.1.1", - "clean-yaml-object": "^0.1.0", - "cli-cursor": "^2.1.0", - "cli-spinners": "^1.0.0", - "cli-truncate": "^1.0.0", - "co-with-promise": "^4.6.0", - "code-excerpt": "^2.1.1", - "common-path-prefix": "^1.0.0", - "concordance": "^3.0.0", - "convert-source-map": "^1.5.1", - "core-assert": "^0.2.0", - "currently-unhandled": "^0.4.1", - "debug": "^3.0.1", - "dot-prop": "^4.1.0", - "empower-core": "^0.6.1", - "equal-length": "^1.0.0", - "figures": "^2.0.0", - "find-cache-dir": "^1.0.0", - "fn-name": "^2.0.0", - "get-port": "^3.0.0", - "globby": "^6.0.0", - "has-flag": "^2.0.0", - "hullabaloo-config-manager": "^1.1.0", - "ignore-by-default": "^1.0.0", - "import-local": "^0.1.1", - "indent-string": "^3.0.0", - "is-ci": "^1.0.7", - "is-generator-fn": "^1.0.0", - "is-obj": "^1.0.0", - "is-observable": "^1.0.0", - "is-promise": "^2.1.0", - "last-line-stream": "^1.0.0", - "lodash.clonedeepwith": "^4.5.0", - "lodash.debounce": "^4.0.3", - "lodash.difference": "^4.3.0", - "lodash.flatten": "^4.2.0", - "loud-rejection": "^1.2.0", - "make-dir": "^1.0.0", - "matcher": "^1.0.0", - "md5-hex": "^2.0.0", - "meow": "^3.7.0", - "ms": "^2.0.0", - "multimatch": "^2.1.0", - "observable-to-promise": "^0.5.0", - "option-chain": "^1.0.0", - "package-hash": "^2.0.0", - "pkg-conf": "^2.0.0", - "plur": "^2.0.0", - "pretty-ms": "^3.0.0", - "require-precompiled": "^0.1.0", - "resolve-cwd": "^2.0.0", - "safe-buffer": "^5.1.1", - "semver": "^5.4.1", - "slash": "^1.0.0", - "source-map-support": "^0.5.0", - "stack-utils": "^1.0.1", - "strip-ansi": "^4.0.0", - "strip-bom-buf": "^1.0.0", - "supertap": "^1.0.0", - "supports-color": "^5.0.0", - "trim-off-newlines": "^1.0.1", - "unique-temp-dir": "^1.0.0", - "update-notifier": "^2.3.0" - } - }, - "ava-init": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ava-init/-/ava-init-0.2.1.tgz", - "integrity": "sha512-lXwK5LM+2g1euDRqW1mcSX/tqzY1QU7EjKpqayFPPtNRmbSYZ8RzPO5tqluTToijmtjp2M+pNpVdbcHssC4glg==", - "dev": true, - "requires": { - "arr-exclude": "^1.0.0", - "execa": "^0.7.0", - "has-yarn": "^1.0.0", - "read-pkg-up": "^2.0.0", - "write-pkg": "^3.1.0" - } - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "axios": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", - "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", - "requires": { - "follow-redirects": "^1.3.0", - "is-buffer": "^1.1.5" - } - }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "babel-core": { - "version": "6.26.3", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-generator": "^6.26.0", - "babel-helpers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "convert-source-map": "^1.5.1", - "debug": "^2.6.9", - "json5": "^0.5.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.4", - "path-is-absolute": "^1.0.1", - "private": "^0.1.8", - "slash": "^1.0.0", - "source-map": "^0.5.7" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", - "dev": true, - "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" - }, - "dependencies": { - "jsesc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", - "dev": true - } - } - }, - "babel-helper-builder-binary-assignment-operator-visitor": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", - "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", - "dev": true, - "requires": { - "babel-helper-explode-assignable-expression": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", - "dev": true, - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-explode-assignable-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", - "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", - "dev": true, - "requires": { - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", - "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-espower": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/babel-plugin-espower/-/babel-plugin-espower-2.4.0.tgz", - "integrity": "sha512-/+SRpy7pKgTI28oEHfn1wkuM5QFAdRq8WNsOOih1dVrdV6A/WbNbRZyl0eX5eyDgtb0lOE27PeDFuCX2j8OxVg==", - "dev": true, - "requires": { - "babel-generator": "^6.1.0", - "babylon": "^6.1.0", - "call-matcher": "^1.0.0", - "core-js": "^2.0.0", - "espower-location-detector": "^1.0.0", - "espurify": "^1.6.0", - "estraverse": "^4.1.1" - } - }, - "babel-plugin-syntax-async-functions": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", - "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", - "dev": true - }, - "babel-plugin-syntax-exponentiation-operator": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", - "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", - "dev": true - }, - "babel-plugin-syntax-object-rest-spread": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", - "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", - "dev": true - }, - "babel-plugin-syntax-trailing-function-commas": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", - "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", - "dev": true - }, - "babel-plugin-transform-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", - "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", - "dev": true, - "requires": { - "babel-helper-remap-async-to-generator": "^6.24.1", - "babel-plugin-syntax-async-functions": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", - "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", - "dev": true, - "requires": { - "babel-plugin-transform-strict-mode": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-types": "^6.26.0" - } - }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", - "dev": true, - "requires": { - "babel-helper-call-delegate": "^6.24.1", - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", - "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", - "dev": true, - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", - "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", - "dev": true, - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "regexpu-core": "^2.0.0" - } - }, - "babel-plugin-transform-exponentiation-operator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", - "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", - "dev": true, - "requires": { - "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", - "babel-plugin-syntax-exponentiation-operator": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", - "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", - "dev": true, - "requires": { - "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "home-or-tmp": "^2.0.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.15" - }, - "dependencies": { - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "dev": true, - "requires": { - "source-map": "^0.5.6" - } - } - } - }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "dev": true, - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "babel-template": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - } - }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "optional": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "binary-extensions": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", - "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", - "dev": true - }, - "bluebird": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", - "dev": true - }, - "boxen": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", - "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", - "dev": true, - "requires": { - "ansi-align": "^2.0.0", - "camelcase": "^4.0.0", - "chalk": "^2.0.1", - "cli-boxes": "^1.0.0", - "string-width": "^2.0.0", - "term-size": "^1.2.0", - "widest-line": "^2.0.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "buf-compare": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buf-compare/-/buf-compare-1.0.1.tgz", - "integrity": "sha1-/vKNqLgROgoNtEMLC2Rntpcws0o=", - "dev": true - }, - "buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, - "cacheable-request": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz", - "integrity": "sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=", - "dev": true, - "requires": { - "clone-response": "1.0.2", - "get-stream": "3.0.0", - "http-cache-semantics": "3.8.1", - "keyv": "3.0.0", - "lowercase-keys": "1.0.0", - "normalize-url": "2.0.1", - "responselike": "1.0.2" - }, - "dependencies": { - "lowercase-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", - "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", - "dev": true - } - } - }, - "caching-transform": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", - "integrity": "sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE=", - "dev": true, - "requires": { - "md5-hex": "^1.2.0", - "mkdirp": "^0.5.1", - "write-file-atomic": "^1.1.4" - }, - "dependencies": { - "md5-hex": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", - "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", - "dev": true, - "requires": { - "md5-o-matic": "^0.1.1" - } - }, - "write-file-atomic": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", - "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "slide": "^1.1.5" - } - } - } - }, - "call-matcher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-matcher/-/call-matcher-1.0.1.tgz", - "integrity": "sha1-UTTQd5hPcSpU2tPL9i3ijc5BbKg=", - "dev": true, - "requires": { - "core-js": "^2.0.0", - "deep-equal": "^1.0.0", - "espurify": "^1.6.0", - "estraverse": "^4.0.0" - } - }, - "call-signature": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", - "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=", - "dev": true - }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", - "dev": true, - "requires": { - "callsites": "^0.2.0" - } - }, - "callsites": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", - "dev": true - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", - "dev": true - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "dev": true, - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - } - }, - "capture-stack-trace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", - "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "catharsis": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.9.tgz", - "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", - "dev": true, - "requires": { - "underscore-contrib": "~0.3.0" - } - }, - "center-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", - "dev": true - }, - "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", - "dev": true, - "requires": { - "anymatch": "^1.3.0", - "async-each": "^1.0.0", - "fsevents": "^1.0.0", - "glob-parent": "^2.0.0", - "inherits": "^2.0.1", - "is-binary-path": "^1.0.0", - "is-glob": "^2.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0" - } - }, - "ci-info": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.3.tgz", - "integrity": "sha512-SK/846h/Rcy8q9Z9CAwGBLfCJ6EkjJWdpelWDufQpqVDYq2Wnnv8zlSO6AMQap02jvhVruKKpEtQOufo3pFhLg==", - "dev": true - }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "dev": true - }, - "clang-format": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/clang-format/-/clang-format-1.2.3.tgz", - "integrity": "sha512-x90Hac4ERacGDcZSvHKK58Ga0STuMD+Doi5g0iG2zf7wlJef5Huvhs/3BvMRFxwRYyYSdl6mpQNrtfMxE8MQzw==", - "dev": true, - "requires": { - "async": "^1.5.2", - "glob": "^7.0.0", - "resolve": "^1.1.6" - } - }, - "clean-stack": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-1.3.0.tgz", - "integrity": "sha1-noIVAa6XmYbEax1m0tQy2y/UrjE=", - "dev": true - }, - "clean-yaml-object": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", - "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", - "dev": true - }, - "cli-boxes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", - "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", - "dev": true - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-spinners": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz", - "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", - "dev": true - }, - "cli-truncate": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-1.1.0.tgz", - "integrity": "sha512-bAtZo0u82gCfaAGfSNxUdTI9mNyza7D8w4CVCcaOsy7sgwDzvx6ekr6cuWJqY3UGzgnQ1+4wgENup5eIhgxEYA==", - "dev": true, - "requires": { - "slice-ansi": "^1.0.0", - "string-width": "^2.0.0" - } - }, - "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", - "dev": true - }, - "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, - "optional": true, - "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true, - "optional": true - } - } - }, - "clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" - }, - "co-with-promise": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co-with-promise/-/co-with-promise-4.6.0.tgz", - "integrity": "sha1-QT59tvWJOmC5Qs9JLEvsk9tBWrc=", - "dev": true, - "requires": { - "pinkie-promise": "^1.0.0" - } - }, - "code-excerpt": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-2.1.1.tgz", - "integrity": "sha512-tJLhH3EpFm/1x7heIW0hemXJTUU5EWl2V0EIX558jp05Mt1U6DVryCgkp3l37cxqs+DNbNgxG43SkwJXpQ14Jw==", - "dev": true, - "requires": { - "convert-to-spaces": "^1.0.1" - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "codecov": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.4.tgz", - "integrity": "sha512-KJyzHdg9B8U9LxXa7hS6jnEW5b1cNckLYc2YpnJ1nEFiOW+/iSzDHp+5MYEIQd9fN3/tC6WmGZmYiwxzkuGp/A==", - "dev": true, - "requires": { - "argv": "^0.0.2", - "ignore-walk": "^3.0.1", - "request": "^2.87.0", - "urlgrey": "^0.4.4" - } - }, - "color-convert": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", - "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", - "dev": true, - "requires": { - "color-name": "1.1.1" - } - }, - "color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=", - "dev": true - }, - "colors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", - "dev": true - }, - "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.0.tgz", - "integrity": "sha512-477o1hdVORiFlZxw8wgsXYCef3lh0zl/OV0FTftqiDxJSWw6dPQ2ipS4k20J2qBcsmsmLKSyr2iFrf9e3JGi4w==", - "dev": true - }, - "common-path-prefix": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-1.0.0.tgz", - "integrity": "sha1-zVL28HEuC6q5fW+XModPIvR3UsA=", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concordance": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/concordance/-/concordance-3.0.0.tgz", - "integrity": "sha512-CZBzJ3/l5QJjlZM20WY7+5GP5pMTw+1UEbThcpMw8/rojsi5sBCiD8ZbBLtD+jYpRGAkwuKuqk108c154V9eyQ==", - "dev": true, - "requires": { - "date-time": "^2.1.0", - "esutils": "^2.0.2", - "fast-diff": "^1.1.1", - "function-name-support": "^0.2.0", - "js-string-escape": "^1.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.flattendeep": "^4.4.0", - "lodash.merge": "^4.6.0", - "md5-hex": "^2.0.0", - "semver": "^5.3.0", - "well-known-symbols": "^1.0.0" - }, - "dependencies": { - "date-time": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/date-time/-/date-time-2.1.0.tgz", - "integrity": "sha512-/9+C44X7lot0IeiyfgJmETtRMhBidBYM2QFFIkGa0U1k+hSyY87Nw7PY3eDqpvCBm7I3WCSfPeZskW/YYq6m4g==", - "dev": true, - "requires": { - "time-zone": "^1.0.0" - } - } - } - }, - "configstore": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", - "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", - "dev": true, - "requires": { - "dot-prop": "^4.1.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "unique-string": "^1.0.0", - "write-file-atomic": "^2.0.0", - "xdg-basedir": "^3.0.0" - } - }, - "convert-source-map": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", - "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", - "dev": true - }, - "convert-to-spaces": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz", - "integrity": "sha1-fj5Iu+bZl7FBfdyihoIEtNPYVxU=", - "dev": true - }, - "cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", - "dev": true - }, - "core-assert": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/core-assert/-/core-assert-0.2.1.tgz", - "integrity": "sha1-+F4s+b/tKPdzzIs/pcW2m9wC/j8=", - "dev": true, - "requires": { - "buf-compare": "^1.0.0", - "is-error": "^2.2.0" - } - }, - "core-js": { - "version": "2.5.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", - "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "create-error-class": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", - "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", - "dev": true, - "requires": { - "capture-stack-trace": "^1.0.0" - } - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "crypto-random-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", - "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", - "dev": true - }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "dev": true, - "requires": { - "array-find-index": "^1.0.1" - } - }, - "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", - "dev": true, - "requires": { - "es5-ext": "^0.10.9" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "date-time": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/date-time/-/date-time-0.1.1.tgz", - "integrity": "sha1-7S9tk9l5DOL9ZtW1/z7dW7y/Owc=", - "dev": true - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", - "dev": true, - "requires": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - } - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", - "dev": true - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "define-properties": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", - "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", - "dev": true, - "requires": { - "foreach": "^2.0.5", - "object-keys": "^1.0.8" - } - }, - "del": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", - "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", - "dev": true, - "requires": { - "globby": "^5.0.0", - "is-path-cwd": "^1.0.0", - "is-path-in-cwd": "^1.0.0", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "rimraf": "^2.2.8" - }, - "dependencies": { - "globby": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", - "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "detect-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "diff-match-patch": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.1.tgz", - "integrity": "sha512-A0QEhr4PxGUMEtKxd6X+JLnOTFd3BfIPSDpsc4dMvj+CbSaErDwTpoTo/nFJDMSrjxLW4BiNq+FbNisAAHhWeQ==", - "dev": true - }, - "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", - "dev": true, - "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" - }, - "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", - "dev": true - } - } - }, - "domelementtype": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", - "dev": true - }, - "domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", - "dev": true, - "requires": { - "domelementtype": "1" - } - }, - "domutils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", - "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", - "dev": true - }, - "duplexify": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", - "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "optional": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "ecdsa-sig-formatter": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", - "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "empower": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/empower/-/empower-1.3.0.tgz", - "integrity": "sha512-tP2WqM7QzrPguCCQEQfFFDF+6Pw6YWLQal3+GHQaV+0uIr0S+jyREQPWljE02zFCYPFYLZ3LosiRV+OzTrxPpQ==", - "dev": true, - "requires": { - "core-js": "^2.0.0", - "empower-core": "^1.2.0" - }, - "dependencies": { - "empower-core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-1.2.0.tgz", - "integrity": "sha512-g6+K6Geyc1o6FdXs9HwrXleCFan7d66G5xSCfSF7x1mJDCes6t0om9lFQG3zOrzh3Bkb/45N0cZ5Gqsf7YrzGQ==", - "dev": true, - "requires": { - "call-signature": "0.0.2", - "core-js": "^2.0.0" - } - } - } - }, - "empower-assert": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/empower-assert/-/empower-assert-1.1.0.tgz", - "integrity": "sha512-Ylck0Q6p8y/LpNzYeBccaxAPm2ZyuqBgErgZpO9KT0HuQWF0sJckBKCLmgS1/DEXEiyBi9XtYh3clZm5cAdARw==", - "dev": true, - "requires": { - "estraverse": "^4.2.0" - } - }, - "empower-core": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-0.6.2.tgz", - "integrity": "sha1-Wt71ZgiOMfuoC6CjbfR9cJQWkUQ=", - "dev": true, - "requires": { - "call-signature": "0.0.2", - "core-js": "^2.0.0" - } - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "requires": { - "once": "^1.4.0" - } - }, - "ent": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=" - }, - "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", - "dev": true - }, - "equal-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/equal-length/-/equal-length-1.0.1.tgz", - "integrity": "sha1-IcoRLUirJLTh5//A5TOdMf38J0w=", - "dev": true - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", - "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", - "dev": true, - "requires": { - "es-to-primitive": "^1.1.1", - "function-bind": "^1.1.1", - "has": "^1.0.1", - "is-callable": "^1.1.3", - "is-regex": "^1.0.4" - } - }, - "es-to-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", - "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", - "dev": true, - "requires": { - "is-callable": "^1.1.1", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.1" - } - }, - "es5-ext": { - "version": "0.10.45", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.45.tgz", - "integrity": "sha512-FkfM6Vxxfmztilbxxz5UKSD4ICMf5tSpRFtDNtkAhOxZ0EKtX6qwmXNyH/sFyIbX2P/nU5AMiA9jilWsUGJzCQ==", - "dev": true, - "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.1", - "next-tick": "1" - } - }, - "es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-map": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", - "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14", - "es6-iterator": "~2.0.1", - "es6-set": "~0.1.5", - "es6-symbol": "~3.1.1", - "event-emitter": "~0.3.5" - } - }, - "es6-set": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", - "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14", - "es6-iterator": "~2.0.1", - "es6-symbol": "3.1.1", - "event-emitter": "~0.3.5" - } - }, - "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "es6-weak-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", - "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.14", - "es6-iterator": "^2.0.1", - "es6-symbol": "^3.1.1" - } - }, - "escallmatch": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/escallmatch/-/escallmatch-1.5.0.tgz", - "integrity": "sha1-UAmdhugJGwkt+N37w/mm+wWgJNA=", - "dev": true, - "requires": { - "call-matcher": "^1.0.0", - "esprima": "^2.0.0" - }, - "dependencies": { - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - } - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "escodegen": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", - "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", - "dev": true, - "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } - } - }, - "escope": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", - "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", - "dev": true, - "requires": { - "es6-map": "^0.1.3", - "es6-weak-map": "^2.0.1", - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "eslint": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.3.0.tgz", - "integrity": "sha512-N/tCqlMKkyNvAvLu+zI9AqDasnSLt00K+Hu8kdsERliC9jYEc8ck12XtjvOXrBKu8fK6RrBcN9bat6Xk++9jAg==", - "dev": true, - "requires": { - "ajv": "^6.5.0", - "babel-code-frame": "^6.26.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^3.1.0", - "doctrine": "^2.1.0", - "eslint-scope": "^4.0.0", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^4.0.0", - "esquery": "^1.0.1", - "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", - "ignore": "^4.0.2", - "imurmurhash": "^0.1.4", - "inquirer": "^5.2.0", - "is-resolvable": "^1.1.0", - "js-yaml": "^3.11.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.5", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", - "progress": "^2.0.0", - "regexpp": "^2.0.0", - "require-uncached": "^1.0.3", - "semver": "^5.5.0", - "string.prototype.matchall": "^2.0.0", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", - "table": "^4.0.3", - "text-table": "^0.2.0" - }, - "dependencies": { - "ajv": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", - "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.1" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "globals": { - "version": "11.7.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", - "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - } - } - }, - "eslint-config-prettier": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz", - "integrity": "sha512-ag8YEyBXsm3nmOv1Hz991VtNNDMRa+MNy8cY47Pl4bw6iuzqKbJajXdqUpiw13STdLLrznxgm1hj9NhxeOYq0A==", - "dev": true, - "requires": { - "get-stdin": "^5.0.1" - }, - "dependencies": { - "get-stdin": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", - "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", - "dev": true - } - } - }, - "eslint-plugin-es": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.3.1.tgz", - "integrity": "sha512-9XcVyZiQRVeFjqHw8qHNDAZcQLqaHlOGGpeYqzYh8S4JYCWTCO3yzyen8yVmA5PratfzTRWDwCOFphtDEG+w/w==", - "dev": true, - "requires": { - "eslint-utils": "^1.3.0", - "regexpp": "^2.0.0" - } - }, - "eslint-plugin-node": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-7.0.1.tgz", - "integrity": "sha512-lfVw3TEqThwq0j2Ba/Ckn2ABdwmL5dkOgAux1rvOk6CO7A6yGyPI2+zIxN6FyNkp1X1X/BSvKOceD6mBWSj4Yw==", - "dev": true, - "requires": { - "eslint-plugin-es": "^1.3.1", - "eslint-utils": "^1.3.1", - "ignore": "^4.0.2", - "minimatch": "^3.0.4", - "resolve": "^1.8.1", - "semver": "^5.5.0" - }, - "dependencies": { - "resolve": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", - "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", - "dev": true, - "requires": { - "path-parse": "^1.0.5" - } - } - } - }, - "eslint-plugin-prettier": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.2.tgz", - "integrity": "sha512-tGek5clmW5swrAx1mdPYM8oThrBE83ePh7LeseZHBWfHVGrHPhKn7Y5zgRMbU/9D5Td9K4CEmUPjGxA7iw98Og==", - "dev": true, - "requires": { - "fast-diff": "^1.1.1", - "jest-docblock": "^21.0.0" - } - }, - "eslint-scope": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", - "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", - "dev": true - }, - "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", - "dev": true - }, - "espower": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/espower/-/espower-2.1.1.tgz", - "integrity": "sha512-F4TY1qYJB1aUyzB03NsZksZzUQmQoEBaTUjRJGR30GxbkbjKI41NhCyYjrF+bGgWN7x/ZsczYppRpz/0WdI0ug==", - "dev": true, - "requires": { - "array-find": "^1.0.0", - "escallmatch": "^1.5.0", - "escodegen": "^1.7.0", - "escope": "^3.3.0", - "espower-location-detector": "^1.0.0", - "espurify": "^1.3.0", - "estraverse": "^4.1.0", - "source-map": "^0.5.0", - "type-name": "^2.0.0", - "xtend": "^4.0.0" - } - }, - "espower-loader": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/espower-loader/-/espower-loader-1.2.2.tgz", - "integrity": "sha1-7bRsPFmga6yOpzppXIblxaC8gto=", - "dev": true, - "requires": { - "convert-source-map": "^1.1.0", - "espower-source": "^2.0.0", - "minimatch": "^3.0.0", - "source-map-support": "^0.4.0", - "xtend": "^4.0.0" - }, - "dependencies": { - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "dev": true, - "requires": { - "source-map": "^0.5.6" - } - } - } - }, - "espower-location-detector": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/espower-location-detector/-/espower-location-detector-1.0.0.tgz", - "integrity": "sha1-oXt+zFnTDheeK+9z+0E3cEyzMbU=", - "dev": true, - "requires": { - "is-url": "^1.2.1", - "path-is-absolute": "^1.0.0", - "source-map": "^0.5.0", - "xtend": "^4.0.0" - } - }, - "espower-source": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/espower-source/-/espower-source-2.3.0.tgz", - "integrity": "sha512-Wc4kC4zUAEV7Qt31JRPoBUc5jjowHRylml2L2VaDQ1XEbnqQofGWx+gPR03TZAPokAMl5dqyL36h3ITyMXy3iA==", - "dev": true, - "requires": { - "acorn": "^5.0.0", - "acorn-es7-plugin": "^1.0.10", - "convert-source-map": "^1.1.1", - "empower-assert": "^1.0.0", - "escodegen": "^1.10.0", - "espower": "^2.1.1", - "estraverse": "^4.0.0", - "merge-estraverse-visitors": "^1.0.0", - "multi-stage-sourcemap": "^0.2.1", - "path-is-absolute": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "espree": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-4.0.0.tgz", - "integrity": "sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg==", - "dev": true, - "requires": { - "acorn": "^5.6.0", - "acorn-jsx": "^4.1.1" - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "espurify": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.1.tgz", - "integrity": "sha512-ZDko6eY/o+D/gHCWyHTU85mKDgYcS4FJj7S+YD6WIInm7GQ6AnOjmcL4+buFV/JOztVLELi/7MmuGU5NHta0Mg==", - "dev": true, - "requires": { - "core-js": "^2.0.0" - } - }, - "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", - "dev": true, - "requires": { - "estraverse": "^4.0.0" - } - }, - "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", - "dev": true, - "requires": { - "estraverse": "^4.1.0" - } - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "^2.1.0" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", - "dev": true, - "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", - "tmp": "^0.0.33" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" - }, - "fast-diff": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz", - "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", - "dev": true, - "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" - } - }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, - "fill-keys": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/fill-keys/-/fill-keys-1.0.2.tgz", - "integrity": "sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=", - "dev": true, - "requires": { - "is-object": "~1.0.1", - "merge-descriptors": "~1.0.0" - } - }, - "fill-range": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", - "dev": true, - "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" - } - }, - "find-cache-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", - "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^2.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "flat-cache": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", - "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", - "dev": true, - "requires": { - "circular-json": "^0.3.1", - "del": "^2.0.2", - "graceful-fs": "^4.1.2", - "write": "^0.2.1" - } - }, - "fn-name": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fn-name/-/fn-name-2.0.1.tgz", - "integrity": "sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc=", - "dev": true - }, - "follow-redirects": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.2.tgz", - "integrity": "sha512-kssLorP/9acIdpQ2udQVTiCS5LQmdEz9mvdIfDcl1gYX2tPKFADHSyFdvJS040XdFsPzemWtgI3q8mFVCxtX8A==", - "requires": { - "debug": "^3.1.0" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "1.0.6", - "mime-types": "^2.1.12" - } - }, - "formidable": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", - "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==", - "dev": true - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "fs-extra": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", - "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.21", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "^2.1.0" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "^5.1.1", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.0", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.1.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.1.10", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.5.1", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true, - "dev": true - } - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "function-name-support": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/function-name-support/-/function-name-support-0.2.0.tgz", - "integrity": "sha1-VdO/qm6v1QWlD5vIH99XVkoLsHE=", - "dev": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "gcp-metadata": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.6.3.tgz", - "integrity": "sha512-MSmczZctbz91AxCvqp9GHBoZOSbJKAICV7Ow/AIWSJZRrRchUd5NL1b2P4OfP+4m490BEUPhhARfpHdqCxuCvg==", - "requires": { - "axios": "^0.18.0", - "extend": "^3.0.1", - "retry-axios": "0.3.2" - } - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "get-port": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", - "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", - "dev": true - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "global-dirs": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", - "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", - "dev": true, - "requires": { - "ini": "^1.3.4" - } - }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true - }, - "globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - } - } - }, - "google-auth-library": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-1.6.1.tgz", - "integrity": "sha512-jYiWC8NA9n9OtQM7ANn0Tk464do9yhKEtaJ72pKcaBiEwn4LwcGYIYOfwtfsSm3aur/ed3tlSxbmg24IAT6gAg==", - "requires": { - "axios": "^0.18.0", - "gcp-metadata": "^0.6.3", - "gtoken": "^2.3.0", - "jws": "^3.1.5", - "lodash.isstring": "^4.0.1", - "lru-cache": "^4.1.3", - "retry-axios": "^0.3.2" - } - }, - "google-p12-pem": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.2.tgz", - "integrity": "sha512-+EuKr4CLlGsnXx4XIJIVkcKYrsa2xkAmCvxRhX2HsazJzUBAJ35wARGeApHUn4nNfPD03Vl057FskNr20VaCyg==", - "requires": { - "node-forge": "^0.7.4", - "pify": "^3.0.0" - } - }, - "got": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/got/-/got-8.3.0.tgz", - "integrity": "sha512-kBNy/S2CGwrYgDSec5KTWGKUvupwkkTVAjIsVFF2shXO13xpZdFP4d4kxa//CLX2tN/rV0aYwK8vY6UKWGn2vQ==", - "dev": true, - "requires": { - "@sindresorhus/is": "^0.7.0", - "cacheable-request": "^2.1.1", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "into-stream": "^3.1.0", - "is-retry-allowed": "^1.1.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "mimic-response": "^1.0.0", - "p-cancelable": "^0.4.0", - "p-timeout": "^2.0.1", - "pify": "^3.0.0", - "safe-buffer": "^5.1.1", - "timed-out": "^4.0.1", - "url-parse-lax": "^3.0.0", - "url-to-options": "^1.0.1" - }, - "dependencies": { - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", - "dev": true - }, - "url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", - "dev": true, - "requires": { - "prepend-http": "^2.0.0" - } - } - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "gtoken": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.0.tgz", - "integrity": "sha512-Jc9/8mV630cZE9FC5tIlJCZNdUjwunvlwOtCz6IDlaiB4Sz68ki29a1+q97sWTnTYroiuF9B135rod9zrQdHLw==", - "requires": { - "axios": "^0.18.0", - "google-p12-pem": "^1.0.0", - "jws": "^3.1.4", - "mime": "^2.2.0", - "pify": "^3.0.0" - } - }, - "gts": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/gts/-/gts-0.8.0.tgz", - "integrity": "sha512-VB9LQLFR+10cJhDBLYu9i2t7vTkewTXeBJbvw5+M2LqGgjiaKIUTIFbVBLjIknDpuaRpAzVcvhiHWy/30c09jg==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "clang-format": "1.2.3", - "inquirer": "^6.0.0", - "meow": "^5.0.0", - "pify": "^3.0.0", - "rimraf": "^2.6.2", - "tslint": "^5.9.1", - "update-notifier": "^2.5.0", - "write-file-atomic": "^2.3.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, - "requires": { - "camelcase": "^4.1.0", - "map-obj": "^2.0.0", - "quick-lru": "^1.0.0" - } - }, - "chardet": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.5.0.tgz", - "integrity": "sha512-9ZTaoBaePSCFvNlNGrsyI8ZVACP2svUtq0DkM7t4K2ClAa96sqOIRjAzDTc8zXzFt1cZR46rRzLTiHFSJ+Qw0g==", - "dev": true - }, - "external-editor": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.0.tgz", - "integrity": "sha512-mpkfj0FEdxrIhOC04zk85X7StNtr0yXnG7zCb+8ikO8OJi2jsHh5YGoknNTyXgsbHOf1WOOcVU3kPFWT2WgCkQ==", - "dev": true, - "requires": { - "chardet": "^0.5.0", - "iconv-lite": "^0.4.22", - "tmp": "^0.0.33" - } - }, - "inquirer": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.0.0.tgz", - "integrity": "sha512-tISQWRwtcAgrz+SHPhTH7d3e73k31gsOy6i1csonLc0u1dVK/wYvuOnFeiWqC5OXFIYbmrIFInef31wbT8MEJg==", - "dev": true, - "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.0", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.1.0", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", - "through": "^2.3.6" - } - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "dev": true - }, - "meow": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", - "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", - "dev": true, - "requires": { - "camelcase-keys": "^4.0.0", - "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", - "minimist-options": "^3.0.1", - "normalize-package-data": "^2.3.4", - "read-pkg-up": "^3.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0", - "yargs-parser": "^10.0.0" - } - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, - "requires": { - "indent-string": "^3.0.0", - "strip-indent": "^2.0.0" - } - }, - "rxjs": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.2.tgz", - "integrity": "sha512-0MI8+mkKAXZUF9vMrEoPnaoHkfzBPP4IGwUYRJhIRJF6/w3uByO1e91bEHn8zd43RdkTMKiooYKmwz7RH6zfOQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true - }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true - } - } - }, - "handlebars": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", - "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", - "dev": true, - "requires": { - "async": "^1.4.0", - "optimist": "^0.6.1", - "source-map": "^0.4.4", - "uglify-js": "^2.6" - }, - "dependencies": { - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", - "requires": { - "ajv": "^5.1.0", - "har-schema": "^2.0.0" - } - }, - "hard-rejection": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-1.0.0.tgz", - "integrity": "sha1-jztHbI4vIhvtc8ZGQP4hfXF9rDY=", - "dev": true - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "has-color": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", - "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=", - "dev": true - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "has-symbol-support-x": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", - "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", - "dev": true - }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true - }, - "has-to-string-tag-x": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", - "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", - "dev": true, - "requires": { - "has-symbol-support-x": "^1.4.1" - } - }, - "has-yarn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-1.0.0.tgz", - "integrity": "sha1-ieJdtgS3Jcj1l2//Ct3JIbgopac=", - "dev": true - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "home-or-tmp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.1" - } - }, - "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", - "dev": true - }, - "html-tags": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-1.2.0.tgz", - "integrity": "sha1-x43mW1Zjqll5id0rerSSANfk25g=" - }, - "htmlparser2": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", - "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", - "dev": true, - "requires": { - "domelementtype": "^1.3.0", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^2.0.2" - } - }, - "http-cache-semantics": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", - "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", - "dev": true - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "hullabaloo-config-manager": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/hullabaloo-config-manager/-/hullabaloo-config-manager-1.1.1.tgz", - "integrity": "sha512-ztKnkZV0TmxnumCDHHgLGNiDnotu4EHCp9YMkznWuo4uTtCyJ+cu+RNcxUeXYKTllpvLFWnbfWry09yzszgg+A==", - "dev": true, - "requires": { - "dot-prop": "^4.1.0", - "es6-error": "^4.0.2", - "graceful-fs": "^4.1.11", - "indent-string": "^3.1.0", - "json5": "^0.5.1", - "lodash.clonedeep": "^4.5.0", - "lodash.clonedeepwith": "^4.5.0", - "lodash.isequal": "^4.5.0", - "lodash.merge": "^4.6.0", - "md5-hex": "^2.0.0", - "package-hash": "^2.0.0", - "pkg-dir": "^2.0.0", - "resolve-from": "^3.0.0", - "safe-buffer": "^5.0.1" - } - }, - "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.3.tgz", - "integrity": "sha512-Z/vAH2GGIEATQnBVXMclE2IGV6i0GyVngKThcGZ5kHgHMxLo9Ow2+XHRq1aEKEej5vOF1TPJNbvX6J/anT0M7A==", - "dev": true - }, - "ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", - "dev": true - }, - "ignore-walk": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", - "dev": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", - "dev": true - }, - "import-local": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-0.1.1.tgz", - "integrity": "sha1-sReVcqrNwRxqkQCftDDbyrX2aKg=", - "dev": true, - "requires": { - "pkg-dir": "^2.0.0", - "resolve-cwd": "^2.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, - "ink-docstrap": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/ink-docstrap/-/ink-docstrap-1.3.2.tgz", - "integrity": "sha512-STx5orGQU1gfrkoI/fMU7lX6CSP7LBGO10gXNgOZhwKhUqbtNjCkYSewJtNnLmWP1tAGN6oyEpG1HFPw5vpa5Q==", - "dev": true, - "requires": { - "moment": "^2.14.1", - "sanitize-html": "^1.13.0" - } - }, - "inquirer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", - "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", - "dev": true, - "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^2.1.0", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^5.5.2", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", - "through": "^2.3.6" - } - }, - "intelli-espower-loader": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/intelli-espower-loader/-/intelli-espower-loader-1.0.1.tgz", - "integrity": "sha1-LHsDFGvB1GvyENCgOXxckatMorA=", - "dev": true, - "requires": { - "espower-loader": "^1.0.0" - } - }, - "into-stream": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", - "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", - "dev": true, - "requires": { - "from2": "^2.1.1", - "p-is-promise": "^1.1.0" - } - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, - "irregular-plurals": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-1.4.0.tgz", - "integrity": "sha1-LKmwM2UREYVUEvFr5dd8YqRYp2Y=", - "dev": true - }, - "is": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz", - "integrity": "sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU=" - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true - }, - "is-ci": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.1.0.tgz", - "integrity": "sha512-c7TnwxLePuqIlxHgr7xtxzycJPegNHFuIrBkwbf8hc58//+Op1CqFkyS+xnIMkwn9UsJIwc174BIjkyBmSpjKg==", - "dev": true, - "requires": { - "ci-info": "^1.0.0" - } - }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true - }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "^2.0.0" - } - }, - "is-error": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-error/-/is-error-2.2.1.tgz", - "integrity": "sha1-aEqW2EB2V3yY9M20DG0mpRI78Zw=", - "dev": true - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "is-generator-fn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz", - "integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "is-html": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-html/-/is-html-1.1.0.tgz", - "integrity": "sha1-4E8cGNOUhRETlvmgJz6rUa8hhGQ=", - "requires": { - "html-tags": "^1.0.0" - } - }, - "is-installed-globally": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", - "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", - "dev": true, - "requires": { - "global-dirs": "^0.1.0", - "is-path-inside": "^1.0.0" - } - }, - "is-npm": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", - "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", - "dev": true - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, - "is-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", - "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", - "dev": true - }, - "is-observable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz", - "integrity": "sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==", - "dev": true, - "requires": { - "symbol-observable": "^1.1.0" - } - }, - "is-path-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", - "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", - "dev": true - }, - "is-path-in-cwd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", - "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", - "dev": true, - "requires": { - "is-path-inside": "^1.0.0" - } - }, - "is-path-inside": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", - "dev": true, - "requires": { - "path-is-inside": "^1.0.1" - } - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true - }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, - "is-redirect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", - "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", - "dev": true - }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, - "requires": { - "has": "^1.0.1" - } - }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, - "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-symbol": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", - "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "is-url": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", - "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", - "dev": true - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "istanbul-lib-coverage": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", - "integrity": "sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA==", - "dev": true - }, - "istanbul-lib-instrument": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-2.3.2.tgz", - "integrity": "sha512-l7TD/VnBsIB2OJvSyxaLW/ab1+92dxZNH9wLH7uHPPioy3JZ8tnx2UXUdKmdkgmP2EFPzg64CToUP6dAS3U32Q==", - "dev": true, - "requires": { - "@babel/generator": "7.0.0-beta.51", - "@babel/parser": "7.0.0-beta.51", - "@babel/template": "7.0.0-beta.51", - "@babel/traverse": "7.0.0-beta.51", - "@babel/types": "7.0.0-beta.51", - "istanbul-lib-coverage": "^2.0.1", - "semver": "^5.5.0" - } - }, - "isurl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", - "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", - "dev": true, - "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" - } - }, - "jest-docblock": { - "version": "21.2.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-21.2.0.tgz", - "integrity": "sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw==", - "dev": true - }, - "js-string-escape": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", - "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", - "dev": true - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - }, - "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "js2xmlparser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", - "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", - "dev": true, - "requires": { - "xmlcreate": "^1.0.1" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "optional": true - }, - "jsdoc": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.5.5.tgz", - "integrity": "sha512-6PxB65TAU4WO0Wzyr/4/YhlGovXl0EVYfpKbpSroSj0qBxT4/xod/l40Opkm38dRHRdQgdeY836M0uVnJQG7kg==", - "dev": true, - "requires": { - "babylon": "7.0.0-beta.19", - "bluebird": "~3.5.0", - "catharsis": "~0.8.9", - "escape-string-regexp": "~1.0.5", - "js2xmlparser": "~3.0.0", - "klaw": "~2.0.0", - "marked": "~0.3.6", - "mkdirp": "~0.5.1", - "requizzle": "~0.2.1", - "strip-json-comments": "~2.0.1", - "taffydb": "2.6.2", - "underscore": "~1.8.3" - }, - "dependencies": { - "babylon": { - "version": "7.0.0-beta.19", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", - "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", - "dev": true - } - } - }, - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - }, - "json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "just-extend": { - "version": "1.1.27", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-1.1.27.tgz", - "integrity": "sha512-mJVp13Ix6gFo3SBAy9U/kL+oeZqzlYYYLQBwXVBlVzIsZwBqGREnOro24oC/8s8aox+rJhtZ2DiQof++IrkA+g==", - "dev": true - }, - "jwa": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz", - "integrity": "sha512-tBO/cf++BUsJkYql/kBbJroKOgHWEigTKBAjjBEmrMGYd1QMBC74Hr4Wo2zCZw6ZrVhlJPvoMrkcOnlWR/DJfw==", - "requires": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.10", - "safe-buffer": "^5.0.1" - } - }, - "jws": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", - "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", - "requires": { - "jwa": "^1.1.5", - "safe-buffer": "^5.0.1" - } - }, - "keyv": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", - "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==", - "dev": true, - "requires": { - "json-buffer": "3.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "klaw": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", - "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "last-line-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/last-line-stream/-/last-line-stream-1.0.0.tgz", - "integrity": "sha1-0bZNafhv8kry0EiDos7uFFIKVgA=", - "dev": true, - "requires": { - "through2": "^2.0.0" - } - }, - "latest-version": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", - "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", - "dev": true, - "requires": { - "package-json": "^4.0.0" - } - }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true, - "optional": true - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.clonedeepwith": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeepwith/-/lodash.clonedeepwith-4.5.0.tgz", - "integrity": "sha1-buMFc6A6GmDWcKYu8zwQzxr9vdQ=", - "dev": true - }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "dev": true - }, - "lodash.difference": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", - "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=", - "dev": true - }, - "lodash.escaperegexp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", - "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=", - "dev": true - }, - "lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", - "dev": true - }, - "lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", - "dev": true - }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "dev": true - }, - "lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", - "dev": true - }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true - }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" - }, - "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==", - "dev": true - }, - "lodash.mergewith": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", - "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", - "dev": true - }, - "lolex": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.1.tgz", - "integrity": "sha512-Oo2Si3RMKV3+lV5MsSWplDQFoTClz/24S0MMHYcgGWWmFXr6TMlqcqk/l1GtH+d5wLBwNRiqGnwDRMirtFalJw==", - "dev": true - }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "dev": true, - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true - }, - "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - }, - "marked": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", - "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", - "dev": true - }, - "matcher": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/matcher/-/matcher-1.1.1.tgz", - "integrity": "sha512-+BmqxWIubKTRKNWx/ahnCkk3mG8m7OturVlqq6HiojGJTd5hVYbgZm6WzcYPCoB+KBT4Vd6R7WSRG2OADNaCjg==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.4" - } - }, - "math-random": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", - "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", - "dev": true - }, - "md5-hex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-2.0.0.tgz", - "integrity": "sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=", - "dev": true, - "requires": { - "md5-o-matic": "^0.1.1" - } - }, - "md5-o-matic": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", - "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", - "dev": true - }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "dev": true, - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - } - } - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", - "dev": true - }, - "merge-estraverse-visitors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/merge-estraverse-visitors/-/merge-estraverse-visitors-1.0.0.tgz", - "integrity": "sha1-65aDOLXe1c7tgs7AMH3sui2OqZQ=", - "dev": true, - "requires": { - "estraverse": "^4.0.0" - } - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "dev": true - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } - }, - "mime": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", - "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==" - }, - "mime-db": { - "version": "1.35.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", - "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==" - }, - "mime-types": { - "version": "2.1.19", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", - "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", - "requires": { - "mime-db": "~1.35.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0" - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - }, - "dependencies": { - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - } - } - }, - "module-not-found-error": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz", - "integrity": "sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA=", - "dev": true - }, - "moment": { - "version": "2.22.2", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", - "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "multi-stage-sourcemap": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/multi-stage-sourcemap/-/multi-stage-sourcemap-0.2.1.tgz", - "integrity": "sha1-sJ/IWG6qF/gdV1xK0C4Pej9rEQU=", - "dev": true, - "requires": { - "source-map": "^0.1.34" - }, - "dependencies": { - "source-map": { - "version": "0.1.43", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", - "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "multimatch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", - "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", - "dev": true, - "requires": { - "array-differ": "^1.0.0", - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "minimatch": "^3.0.0" - } - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "nan": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", - "dev": true, - "optional": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", - "dev": true - }, - "nice-try": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", - "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==", - "dev": true - }, - "nise": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.2.tgz", - "integrity": "sha512-BxH/DxoQYYdhKgVAfqVy4pzXRZELHOIewzoesxpjYvpU+7YOalQhGNPf7wAx8pLrTNPrHRDlLOkAl8UI0ZpXjw==", - "dev": true, - "requires": { - "@sinonjs/formatio": "^2.0.0", - "just-extend": "^1.1.27", - "lolex": "^2.3.2", - "path-to-regexp": "^1.7.0", - "text-encoding": "^0.6.4" - } - }, - "node-forge": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.5.tgz", - "integrity": "sha512-MmbQJ2MTESTjt3Gi/3yG1wGpIMhUfcIypUCGtTizFR9IiccFwxSpfp0vtIZlkFclEqERemxfnSdZEMR9VqqEFQ==" - }, - "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "normalize-url": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", - "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", - "dev": true, - "requires": { - "prepend-http": "^2.0.0", - "query-string": "^5.0.1", - "sort-keys": "^2.0.0" - }, - "dependencies": { - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", - "dev": true - } - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "nyc": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-12.0.2.tgz", - "integrity": "sha1-ikpO1pCWbBHsWH/4fuoMEsl0upk=", - "dev": true, - "requires": { - "archy": "^1.0.0", - "arrify": "^1.0.1", - "caching-transform": "^1.0.0", - "convert-source-map": "^1.5.1", - "debug-log": "^1.0.1", - "default-require-extensions": "^1.0.0", - "find-cache-dir": "^0.1.1", - "find-up": "^2.1.0", - "foreground-child": "^1.5.3", - "glob": "^7.0.6", - "istanbul-lib-coverage": "^1.2.0", - "istanbul-lib-hook": "^1.1.0", - "istanbul-lib-instrument": "^2.1.0", - "istanbul-lib-report": "^1.1.3", - "istanbul-lib-source-maps": "^1.2.5", - "istanbul-reports": "^1.4.1", - "md5-hex": "^1.2.0", - "merge-source-map": "^1.1.0", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.0", - "resolve-from": "^2.0.0", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.1", - "spawn-wrap": "^1.4.2", - "test-exclude": "^4.2.0", - "yargs": "11.1.0", - "yargs-parser": "^8.0.0" - }, - "dependencies": { - "align-text": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2", - "longest": "^1.0.1", - "repeat-string": "^1.5.2" - } - }, - "amdefine": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "append-transform": { - "version": "0.4.0", - "bundled": true, - "dev": true, - "requires": { - "default-require-extensions": "^1.0.0" - } - }, - "archy": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "arr-diff": { - "version": "4.0.0", - "bundled": true, - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "bundled": true, - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "bundled": true, - "dev": true - }, - "arrify": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "async": { - "version": "1.5.2", - "bundled": true, - "dev": true - }, - "atob": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "base": { - "version": "0.11.2", - "bundled": true, - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "builtin-modules": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "cache-base": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "caching-transform": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "md5-hex": "^1.2.0", - "mkdirp": "^0.5.1", - "write-file-atomic": "^1.1.4" - } - }, - "camelcase": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true - }, - "center-align": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" - } - }, - "class-utils": { - "version": "0.3.6", - "bundled": true, - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "cliui": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "commondir": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "component-emitter": { - "version": "1.2.1", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "convert-source-map": { - "version": "1.5.1", - "bundled": true, - "dev": true - }, - "copy-descriptor": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "cross-spawn": { - "version": "4.0.2", - "bundled": true, - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" - } - }, - "debug": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "debug-log": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "decamelize": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "bundled": true, - "dev": true - }, - "default-require-extensions": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "strip-bom": "^2.0.0" - } - }, - "define-property": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "error-ex": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "execa": { - "version": "0.7.0", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "bundled": true, - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "bundled": true, - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "extend-shallow": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "fill-range": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "find-cache-dir": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "requires": { - "commondir": "^1.0.1", - "mkdirp": "^0.5.1", - "pkg-dir": "^1.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "for-in": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "foreground-child": { - "version": "1.5.6", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" - } - }, - "fragment-cache": { - "version": "0.2.1", - "bundled": true, - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "get-caller-file": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "get-value": { - "version": "2.0.6", - "bundled": true, - "dev": true - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "handlebars": { - "version": "4.0.11", - "bundled": true, - "dev": true, - "requires": { - "async": "^1.4.0", - "optimist": "^0.6.1", - "source-map": "^0.4.4", - "uglify-js": "^2.6" - }, - "dependencies": { - "source-map": { - "version": "0.4.4", - "bundled": true, - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "has-value": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hosted-git-info": { - "version": "2.6.0", - "bundled": true, - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "bundled": true, - "dev": true - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "invert-kv": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-arrayish": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "is-buffer": { - "version": "1.1.6", - "bundled": true, - "dev": true - }, - "is-builtin-module": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "bundled": true, - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "is-number": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-odd": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "bundled": true, - "dev": true - } - } - }, - "is-plain-object": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-stream": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "is-utf8": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "isexe": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, - "istanbul-lib-coverage": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "istanbul-lib-hook": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "append-transform": "^0.4.0" - } - }, - "istanbul-lib-report": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "requires": { - "istanbul-lib-coverage": "^1.1.2", - "mkdirp": "^0.5.1", - "path-parse": "^1.0.5", - "supports-color": "^3.1.2" - }, - "dependencies": { - "has-flag": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "bundled": true, - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "requires": { - "debug": "^3.1.0", - "istanbul-lib-coverage": "^1.2.0", - "mkdirp": "^0.5.1", - "rimraf": "^2.6.1", - "source-map": "^0.5.3" - } - }, - "istanbul-reports": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "requires": { - "handlebars": "^4.0.3" - } - }, - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "lazy-cache": { - "version": "1.0.4", - "bundled": true, - "dev": true, - "optional": true - }, - "lcid": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "dependencies": { - "path-exists": { - "version": "3.0.0", - "bundled": true, - "dev": true - } - } - }, - "longest": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "lru-cache": { - "version": "4.1.3", - "bundled": true, - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "map-cache": { - "version": "0.2.2", - "bundled": true, - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "md5-hex": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "md5-o-matic": "^0.1.1" - } - }, - "md5-o-matic": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "mem": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "merge-source-map": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } - } - }, - "micromatch": { - "version": "3.1.10", - "bundled": true, - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "mimic-fn": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "mixin-deep": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "nanomatch": { - "version": "1.2.9", - "bundled": true, - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-odd": "^2.0.0", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "normalize-package-data": { - "version": "2.4.0", - "bundled": true, - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "object-visit": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.pick": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optimist": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "os-locale": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - } - }, - "p-finally": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "p-limit": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "parse-json": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "pascalcase": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "path-exists": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "path-key": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "path-parse": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "path-type": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "bundled": true, - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "bundled": true, - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "pkg-dir": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "find-up": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - } - } - }, - "posix-character-classes": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "read-pkg": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - } - } - }, - "regex-not": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "repeat-element": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "bundled": true, - "dev": true - }, - "require-directory": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "resolve-from": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "ret": { - "version": "0.1.15", - "bundled": true, - "dev": true - }, - "right-align": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-regex": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "set-value": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "shebang-command": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "slide": { - "version": "1.1.6", - "bundled": true, - "dev": true - }, - "snapdragon": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.2.0" - } - }, - "source-map": { - "version": "0.5.7", - "bundled": true, - "dev": true - }, - "source-map-resolve": { - "version": "0.5.2", - "bundled": true, - "dev": true, - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "bundled": true, - "dev": true - }, - "spawn-wrap": { - "version": "1.4.2", - "bundled": true, - "dev": true, - "requires": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.2", - "which": "^1.3.0" - } - }, - "spdx-correct": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.1.0", - "bundled": true, - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "split-string": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "static-extend": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "string-width": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-eof": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "test-exclude": { - "version": "4.2.1", - "bundled": true, - "dev": true, - "requires": { - "arrify": "^1.0.1", - "micromatch": "^3.1.8", - "object-assign": "^4.1.0", - "read-pkg-up": "^1.0.1", - "require-main-filename": "^1.0.1" - } - }, - "to-object-path": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "to-regex": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "uglify-js": { - "version": "2.8.29", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" - }, - "dependencies": { - "yargs": { - "version": "3.10.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - } - } - } - }, - "uglify-to-browserify": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "union-value": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "unset-value": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "bundled": true, - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "bundled": true, - "dev": true - } - } - }, - "urix": { - "version": "0.1.0", - "bundled": true, - "dev": true - }, - "use": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "validate-npm-package-license": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "window-size": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "wordwrap": { - "version": "0.0.3", - "bundled": true, - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "write-file-atomic": { - "version": "1.3.4", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "slide": "^1.1.5" - } - }, - "y18n": { - "version": "3.2.1", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "2.1.2", - "bundled": true, - "dev": true - }, - "yargs": { - "version": "11.1.0", - "bundled": true, - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "bundled": true, - "dev": true - }, - "cliui": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "yargs-parser": { - "version": "9.0.2", - "bundled": true, - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } - } - } - }, - "yargs-parser": { - "version": "8.1.0", - "bundled": true, - "dev": true, - "requires": { - "camelcase": "^4.1.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "bundled": true, - "dev": true - } - } - } - } - }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", - "dev": true - }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - } - }, - "observable-to-promise": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/observable-to-promise/-/observable-to-promise-0.5.0.tgz", - "integrity": "sha1-yCjw8NxH6fhq+KSXfF1VB2znqR8=", - "dev": true, - "requires": { - "is-observable": "^0.2.0", - "symbol-observable": "^1.0.4" - }, - "dependencies": { - "is-observable": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-0.2.0.tgz", - "integrity": "sha1-s2ExHYPG5dcmyr9eJQsCNxBvWuI=", - "dev": true, - "requires": { - "symbol-observable": "^0.2.2" - }, - "dependencies": { - "symbol-observable": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-0.2.4.tgz", - "integrity": "sha1-lag9smGG1q9+ehjb2XYKL4bQj0A=", - "dev": true - } - } - } - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - } - }, - "option-chain": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/option-chain/-/option-chain-1.0.0.tgz", - "integrity": "sha1-k41zvU4Xg/lI00AjZEraI2aeMPI=", - "dev": true - }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - }, - "dependencies": { - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - } - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", - "dev": true, - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "p-cancelable": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", - "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-is-promise": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", - "dev": true - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-timeout": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", - "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", - "dev": true, - "requires": { - "p-finally": "^1.0.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "package-hash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-2.0.0.tgz", - "integrity": "sha1-eK4ybIngWk2BO2hgGXevBcANKg0=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "lodash.flattendeep": "^4.4.0", - "md5-hex": "^2.0.0", - "release-zalgo": "^1.0.0" - } - }, - "package-json": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", - "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", - "dev": true, - "requires": { - "got": "^6.7.1", - "registry-auth-token": "^3.0.1", - "registry-url": "^3.0.3", - "semver": "^5.1.0" - }, - "dependencies": { - "got": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", - "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", - "dev": true, - "requires": { - "create-error-class": "^3.0.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-redirect": "^1.0.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "lowercase-keys": "^1.0.0", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "unzip-response": "^2.0.1", - "url-parse-lax": "^1.0.0" - } - } - } - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "parse-ms": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-0.1.2.tgz", - "integrity": "sha1-3T+iXtbC78e93hKtm0bBY6opIk4=", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", - "dev": true, - "requires": { - "isarray": "0.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - } - } - }, - "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, - "requires": { - "pify": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - }, - "pinkie": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-1.0.0.tgz", - "integrity": "sha1-Wkfyi6EBXQIBvae/DzWOR77Ix+Q=", - "dev": true - }, - "pinkie-promise": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-1.0.0.tgz", - "integrity": "sha1-0dpn9UglY7t89X8oauKCLs+/NnA=", - "dev": true, - "requires": { - "pinkie": "^1.0.0" - } - }, - "pkg-conf": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", - "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "load-json-file": "^4.0.0" - }, - "dependencies": { - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - } - } - }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - }, - "plur": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/plur/-/plur-2.1.2.tgz", - "integrity": "sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=", - "dev": true, - "requires": { - "irregular-plurals": "^1.0.0" - } - }, - "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", - "dev": true - }, - "postcss": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", - "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "source-map": "^0.6.1", - "supports-color": "^5.4.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "power-assert": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.6.0.tgz", - "integrity": "sha512-nDb6a+p2C7Wj8Y2zmFtLpuv+xobXz4+bzT5s7dr0nn71tLozn7nRMQqzwbefzwZN5qOm0N7Cxhw4kXP75xboKA==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "empower": "^1.3.0", - "power-assert-formatter": "^1.4.1", - "universal-deep-strict-equal": "^1.2.1", - "xtend": "^4.0.0" - } - }, - "power-assert-context-formatter": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-formatter/-/power-assert-context-formatter-1.2.0.tgz", - "integrity": "sha512-HLNEW8Bin+BFCpk/zbyKwkEu9W8/zThIStxGo7weYcFkKgMuGCHUJhvJeBGXDZf0Qm2xis4pbnnciGZiX0EpSg==", - "dev": true, - "requires": { - "core-js": "^2.0.0", - "power-assert-context-traversal": "^1.2.0" - } - }, - "power-assert-context-reducer-ast": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.2.0.tgz", - "integrity": "sha512-EgOxmZ/Lb7tw4EwSKX7ZnfC0P/qRZFEG28dx/690qvhmOJ6hgThYFm5TUWANDLK5NiNKlPBi5WekVGd2+5wPrw==", - "dev": true, - "requires": { - "acorn": "^5.0.0", - "acorn-es7-plugin": "^1.0.12", - "core-js": "^2.0.0", - "espurify": "^1.6.0", - "estraverse": "^4.2.0" - } - }, - "power-assert-context-traversal": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-traversal/-/power-assert-context-traversal-1.2.0.tgz", - "integrity": "sha512-NFoHU6g2umNajiP2l4qb0BRWD773Aw9uWdWYH9EQsVwIZnog5bd2YYLFCVvaxWpwNzWeEfZIon2xtyc63026pQ==", - "dev": true, - "requires": { - "core-js": "^2.0.0", - "estraverse": "^4.1.0" - } - }, - "power-assert-formatter": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/power-assert-formatter/-/power-assert-formatter-1.4.1.tgz", - "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", - "dev": true, - "requires": { - "core-js": "^2.0.0", - "power-assert-context-formatter": "^1.0.7", - "power-assert-context-reducer-ast": "^1.0.7", - "power-assert-renderer-assertion": "^1.0.7", - "power-assert-renderer-comparison": "^1.0.7", - "power-assert-renderer-diagram": "^1.0.7", - "power-assert-renderer-file": "^1.0.7" - } - }, - "power-assert-renderer-assertion": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.2.0.tgz", - "integrity": "sha512-3F7Q1ZLmV2ZCQv7aV7NJLNK9G7QsostrhOU7U0RhEQS/0vhEqrRg2jEJl1jtUL4ZyL2dXUlaaqrmPv5r9kRvIg==", - "dev": true, - "requires": { - "power-assert-renderer-base": "^1.1.1", - "power-assert-util-string-width": "^1.2.0" - } - }, - "power-assert-renderer-base": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz", - "integrity": "sha1-lqZQxv0F7hvB9mtUrWFELIs/Y+s=", - "dev": true - }, - "power-assert-renderer-comparison": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.2.0.tgz", - "integrity": "sha512-7c3RKPDBKK4E3JqdPtYRE9cM8AyX4LC4yfTvvTYyx8zSqmT5kJnXwzR0yWQLOavACllZfwrAGQzFiXPc5sWa+g==", - "dev": true, - "requires": { - "core-js": "^2.0.0", - "diff-match-patch": "^1.0.0", - "power-assert-renderer-base": "^1.1.1", - "stringifier": "^1.3.0", - "type-name": "^2.0.1" - } - }, - "power-assert-renderer-diagram": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.2.0.tgz", - "integrity": "sha512-JZ6PC+DJPQqfU6dwSmpcoD7gNnb/5U77bU5KgNwPPa+i1Pxiz6UuDeM3EUBlhZ1HvH9tMjI60anqVyi5l2oNdg==", - "dev": true, - "requires": { - "core-js": "^2.0.0", - "power-assert-renderer-base": "^1.1.1", - "power-assert-util-string-width": "^1.2.0", - "stringifier": "^1.3.0" - } - }, - "power-assert-renderer-file": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-file/-/power-assert-renderer-file-1.2.0.tgz", - "integrity": "sha512-/oaVrRbeOtGoyyd7e4IdLP/jIIUFJdqJtsYzP9/88R39CMnfF/S/rUc8ZQalENfUfQ/wQHu+XZYRMaCEZmEesg==", - "dev": true, - "requires": { - "power-assert-renderer-base": "^1.1.1" - } - }, - "power-assert-util-string-width": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-util-string-width/-/power-assert-util-string-width-1.2.0.tgz", - "integrity": "sha512-lX90G0igAW0iyORTILZ/QjZWsa1MZ6VVY3L0K86e2eKun3S4LKPH4xZIl8fdeMYLfOjkaszbNSzf1uugLeAm2A==", - "dev": true, - "requires": { - "eastasianwidth": "^0.2.0" - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", - "dev": true - }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, - "prettier": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.0.tgz", - "integrity": "sha512-KtQ2EGaUwf2EyDfp1fxyEb0PqGKakVm0WyXwDt6u+cAoxbO2Z2CwKvOe3+b4+F2IlO9lYHi1kqFuRM70ddBnow==", - "dev": true - }, - "pretty-ms": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-3.2.0.tgz", - "integrity": "sha512-ZypexbfVUGTFxb0v+m1bUyy92DHe5SyYlnyY0msyms5zd3RwyvNgyxZZsXXgoyzlxjx5MiqtXUdhUfvQbe0A2Q==", - "dev": true, - "requires": { - "parse-ms": "^1.0.0" - }, - "dependencies": { - "parse-ms": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", - "integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=", - "dev": true - } - } - }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "progress": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", - "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", - "dev": true - }, - "proxyquire": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-2.0.1.tgz", - "integrity": "sha512-fQr3VQrbdzHrdaDn3XuisVoJlJNDJizHAvUXw9IuXRR8BpV2x0N7LsCxrpJkeKfPbNjiNU/V5vc008cI0TmzzQ==", - "dev": true, - "requires": { - "fill-keys": "^1.0.2", - "module-not-found-error": "^1.0.0", - "resolve": "~1.5.0" - }, - "dependencies": { - "resolve": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", - "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", - "dev": true, - "requires": { - "path-parse": "^1.0.5" - } - } - } - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "query-string": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", - "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", - "dev": true, - "requires": { - "decode-uri-component": "^0.2.0", - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - } - }, - "quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", - "dev": true - }, - "randomatic": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", - "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", - "dev": true, - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } - }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, - "requires": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - } - }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "minimatch": "^3.0.2", - "readable-stream": "^2.0.2", - "set-immediate-shim": "^1.0.1" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "dev": true, - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - }, - "dependencies": { - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - } - } - }, - "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", - "dev": true - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, - "regexp.prototype.flags": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", - "integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==", - "dev": true, - "requires": { - "define-properties": "^1.1.2" - } - }, - "regexpp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.0.tgz", - "integrity": "sha512-g2FAVtR8Uh8GO1Nv5wpxW7VFVwHcCEr4wyA8/MHiRkO8uHoR5ntAA8Uq3P1vvMTX/BeQiRVSpDGLd+Wn5HNOTA==", - "dev": true - }, - "regexpu-core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", - "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", - "dev": true, - "requires": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" - } - }, - "registry-auth-token": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", - "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", - "dev": true, - "requires": { - "rc": "^1.1.6", - "safe-buffer": "^5.0.1" - } - }, - "registry-url": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", - "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", - "dev": true, - "requires": { - "rc": "^1.0.1" - } - }, - "regjsgen": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", - "dev": true - }, - "regjsparser": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - } - }, - "release-zalgo": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", - "dev": true, - "requires": { - "es6-error": "^4.0.1" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.87.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", - "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.6.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.1", - "forever-agent": "~0.6.1", - "form-data": "~2.3.1", - "har-validator": "~5.0.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.17", - "oauth-sign": "~0.8.2", - "performance-now": "^2.1.0", - "qs": "~6.5.1", - "safe-buffer": "^5.1.1", - "tough-cookie": "~2.3.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.1.0" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "require-precompiled": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/require-precompiled/-/require-precompiled-0.1.0.tgz", - "integrity": "sha1-WhtS63Dr7UPrmC6XTIWrWVceVvo=", - "dev": true - }, - "require-uncached": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", - "dev": true - } - } - }, - "requizzle": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", - "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", - "dev": true, - "requires": { - "underscore": "~1.6.0" - }, - "dependencies": { - "underscore": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", - "dev": true - } - } - }, - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - }, - "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "requires": { - "resolve-from": "^3.0.0" - } - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - }, - "responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", - "dev": true, - "requires": { - "lowercase-keys": "^1.0.0" - } - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "retry-axios": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/retry-axios/-/retry-axios-0.3.2.tgz", - "integrity": "sha512-jp4YlI0qyDFfXiXGhkCOliBN1G7fRH03Nqy8YdShzGqbY5/9S2x/IR6C88ls2DFkbWuL3ASkP7QD3pVrNpPgwQ==" - }, - "retry-request": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz", - "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==", - "requires": { - "through2": "^2.0.0" - } - }, - "right-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.1" - } - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "^7.0.5" - } - }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } - }, - "rxjs": { - "version": "5.5.11", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.11.tgz", - "integrity": "sha512-3bjO7UwWfA2CV7lmwYMBzj4fQ6Cq+ftHc2MvUe+WMS7wcdJ1LosDWmdjPQanYp2dBRj572p7PeU81JUxHKOcBA==", - "dev": true, - "requires": { - "symbol-observable": "1.0.1" - }, - "dependencies": { - "symbol-observable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", - "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", - "dev": true - } - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "samsam": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", - "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", - "dev": true - }, - "sanitize-html": { - "version": "1.18.4", - "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.18.4.tgz", - "integrity": "sha512-hjyDYCYrQuhnEjq+5lenLlIfdPBtnZ7z0DkQOC8YGxvkuOInH+1SrkNTj30t4f2/SSv9c5kLniB+uCIpBvYuew==", - "dev": true, - "requires": { - "chalk": "^2.3.0", - "htmlparser2": "^3.9.0", - "lodash.clonedeep": "^4.5.0", - "lodash.escaperegexp": "^4.1.2", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.mergewith": "^4.6.0", - "postcss": "^6.0.14", - "srcset": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", - "dev": true - }, - "semver-diff": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", - "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", - "dev": true, - "requires": { - "semver": "^5.0.3" - } - }, - "serialize-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", - "integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=", - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "sinon": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-6.0.1.tgz", - "integrity": "sha512-rfszhNcfamK2+ofIPi9XqeH89pH7KGDcAtM+F9CsjHXOK3jzWG99vyhyD2V+r7s4IipmWcWUFYq4ftZ9/Eu2Wg==", - "dev": true, - "requires": { - "@sinonjs/formatio": "^2.0.0", - "diff": "^3.5.0", - "lodash.get": "^4.4.2", - "lolex": "^2.4.2", - "nise": "^1.3.3", - "supports-color": "^5.4.0", - "type-detect": "^4.0.8" - } - }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", - "dev": true - }, - "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0" - } - }, - "slide": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", - "dev": true - }, - "sort-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", - "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", - "dev": true, - "requires": { - "is-plain-obj": "^1.0.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-support": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz", - "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "spdx-correct": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", - "dev": true - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "srcset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/srcset/-/srcset-1.0.0.tgz", - "integrity": "sha1-pWad4StC87HV6D7QPHEEb8SPQe8=", - "dev": true, - "requires": { - "array-uniq": "^1.0.2", - "number-is-nan": "^1.0.0" - } - }, - "sshpk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stack-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.1.tgz", - "integrity": "sha1-1PM6tU6OOHeLDKXP07OvsS22hiA=", - "dev": true - }, - "stream-events": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.4.tgz", - "integrity": "sha512-D243NJaYs/xBN2QnoiMDY7IesJFIK7gEhnvAYqJa5JvDdnh2dC4qDBwlCf0ohPpX2QRlA/4gnbnPd3rs3KxVcA==", - "requires": { - "stubs": "^3.0.0" - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" - }, - "strict-uri-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", - "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", - "dev": true - }, - "string": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/string/-/string-3.3.3.tgz", - "integrity": "sha1-XqIRzZLSKOGEKUmQpsyXs2anfLA=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "string.prototype.matchall": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-2.0.0.tgz", - "integrity": "sha512-WoZ+B2ypng1dp4iFLF2kmZlwwlE19gmjgKuhL1FJfDgCREWb3ye3SDVHSzLH6bxfnvYmkCxbzkmWcQZHA4P//Q==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.10.0", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "regexp.prototype.flags": "^1.2.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "stringifier": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/stringifier/-/stringifier-1.3.0.tgz", - "integrity": "sha1-3vGDQvaTPbDy2/yaoCF1tEjBeVk=", - "dev": true, - "requires": { - "core-js": "^2.0.0", - "traverse": "^0.6.6", - "type-name": "^2.0.1" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - } - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "strip-bom-buf": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz", - "integrity": "sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI=", - "dev": true, - "requires": { - "is-utf8": "^0.2.1" - } - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "dev": true, - "requires": { - "get-stdin": "^4.0.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "stubs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", - "integrity": "sha1-6NK6H6nJBXAwPAMLaQD31fiavls=" - }, - "superagent": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.2.tgz", - "integrity": "sha512-gVH4QfYHcY3P0f/BZzavLreHW3T1v7hG9B+hpMQotGQqurOvhv87GcMCd6LWySmBuf+BDR44TQd0aISjVHLeNQ==", - "dev": true, - "requires": { - "component-emitter": "^1.2.0", - "cookiejar": "^2.1.0", - "debug": "^3.1.0", - "extend": "^3.0.0", - "form-data": "^2.3.1", - "formidable": "^1.1.1", - "methods": "^1.1.1", - "mime": "^1.4.1", - "qs": "^6.5.1", - "readable-stream": "^2.0.5" - }, - "dependencies": { - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true - } - } - }, - "supertap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supertap/-/supertap-1.0.0.tgz", - "integrity": "sha512-HZJ3geIMPgVwKk2VsmO5YHqnnJYl6bV5A9JW2uzqV43WmpgliNEYbuvukfor7URpaqpxuw3CfZ3ONdVbZjCgIA==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "indent-string": "^3.2.0", - "js-yaml": "^3.10.0", - "serialize-error": "^2.1.0", - "strip-ansi": "^4.0.0" - } - }, - "supertest": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/supertest/-/supertest-3.1.0.tgz", - "integrity": "sha512-O44AMnmJqx294uJQjfUmEyYOg7d9mylNFsMw/Wkz4evKd1njyPrtCN+U6ZIC7sKtfEVQhfTqFFijlXx8KP/Czw==", - "dev": true, - "requires": { - "methods": "~1.1.2", - "superagent": "3.8.2" - } - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - }, - "dependencies": { - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - } - } - }, - "symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", - "dev": true - }, - "table": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", - "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", - "dev": true, - "requires": { - "ajv": "^6.0.1", - "ajv-keywords": "^3.0.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" - }, - "dependencies": { - "ajv": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", - "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.1" - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - } - } - }, - "taffydb": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", - "dev": true - }, - "term-size": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "dev": true, - "requires": { - "execa": "^0.7.0" - } - }, - "text-encoding": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", - "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", - "dev": true - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "requires": { - "readable-stream": "^2.1.5", - "xtend": "~4.0.1" - } - }, - "time-zone": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", - "integrity": "sha1-mcW/VZWJZq9tBtg73zgA3IL67F0=", - "dev": true - }, - "timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", - "dev": true - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - }, - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", - "dev": true - }, - "tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", - "requires": { - "punycode": "^1.4.1" - } - }, - "traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=", - "dev": true - }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", - "dev": true - }, - "trim-off-newlines": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", - "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", - "dev": true - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true - }, - "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", - "dev": true - }, - "tslint": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.11.0.tgz", - "integrity": "sha1-mPMMAurjzecAYgHkwzywi0hYHu0=", - "dev": true, - "requires": { - "babel-code-frame": "^6.22.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^3.2.0", - "glob": "^7.1.1", - "js-yaml": "^3.7.0", - "minimatch": "^3.0.4", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.8.0", - "tsutils": "^2.27.2" - }, - "dependencies": { - "resolve": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", - "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", - "dev": true, - "requires": { - "path-parse": "^1.0.5" - } - } - } - }, - "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "optional": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "type-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", - "integrity": "sha1-7+fUEj2KxSr/9/QMfk3sUmYAj7Q=", - "dev": true - }, - "typescript": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.1.tgz", - "integrity": "sha512-zQIMOmC+372pC/CCVLqnQ0zSBiY7HHodU7mpQdjiZddek4GMj31I3dUJ7gAs9o65X7mnRma6OokOkc6f9jjfBg==", - "dev": true - }, - "uglify-js": { - "version": "2.8.29", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", - "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", - "dev": true, - "optional": true, - "requires": { - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" - }, - "dependencies": { - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "dev": true, - "optional": true - }, - "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "optional": true, - "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - } - } - } - }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true, - "optional": true - }, - "uid2": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", - "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=", - "dev": true - }, - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", - "dev": true - }, - "underscore-contrib": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz", - "integrity": "sha1-ZltmwkeD+PorGMn4y7Dix9SMJsc=", - "dev": true, - "requires": { - "underscore": "1.6.0" - }, - "dependencies": { - "underscore": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", - "dev": true - } - } - }, - "unique-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", - "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", - "dev": true, - "requires": { - "crypto-random-string": "^1.0.0" - } - }, - "unique-temp-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-temp-dir/-/unique-temp-dir-1.0.0.tgz", - "integrity": "sha1-bc6VsmgcoAPuv7MEpBX5y6vMU4U=", - "dev": true, - "requires": { - "mkdirp": "^0.5.1", - "os-tmpdir": "^1.0.1", - "uid2": "0.0.3" - } - }, - "universal-deep-strict-equal": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz", - "integrity": "sha1-DaSsL3PP95JMgfpN4BjKViyisKc=", - "dev": true, - "requires": { - "array-filter": "^1.0.0", - "indexof": "0.0.1", - "object-keys": "^1.0.0" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - }, - "unzip-response": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", - "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", - "dev": true - }, - "update-notifier": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", - "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", - "dev": true, - "requires": { - "boxen": "^1.2.1", - "chalk": "^2.0.1", - "configstore": "^3.0.0", - "import-lazy": "^2.1.0", - "is-ci": "^1.0.10", - "is-installed-globally": "^0.1.0", - "is-npm": "^1.0.0", - "latest-version": "^3.0.0", - "semver-diff": "^2.0.0", - "xdg-basedir": "^3.0.0" - } - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } - } - }, - "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", - "dev": true, - "requires": { - "prepend-http": "^1.0.1" - } - }, - "url-to-options": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", - "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", - "dev": true - }, - "urlgrey": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz", - "integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "well-known-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-1.0.0.tgz", - "integrity": "sha1-c8eK6Bp3Jqj6WY4ogIAcixYiVRg=", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "widest-line": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz", - "integrity": "sha1-AUKk6KJD+IgsAjOqDgKBqnYVInM=", - "dev": true, - "requires": { - "string-width": "^2.1.1" - } - }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true, - "optional": true - }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - } - }, - "write-file-atomic": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, - "write-json-file": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz", - "integrity": "sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=", - "dev": true, - "requires": { - "detect-indent": "^5.0.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "pify": "^3.0.0", - "sort-keys": "^2.0.0", - "write-file-atomic": "^2.0.0" - }, - "dependencies": { - "detect-indent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", - "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=", - "dev": true - } - } - }, - "write-pkg": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-3.2.0.tgz", - "integrity": "sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw==", - "dev": true, - "requires": { - "sort-keys": "^2.0.0", - "write-json-file": "^2.2.0" - } - }, - "xdg-basedir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", - "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", - "dev": true - }, - "xmlcreate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", - "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, - "yargs": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.0.0.tgz", - "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "yargs-parser": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", - "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } - } - } - }, - "yargs-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", - "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - } - } - } - } -} From e1fd99145722e83f6ca6255bd9734455f343d89f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 9 Aug 2018 09:51:16 -0700 Subject: [PATCH 131/513] chore: add better types (#92) --- packages/google-cloud-translate/.nycrc | 3 +- packages/google-cloud-translate/package.json | 2 + packages/google-cloud-translate/src/index.ts | 271 +++++++++++------- .../system-test/translate.ts | 24 +- packages/google-cloud-translate/test/index.ts | 164 ++++++----- packages/google-cloud-translate/tsconfig.json | 1 - 6 files changed, 273 insertions(+), 192 deletions(-) diff --git a/packages/google-cloud-translate/.nycrc b/packages/google-cloud-translate/.nycrc index a1a8e6920ce..feb032400d4 100644 --- a/packages/google-cloud-translate/.nycrc +++ b/packages/google-cloud-translate/.nycrc @@ -3,7 +3,8 @@ "exclude": [ "src/*{/*,/**/*}.js", "src/*/v*/*.js", - "test/**/*.js" + "test/**/*.js", + "build/test" ], "watermarks": { "branches": [ diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 925d0d95f7b..e09f2e8c7b2 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -76,6 +76,8 @@ "@types/extend": "^3.0.0", "@types/is": "0.0.20", "@types/mocha": "^5.2.4", + "@types/node": "^10.5.7", + "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", "codecov": "^3.0.2", "eslint": "^5.0.0", diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 79c1230cd7a..8311fb7bd59 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -19,14 +19,103 @@ import * as arrify from 'arrify'; import {Service, util} from '@google-cloud/common'; import {promisifyAll} from '@google-cloud/promisify'; +import {GoogleAuthOptions} from 'google-auth-library'; import * as extend from 'extend'; import * as is from 'is'; -import * as isHtml from 'is-html'; +const isHtml = require('is-html'); import {DecorateRequestOptions, BodyResponseCallback} from '@google-cloud/common/build/src/util'; import * as r from 'request'; const PKG = require('../../package.json'); +/** + * Translate request options. + * + * @typedef {object} TranslateRequest + * @property {string} [format] Set the text's format as `html` or `text`. + * If not provided, we will try to auto-detect if the text given is HTML. + * If not, we set the format as `text`. + * @property {string} [from] The ISO 639-1 language code the source input + * is written in. + * @property {string} [model] Set the model type requested for this + * translation. Please refer to the upstream documentation for possible + * values. + * @property {string} to The ISO 639-1 language code to translate the + * input to. + */ +export interface TranslateRequest { + format?: string; + from?: string; + model?: string; + to?: string; +} + +/** + * @callback TranslateCallback + * @param {?Error} err Request error, if any. + * @param {object|object[]} translations If a single string input was given, a + * single translation is given. Otherwise, it is an array of translations. + * @param {object} apiResponse The full API response. + */ +export interface TranslateCallback { + (err: Error|null, translations?: T|null, apiResponse?: r.Response): void; +} + +/** + * @typedef {object} DetectResult + * @property {string} 0.language The language code matched from the input. + * @property {number} [0.confidence] A float 0 - 1. The higher the number, the + * higher the confidence in language detection. Note, this is not always + * returned from the API. + * @property {object} 1 The full API response. + */ +export interface DetectResult { + language: string; + confidence: number; + input: string; +} + +/** + * @callback DetectCallback + * @param {?Error} err Request error, if any. + * @param {object|object[]} results The detection results. + * @param {string} results.language The language code matched from the input. + * @param {number} [results.confidence] A float 0 - 1. The higher the number, the + * higher the confidence in language detection. Note, this is not always + * returned from the API. + * @param {object} apiResponse The full API response. + */ +export interface DetectCallback { + (err: Error|null, results?: T|null, apiResponse?: r.Response): void; +} + +/** + * @typedef {object} LanguageResult + * @property {string} code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * language code. + * @property {string} name The language name. This can be translated into your + * preferred language with the `target` option. + */ +export interface LanguageResult { + code: string; + name: string; +} + +/** + * @callback GetLanguagesCallback + * @param {?Error} err Request error, if any. + * @param {object[]} results The languages supported by the API. + * @param {string} results.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * language code. + * @param {string} results.name The language name. This can be translated into your + * preferred language with the `target` option. + * @param {object} apiResponse The full API response. + */ +export interface GetLanguagesCallback { + (err: Error|null, results?: LanguageResult[]|null, + apiResponse?: r.Response): void; +} + /** * @typedef {object} ClientConfig * @property {string} [projectId] The project ID from the Google Developer's @@ -55,6 +144,11 @@ const PKG = require('../../package.json'); * @property {Constructor} [promise] Custom promise module to use instead of * native Promises. */ +export interface TranslateConfig extends GoogleAuthOptions { + key?: string; + autoRetry?: boolean; + maxRetries?: number; +} /** * With [Google Translate](https://cloud.google.com/translate), you can @@ -83,10 +177,9 @@ const PKG = require('../../package.json'); * Full quickstart example: */ export class Translate extends Service { - options; + options: TranslateConfig; key?: string; - constructor(options?) { - options = options || {}; + constructor(options?: TranslateConfig) { let baseUrl = 'https://translation.googleapis.com/language/translate/v2'; if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { @@ -101,32 +194,12 @@ export class Translate extends Service { }; super(config, options); - - if (options.key) { - this.options = options; - this.key = options.key; + this.options = options || {}; + if (this.options.key) { + this.key = this.options.key; } } - /** - * @typedef {array} DetectResponse - * @property {object|object[]} 0 The detection results. - * @property {string} 0.language The language code matched from the input. - * @property {number} [0.confidence] A float 0 - 1. The higher the number, the - * higher the confidence in language detection. Note, this is not always - * returned from the API. - * @property {object} 1 The full API response. - */ - /** - * @callback DetectCallback - * @param {?Error} err Request error, if any. - * @param {object|object[]} results The detection results. - * @param {string} results.language The language code matched from the input. - * @param {number} [results.confidence] A float 0 - 1. The higher the number, the - * higher the confidence in language detection. Note, this is not always - * returned from the API. - * @param {object} apiResponse The full API response. - */ /** * Detect the language used in a string or multiple strings. * @@ -190,10 +263,14 @@ export class Translate extends Service { * region_tag:translate_detect_language * Here's a full example: */ - detect(input, callback) { + detect(input: string, callback: DetectCallback): void; + detect(input: string[], callback: DetectCallback): void; + detect( + input: string|string[], + callback: DetectCallback| + DetectCallback): void { const inputIsArray = Array.isArray(input); input = arrify(input); - this.request( { method: 'POST', @@ -204,48 +281,31 @@ export class Translate extends Service { }, (err, resp) => { if (err) { - callback(err, null, resp); + (callback as Function)(err, null, resp); return; } - let results = resp.data.detections.map((detection, index) => { - const result = extend({}, detection[0], { - input: input[index], - }); + let results = resp.data.detections.map( + (detection: Array<{}>, index: number) => { + const result = extend({}, detection[0], { + input: input[index], + }); - // Deprecated. - delete result.isReliable; + // Deprecated. + // tslint:disable-next-line no-any + delete (result as any).isReliable; - return result; - }); + return result; + }); if (input.length === 1 && !inputIsArray) { results = results[0]; } - callback(null, results, resp); + (callback as Function)(null, results, resp); }); } - /** - * @typedef {array} GetLanguagesResponse - * @property {object[]} 0 The languages supported by the API. - * @property {string} 0.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) - * language code. - * @property {string} 0.name The language name. This can be translated into your - * preferred language with the `target` option. - * @property {object} 1 The full API response. - */ - /** - * @callback GetLanguagesCallback - * @param {?Error} err Request error, if any. - * @param {object[]} results The languages supported by the API. - * @param {string} results.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) - * language code. - * @param {string} results.name The language name. This can be translated into your - * preferred language with the `target` option. - * @param {object} apiResponse The full API response. - */ /** * Get an array of all supported languages. * @@ -264,10 +324,17 @@ export class Translate extends Service { * region_tag:translate_list_language_names * Gets the language names in a language other than English: */ - getLanguages(target, callback?) { - if (is.fn(target)) { - callback = target; + getLanguages(callback: GetLanguagesCallback): void; + getLanguages(target: string, callback: GetLanguagesCallback): void; + getLanguages( + targetOrCallback?: string|GetLanguagesCallback, + callback?: GetLanguagesCallback) { + let target: string; + if (is.fn(targetOrCallback)) { + callback = targetOrCallback as GetLanguagesCallback; target = 'en'; + } else { + target = targetOrCallback as string; } const reqOpts = { @@ -282,49 +349,23 @@ export class Translate extends Service { this.request(reqOpts, (err, resp) => { if (err) { - callback(err, null, resp); + callback!(err, null, resp); return; } - const languages = resp.data.languages.map(language => { - return { - code: language.language, - name: language.name, - }; - }); + const languages = resp.data.languages.map( + (language: {language: string, name: string}) => { + return { + code: language.language, + name: language.name, + }; + }); - callback(null, languages, resp); + callback!(null, languages, resp); }); } - /** - * Translate request options. - * - * @typedef {object} TranslateRequest - * @property {string} [format] Set the text's format as `html` or `text`. - * If not provided, we will try to auto-detect if the text given is HTML. - * If not, we set the format as `text`. - * @property {string} [from] The ISO 639-1 language code the source input - * is written in. - * @property {string} [model] Set the model type requested for this - * translation. Please refer to the upstream documentation for possible - * values. - * @property {string} to The ISO 639-1 language code to translate the - * input to. - */ - /** - * @typedef {array} TranslateResponse - * @property {object|object[]} 0 If a single string input was given, a single - * translation is given. Otherwise, it is an array of translations. - * @property {object} 1 The full API response. - */ - /** - * @callback TranslateCallback - * @param {?Error} err Request error, if any. - * @param {object|object[]} translations If a single string input was given, a - * single translation is given. Otherwise, it is an array of translations. - * @param {object} apiResponse The full API response. - */ + /** * Translate a string or multiple strings into another language. * @@ -400,11 +441,30 @@ export class Translate extends Service { * region_tag:translate_text_with_model * Translation using the premium model: */ - translate(input, options, callback) { - const inputIsArray = Array.isArray(input); - input = arrify(input); + translate( + input: string, options: TranslateRequest, + callback: TranslateCallback): void; + translate(input: string, to: string, callback: TranslateCallback): + void; + translate( + input: string[], options: TranslateRequest, + callback: TranslateCallback): void; + translate(input: string[], to: string, callback: TranslateCallback): + void; + translate( + inputs: string|string[], optionsOrTo: string|TranslateRequest, + callback: TranslateCallback|TranslateCallback) { + const inputIsArray = Array.isArray(inputs); + const input = arrify(inputs); + let options: TranslateRequest = {}; + if (typeof optionsOrTo === 'object') { + options = optionsOrTo as TranslateRequest; + } else if (typeof optionsOrTo === 'string') { + options = {to: optionsOrTo}; + } - const body: {[index: string]: string} = { + // tslint:disable-next-line no-any + const body: any = { q: input, format: options.format || (isHtml(input[0]) ? 'html' : 'text'), }; @@ -438,17 +498,18 @@ export class Translate extends Service { }, (err, resp) => { if (err) { - callback(err, null, resp); + (callback as Function)(err, null, resp); return; } - let translations = resp.data.translations.map(x => x.translatedText); + let translations = resp.data.translations.map( + (x: {translatedText: string}) => x.translatedText); if (body.q.length === 1 && !inputIsArray) { translations = translations[0]; } - callback(err, translations, resp); + (callback as Function)(err, translations, resp); }); } @@ -483,7 +544,7 @@ export class Translate extends Service { }, }); - util.makeRequest(reqOpts, this.options, callback!); + util.makeRequest(reqOpts, this.options!, callback!); } } diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index a3261fd6124..13eff01cb5e 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -41,8 +41,8 @@ describe('translate', () => { translate.detect(input, (err, results) => { assert.ifError(err); - assert.strictEqual(results[0].language, INPUT[0].expectedLanguage); - assert.strictEqual(results[1].language, INPUT[1].expectedLanguage); + assert.strictEqual(results![0].language, INPUT[0].expectedLanguage); + assert.strictEqual(results![1].language, INPUT[1].expectedLanguage); done(); }); }); @@ -60,7 +60,7 @@ describe('translate', () => { }, ]; - function removeSymbols(input) { + function removeSymbols(input: string) { // Remove the leading and trailing ! or ? symbols. The API has been known // to switch back and forth between returning "Cómo estás hoy" and // "¿Cómo estás hoy?", so let's just not depend on that. @@ -72,9 +72,9 @@ describe('translate', () => { translate.translate(input, 'es', (err, results) => { assert.ifError(err); - results = results.map(removeSymbols); - assert.strictEqual(results[0], INPUT[0].expectedTranslation); - assert.strictEqual(results[1], INPUT[1].expectedTranslation); + results = results!.map(removeSymbols); + assert.strictEqual(results![0], INPUT[0].expectedTranslation); + assert.strictEqual(results![1], INPUT[1].expectedTranslation); done(); }); }); @@ -89,9 +89,9 @@ describe('translate', () => { translate.translate(input, opts, (err, results) => { assert.ifError(err); - results = results.map(removeSymbols); - assert.strictEqual(results[0], INPUT[0].expectedTranslation); - assert.strictEqual(results[1], INPUT[1].expectedTranslation); + results = results!.map(removeSymbols); + assert.strictEqual(results![0], INPUT[0].expectedTranslation); + assert.strictEqual(results![1], INPUT[1].expectedTranslation); done(); }); }); @@ -107,7 +107,7 @@ describe('translate', () => { translate.translate(input, opts, (err, results) => { assert.ifError(err); - const translation = results.split(/<\/*body>/g)[1].trim(); + const translation = results!.split(/<\/*body>/g)[1].trim(); assert.strictEqual( removeSymbols(translation), INPUT[0].expectedTranslation); @@ -122,7 +122,7 @@ describe('translate', () => { translate.getLanguages((err, languages) => { assert.ifError(err); - const englishResult = languages.filter((language) => { + const englishResult = languages!.filter(language => { return language.code === 'en'; })[0]; @@ -139,7 +139,7 @@ describe('translate', () => { translate.getLanguages('es', (err, languages) => { assert.ifError(err); - const englishResult = languages.filter((language) => { + const englishResult = languages!.filter((language) => { return language.code === 'en'; })[0]; diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index caae77725a0..dbf50b9a1f5 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -21,13 +21,16 @@ import * as extend from 'extend'; import * as proxyquire from 'proxyquire'; import {util} from '@google-cloud/common'; import * as pfy from '@google-cloud/promisify'; +import * as orig from '../src'; +import * as r from 'request'; const pkgJson = require('../../package.json'); -let makeRequestOverride; +// tslint:disable-next-line no-any +let makeRequestOverride: any; let promisified = false; const fakePromisify = extend({}, pfy, { - promisifyAll(c) { + promisifyAll(c: Function) { if (c.name === 'Translate') { promisified = true; } @@ -54,8 +57,9 @@ describe('Translate', () => { }; // tslint:disable-next-line variable-name - let Translate; - let translate; + let Translate: typeof orig.Translate; + // tslint:disable-next-line no-any + let translate: any; before(() => { Translate = proxyquire('../src', { @@ -82,7 +86,8 @@ describe('Translate', () => { it('should inherit from Service', () => { assert(translate instanceof FakeService); - const calledWith = translate.calledWith_[0]; + // tslint:disable-next-line no-any + const calledWith = (translate as any).calledWith_[0]; const baseUrl = 'https://translation.googleapis.com/language/translate/v2'; @@ -116,7 +121,9 @@ describe('Translate', () => { describe('GOOGLE_CLOUD_TRANSLATE_ENDPOINT', () => { const CUSTOM_ENDPOINT = '...'; - let translate; + + // tslint:disable-next-line no-any + let translate: any; before(() => { process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT = CUSTOM_ENDPOINT; @@ -138,7 +145,8 @@ describe('Translate', () => { process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT = 'http://localhost:8080//'; - const translate = new Translate(OPTIONS); + // tslint:disable-next-line no-any + const translate: any = new Translate(OPTIONS); const baseUrl = translate.calledWith_[0].baseUrl; assert.strictEqual(baseUrl, expectedBaseUrl); @@ -150,7 +158,7 @@ describe('Translate', () => { const INPUT = 'input'; it('should make the correct API request', done => { - translate.request = reqOpts => { + translate.request = (reqOpts: r.OptionsWithUri) => { assert.strictEqual(reqOpts.uri, '/detect'); assert.strictEqual(reqOpts.method, 'POST'); assert.deepStrictEqual(reqOpts.json, {q: [INPUT]}); @@ -165,13 +173,13 @@ describe('Translate', () => { const apiResponse = {}; beforeEach(() => { - translate.request = (reqOpts, callback) => { + translate.request = (reqOpts: r.OptionsWithUri, callback: Function) => { callback(error, apiResponse); }; }); it('should execute callback with error & API resp', done => { - translate.detect(INPUT, (err, results, apiResponse_) => { + translate.detect(INPUT, (err: Error, results: {}, apiResponse_: {}) => { assert.strictEqual(err, error); assert.strictEqual(results, null); assert.strictEqual(apiResponse_, apiResponse); @@ -204,13 +212,13 @@ describe('Translate', () => { }; beforeEach(() => { - translate.request = (reqOpts, callback) => { + translate.request = (reqOpts: {}, callback: Function) => { callback(null, apiResponse); }; }); it('should execute callback with results & API response', done => { - translate.detect(INPUT, (err, results, apiResponse_) => { + translate.detect(INPUT, (err: Error, results: {}, apiResponse_: {}) => { assert.ifError(err); assert.deepStrictEqual(results, expectedResults); assert.strictEqual(apiResponse_, apiResponse); @@ -220,7 +228,7 @@ describe('Translate', () => { }); it('should execute callback with multiple results', done => { - translate.detect([INPUT, INPUT], (err, results) => { + translate.detect([INPUT, INPUT], (err: Error, results: {}) => { assert.ifError(err); assert.deepStrictEqual(results, [expectedResults]); done(); @@ -228,20 +236,21 @@ describe('Translate', () => { }); it('should return an array if input was an array', done => { - translate.detect([INPUT], (err, results, apiResponse_) => { - assert.ifError(err); - assert.deepStrictEqual(results, [expectedResults]); - assert.strictEqual(apiResponse_, apiResponse); - assert.deepStrictEqual(apiResponse_, originalApiResponse); - done(); - }); + translate.detect( + [INPUT], (err: Error, results: {}, apiResponse_: {}) => { + assert.ifError(err); + assert.deepStrictEqual(results, [expectedResults]); + assert.strictEqual(apiResponse_, apiResponse); + assert.deepStrictEqual(apiResponse_, originalApiResponse); + done(); + }); }); }); }); describe('getLanguages', () => { it('should make the correct API request', done => { - translate.request = reqOpts => { + translate.request = (reqOpts: r.OptionsWithUri) => { assert.strictEqual(reqOpts.uri, '/languages'); assert.deepStrictEqual(reqOpts.qs, { target: 'en', @@ -253,7 +262,7 @@ describe('Translate', () => { }); it('should make the correct API request with target', done => { - translate.request = reqOpts => { + translate.request = (reqOpts: r.OptionsWithUri) => { assert.strictEqual(reqOpts.uri, '/languages'); assert.deepStrictEqual(reqOpts.qs, { target: 'es', @@ -269,18 +278,19 @@ describe('Translate', () => { const apiResponse = {}; beforeEach(() => { - translate.request = (reqOpts, callback) => { + translate.request = (reqOpts: {}, callback: Function) => { callback(error, apiResponse); }; }); it('should exec callback with error & API response', done => { - translate.getLanguages((err, languages, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(languages, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); + translate.getLanguages( + (err: Error, languages: {}, apiResponse_: {}) => { + assert.strictEqual(err, error); + assert.strictEqual(languages, null); + assert.strictEqual(apiResponse_, apiResponse); + done(); + }); }); }); @@ -312,18 +322,19 @@ describe('Translate', () => { ]; beforeEach(() => { - translate.request = (reqOpts, callback) => { + translate.request = (reqOpts: {}, callback: Function) => { callback(null, apiResponse); }; }); it('should exec callback with languages', done => { - translate.getLanguages((err, languages, apiResponse_) => { - assert.ifError(err); - assert.deepStrictEqual(languages, expectedResults); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); + translate.getLanguages( + (err: Error, languages: {}, apiResponse_: {}) => { + assert.ifError(err); + assert.deepStrictEqual(languages, expectedResults); + assert.strictEqual(apiResponse_, apiResponse); + done(); + }); }); }); }); @@ -341,7 +352,7 @@ describe('Translate', () => { describe('options = target langauge', () => { it('should make the correct API request', done => { - translate.request = reqOpts => { + translate.request = (reqOpts: r.Options) => { assert.strictEqual(reqOpts.json.target, TARGET_LANG_CODE); done(); }; @@ -358,7 +369,7 @@ describe('Translate', () => { }); it('should make the correct API request', done => { - translate.request = reqOpts => { + translate.request = (reqOpts: r.Options) => { assert.strictEqual(reqOpts.json.source, SOURCE_LANG_CODE); assert.strictEqual(reqOpts.json.target, TARGET_LANG_CODE); done(); @@ -375,7 +386,7 @@ describe('Translate', () => { describe('options.format', () => { it('should default to text', done => { - translate.request = reqOpts => { + translate.request = (reqOpts: r.Options) => { assert.strictEqual(reqOpts.json.format, 'text'); done(); }; @@ -384,7 +395,7 @@ describe('Translate', () => { }); it('should recognize HTML', done => { - translate.request = reqOpts => { + translate.request = (reqOpts: r.Options) => { assert.strictEqual(reqOpts.json.format, 'html'); done(); }; @@ -397,7 +408,7 @@ describe('Translate', () => { format: 'custom format', }); - translate.request = reqOpts => { + translate.request = (reqOpts: r.Options) => { assert.strictEqual(reqOpts.json.format, options.format); done(); }; @@ -413,7 +424,7 @@ describe('Translate', () => { to: 'es', }; - translate.request = reqOpts => { + translate.request = (reqOpts: r.Options) => { assert.strictEqual(reqOpts.json.model, 'nmt'); done(); }; @@ -423,7 +434,7 @@ describe('Translate', () => { }); it('should make the correct API request', done => { - translate.request = reqOpts => { + translate.request = (reqOpts: r.OptionsWithUri) => { assert.strictEqual(reqOpts.uri, ''); assert.strictEqual(reqOpts.method, 'POST'); assert.deepStrictEqual(reqOpts.json, { @@ -443,18 +454,20 @@ describe('Translate', () => { const apiResponse = {}; beforeEach(() => { - translate.request = (reqOpts, callback) => { + translate.request = (reqOpts: r.Options, callback: Function) => { callback(error, apiResponse); }; }); it('should exec callback with error & API response', done => { - translate.translate(INPUT, OPTIONS, (err, translations, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(translations, null); - assert.strictEqual(resp, apiResponse); - done(); - }); + translate.translate( + INPUT, OPTIONS, + (err: Error, translations: {}, resp: r.Response) => { + assert.strictEqual(err, error); + assert.strictEqual(translations, null); + assert.strictEqual(resp, apiResponse); + done(); + }); }); }); @@ -474,23 +487,25 @@ describe('Translate', () => { const expectedResults = apiResponse.data.translations[0].translatedText; beforeEach(() => { - translate.request = (reqOpts, callback) => { + translate.request = (reqOpts: r.Options, callback: Function) => { callback(null, apiResponse); }; }); it('should execute callback with results & API response', done => { - translate.translate(INPUT, OPTIONS, (err, translations, resp) => { - assert.ifError(err); - assert.deepStrictEqual(translations, expectedResults); - assert.strictEqual(resp, apiResponse); - done(); - }); + translate.translate( + INPUT, OPTIONS, + (err: Error, translations: {}, resp: r.Response) => { + assert.ifError(err); + assert.deepStrictEqual(translations, expectedResults); + assert.strictEqual(resp, apiResponse); + done(); + }); }); it('should execute callback with multiple results', done => { const input = [INPUT, INPUT]; - translate.translate(input, OPTIONS, (err, translations) => { + translate.translate(input, OPTIONS, (err: Error, translations: {}) => { assert.ifError(err); assert.deepStrictEqual(translations, [expectedResults]); done(); @@ -498,18 +513,19 @@ describe('Translate', () => { }); it('should return an array if input was an array', done => { - translate.translate([INPUT], OPTIONS, (err, translations) => { - assert.ifError(err); - assert.deepStrictEqual(translations, [expectedResults]); - done(); - }); + translate.translate( + [INPUT], OPTIONS, (err: Error, translations: {}) => { + assert.ifError(err); + assert.deepStrictEqual(translations, [expectedResults]); + done(); + }); }); }); }); describe('request', () => { describe('OAuth mode', () => { - let request; + let request: r.Request; beforeEach(() => { request = FakeService.prototype.request; @@ -528,10 +544,11 @@ describe('Translate', () => { }, }; - FakeService.prototype.request = (reqOpts, callback) => { - assert.strictEqual(reqOpts, fakeOptions); - callback(); - }; + FakeService.prototype.request = + (reqOpts: r.Options, callback: Function) => { + assert.strictEqual(reqOpts, fakeOptions); + callback(); + }; translate.request(fakeOptions, done); }); @@ -577,11 +594,12 @@ describe('Translate', () => { expectedReqOpts.uri = translate.baseUrl + reqOpts.uri; - makeRequestOverride = (reqOpts, options, callback) => { - assert.deepStrictEqual(reqOpts, expectedReqOpts); - assert.strictEqual(options, translate.options); - callback(); // done() - }; + makeRequestOverride = + (reqOpts: r.Options, options: {}, callback: Function) => { + assert.deepStrictEqual(reqOpts, expectedReqOpts); + assert.strictEqual(options, translate.options); + callback(); // done() + }; translate.request(reqOpts, done); }); diff --git a/packages/google-cloud-translate/tsconfig.json b/packages/google-cloud-translate/tsconfig.json index 1942ae08fa2..9cc6883089f 100644 --- a/packages/google-cloud-translate/tsconfig.json +++ b/packages/google-cloud-translate/tsconfig.json @@ -3,7 +3,6 @@ "compilerOptions": { "rootDir": ".", "outDir": "build", - "noImplicitAny": false, "noImplicitThis": false }, "include": [ From bf81869a86b4721477254c69c9ace385af774d00 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 9 Aug 2018 10:16:54 -0700 Subject: [PATCH 132/513] fix: add a synth file (#93) --- .../.circleci/config.yml | 25 +++++++++++++++---- .../google-cloud-translate/CODE_OF_CONDUCT.md | 2 +- packages/google-cloud-translate/synth.py | 12 +++++++++ 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 packages/google-cloud-translate/synth.py diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 6d9812795c9..6286d44c7cc 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -57,8 +57,9 @@ jobs: node6: docker: - image: 'node:6' + user: node steps: &unit_tests_steps - - checkout + - checkout - run: &npm_install_and_link name: Install and link the module command: |- @@ -72,14 +73,17 @@ jobs: node8: docker: - image: 'node:8' + user: node steps: *unit_tests_steps node10: docker: - image: 'node:10' + user: node steps: *unit_tests_steps lint: docker: - image: 'node:8' + user: node steps: - checkout - run: *npm_install_and_link @@ -89,10 +93,17 @@ jobs: cd samples/ npm link ../ npm install - - run: npm run lint + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global + - run: + name: Run linting. + command: npm run lint + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global docs: docker: - image: 'node:8' + user: node steps: - checkout - run: *npm_install_and_link @@ -102,6 +113,7 @@ jobs: sample_tests: docker: - image: 'node:8' + user: node steps: - checkout - run: @@ -117,15 +129,17 @@ jobs: command: npm run samples-test environment: GCLOUD_PROJECT: long-door-651 - GOOGLE_APPLICATION_CREDENTIALS: /var/translate/.circleci/key.json + GOOGLE_APPLICATION_CREDENTIALS: /home/node/samples/.circleci/key.json + NPM_CONFIG_PREFIX: /home/node/.npm-global - run: name: Remove unencrypted key. command: rm .circleci/key.json when: always - working_directory: /var/translate/ + working_directory: /home/node/samples/ system_tests: docker: - image: 'node:8' + user: node steps: - checkout - run: @@ -147,7 +161,8 @@ jobs: publish_npm: docker: - image: 'node:8' + user: node steps: - checkout - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc' - - run: npm publish + - run: npm publish --access=public \ No newline at end of file diff --git a/packages/google-cloud-translate/CODE_OF_CONDUCT.md b/packages/google-cloud-translate/CODE_OF_CONDUCT.md index 46b2a08ea6d..c3727800341 100644 --- a/packages/google-cloud-translate/CODE_OF_CONDUCT.md +++ b/packages/google-cloud-translate/CODE_OF_CONDUCT.md @@ -40,4 +40,4 @@ may be reported by opening an issue or contacting one or more of the project maintainers. This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) \ No newline at end of file diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py new file mode 100644 index 00000000000..005ba153053 --- /dev/null +++ b/packages/google-cloud-translate/synth.py @@ -0,0 +1,12 @@ +import synthtool as s +import synthtool.gcp as gcp +import logging +import subprocess + +logging.basicConfig(level=logging.DEBUG) +common_templates = gcp.CommonTemplates() +templates = common_templates.node_library( + package_name="@google-cloud/translate", + repo_name="googleapis/translate" +) +s.copy(templates) From 24671cc56c61d46265c0ccace3fb4b65cb6979a4 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Aug 2018 11:47:34 -0700 Subject: [PATCH 133/513] Release v2.0.0 (#94) --- packages/google-cloud-translate/CHANGELOG.md | 72 ++++++++++++++++++++ packages/google-cloud-translate/package.json | 2 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 packages/google-cloud-translate/CHANGELOG.md diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md new file mode 100644 index 00000000000..67aa2a9c923 --- /dev/null +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -0,0 +1,72 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions + +## v2.0.0 + +**This release has breaking changes**. + +Previous versions of the API would allow for creating new Translate objects directly from the imported module. To provide consistency with es modules, there are no default exports. + +#### Old code +```js +const translate = require('@google-cloud/translate')({ + keyFilename: '...' +}); +``` + +#### New code +```js +const {Translate} = require('@google-cloud/translate'); +const translate = new Translate({ + keyFilename: '...' +}); +``` + +### More Breaking changes +- fix: drop support for node.js 4.x and 9.x (#64) + +### New Features +- feat: convert to TypeScript (#63) + +### Documentation +- docs: fix link (#72) +- docs: fix small typos (#71) + +### Internal / Testing Changes +- fix: add a synth file (#93) +- chore: add better types (#92) +- chore: ignore package-lock.json (#91) +- chore: use promisify and upgrade common (#90) +- chore: update renovate config (#86) +- chore: remove propprop, clean up (#87) +- remove that whitespace (#85) +- chore(deps): update dependency typescript to v3 (#82) +- chore: move mocha options to mocha.opts (#78) +- chore: assert.deelEqual => assert.deepStrictEqual (#81) +- chore: enable linting and arrow functions (#80) +- chore: require node 8 for samples (#79) +- chore(deps): update dependency gts to ^0.8.0 (#73) +- chore(deps): update dependency eslint-plugin-node to v7 (#75) +- fix(deps): update dependency yargs to v12 (#59) +- chore(deps): update dependency sinon to v6.0.1 (#57) +- Configure Renovate (#52) +- refactor: drop repo-tool as an exec wrapper (#56) +- fix: update linking for samples (#54) +- chore(package): update eslint to version 5.0.0 (#53) +- chore: the ultimate fix for repo-tools EPERM (#45) +- chore: update all dependencies (#50) +- fix(package): update @google-cloud/common to version 0.20.0 (#49) +- fix: update all the dependencies (#48) +- Update nyc to the latest version 🚀 (#47) +- chore: timeout for system test (#44) +- chore: test on node10 (#41) +- chore: workaround for repo-tools EPERM (#36) +- chore: setup nighty build in CircleCI (#34) +- Upgrade repo-tools and regenerate scaffolding. (#33) +- Update proxyquire to the latest version 🚀 (#29) +- Update mocha to the latest version 🚀 (#22) +- Linting per prettier@1.9.0. (#21) + diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index e09f2e8c7b2..5afaef5d34c 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "1.1.0", + "version": "2.0.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { From bf86f656cfd34da86e73803c03a1a0ada97c59dc Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 16 Aug 2018 16:55:53 -0400 Subject: [PATCH 134/513] chore: run repo tools (#96) Update contributors and README. --- .../google-cloud-translate/CODE_OF_CONDUCT.md | 2 +- packages/google-cloud-translate/CONTRIBUTORS | 4 ++ packages/google-cloud-translate/README.md | 64 ++++++++----------- packages/google-cloud-translate/package.json | 6 +- 4 files changed, 36 insertions(+), 40 deletions(-) diff --git a/packages/google-cloud-translate/CODE_OF_CONDUCT.md b/packages/google-cloud-translate/CODE_OF_CONDUCT.md index c3727800341..46b2a08ea6d 100644 --- a/packages/google-cloud-translate/CODE_OF_CONDUCT.md +++ b/packages/google-cloud-translate/CODE_OF_CONDUCT.md @@ -40,4 +40,4 @@ may be reported by opening an issue or contacting one or more of the project maintainers. This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) \ No newline at end of file +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/packages/google-cloud-translate/CONTRIBUTORS b/packages/google-cloud-translate/CONTRIBUTORS index 1f8a5887454..fa4f506ed93 100644 --- a/packages/google-cloud-translate/CONTRIBUTORS +++ b/packages/google-cloud-translate/CONTRIBUTORS @@ -8,8 +8,11 @@ Alexander Fenster Dave Gramlich Eric Uldall Ernest Landrito +F. Hinkelmann Jason Dobry Jason Dobry +Jonathan Lui +Justin Beckwith Luke Sneeringer Stephen Stephen Sawchuk @@ -17,3 +20,4 @@ Stephen Sawchuk Tim Swast florencep greenkeeper[bot] +renovate[bot] diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 702f41d11d9..761d026dd29 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -1,3 +1,5 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `npm run generate-scaffolding`." Google Cloud Platform logo # [Google Cloud Translation API: Node.js Client](https://github.com/googleapis/nodejs-translate) @@ -7,60 +9,31 @@ [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/googleapis/nodejs-translate?branch=master&svg=true)](https://ci.appveyor.com/project/googleapis/nodejs-translate) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-translate/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-translate) -> Node.js idiomatic client for [Cloud Translation API][product-docs]. - The [Cloud Translation API](https://cloud.google.com/translate/docs), can dynamically translate text between thousands of language pairs. The Cloud Translation API lets websites and programs integrate with the translation service programmatically. The Cloud Translation API is part of the larger Cloud Machine Learning API family. -* [Cloud Translation API Node.js Client API Reference][client-docs] -* [github.com/googleapis/nodejs-translate](https://github.com/googleapis/nodejs-translate) -* [Cloud Translation API Documentation][product-docs] - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - * [Using the client library](#using-the-client-library) +* [Using the client library](#using-the-client-library) * [Samples](#samples) * [Versioning](#versioning) * [Contributing](#contributing) * [License](#license) -## Quickstart - -### Before you begin - -1. Select or create a Cloud Platform project. +## Using the client library - [Go to the projects page][projects] +1. [Select or create a Cloud Platform project][projects]. -1. Enable billing for your project. +1. [Enable billing for your project][billing]. - [Enable billing][billing] - -1. Enable the Google Cloud Translation API API. - - [Enable the API][enable_api] +1. [Enable the Google Cloud Translation API API][enable_api]. 1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=translate.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started - -### Installing the client library +1. Install the client library: - npm install --save @google-cloud/translate + npm install --save @google-cloud/translate -### Using the client library +1. Try an example: ```javascript // Imports the Google Cloud client library @@ -129,6 +102,21 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-translate/blob/master/LICENSE) +## What's Next + +* [Cloud Translation API Documentation][product-docs] +* [Cloud Translation API Node.js Client API Reference][client-docs] +* [github.com/googleapis/nodejs-translate](https://github.com/googleapis/nodejs-translate) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + [client-docs]: https://cloud.google.com/nodejs/docs/reference/translate/latest/ [product-docs]: https://cloud.google.com/translate/docs -[shell_img]: //gstatic.com/cloudssh/images/open-btn.png +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=translate.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 5afaef5d34c..0078f6b9e09 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -34,15 +34,19 @@ "Dave Gramlich ", "Eric Uldall ", "Ernest Landrito ", + "F. Hinkelmann ", "Jason Dobry ", "Jason Dobry ", + "Jonathan Lui ", + "Justin Beckwith ", "Luke Sneeringer ", "Stephen ", "Stephen Sawchuk ", "Stephen Sawchuk ", "Tim Swast ", "florencep ", - "greenkeeper[bot] " + "greenkeeper[bot] ", + "renovate[bot] " ], "scripts": { "cover": "nyc --reporter=lcov mocha build/test && nyc report", From 968d048a678b00897237c651a63f93ca4332afae Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 16 Aug 2018 16:29:08 -0700 Subject: [PATCH 135/513] chore(deps): update dependency eslint-config-prettier to v3 (#95) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 0078f6b9e09..2343e20e064 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -85,7 +85,7 @@ "@types/request": "^2.47.1", "codecov": "^3.0.2", "eslint": "^5.0.0", - "eslint-config-prettier": "^2.9.0", + "eslint-config-prettier": "^3.0.0", "eslint-plugin-node": "^7.0.0", "eslint-plugin-prettier": "^2.6.0", "gts": "^0.8.0", From c14bfc83159ecddd4c38068dd16e463040fa8f7d Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 23 Aug 2018 13:13:08 -0700 Subject: [PATCH 136/513] doc: use new import syntax in samples (#100) --- packages/google-cloud-translate/README.md | 2 +- packages/google-cloud-translate/samples/quickstart.js | 2 +- packages/google-cloud-translate/src/index.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 761d026dd29..91e4c03529d 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -37,7 +37,7 @@ The [Cloud Translation API](https://cloud.google.com/translate/docs), can dynami ```javascript // Imports the Google Cloud client library -const Translate = require('@google-cloud/translate'); +const {Translate} = require('@google-cloud/translate'); // Your Google Cloud Platform project ID const projectId = 'YOUR_PROJECT_ID'; diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index 6fd4e0350b1..d56235c2401 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -17,7 +17,7 @@ // [START translate_quickstart] // Imports the Google Cloud client library -const Translate = require('@google-cloud/translate'); +const {Translate} = require('@google-cloud/translate'); // Your Google Cloud Platform project ID const projectId = 'YOUR_PROJECT_ID'; diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 8311fb7bd59..6dfa7fde0b8 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -210,7 +210,7 @@ export class Translate extends Service { * @returns {Promise} * * @example - * const Translate = require('@google-cloud/translate'); + * const {Translate} = require('@google-cloud/translate'); * * const translate = new Translate(); * @@ -570,7 +570,7 @@ promisifyAll(Translate, {exclude: ['request']}); * @google-cloud/translate * * @example Import the client library: - * const Translate = require('@google-cloud/translate'); + * const {Translate} = require('@google-cloud/translate'); * * @example Create a client that uses Application Default Credentials From 2b8c453de66f8d584f2e4bb74924ec3f48f53283 Mon Sep 17 00:00:00 2001 From: DPE bot Date: Fri, 24 Aug 2018 10:34:44 -0700 Subject: [PATCH 137/513] chore: update CircleCI config --- packages/google-cloud-translate/.circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 6286d44c7cc..41c82336dbb 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -165,4 +165,4 @@ jobs: steps: - checkout - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc' - - run: npm publish --access=public \ No newline at end of file + - run: npm publish --access=public From dd6d72dd66f534db781f615524c13180bb793dbc Mon Sep 17 00:00:00 2001 From: DPE bot Date: Mon, 27 Aug 2018 11:24:25 -0700 Subject: [PATCH 138/513] Update the CI config (#102) --- packages/google-cloud-translate/.circleci/config.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 41c82336dbb..eab76c4a6ba 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -107,9 +107,7 @@ jobs: steps: - checkout - run: *npm_install_and_link - - run: - name: Build documentation. - command: npm run docs + - run: npm run docs sample_tests: docker: - image: 'node:8' @@ -164,5 +162,6 @@ jobs: user: node steps: - checkout - - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc' + - npm install + - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - run: npm publish --access=public From c294b0e40821f89dc359b86ce1d4bff298b8e6df Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Tue, 28 Aug 2018 10:40:39 -0400 Subject: [PATCH 139/513] feat: Use small request dependency (#98) Pass teeny-request to common. Service so we don't rely on request. --- packages/google-cloud-translate/package.json | 5 +++-- packages/google-cloud-translate/src/index.ts | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 2343e20e064..a223ad761eb 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -67,12 +67,13 @@ "presystem-test": "npm run compile" }, "dependencies": { - "@google-cloud/common": "^0.21.0", + "@google-cloud/common": "^0.23.0", "@google-cloud/promisify": "^0.3.0", "arrify": "^1.0.1", "extend": "^3.0.1", "is": "^3.2.1", - "is-html": "^1.1.0" + "is-html": "^1.1.0", + "teeny-request": "^3.4.0" }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^2.3.0", diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 6dfa7fde0b8..8e909c12875 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -25,6 +25,7 @@ import * as is from 'is'; const isHtml = require('is-html'); import {DecorateRequestOptions, BodyResponseCallback} from '@google-cloud/common/build/src/util'; import * as r from 'request'; +import {teenyRequest} from 'teeny-request'; const PKG = require('../../package.json'); @@ -148,6 +149,7 @@ export interface TranslateConfig extends GoogleAuthOptions { key?: string; autoRetry?: boolean; maxRetries?: number; + requestModule?: typeof teenyRequest; } /** @@ -191,10 +193,12 @@ export class Translate extends Service { scopes: ['https://www.googleapis.com/auth/cloud-platform'], packageJson: require('../../package.json'), projectIdRequired: false, + requestModule: teenyRequest as typeof r, }; super(config, options); this.options = options || {}; + this.options.requestModule = config.requestModule; if (this.options.key) { this.key = this.options.key; } @@ -544,7 +548,7 @@ export class Translate extends Service { }, }); - util.makeRequest(reqOpts, this.options!, callback!); + util.makeRequest(reqOpts, this.options, callback!); } } From acca868c610bf23ffc96bdc427facb7952375a10 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 28 Aug 2018 07:59:48 -0700 Subject: [PATCH 140/513] chore(deps): update dependency nyc to v13 (#103) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index a223ad761eb..1069cb2d90e 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -95,7 +95,7 @@ "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", "mocha": "^5.2.0", - "nyc": "^12.0.2", + "nyc": "^13.0.0", "power-assert": "^1.6.0", "prettier": "^1.13.5", "proxyquire": "^2.0.1", From 5975c96b81c9a1965fd9aa42dbaa41d22c9ed604 Mon Sep 17 00:00:00 2001 From: DPE bot Date: Tue, 28 Aug 2018 13:19:11 -0700 Subject: [PATCH 141/513] Re-generate library using /synth.py (#104) --- packages/google-cloud-translate/.jsdoc.js | 4 ++-- packages/google-cloud-translate/.nycrc | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index 258a304c207..b1e1d8d8721 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -1,5 +1,5 @@ /*! - * Copyright 2017 Google Inc. All Rights Reserved. + * Copyright 2018 Google LLC. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2017 Google, Inc.', + copyright: 'Copyright 2018 Google, LLC.', includeDate: false, sourceFiles: false, systemName: '@google-cloud/translate', diff --git a/packages/google-cloud-translate/.nycrc b/packages/google-cloud-translate/.nycrc index feb032400d4..a1a8e6920ce 100644 --- a/packages/google-cloud-translate/.nycrc +++ b/packages/google-cloud-translate/.nycrc @@ -3,8 +3,7 @@ "exclude": [ "src/*{/*,/**/*}.js", "src/*/v*/*.js", - "test/**/*.js", - "build/test" + "test/**/*.js" ], "watermarks": { "branches": [ From e730895fd66ea15ac2ec773d6002f6a6487bf867 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 28 Aug 2018 18:31:07 -0700 Subject: [PATCH 142/513] Release nodejs-translate v2.1.0 (#106) --- packages/google-cloud-translate/CHANGELOG.md | 16 ++++++++++++++++ packages/google-cloud-translate/package.json | 2 +- .../google-cloud-translate/samples/package.json | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 67aa2a9c923..c8dda7ed904 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,22 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## v2.1.0 + +### Implementation Changes +- feat: Use small request dependency (#98) + +### Documentation +- doc: use new import syntax in samples (#100) + +### Internal / Testing Changes +- Re-generate library using /synth.py (#104) +- chore(deps): update dependency nyc to v13 (#103) +- Update the CI config (#102) +- chore: update CircleCI config +- chore(deps): update dependency eslint-config-prettier to v3 (#95) +- chore: run repo tools (#96) + ## v2.0.0 **This release has breaking changes**. diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 1069cb2d90e..e4306596827 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "2.0.0", + "version": "2.1.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 0d59c797f2d..972871d2b77 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -14,7 +14,7 @@ "test": "npm run cover" }, "dependencies": { - "@google-cloud/translate": "^1.1.0", + "@google-cloud/translate": "^2.1.0", "yargs": "^12.0.1" }, "devDependencies": { From 39185bd70a0f17e18d6230034fa1b4956830a563 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 30 Aug 2018 11:03:53 -0700 Subject: [PATCH 143/513] fix: always run all system-tests (#109) --- packages/google-cloud-translate/system-test/translate.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 13eff01cb5e..29d68c15ec3 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -153,8 +153,11 @@ describe('translate', () => { }); }); - (API_KEY ? describe : describe.skip)('authentication', () => { + describe('authentication', () => { beforeEach(() => { + if (!API_KEY) { + throw new Error('The `TRANSLATE_API_KEY` environment variable is required!'); + } translate = new Translate({key: API_KEY}); }); From 5a0d953119e88864ec889b807586eb3e0edaea23 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 30 Aug 2018 13:23:40 -0700 Subject: [PATCH 144/513] fix: run the linter (#110) --- packages/google-cloud-translate/system-test/translate.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 29d68c15ec3..9e33fb904ad 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -156,7 +156,8 @@ describe('translate', () => { describe('authentication', () => { beforeEach(() => { if (!API_KEY) { - throw new Error('The `TRANSLATE_API_KEY` environment variable is required!'); + throw new Error( + 'The `TRANSLATE_API_KEY` environment variable is required!'); } translate = new Translate({key: API_KEY}); }); From 34ea5aa1465c7608b2e62f304d7242365f826b3b Mon Sep 17 00:00:00 2001 From: DPE bot Date: Fri, 31 Aug 2018 12:23:08 -0700 Subject: [PATCH 145/513] Re-generate library using /synth.py (#111) --- .../.circleci/config.yml | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index eab76c4a6ba..9a65e928a47 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -117,9 +117,11 @@ jobs: - run: name: Decrypt credentials. command: | - openssl aes-256-cbc -d -in .circleci/key.json.enc \ + if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then + openssl aes-256-cbc -d -in .circleci/key.json.enc \ -out .circleci/key.json \ -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + fi - run: *npm_install_and_link - run: *samples_npm_install_and_link - run: @@ -131,7 +133,10 @@ jobs: NPM_CONFIG_PREFIX: /home/node/.npm-global - run: name: Remove unencrypted key. - command: rm .circleci/key.json + command: | + if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then + rm .circleci/key.json + fi when: always working_directory: /home/node/samples/ system_tests: @@ -143,9 +148,11 @@ jobs: - run: name: Decrypt credentials. command: | - openssl aes-256-cbc -d -in .circleci/key.json.enc \ + if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then + openssl aes-256-cbc -d -in .circleci/key.json.enc \ -out .circleci/key.json \ -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + fi - run: *npm_install_and_link - run: name: Run system tests. @@ -154,7 +161,10 @@ jobs: GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json - run: name: Remove unencrypted key. - command: rm .circleci/key.json + command: | + if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then + rm .circleci/key.json + fi when: always publish_npm: docker: @@ -162,6 +172,6 @@ jobs: user: node steps: - checkout - - npm install + - run: npm install - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - run: npm publish --access=public From 2d9eb124b8a9916aed7f30c48fb8bdb1f937734e Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Tue, 4 Sep 2018 10:53:24 -0400 Subject: [PATCH 146/513] fix: set request module (#112) The field is called `request`, not `requestModule`. Fixes: https://github.com/googleapis/nodejs-translate/issues/108 --- packages/google-cloud-translate/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 8e909c12875..f439ad4a2a6 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -149,7 +149,7 @@ export interface TranslateConfig extends GoogleAuthOptions { key?: string; autoRetry?: boolean; maxRetries?: number; - requestModule?: typeof teenyRequest; + request?: typeof r; } /** @@ -198,7 +198,7 @@ export class Translate extends Service { super(config, options); this.options = options || {}; - this.options.requestModule = config.requestModule; + this.options.request = config.requestModule; if (this.options.key) { this.key = this.options.key; } From 5334094343621ef9ba2d53bc0853b51c86600104 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 4 Sep 2018 10:56:09 -0700 Subject: [PATCH 147/513] Retry npm install in CI (#113) --- .../.circleci/config.yml | 6 +- .../.circleci/npm-install-retry.js | 60 +++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) create mode 100755 packages/google-cloud-translate/.circleci/npm-install-retry.js diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 9a65e928a47..80dcf7e67d9 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -64,7 +64,7 @@ jobs: name: Install and link the module command: |- mkdir -p /home/node/.npm-global - npm install + ./.circleci/npm-install-retry.js environment: NPM_CONFIG_PREFIX: /home/node/.npm-global - run: npm test @@ -92,7 +92,7 @@ jobs: command: | cd samples/ npm link ../ - npm install + ./../.circleci/npm-install-retry.js environment: NPM_CONFIG_PREFIX: /home/node/.npm-global - run: @@ -172,6 +172,6 @@ jobs: user: node steps: - checkout - - run: npm install + - run: ./.circleci/npm-install-retry.js - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - run: npm publish --access=public diff --git a/packages/google-cloud-translate/.circleci/npm-install-retry.js b/packages/google-cloud-translate/.circleci/npm-install-retry.js new file mode 100755 index 00000000000..ae3220d7348 --- /dev/null +++ b/packages/google-cloud-translate/.circleci/npm-install-retry.js @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +let spawn = require('child_process').spawn; + +// +//USE: ./index.js [... NPM ARGS] +// + +let timeout = process.argv[2] || 60000; +let attempts = process.argv[3] || 3; +let args = process.argv.slice(4); +if (args.length === 0) { + args = ['install']; +} + +(function npm() { + let timer; + args.push('--verbose'); + let proc = spawn('npm', args); + proc.stdout.pipe(process.stdout); + proc.stderr.pipe(process.stderr); + proc.stdin.end(); + proc.stdout.on('data', () => { + setTimer(); + }); + proc.stderr.on('data', () => { + setTimer(); + }); + + // side effect: this also restarts when npm exits with a bad code even if it + // didnt timeout + proc.on('close', (code, signal) => { + clearTimeout(timer); + if (code || signal) { + console.log('[npm-are-you-sleeping] npm exited with code ' + code + ''); + + if (--attempts) { + console.log('[npm-are-you-sleeping] restarting'); + npm(); + } else { + console.log('[npm-are-you-sleeping] i tried lots of times. giving up.'); + throw new Error("npm install fails"); + } + } + }); + + function setTimer() { + clearTimeout(timer); + timer = setTimeout(() => { + console.log('[npm-are-you-sleeping] killing npm with SIGTERM'); + proc.kill('SIGTERM'); + // wait a couple seconds + timer = setTimeout(() => { + // its it's still not closed sigkill + console.log('[npm-are-you-sleeping] killing npm with SIGKILL'); + proc.kill('SIGKILL'); + }, 2000); + }, timeout); + } +})(); From 039c9a2c4262f93bc2b3aab578ab0a627d9acf04 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 4 Sep 2018 18:49:10 -0700 Subject: [PATCH 148/513] Release v2.1.1 (#114) --- packages/google-cloud-translate/CHANGELOG.md | 9 +++++++++ packages/google-cloud-translate/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index c8dda7ed904..7f9adfbf140 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,15 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## v2.1.1 + +### Internal / Testing Changes +- Retry npm install in CI (#113) +- fix: set request module (#112) +- Re-generate library using /synth.py (#111) +- fix: run the linter (#110) +- fix: always run all system-tests (#109) + ## v2.1.0 ### Implementation Changes diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index e4306596827..94702604a76 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "2.1.0", + "version": "2.1.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { From 22f8ff330b88b65ff28a4dbd13226cba86dbbefe Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 5 Sep 2018 07:08:00 -0700 Subject: [PATCH 149/513] Enable noImplicitThis in tsconfig (#115) Resolves #69 --- packages/google-cloud-translate/test/index.ts | 12 ++++++++---- packages/google-cloud-translate/tsconfig.json | 3 +-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index dbf50b9a1f5..65f6acc98dc 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -47,8 +47,12 @@ const fakeUtil = extend({}, util, { }); const originalFakeUtil = extend(true, {}, fakeUtil); -function FakeService() { - this.calledWith_ = arguments; +class FakeService { + calledWith_: IArguments; + request?: Function; + constructor() { + this.calledWith_ = arguments; + } } describe('Translate', () => { @@ -525,10 +529,10 @@ describe('Translate', () => { describe('request', () => { describe('OAuth mode', () => { - let request: r.Request; + let request: Function; beforeEach(() => { - request = FakeService.prototype.request; + request = FakeService.prototype.request!; }); afterEach(() => { diff --git a/packages/google-cloud-translate/tsconfig.json b/packages/google-cloud-translate/tsconfig.json index 9cc6883089f..b10ee498aef 100644 --- a/packages/google-cloud-translate/tsconfig.json +++ b/packages/google-cloud-translate/tsconfig.json @@ -2,8 +2,7 @@ "extends": "./node_modules/gts/tsconfig-google.json", "compilerOptions": { "rootDir": ".", - "outDir": "build", - "noImplicitThis": false + "outDir": "build" }, "include": [ "src/*.ts", From 62cec04a64632e7c16d706f8397fa931a83d5469 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 6 Sep 2018 07:43:11 -0700 Subject: [PATCH 150/513] fix(deps): update dependency @google-cloud/common to ^0.24.0 (#117) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 94702604a76..d563493aaef 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -67,7 +67,7 @@ "presystem-test": "npm run compile" }, "dependencies": { - "@google-cloud/common": "^0.23.0", + "@google-cloud/common": "^0.24.0", "@google-cloud/promisify": "^0.3.0", "arrify": "^1.0.1", "extend": "^3.0.1", From 23e14ea40d4fe7c5394a6b05cf6c4fd250e0eea9 Mon Sep 17 00:00:00 2001 From: DPE bot Date: Mon, 10 Sep 2018 08:09:04 -0700 Subject: [PATCH 151/513] Update CI config (#118) --- packages/google-cloud-translate/.circleci/config.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 80dcf7e67d9..8af6a4d0489 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -149,21 +149,24 @@ jobs: name: Decrypt credentials. command: | if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - openssl aes-256-cbc -d -in .circleci/key.json.enc \ - -out .circleci/key.json \ - -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + for encrypted_key in .circleci/*.json.enc; do + openssl aes-256-cbc -d -in $encrypted_key \ + -out $(echo $encrypted_key | sed 's/\.enc//') \ + -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + done fi - run: *npm_install_and_link - run: name: Run system tests. command: npm run system-test environment: + GCLOUD_PROJECT: long-door-651 GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json - run: name: Remove unencrypted key. command: | if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - rm .circleci/key.json + rm .circleci/*.json fi when: always publish_npm: From 69cc21849eda280a754d26bd6b709e178f602df1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 18 Sep 2018 06:53:47 -0700 Subject: [PATCH 152/513] fix(deps): update dependency @google-cloud/common to ^0.25.0 (#122) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index d563493aaef..917f44cfc52 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -67,7 +67,7 @@ "presystem-test": "npm run compile" }, "dependencies": { - "@google-cloud/common": "^0.24.0", + "@google-cloud/common": "^0.25.0", "@google-cloud/promisify": "^0.3.0", "arrify": "^1.0.1", "extend": "^3.0.1", From 4f91ef1a67fa8978a761c49cdff071999b8923de Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 18 Sep 2018 11:22:04 -0700 Subject: [PATCH 153/513] Enable no-var in eslint (#121) --- packages/google-cloud-translate/.eslintrc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-translate/.eslintrc.yml b/packages/google-cloud-translate/.eslintrc.yml index bed57fbc42c..65f1dce6c0c 100644 --- a/packages/google-cloud-translate/.eslintrc.yml +++ b/packages/google-cloud-translate/.eslintrc.yml @@ -11,3 +11,4 @@ rules: block-scoped-var: error eqeqeq: error no-warning-comments: warn + no-var: error From 8e343def648b2c33c1506f6db3728ee4dcd179ed Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 20 Sep 2018 12:29:23 -0700 Subject: [PATCH 154/513] Enable prefer-const in the eslint config (#123) --- packages/google-cloud-translate/.eslintrc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-translate/.eslintrc.yml b/packages/google-cloud-translate/.eslintrc.yml index 65f1dce6c0c..73eeec27612 100644 --- a/packages/google-cloud-translate/.eslintrc.yml +++ b/packages/google-cloud-translate/.eslintrc.yml @@ -12,3 +12,4 @@ rules: eqeqeq: error no-warning-comments: warn no-var: error + prefer-const: error From dd6868851157db1ced28254218de05bc5f6e7c5e Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 21 Sep 2018 07:29:13 -0700 Subject: [PATCH 155/513] fix: Improve typescript types (#124) --- packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/src/index.ts | 25 +++-- .../system-test/translate.ts | 101 ++++++------------ 3 files changed, 53 insertions(+), 75 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 917f44cfc52..3c5262b5f22 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -61,7 +61,7 @@ "check": "gts check", "clean": "gts clean", "compile": "tsc -p .", - "fix": "gts fix", + "fix": "gts fix && eslint --fix 'samples/**/*.js' && npm run prettier", "prepare": "npm run compile", "pretest": "npm run compile", "presystem-test": "npm run compile" diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index f439ad4a2a6..b99382ce932 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -178,7 +178,7 @@ export interface TranslateConfig extends GoogleAuthOptions { * region_tag:translate_quickstart * Full quickstart example: */ -export class Translate extends Service { +class Translate extends Service { options: TranslateConfig; key?: string; constructor(options?: TranslateConfig) { @@ -267,12 +267,15 @@ export class Translate extends Service { * region_tag:translate_detect_language * Here's a full example: */ + detect(input: string): Promise<[DetectResult, r.Response]>; + detect(input: string[]): Promise<[DetectResult[], r.Response]>; detect(input: string, callback: DetectCallback): void; detect(input: string[], callback: DetectCallback): void; detect( input: string|string[], - callback: DetectCallback| - DetectCallback): void { + callback?: DetectCallback| + DetectCallback): void|Promise<[DetectResult, r.Response]>| + Promise<[DetectResult[], r.Response]> { const inputIsArray = Array.isArray(input); input = arrify(input); this.request( @@ -328,11 +331,13 @@ export class Translate extends Service { * region_tag:translate_list_language_names * Gets the language names in a language other than English: */ - getLanguages(callback: GetLanguagesCallback): void; + getLanguages(target?: string): Promise<[LanguageResult[], r.Response]>; getLanguages(target: string, callback: GetLanguagesCallback): void; + getLanguages(callback: GetLanguagesCallback): void; getLanguages( targetOrCallback?: string|GetLanguagesCallback, - callback?: GetLanguagesCallback) { + callback?: GetLanguagesCallback): + void|Promise<[LanguageResult[], r.Response]> { let target: string; if (is.fn(targetOrCallback)) { callback = targetOrCallback as GetLanguagesCallback; @@ -445,6 +450,12 @@ export class Translate extends Service { * region_tag:translate_text_with_model * Translation using the premium model: */ + translate(input: string, options: TranslateRequest): + Promise<[string, r.Response]>; + translate(input: string[], options: TranslateRequest): + Promise<[string[], r.Response]>; + translate(input: string, to: string): Promise<[string, r.Response]>; + translate(input: string[], to: string): Promise<[string[], r.Response]>; translate( input: string, options: TranslateRequest, callback: TranslateCallback): void; @@ -457,7 +468,8 @@ export class Translate extends Service { void; translate( inputs: string|string[], optionsOrTo: string|TranslateRequest, - callback: TranslateCallback|TranslateCallback) { + callback?: TranslateCallback|TranslateCallback): + void|Promise<[string, r.Response]>|Promise<[string[], r.Response]> { const inputIsArray = Array.isArray(inputs); const input = arrify(inputs); let options: TranslateRequest = {}; @@ -590,3 +602,4 @@ promisifyAll(Translate, {exclude: ['request']}); * region_tag:translate_quickstart * Full quickstart example: */ +export {Translate}; diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 9e33fb904ad..626c88375a9 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -36,15 +36,11 @@ describe('translate', () => { }, ]; - it('should detect a langauge', (done) => { + it('should detect a langauge', async () => { const input = INPUT.map(x => x.input); - - translate.detect(input, (err, results) => { - assert.ifError(err); - assert.strictEqual(results![0].language, INPUT[0].expectedLanguage); - assert.strictEqual(results![1].language, INPUT[1].expectedLanguage); - done(); - }); + const [results] = await translate.detect(input); + assert.strictEqual(results[0].language, INPUT[0].expectedLanguage); + assert.strictEqual(results[1].language, INPUT[1].expectedLanguage); }); }); @@ -67,88 +63,57 @@ describe('translate', () => { return input.replace(/^\W|\W*$/g, ''); } - it('should translate input', (done) => { + it('should translate input', async () => { const input = INPUT.map(x => x.input); - - translate.translate(input, 'es', (err, results) => { - assert.ifError(err); - results = results!.map(removeSymbols); - assert.strictEqual(results![0], INPUT[0].expectedTranslation); - assert.strictEqual(results![1], INPUT[1].expectedTranslation); - done(); - }); + let [results] = await translate.translate(input, 'es'); + results = results.map(removeSymbols); + assert.strictEqual(results[0], INPUT[0].expectedTranslation); + assert.strictEqual(results[1], INPUT[1].expectedTranslation); }); - it('should translate input with from and to options', (done) => { + it('should translate input with from and to options', async () => { const input = INPUT.map(x => x.input); - const opts = { from: 'en', to: 'es', }; - - translate.translate(input, opts, (err, results) => { - assert.ifError(err); - results = results!.map(removeSymbols); - assert.strictEqual(results![0], INPUT[0].expectedTranslation); - assert.strictEqual(results![1], INPUT[1].expectedTranslation); - done(); - }); + let [results] = await translate.translate(input, opts); + results = results.map(removeSymbols); + assert.strictEqual(results[0], INPUT[0].expectedTranslation); + assert.strictEqual(results[1], INPUT[1].expectedTranslation); }); - it('should autodetect HTML', (done) => { + it('should autodetect HTML', async () => { const input = '' + INPUT[0].input + ''; - const opts = { from: 'en', to: 'es', }; - - translate.translate(input, opts, (err, results) => { - assert.ifError(err); - - const translation = results!.split(/<\/*body>/g)[1].trim(); - - assert.strictEqual( - removeSymbols(translation), INPUT[0].expectedTranslation); - - done(); - }); + const [results] = await translate.translate(input, opts); + const translation = results.split(/<\/*body>/g)[1].trim(); + assert.strictEqual( + removeSymbols(translation), INPUT[0].expectedTranslation); }); }); describe('supported languages', () => { - it('should get a list of supported languages', (done) => { - translate.getLanguages((err, languages) => { - assert.ifError(err); - - const englishResult = languages!.filter(language => { - return language.code === 'en'; - })[0]; - - assert.deepStrictEqual(englishResult, { - code: 'en', - name: 'English', - }); - - done(); + it('should get a list of supported languages', async () => { + const [languages] = await translate.getLanguages(); + const englishResult = languages.filter(l => l.code === 'en')[0]; + assert.deepStrictEqual(englishResult, { + code: 'en', + name: 'English', }); }); - it('should accept a target language', (done) => { - translate.getLanguages('es', (err, languages) => { - assert.ifError(err); - - const englishResult = languages!.filter((language) => { - return language.code === 'en'; - })[0]; - - assert.deepStrictEqual(englishResult, { - code: 'en', - name: 'inglés', - }); - - done(); + it('should accept a target language', async () => { + const [languages] = await translate.getLanguages('es'); + const englishResult = languages.filter((language) => { + return language.code === 'en'; + })[0]; + assert.deepStrictEqual(englishResult, { + code: 'en', + name: 'inglés', }); }); }); From 49e8091f415482f745ef30ae02c7207a32e3256f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 21 Sep 2018 07:49:07 -0700 Subject: [PATCH 156/513] Release v2.1.2 (#125) --- packages/google-cloud-translate/CHANGELOG.md | 15 +++++++++++++++ packages/google-cloud-translate/package.json | 2 +- .../google-cloud-translate/samples/package.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 7f9adfbf140..7d1aec468df 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,21 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## v2.1.2 + +### Bug fixes +- fix: Improve typescript types ([#124](https://github.com/googleapis/nodejs-translate/pull/124)) + +### Dependencies +- fix(deps): update dependency @google-cloud/common to ^0.25.0 ([#122](https://github.com/googleapis/nodejs-translate/pull/122)) +- fix(deps): update dependency @google-cloud/common to ^0.24.0 ([#117](https://github.com/googleapis/nodejs-translate/pull/117)) + +### Internal / Testing Changes +- Enable prefer-const in the eslint config ([#123](https://github.com/googleapis/nodejs-translate/pull/123)) +- Enable no-var in eslint ([#121](https://github.com/googleapis/nodejs-translate/pull/121)) +- Update CI config ([#118](https://github.com/googleapis/nodejs-translate/pull/118)) +- Enable noImplicitThis in tsconfig ([#115](https://github.com/googleapis/nodejs-translate/pull/115)) + ## v2.1.1 ### Internal / Testing Changes diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 3c5262b5f22..0ad956ab0c1 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "2.1.1", + "version": "2.1.2", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 972871d2b77..1c2fff4906d 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -14,7 +14,7 @@ "test": "npm run cover" }, "dependencies": { - "@google-cloud/translate": "^2.1.0", + "@google-cloud/translate": "^2.1.2", "yargs": "^12.0.1" }, "devDependencies": { From 5850f700494b893381716f0ea331fcc94f84c89d Mon Sep 17 00:00:00 2001 From: DPE bot Date: Mon, 24 Sep 2018 11:12:34 -0700 Subject: [PATCH 157/513] Re-generate library using /synth.py (#127) * Re-generate library using /synth.py * inject TRANSLATE_API_KEY to kokoro builds via pre-system-test hook (#128) --- packages/google-cloud-translate/.circleci/npm-install-retry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/.circleci/npm-install-retry.js b/packages/google-cloud-translate/.circleci/npm-install-retry.js index ae3220d7348..3240aa2cbf2 100755 --- a/packages/google-cloud-translate/.circleci/npm-install-retry.js +++ b/packages/google-cloud-translate/.circleci/npm-install-retry.js @@ -6,7 +6,7 @@ let spawn = require('child_process').spawn; //USE: ./index.js [... NPM ARGS] // -let timeout = process.argv[2] || 60000; +let timeout = process.argv[2] || process.env.NPM_INSTALL_TIMEOUT || 60000; let attempts = process.argv[3] || 3; let args = process.argv.slice(4); if (args.length === 0) { From c485fe5880f7536653fef40d43b6db946b1d4036 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 24 Sep 2018 17:00:22 -0700 Subject: [PATCH 158/513] test: remove appveyor config (#129) --- packages/google-cloud-translate/.appveyor.yml | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 packages/google-cloud-translate/.appveyor.yml diff --git a/packages/google-cloud-translate/.appveyor.yml b/packages/google-cloud-translate/.appveyor.yml deleted file mode 100644 index 24082152655..00000000000 --- a/packages/google-cloud-translate/.appveyor.yml +++ /dev/null @@ -1,20 +0,0 @@ -environment: - matrix: - - nodejs_version: 8 - -install: - - ps: Install-Product node $env:nodejs_version - - npm install -g npm # Force using the latest npm to get dedupe during install - - set PATH=%APPDATA%\npm;%PATH% - - npm install --force --ignore-scripts - -test_script: - - node --version - - npm --version - - npm rebuild - - npm test - -build: off - -matrix: - fast_finish: true From f07d2455ec69e94c977d3cd58d7d41713739b194 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 27 Sep 2018 12:05:44 -0700 Subject: [PATCH 159/513] Don't publish sourcemaps (#132) --- packages/google-cloud-translate/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 0ad956ab0c1..4644b96e44f 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -12,6 +12,7 @@ "types": "build/src/index.d.ts", "files": [ "build/src", + "!build/src/**/*.map", "AUTHORS", "CONTRIBUTORS", "LICENSE" From 757cad78acb13b27d76c0c99661d56325c653295 Mon Sep 17 00:00:00 2001 From: Nirupa Anantha Kumar Date: Thu, 27 Sep 2018 14:56:37 -0700 Subject: [PATCH 160/513] Translate Automl samples (#131) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * initial translation commit * readme fix - check cloud link * first round style fixes * style fix 2 * Thanks Ace! * template path fix * Fix ENV variable for project Id (GCLOUD_PROJECT) * Translate AutoML samples * fixing lint issues * re-trigger tests --- .../google-cloud-translate/samples/README.md | 139 ++++++++++++++++++ .../samples/package.json | 2 + 2 files changed, 141 insertions(+) diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index d967f6cb836..08dbdd6a944 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -64,3 +64,142 @@ For more information, see https://cloud.google.com/translate/docs [shell_img]: //gstatic.com/cloudssh/images/open-btn.png [shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md + +### automlTranslationDataset + +View the [source code][automlTranslationDataset_code]. + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/automl/automlTranslationDataset.js,samples/README.md) + +__Usage:__ `node automlTranslationDataset.js --help` + +``` +automlTranslationDataset.js + +Commands: + automlTranslationDataset.js create-dataset creates a new Dataset + automlTranslationDataset.js list-datasets list all Datasets + automlTranslationDataset.js get-dataset Get a Dataset + automlTranslationDataset.js delete-dataset Delete a dataset + automlTranslationDataset.js import-data Import labeled items into dataset + +Options: + --version Show version number [boolean] + --computeRegion, -c region name e.g. "us-central1" [string] [default: "us-central1"] + --datasetName, -n Name of the Dataset [string] [default: "testDataSet"] + --datasetId, -i Id of the dataset [string] + --filter, -f Name of the Dataset to search for [string] [default: "translationDatasetMetadata:*"] + --multilabel, -m Type of the classification problem, False - MULTICLASS, True - MULTILABEL. + [string] [default: false] + --outputUri, -o URI (or local path) to export dataset [string] + --path, -p URI or local path to input .csv, or array of .csv paths + [string] [default: "gs://nodejs-docs-samples-vcm/en-ja.csv"] + --projectId, -z The GCLOUD_PROJECT string, e.g. "my-gcloud-project" [number] [default: "nodejs-docs-samples"] + --source, -s The source language to be translated from [string] + --target, -t The target language to be translated to [string] + --help Show help [boolean] + +Examples: + node automlTranslationDataset.js create-dataset -n "newDataSet" -s "en" -t "ja" + node automlTranslationDataset.js list-datasets -f "translationDatasetMetadata:*" + node automlTranslationDataset.js get-dataset -i "DATASETID" + node automlTranslationDataset.js delete-dataset -i "DATASETID" + node automlTranslationDataset.js import-data -i "dataSetId" -p "gs://myproject/mytraindata.csv" + +For more information, see https://cloud.google.com/translate/docs +``` + +[automlTranslationDataset_docs]: https://cloud.google.com/translate/docs +[automlTranslationDataset_code]: automl/automlTranslationDataset.js + +[shell_img]: //gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md + +### automlTranslationModel + +View the [source code][automlTranslationModel_code]. + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/automl/automlTranslationModel.js,samples/README.md) + +__Usage:__ `node translate.js --help` + +``` +automlTranslationModel.js + +Commands: + automlTranslationModel.js create-model creates a new Model + automlTranslationModel.js get-operation-status Gets status of current operation + automlTranslationModel.js list-models list all Models + automlTranslationModel.js get-model Get a Model + automlTranslationModel.js list-model-evaluations List model evaluations + automlTranslationModel.js get-model-evaluation Get model evaluation + automlTranslationModel.js delete-model Delete a Model + +Options: + --version Show version number [boolean] + --computeRegion, -c region name e.g. "us-central1" [string] [default: "us-central1"] + --datasetId, -i Id of the dataset [string] + --filter, -f Name of the Dataset to search for [string] [default: ""] + --modelName, -m Name of the model [string] [default: false] + --modelId, -a Id of the model [string] [default: ""] + --modelEvaluationId, -e Id of the model evaluation [string] [default: ""] + --operationFullId, -o Full name of an operation [string] [default: ""] + --projectId, -z The GCLOUD_PROJECT string, e.g. "my-gcloud-project" [number] [default: "nodejs-docs-samples"] + --help Show help [boolean] + +Examples: + node automlTranslationModel.js create-model -i "DatasetID" -m "myModelName" + node automlTranslationModel.js get-operation-status -i "datasetId" -o "OperationFullID" + node automlTranslationModel.js list-models -f "translationModelMetadata:*" + node automlTranslationModel.js get-model -a "ModelID" + node automlTranslationModel.js list-model-evaluations -a "ModelID" + node automlTranslationModel.js get-model-evaluation -a "ModelId" -e "ModelEvaluationID" + node automlTranslationModel.js delete-model -a "ModelID" + +For more information, see https://cloud.google.com/translate/docs +``` + +[automlTranslationModel_docs]: https://cloud.google.com/translate/docs +[automlTranslationModel_code]: automl/automlTranslationModel.js + +[shell_img]: //gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md + +### automlTranslationPredict + +View the [source code][automlTranslationPredict_code]. + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/automl/automlTranslationPredict.js,samples/README.md) + +__Usage:__ `node translate.js --help` + +``` +automlTranslationPredict.js + +Commands: + automlTranslationPredict.js predict classify the content + +Options: + --version Show version number [boolean] + --computeRegion, -c region name e.g. "us-central1" [string] [default: "us-central1"] + --filePath, -f local text file path of the content to be classified + [string] [default: "./resources/testInput.txt"] + --modelId, -i Id of the model which will be used for text classification [string] + --projectId, -z The GCLOUD_PROJECT string, e.g. "my-gcloud-project" [number] [default: "203278707824"] + --translationAllowFallback, -t Use true if AutoML will fallback to use a Google translation model fortranslation + requests if the specified AutoML translation model cannotserve the request. Use false + to not use Google translation model. [string] [default: "False"] + --help Show help [boolean] + +Examples: + node automlTranslationPredict.js predict -i "modelId" -f "./resources/testInput.txt" -t "False" + +For more information, see https://cloud.google.com/translate/docs +``` + +[automlTranslationPredict_docs]: https://cloud.google.com/translate/docs +[automlTranslationPredict_code]: automl/automlTranslationPredict.js + +[shell_img]: //gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md + diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 1c2fff4906d..beff7870be3 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -15,6 +15,8 @@ }, "dependencies": { "@google-cloud/translate": "^2.1.2", + "@google-cloud/automl": "^0.1.1", + "mathjs": "^5.1.0", "yargs": "^12.0.1" }, "devDependencies": { From b897fd206cd752d0536f8bd5151aaef4847c4816 Mon Sep 17 00:00:00 2001 From: DPE bot Date: Thu, 27 Sep 2018 19:13:58 -0700 Subject: [PATCH 161/513] Update CI config (#135) --- packages/google-cloud-translate/.circleci/config.yml | 2 -- packages/google-cloud-translate/codecov.yaml | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-translate/codecov.yaml diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 8af6a4d0489..da54155fc57 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -68,8 +68,6 @@ jobs: environment: NPM_CONFIG_PREFIX: /home/node/.npm-global - run: npm test - - run: node_modules/.bin/codecov - node8: docker: - image: 'node:8' diff --git a/packages/google-cloud-translate/codecov.yaml b/packages/google-cloud-translate/codecov.yaml new file mode 100644 index 00000000000..5724ea9478d --- /dev/null +++ b/packages/google-cloud-translate/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com From 69cb8246d4e7bc184985d10897e3074958bedc30 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 28 Sep 2018 06:44:10 -0700 Subject: [PATCH 162/513] chore(deps): update dependency typescript to ~3.1.0 (#136) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 4644b96e44f..c99b98bb5da 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -101,6 +101,6 @@ "prettier": "^1.13.5", "proxyquire": "^2.0.1", "source-map-support": "^0.5.6", - "typescript": "~3.0.0" + "typescript": "~3.1.0" } } From 97ac9be20c3da117cb38188e4ae6b451507b043f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 1 Oct 2018 05:02:28 -0700 Subject: [PATCH 163/513] chore(deps): update dependency eslint-plugin-prettier to v3 (#139) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c99b98bb5da..01e9a5fad94 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -89,7 +89,7 @@ "eslint": "^5.0.0", "eslint-config-prettier": "^3.0.0", "eslint-plugin-node": "^7.0.0", - "eslint-plugin-prettier": "^2.6.0", + "eslint-plugin-prettier": "^3.0.0", "gts": "^0.8.0", "hard-rejection": "^1.0.0", "ink-docstrap": "^1.3.2", From 5dff98853238dc690fdc843a97a4d6e133532dcf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 15 Oct 2018 14:47:49 -0700 Subject: [PATCH 164/513] chore(deps): update dependency sinon to v7 (#142) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index beff7870be3..71e7a868004 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -23,6 +23,6 @@ "@google-cloud/nodejs-repo-tools": "^2.3.0", "ava": "^0.25.0", "proxyquire": "^2.0.1", - "sinon": "^6.0.1" + "sinon": "^7.0.0" } } From 454c0f972be31f4253c9f2231a8088854b6a6247 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 26 Oct 2018 06:34:47 -0700 Subject: [PATCH 165/513] fix(deps): update dependency @google-cloud/common to ^0.26.0 (#149) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 01e9a5fad94..7c536cd82d6 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -68,7 +68,7 @@ "presystem-test": "npm run compile" }, "dependencies": { - "@google-cloud/common": "^0.25.0", + "@google-cloud/common": "^0.26.0", "@google-cloud/promisify": "^0.3.0", "arrify": "^1.0.1", "extend": "^3.0.1", From 0066605a2e5c114617d93fe42f24490efd12661d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sun, 28 Oct 2018 08:34:13 -0700 Subject: [PATCH 166/513] chore(deps): update dependency eslint-plugin-node to v8 (#157) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7c536cd82d6..a28e92e220e 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -88,7 +88,7 @@ "codecov": "^3.0.2", "eslint": "^5.0.0", "eslint-config-prettier": "^3.0.0", - "eslint-plugin-node": "^7.0.0", + "eslint-plugin-node": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", "gts": "^0.8.0", "hard-rejection": "^1.0.0", From cf612e91a3f9836cff71abf8c06b452a2ac3437b Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 1 Nov 2018 12:03:13 -0700 Subject: [PATCH 167/513] chore: update CircleCI config (#163) --- packages/google-cloud-translate/.circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index da54155fc57..6735ebdaaa1 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -159,7 +159,8 @@ jobs: command: npm run system-test environment: GCLOUD_PROJECT: long-door-651 - GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json + GOOGLE_APPLICATION_CREDENTIALS: /home/node/project/.circleci/key.json + NPM_CONFIG_PREFIX: /home/node/.npm-global - run: name: Remove unencrypted key. command: | From 3084a9c93d1972dcf083cee5d0c03cf3baf9307d Mon Sep 17 00:00:00 2001 From: DPE bot Date: Sun, 4 Nov 2018 22:21:30 -0800 Subject: [PATCH 168/513] chore(build): ignore build dir with eslint chore(build): ignore build dir with eslint --- packages/google-cloud-translate/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-translate/.eslintignore b/packages/google-cloud-translate/.eslintignore index f6fac98b0a8..f08b0fd1c65 100644 --- a/packages/google-cloud-translate/.eslintignore +++ b/packages/google-cloud-translate/.eslintignore @@ -1,3 +1,4 @@ node_modules/* samples/node_modules/* src/**/doc/* +build/ From c1e2f44be9ebca235bad5c167bf20a85979432fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 8 Nov 2018 09:04:11 -0800 Subject: [PATCH 169/513] chore(deps): update dependency @types/is to v0.0.21 (#166) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index a28e92e220e..1c02b100608 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -80,7 +80,7 @@ "@google-cloud/nodejs-repo-tools": "^2.3.0", "@types/arrify": "^1.0.4", "@types/extend": "^3.0.0", - "@types/is": "0.0.20", + "@types/is": "0.0.21", "@types/mocha": "^5.2.4", "@types/node": "^10.5.7", "@types/proxyquire": "^1.3.28", From 19a828952b89b2bd0a72f2c92d72ec87efa48581 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 9 Nov 2018 10:00:43 -0800 Subject: [PATCH 170/513] chore: drop contributors from multiple places (#167) --- packages/google-cloud-translate/CONTRIBUTORS | 23 -------------------- packages/google-cloud-translate/package.json | 20 ----------------- 2 files changed, 43 deletions(-) delete mode 100644 packages/google-cloud-translate/CONTRIBUTORS diff --git a/packages/google-cloud-translate/CONTRIBUTORS b/packages/google-cloud-translate/CONTRIBUTORS deleted file mode 100644 index fa4f506ed93..00000000000 --- a/packages/google-cloud-translate/CONTRIBUTORS +++ /dev/null @@ -1,23 +0,0 @@ -# The names of individuals who have contributed to this project. -# -# Names are formatted as: -# name -# -Ace Nassri -Alexander Fenster -Dave Gramlich -Eric Uldall -Ernest Landrito -F. Hinkelmann -Jason Dobry -Jason Dobry -Jonathan Lui -Justin Beckwith -Luke Sneeringer -Stephen -Stephen Sawchuk -Stephen Sawchuk -Tim Swast -florencep -greenkeeper[bot] -renovate[bot] diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 1c02b100608..7e0d05e4f58 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -29,26 +29,6 @@ "google translate", "translate" ], - "contributors": [ - "Ace Nassri ", - "Alexander Fenster ", - "Dave Gramlich ", - "Eric Uldall ", - "Ernest Landrito ", - "F. Hinkelmann ", - "Jason Dobry ", - "Jason Dobry ", - "Jonathan Lui ", - "Justin Beckwith ", - "Luke Sneeringer ", - "Stephen ", - "Stephen Sawchuk ", - "Stephen Sawchuk ", - "Tim Swast ", - "florencep ", - "greenkeeper[bot] ", - "renovate[bot] " - ], "scripts": { "cover": "nyc --reporter=lcov mocha build/test && nyc report", "docs": "jsdoc -c .jsdoc.js", From 8c9d2f4adaa1362d698c95110a4c4501258f761a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 10 Nov 2018 10:49:53 -0800 Subject: [PATCH 171/513] chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 (#168) --- packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7e0d05e4f58..8fe852f5d57 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -57,7 +57,7 @@ "teeny-request": "^3.4.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^2.3.0", + "@google-cloud/nodejs-repo-tools": "^3.0.0", "@types/arrify": "^1.0.4", "@types/extend": "^3.0.0", "@types/is": "0.0.21", diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 71e7a868004..59176993674 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -20,7 +20,7 @@ "yargs": "^12.0.1" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^2.3.0", + "@google-cloud/nodejs-repo-tools": "^3.0.0", "ava": "^0.25.0", "proxyquire": "^2.0.1", "sinon": "^7.0.0" From 6aff991f824526a733c15c09bae8d0c77ced0151 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 12 Nov 2018 15:54:28 -0800 Subject: [PATCH 172/513] chore: update eslintignore config (#169) --- packages/google-cloud-translate/.eslintignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/.eslintignore b/packages/google-cloud-translate/.eslintignore index f08b0fd1c65..2f642cb6044 100644 --- a/packages/google-cloud-translate/.eslintignore +++ b/packages/google-cloud-translate/.eslintignore @@ -1,4 +1,3 @@ -node_modules/* -samples/node_modules/* +**/node_modules src/**/doc/* build/ From 850403b40206300d71bfce6476e0c2ebc76b470c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 13 Nov 2018 08:11:32 -0800 Subject: [PATCH 173/513] chore(deps): update dependency gts to ^0.9.0 (#170) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 8fe852f5d57..1cd4d498cc9 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -70,7 +70,7 @@ "eslint-config-prettier": "^3.0.0", "eslint-plugin-node": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", - "gts": "^0.8.0", + "gts": "^0.9.0", "hard-rejection": "^1.0.0", "ink-docstrap": "^1.3.2", "intelli-espower-loader": "^1.0.1", From bb005a7c7a36dad806bca1683c76feb7fe1ed2cc Mon Sep 17 00:00:00 2001 From: nareshqlogic <44403913+nareshqlogic@users.noreply.github.com> Date: Fri, 16 Nov 2018 00:35:18 +0530 Subject: [PATCH 174/513] refactor(samples): convert sample tests from ava to mocha (#171) --- packages/google-cloud-translate/samples/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 59176993674..2f6b3196bcc 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -9,8 +9,7 @@ "node": ">=8" }, "scripts": { - "ava": "ava -T 20s --verbose test/*.test.js ./system-test/*.test.js", - "cover": "nyc --reporter=lcov --cache ava -T 20s --verbose test/*.test.js ./system-test/*.test.js && nyc report", + "cover": "nyc --reporter=lcov --cache mocha ./system-test/*.test.js --timeout=60000 && nyc report", "test": "npm run cover" }, "dependencies": { From eedb820cd545ea802c8cc6228671ecf873454358 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Mon, 19 Nov 2018 09:16:21 -0800 Subject: [PATCH 175/513] chore: add a synth.metadata --- packages/google-cloud-translate/synth.metadata | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/google-cloud-translate/synth.metadata diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata new file mode 100644 index 00000000000..9e26dfeeb6e --- /dev/null +++ b/packages/google-cloud-translate/synth.metadata @@ -0,0 +1 @@ +{} \ No newline at end of file From d13489b16d2f3cb9f47ab8fde801d66379065c1e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 30 Nov 2018 05:23:54 -0800 Subject: [PATCH 176/513] chore(deps): update dependency typescript to ~3.2.0 (#177) --- packages/google-cloud-translate/package.json | 5 ++--- packages/google-cloud-translate/src/index.ts | 7 +++---- .../system-test/.eslintrc.yml | 6 ------ .../system-test/translate.ts | 2 -- .../google-cloud-translate/test/.eslintrc.yml | 5 ----- packages/google-cloud-translate/test/index.ts | 18 ++++++++++-------- 6 files changed, 15 insertions(+), 28 deletions(-) delete mode 100644 packages/google-cloud-translate/system-test/.eslintrc.yml delete mode 100644 packages/google-cloud-translate/test/.eslintrc.yml diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 1cd4d498cc9..0b7033fef74 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -34,7 +34,6 @@ "docs": "jsdoc -c .jsdoc.js", "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", "lint": "npm run check && eslint samples/", - "prettier": "prettier --write samples/*.js samples/*/*.js", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha build/system-test --timeout 600000", "test-no-cover": "mocha build/test", @@ -42,7 +41,7 @@ "check": "gts check", "clean": "gts clean", "compile": "tsc -p .", - "fix": "gts fix && eslint --fix 'samples/**/*.js' && npm run prettier", + "fix": "gts fix && eslint --fix 'samples/**/*.js'", "prepare": "npm run compile", "pretest": "npm run compile", "presystem-test": "npm run compile" @@ -81,6 +80,6 @@ "prettier": "^1.13.5", "proxyquire": "^2.0.1", "source-map-support": "^0.5.6", - "typescript": "~3.1.0" + "typescript": "~3.2.0" } } diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index b99382ce932..5adc2556f01 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -14,14 +14,13 @@ * limitations under the License. */ -'use strict'; - -import * as arrify from 'arrify'; import {Service, util} from '@google-cloud/common'; import {promisifyAll} from '@google-cloud/promisify'; -import {GoogleAuthOptions} from 'google-auth-library'; +import * as arrify from 'arrify'; import * as extend from 'extend'; +import {GoogleAuthOptions} from 'google-auth-library'; import * as is from 'is'; + const isHtml = require('is-html'); import {DecorateRequestOptions, BodyResponseCallback} from '@google-cloud/common/build/src/util'; import * as r from 'request'; diff --git a/packages/google-cloud-translate/system-test/.eslintrc.yml b/packages/google-cloud-translate/system-test/.eslintrc.yml deleted file mode 100644 index 2e6882e46d2..00000000000 --- a/packages/google-cloud-translate/system-test/.eslintrc.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -env: - mocha: true -rules: - node/no-unpublished-require: off - no-console: off diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 626c88375a9..c3a4252bd18 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -14,8 +14,6 @@ * limitations under the License. */ -'use strict'; - import * as assert from 'assert'; import {Translate} from '../src'; diff --git a/packages/google-cloud-translate/test/.eslintrc.yml b/packages/google-cloud-translate/test/.eslintrc.yml deleted file mode 100644 index 73f7bbc946f..00000000000 --- a/packages/google-cloud-translate/test/.eslintrc.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -env: - mocha: true -rules: - node/no-unpublished-require: off diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index 65f6acc98dc..9a4db673816 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -'use strict'; - +import {DecorateRequestOptions, util} from '@google-cloud/common'; +import {BodyResponseCallback, MakeRequestConfig} from '@google-cloud/common/build/src/util'; +import * as pfy from '@google-cloud/promisify'; import * as assert from 'assert'; import * as extend from 'extend'; import * as proxyquire from 'proxyquire'; -import {util} from '@google-cloud/common'; -import * as pfy from '@google-cloud/promisify'; -import * as orig from '../src'; import * as r from 'request'; +import * as orig from '../src'; + const pkgJson = require('../../package.json'); // tslint:disable-next-line no-any @@ -38,11 +38,13 @@ const fakePromisify = extend({}, pfy, { }); const fakeUtil = extend({}, util, { - makeRequest() { + makeRequest( + opts: DecorateRequestOptions, cfg: MakeRequestConfig, + cb: BodyResponseCallback) { if (makeRequestOverride) { - return makeRequestOverride.apply(null, arguments); + return makeRequestOverride(opts, cfg, cb); } - return util.makeRequest.apply(null, arguments); + return util.makeRequest(opts, cfg, cb); }, }); const originalFakeUtil = extend(true, {}, fakeUtil); From eb7e8bc1e059682f91f7dcb702b2b52a6736635b Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Sat, 1 Dec 2018 18:41:47 -0800 Subject: [PATCH 177/513] fix(build): fix system key decryption (#178) --- packages/google-cloud-translate/.circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml index 6735ebdaaa1..86c63432242 100644 --- a/packages/google-cloud-translate/.circleci/config.yml +++ b/packages/google-cloud-translate/.circleci/config.yml @@ -116,7 +116,7 @@ jobs: name: Decrypt credentials. command: | if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - openssl aes-256-cbc -d -in .circleci/key.json.enc \ + openssl aes-256-cbc -d -md md5 -in .circleci/key.json.enc \ -out .circleci/key.json \ -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" fi @@ -148,7 +148,7 @@ jobs: command: | if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then for encrypted_key in .circleci/*.json.enc; do - openssl aes-256-cbc -d -in $encrypted_key \ + openssl aes-256-cbc -d -md md5 -in $encrypted_key \ -out $(echo $encrypted_key | sed 's/\.enc//') \ -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" done From ba1c58c0310a501d5fb9323bb20f1b8784006aa7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sun, 2 Dec 2018 11:25:53 -0800 Subject: [PATCH 178/513] fix(deps): update dependency @google-cloud/common to ^0.27.0 (#176) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 0b7033fef74..2d5ce3159b3 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -47,7 +47,7 @@ "presystem-test": "npm run compile" }, "dependencies": { - "@google-cloud/common": "^0.26.0", + "@google-cloud/common": "^0.27.0", "@google-cloud/promisify": "^0.3.0", "arrify": "^1.0.1", "extend": "^3.0.1", From 1fd5330467cd638e567126e29c629c7a7bb1a69f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 3 Dec 2018 15:49:59 -0800 Subject: [PATCH 179/513] docs: update readme badges (#180) --- packages/google-cloud-translate/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 91e4c03529d..f9fbe4b72dc 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -5,8 +5,7 @@ # [Google Cloud Translation API: Node.js Client](https://github.com/googleapis/nodejs-translate) [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![CircleCI](https://img.shields.io/circleci/project/github/googleapis/nodejs-translate.svg?style=flat)](https://circleci.com/gh/googleapis/nodejs-translate) -[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/googleapis/nodejs-translate?branch=master&svg=true)](https://ci.appveyor.com/project/googleapis/nodejs-translate) +[![npm version](https://img.shields.io/npm/v/@google-cloud/translate.svg)](https://www.npmjs.org/package/@google-cloud/translate) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-translate/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-translate) The [Cloud Translation API](https://cloud.google.com/translate/docs), can dynamically translate text between thousands of language pairs. The Cloud Translation API lets websites and programs integrate with the translation service programmatically. The Cloud Translation API is part of the larger Cloud Machine Learning API family. @@ -120,3 +119,4 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=translate.googleapis.com [auth]: https://cloud.google.com/docs/authentication/getting-started + From 0562c767d0cfcbc136f84508adadf425dc31b331 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 4 Dec 2018 08:51:30 -0800 Subject: [PATCH 180/513] chore: update license file (#182) --- packages/google-cloud-translate/LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/LICENSE b/packages/google-cloud-translate/LICENSE index 7a4a3ea2424..d6456956733 100644 --- a/packages/google-cloud-translate/LICENSE +++ b/packages/google-cloud-translate/LICENSE @@ -199,4 +199,4 @@ 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. \ No newline at end of file + limitations under the License. From 18fe5f7872ea444e7dbc1bf12963169ccd56919c Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 5 Dec 2018 15:54:54 -0800 Subject: [PATCH 181/513] chore: nyc ignore build/test by default (#184) --- packages/google-cloud-translate/.nycrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/.nycrc b/packages/google-cloud-translate/.nycrc index a1a8e6920ce..feb032400d4 100644 --- a/packages/google-cloud-translate/.nycrc +++ b/packages/google-cloud-translate/.nycrc @@ -3,7 +3,8 @@ "exclude": [ "src/*{/*,/**/*}.js", "src/*/v*/*.js", - "test/**/*.js" + "test/**/*.js", + "build/test" ], "watermarks": { "branches": [ From 4b86a81c6b3082004436be180ecb94bc65367943 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 6 Dec 2018 15:25:13 -0800 Subject: [PATCH 182/513] fix(docs): place doc comment above the last overload (#186) --- packages/google-cloud-translate/src/index.ts | 53 ++++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 5adc2556f01..ed10510fdcb 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -203,6 +203,10 @@ class Translate extends Service { } } + detect(input: string): Promise<[DetectResult, r.Response]>; + detect(input: string[]): Promise<[DetectResult[], r.Response]>; + detect(input: string, callback: DetectCallback): void; + detect(input: string[], callback: DetectCallback): void; /** * Detect the language used in a string or multiple strings. * @@ -266,10 +270,6 @@ class Translate extends Service { * region_tag:translate_detect_language * Here's a full example: */ - detect(input: string): Promise<[DetectResult, r.Response]>; - detect(input: string[]): Promise<[DetectResult[], r.Response]>; - detect(input: string, callback: DetectCallback): void; - detect(input: string[], callback: DetectCallback): void; detect( input: string|string[], callback?: DetectCallback| @@ -312,6 +312,9 @@ class Translate extends Service { }); } + getLanguages(target?: string): Promise<[LanguageResult[], r.Response]>; + getLanguages(target: string, callback: GetLanguagesCallback): void; + getLanguages(callback: GetLanguagesCallback): void; /** * Get an array of all supported languages. * @@ -330,9 +333,6 @@ class Translate extends Service { * region_tag:translate_list_language_names * Gets the language names in a language other than English: */ - getLanguages(target?: string): Promise<[LanguageResult[], r.Response]>; - getLanguages(target: string, callback: GetLanguagesCallback): void; - getLanguages(callback: GetLanguagesCallback): void; getLanguages( targetOrCallback?: string|GetLanguagesCallback, callback?: GetLanguagesCallback): @@ -373,7 +373,22 @@ class Translate extends Service { }); } - + translate(input: string, options: TranslateRequest): + Promise<[string, r.Response]>; + translate(input: string[], options: TranslateRequest): + Promise<[string[], r.Response]>; + translate(input: string, to: string): Promise<[string, r.Response]>; + translate(input: string[], to: string): Promise<[string[], r.Response]>; + translate( + input: string, options: TranslateRequest, + callback: TranslateCallback): void; + translate(input: string, to: string, callback: TranslateCallback): + void; + translate( + input: string[], options: TranslateRequest, + callback: TranslateCallback): void; + translate(input: string[], to: string, callback: TranslateCallback): + void; /** * Translate a string or multiple strings into another language. * @@ -449,22 +464,6 @@ class Translate extends Service { * region_tag:translate_text_with_model * Translation using the premium model: */ - translate(input: string, options: TranslateRequest): - Promise<[string, r.Response]>; - translate(input: string[], options: TranslateRequest): - Promise<[string[], r.Response]>; - translate(input: string, to: string): Promise<[string, r.Response]>; - translate(input: string[], to: string): Promise<[string[], r.Response]>; - translate( - input: string, options: TranslateRequest, - callback: TranslateCallback): void; - translate(input: string, to: string, callback: TranslateCallback): - void; - translate( - input: string[], options: TranslateRequest, - callback: TranslateCallback): void; - translate(input: string[], to: string, callback: TranslateCallback): - void; translate( inputs: string|string[], optionsOrTo: string|TranslateRequest, callback?: TranslateCallback|TranslateCallback): @@ -528,6 +527,9 @@ class Translate extends Service { }); } + request(reqOpts: DecorateRequestOptions): Promise; + request(reqOpts: DecorateRequestOptions, callback: BodyResponseCallback): + void; /** * A custom request implementation. Requests to this API may optionally use an * API key for an application, not a bearer token from a service account. This @@ -539,9 +541,6 @@ class Translate extends Service { * @param {object} reqOpts - Request options that are passed to `request`. * @param {function} callback - The callback function passed to `request`. */ - request(reqOpts: DecorateRequestOptions): Promise; - request(reqOpts: DecorateRequestOptions, callback: BodyResponseCallback): - void; request(reqOpts: DecorateRequestOptions, callback?: BodyResponseCallback): void|Promise { if (!this.key) { From d8a1ecaf4276bada39474187ba4d82307e0a1c94 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 7 Dec 2018 17:01:14 -0800 Subject: [PATCH 183/513] Release v2.1.3 (#187) --- packages/google-cloud-translate/CHANGELOG.md | 51 +++++++++++++++++++ packages/google-cloud-translate/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 7d1aec468df..c1d534cd50d 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,57 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## v2.1.3 + +12-06-2018 17:12 PST + +### Dependencies +- fix(deps): update dependency @google-cloud/common to ^0.27.0 ([#176](https://github.com/googleapis/nodejs-translate/pull/176)) +- chore(deps): update dependency typescript to ~3.2.0 ([#177](https://github.com/googleapis/nodejs-translate/pull/177)) +- chore(deps): update dependency gts to ^0.9.0 ([#170](https://github.com/googleapis/nodejs-translate/pull/170)) +- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#168](https://github.com/googleapis/nodejs-translate/pull/168)) +- chore(deps): update dependency @types/is to v0.0.21 ([#166](https://github.com/googleapis/nodejs-translate/pull/166)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#157](https://github.com/googleapis/nodejs-translate/pull/157)) +- fix(deps): update dependency @google-cloud/common to ^0.26.0 ([#149](https://github.com/googleapis/nodejs-translate/pull/149)) +- chore(deps): update dependency sinon to v7 ([#142](https://github.com/googleapis/nodejs-translate/pull/142)) +- fix(deps): update dependency @google-cloud/translate to v2 ([#137](https://github.com/googleapis/nodejs-translate/pull/137)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#139](https://github.com/googleapis/nodejs-translate/pull/139)) +- chore(deps): update dependency typescript to ~3.1.0 ([#136](https://github.com/googleapis/nodejs-translate/pull/136)) + +### Documentation +- fix(docs): place doc comment above the last overload ([#186](https://github.com/googleapis/nodejs-translate/pull/186)) +- docs: update readme badges ([#180](https://github.com/googleapis/nodejs-translate/pull/180)) +- docs(samples): updated samples code to use async await ([#154](https://github.com/googleapis/nodejs-translate/pull/154)) + +### Internal / Testing Changes +- chore: always nyc report before calling codecov ([#185](https://github.com/googleapis/nodejs-translate/pull/185)) +- chore: nyc ignore build/test by default ([#184](https://github.com/googleapis/nodejs-translate/pull/184)) +- chore: update license file ([#182](https://github.com/googleapis/nodejs-translate/pull/182)) +- fix(build): fix system key decryption ([#178](https://github.com/googleapis/nodejs-translate/pull/178)) +- chore: add a synth.metadata +- refactor(samples): convert sample tests from ava to mocha ([#171](https://github.com/googleapis/nodejs-translate/pull/171)) +- chore: update eslintignore config ([#169](https://github.com/googleapis/nodejs-translate/pull/169)) +- chore: drop contributors from multiple places ([#167](https://github.com/googleapis/nodejs-translate/pull/167)) +- chore: use latest npm on Windows ([#165](https://github.com/googleapis/nodejs-translate/pull/165)) +- chore(build): ignore build dir with eslint +- chore: update CircleCI config ([#163](https://github.com/googleapis/nodejs-translate/pull/163)) +- fix: fix the sample tests ([#156](https://github.com/googleapis/nodejs-translate/pull/156)) +- chore: update issue templates ([#155](https://github.com/googleapis/nodejs-translate/pull/155)) +- chore: remove old issue template ([#151](https://github.com/googleapis/nodejs-translate/pull/151)) +- build: run tests on node11 ([#150](https://github.com/googleapis/nodejs-translate/pull/150)) +- chores(build): do not collect sponge.xml from windows builds ([#148](https://github.com/googleapis/nodejs-translate/pull/148)) +- chores(build): run codecov on continuous builds ([#147](https://github.com/googleapis/nodejs-translate/pull/147)) +- chore: update new issue template ([#146](https://github.com/googleapis/nodejs-translate/pull/146)) +- build: fix codecov uploading on Kokoro ([#143](https://github.com/googleapis/nodejs-translate/pull/143)) +- Update kokoro config ([#140](https://github.com/googleapis/nodejs-translate/pull/140)) +- Update CI config ([#135](https://github.com/googleapis/nodejs-translate/pull/135)) +- samples: fixed incorrect end tag ([#134](https://github.com/googleapis/nodejs-translate/pull/134)) +- Update CI config ([#130](https://github.com/googleapis/nodejs-translate/pull/130)) +- Translate Automl samples ([#131](https://github.com/googleapis/nodejs-translate/pull/131)) +- Don't publish sourcemaps ([#132](https://github.com/googleapis/nodejs-translate/pull/132)) +- test: remove appveyor config ([#129](https://github.com/googleapis/nodejs-translate/pull/129)) +- build: update CI configs ([#127](https://github.com/googleapis/nodejs-translate/pull/127)) + ## v2.1.2 ### Bug fixes diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 2d5ce3159b3..a7ec478f1cc 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "2.1.2", + "version": "2.1.3", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 2f6b3196bcc..3279abb22c5 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -13,7 +13,7 @@ "test": "npm run cover" }, "dependencies": { - "@google-cloud/translate": "^2.1.2", + "@google-cloud/translate": "^2.1.3", "@google-cloud/automl": "^0.1.1", "mathjs": "^5.1.0", "yargs": "^12.0.1" From 3b202d80b7f703310db21d196550b2401eca7485 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 10 Dec 2018 13:34:20 -0800 Subject: [PATCH 184/513] build: add Kokoro configs for autorelease (#190) * build: add Kokoro configs for autorelease * build: add Kokoro configs for autorelease * chore: remove CircleCI config --- .../.circleci/config.yml | 179 ------------------ .../.circleci/key.json.enc | Bin 2368 -> 0 bytes .../.circleci/npm-install-retry.js | 60 ------ 3 files changed, 239 deletions(-) delete mode 100644 packages/google-cloud-translate/.circleci/config.yml delete mode 100644 packages/google-cloud-translate/.circleci/key.json.enc delete mode 100755 packages/google-cloud-translate/.circleci/npm-install-retry.js diff --git a/packages/google-cloud-translate/.circleci/config.yml b/packages/google-cloud-translate/.circleci/config.yml deleted file mode 100644 index 86c63432242..00000000000 --- a/packages/google-cloud-translate/.circleci/config.yml +++ /dev/null @@ -1,179 +0,0 @@ -version: 2 -workflows: - version: 2 - tests: - jobs: &workflow_jobs - - node6: - filters: &all_commits - tags: - only: /.*/ - - node8: - filters: *all_commits - - node10: - filters: *all_commits - - lint: - requires: - - node6 - - node8 - - node10 - filters: *all_commits - - docs: - requires: - - node6 - - node8 - - node10 - filters: *all_commits - - system_tests: - requires: - - lint - - docs - filters: &master_and_releases - branches: - only: master - tags: &releases - only: '/^v[\d.]+$/' - - sample_tests: - requires: - - lint - - docs - filters: *master_and_releases - - publish_npm: - requires: - - system_tests - - sample_tests - filters: - branches: - ignore: /.*/ - tags: *releases - nightly: - triggers: - - schedule: - cron: 0 7 * * * - filters: - branches: - only: master - jobs: *workflow_jobs -jobs: - node6: - docker: - - image: 'node:6' - user: node - steps: &unit_tests_steps - - checkout - - run: &npm_install_and_link - name: Install and link the module - command: |- - mkdir -p /home/node/.npm-global - ./.circleci/npm-install-retry.js - environment: - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: npm test - node8: - docker: - - image: 'node:8' - user: node - steps: *unit_tests_steps - node10: - docker: - - image: 'node:10' - user: node - steps: *unit_tests_steps - lint: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: *npm_install_and_link - - run: &samples_npm_install_and_link - name: Link the module being tested to the samples. - command: | - cd samples/ - npm link ../ - ./../.circleci/npm-install-retry.js - environment: - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Run linting. - command: npm run lint - environment: - NPM_CONFIG_PREFIX: /home/node/.npm-global - docs: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: *npm_install_and_link - - run: npm run docs - sample_tests: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: - name: Decrypt credentials. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - openssl aes-256-cbc -d -md md5 -in .circleci/key.json.enc \ - -out .circleci/key.json \ - -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" - fi - - run: *npm_install_and_link - - run: *samples_npm_install_and_link - - run: - name: Run sample tests. - command: npm run samples-test - environment: - GCLOUD_PROJECT: long-door-651 - GOOGLE_APPLICATION_CREDENTIALS: /home/node/samples/.circleci/key.json - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Remove unencrypted key. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - rm .circleci/key.json - fi - when: always - working_directory: /home/node/samples/ - system_tests: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: - name: Decrypt credentials. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - for encrypted_key in .circleci/*.json.enc; do - openssl aes-256-cbc -d -md md5 -in $encrypted_key \ - -out $(echo $encrypted_key | sed 's/\.enc//') \ - -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" - done - fi - - run: *npm_install_and_link - - run: - name: Run system tests. - command: npm run system-test - environment: - GCLOUD_PROJECT: long-door-651 - GOOGLE_APPLICATION_CREDENTIALS: /home/node/project/.circleci/key.json - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Remove unencrypted key. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - rm .circleci/*.json - fi - when: always - publish_npm: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: ./.circleci/npm-install-retry.js - - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - - run: npm publish --access=public diff --git a/packages/google-cloud-translate/.circleci/key.json.enc b/packages/google-cloud-translate/.circleci/key.json.enc deleted file mode 100644 index 0de23fb2182c10cbe02c3e57ecace392c7015552..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2368 zcmV-G3BUGJVQh3|WM5xQt<`oVSbY)HVQpG6zWZ|x7N$0BFw(WTVt`Ke2;vlbc~kai zIhY1t`LA}Qe$q%)u`NH_>>BBn)@Vu#EMC(7?GI5=TbOR&xXGwg3bf5FI(7C~PXPz>63jKB0zXU3Ym?^`01pXpPVt+fFSZexL{1lkH7KktgKG*bF=kmq$&K_%mQ@)zgLS)Ql+2@&TTf(&d}0#s)CZPI+(7^|Cs&;XjP z6!-EjMc?u#w!Js!Ll|X3I%6tOQRpu{P2mSP015k5$yu zk{7Qz_0e8nXt~7XRJ)6j*CNl=@$5I8x1jeb6e%+LSg%;LLas2mpG#R(dTB(=7r{Av zt}bwYGL}ZJ{qfq(c1z_*$tE_F#A!=q1g5InWYrUNYFOi!ZM5^x0q;uD*8}U;T?=%{ zK6a+MtEg{2r1HjwthSyV@ZY;%H7PD{UWx%bBiKM|P9@G-fkGC%QL7?P=7V8H>PDsD z^H9N#!X`l7?5P_$hq%F#SK^k$-u%hUU8bj6>qfHWwK@V)(K~-+0^WN(#lOGAIa4C? z2Z_2@rilxyRFu*WA%|y+6o$hjMEu}j{Cca4qXs+D)auF2SGZowyQQ*5z>-VWy(QLKZH~Dr<-h7&o1|?D7t&Meo~u!AR~}HTmFY zngb>FH?P{9H@)AJDBZ#ki3s-;63Ej^PlTe$H8hQ@GvtEI>>#V{+Wi>5Z8~@{x@P~s zP-XTLxiVs_Rw>ga^|Ki;z8-Jcqhf|j#_xM|r59y^Rv}0?GeRqimiWp<*4qwn$<=Ve z`!~X_xp5wq4kQ-}5%03<0E)j~Ynd^I0y*jyR!Gkntw=2X!(}8keH2QYMo}p=53CN0 zZ*1E!=*eIGXBP|@%GwPr2VeK)a_}~#Pmkm%A}B8wtyjRL!FiJU%gPVwNqQD;MXhB% zpCiu8u?F!RB9nd8`;z~wfqu}&0}wY@PONZcL3RbxV7O2@(BNA0o5e#>$`Mo|L4oNK z`o_>UcSt}Fa#!|ZdR1MFw?mH2@(9icsR6<*>TVz7?|cXf{~u|s?A1y7v*dbfg2}AV z@8BK*vF95k^n=Sht%e+g);|_C2IWg&-swm!rIO!r^ zNA1jyCGckK!qfsYH#WRN?UbCzF+s7V;(lsGgZE=^fQN~~jqKW^N9f)nEm|tKPZS+9 zBcA_0(aGv&0Ptd+Fr1uE$Q!DOfxD4 z;+ZkqJ6ALDU$odrAt{|7)oN+!TyXDkGPN;Tw{2=_a?=Sqii8$xz;IO~HEp1=Y;n9C zI)+l-FDN@0r)G+?)48@?x!efS3G0;5{W-gyw%Pspe6EnGw$FGOsuYsac>pSzSX1O| zf=cq|6kr9%VawNjKi0Z9WZu_&MZ7Zh5ebZ3w3CfR zn=V7r8>SMu$Y5#LL=D$KbK1oTU~IqLXsvC#vNWalq#lKrfQoFv1j+#qYPA~Adj0xV zsjG1&N@+EtHuRsxXtKMWLgSHz#h;gnxF9%1p&70Z}M@|A2#5 z7z^=~Ac*K|9A#Y0UnIfXuGGrjTdv{=-QIzh9yI%7t{hLz?AX_$1J#U z`$*<22|cc!J0yDte5|&~e1eK4*b^A6*SJCG^-1^&xtiPqOUc=RdC3ThW5C0$v%6r9SUcD&B#5avAAV zUcV20Rjj+9B^M!O`G0acl0Sj)b4_YnLeF+i2vj*_&024IEBq3_I(H(~t9yrDg{_Vf zb~d3z)}K%za0N+;Q)V;27c}U)E`z=^T;f5)Kn!s^^8`q|HW z{4)of)Yf@VlzB}ro;C$l>M1F2fBqV8l=ep diff --git a/packages/google-cloud-translate/.circleci/npm-install-retry.js b/packages/google-cloud-translate/.circleci/npm-install-retry.js deleted file mode 100755 index 3240aa2cbf2..00000000000 --- a/packages/google-cloud-translate/.circleci/npm-install-retry.js +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env node - -let spawn = require('child_process').spawn; - -// -//USE: ./index.js [... NPM ARGS] -// - -let timeout = process.argv[2] || process.env.NPM_INSTALL_TIMEOUT || 60000; -let attempts = process.argv[3] || 3; -let args = process.argv.slice(4); -if (args.length === 0) { - args = ['install']; -} - -(function npm() { - let timer; - args.push('--verbose'); - let proc = spawn('npm', args); - proc.stdout.pipe(process.stdout); - proc.stderr.pipe(process.stderr); - proc.stdin.end(); - proc.stdout.on('data', () => { - setTimer(); - }); - proc.stderr.on('data', () => { - setTimer(); - }); - - // side effect: this also restarts when npm exits with a bad code even if it - // didnt timeout - proc.on('close', (code, signal) => { - clearTimeout(timer); - if (code || signal) { - console.log('[npm-are-you-sleeping] npm exited with code ' + code + ''); - - if (--attempts) { - console.log('[npm-are-you-sleeping] restarting'); - npm(); - } else { - console.log('[npm-are-you-sleeping] i tried lots of times. giving up.'); - throw new Error("npm install fails"); - } - } - }); - - function setTimer() { - clearTimeout(timer); - timer = setTimeout(() => { - console.log('[npm-are-you-sleeping] killing npm with SIGTERM'); - proc.kill('SIGTERM'); - // wait a couple seconds - timer = setTimeout(() => { - // its it's still not closed sigkill - console.log('[npm-are-you-sleeping] killing npm with SIGKILL'); - proc.kill('SIGKILL'); - }, 2000); - }, timeout); - } -})(); From e7911b2fbda4f2592493f3fcf847c87bdf506afa Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 11 Dec 2018 10:33:43 -0800 Subject: [PATCH 185/513] chore: update nyc and eslint configs (#194) --- packages/google-cloud-translate/.eslintignore | 1 + packages/google-cloud-translate/.nycrc | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/google-cloud-translate/.eslintignore b/packages/google-cloud-translate/.eslintignore index 2f642cb6044..f0c7aead4bf 100644 --- a/packages/google-cloud-translate/.eslintignore +++ b/packages/google-cloud-translate/.eslintignore @@ -1,3 +1,4 @@ **/node_modules src/**/doc/* build/ +docs/ diff --git a/packages/google-cloud-translate/.nycrc b/packages/google-cloud-translate/.nycrc index feb032400d4..88b001cb587 100644 --- a/packages/google-cloud-translate/.nycrc +++ b/packages/google-cloud-translate/.nycrc @@ -1,5 +1,6 @@ { "report-dir": "./.coverage", + "reporter": "lcov", "exclude": [ "src/*{/*,/**/*}.js", "src/*/v*/*.js", From c0fd299f7b5dcd412dc102bcb17ab59fb04a54ba Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 14 Dec 2018 11:20:16 -0800 Subject: [PATCH 186/513] fix(docs): brand issue - Translate API => Cloud Translation API (#196) --- packages/google-cloud-translate/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index ed10510fdcb..e8e10b2eb30 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -155,8 +155,8 @@ export interface TranslateConfig extends GoogleAuthOptions { * With [Google Translate](https://cloud.google.com/translate), you can * dynamically translate text between thousands of language pairs. * - * The Google Translate API lets websites and programs integrate with Google - * Translate programmatically. + * The Google Cloud Translation API lets websites and programs integrate with + * Google Translate programmatically. * * @class * @@ -167,7 +167,7 @@ export interface TranslateConfig extends GoogleAuthOptions { * * @example * //- - * //

Custom Translate API

+ * //

Custom Translation API

* // * // The environment variable, `GOOGLE_CLOUD_TRANSLATE_ENDPOINT`, is honored as * // a custom backend which our library will send requests to. From 3d678aeee27ec5e83e002a5484b6494e0817378a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 14 Dec 2018 12:04:00 -0800 Subject: [PATCH 187/513] fix(deps): update dependency @google-cloud/common to ^0.28.0 (#197) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index a7ec478f1cc..bb8072e6900 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -47,7 +47,7 @@ "presystem-test": "npm run compile" }, "dependencies": { - "@google-cloud/common": "^0.27.0", + "@google-cloud/common": "^0.28.0", "@google-cloud/promisify": "^0.3.0", "arrify": "^1.0.1", "extend": "^3.0.1", From 8fd4b9e0cff2cc9ac528ac3741b8ab9e9d2b26ed Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 17 Dec 2018 16:36:06 -0800 Subject: [PATCH 188/513] refactor: modernize sample tests (#199) --- packages/google-cloud-translate/package.json | 14 ++---- .../samples/package.json | 15 +++---- .../samples/quickstart.js | 43 ++++++++----------- .../google-cloud-translate/test/mocha.opts | 1 - 4 files changed, 29 insertions(+), 44 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index bb8072e6900..74617355d70 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -12,10 +12,7 @@ "types": "build/src/index.d.ts", "files": [ "build/src", - "!build/src/**/*.map", - "AUTHORS", - "CONTRIBUTORS", - "LICENSE" + "!build/src/**/*.map" ], "keywords": [ "google apis client", @@ -30,18 +27,16 @@ "translate" ], "scripts": { - "cover": "nyc --reporter=lcov mocha build/test && nyc report", "docs": "jsdoc -c .jsdoc.js", "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", - "lint": "npm run check && eslint samples/", + "lint": "npm run check && eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha build/system-test --timeout 600000", - "test-no-cover": "mocha build/test", - "test": "npm run cover", + "test": "nyc mocha build/test", "check": "gts check", "clean": "gts clean", "compile": "tsc -p .", - "fix": "gts fix && eslint --fix 'samples/**/*.js'", + "fix": "gts fix && eslint --fix '**/*.js'", "prepare": "npm run compile", "pretest": "npm run compile", "presystem-test": "npm run compile" @@ -70,7 +65,6 @@ "eslint-plugin-node": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", "gts": "^0.9.0", - "hard-rejection": "^1.0.0", "ink-docstrap": "^1.3.2", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 3279abb22c5..a9371ede36a 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -1,6 +1,5 @@ { "name": "nodejs-docs-samples-translate", - "version": "0.0.1", "private": true, "license": "Apache-2.0", "author": "Google Inc.", @@ -9,19 +8,17 @@ "node": ">=8" }, "scripts": { - "cover": "nyc --reporter=lcov --cache mocha ./system-test/*.test.js --timeout=60000 && nyc report", - "test": "npm run cover" + "test": "mocha system-test" }, "dependencies": { "@google-cloud/translate": "^2.1.3", - "@google-cloud/automl": "^0.1.1", - "mathjs": "^5.1.0", + "@google-cloud/automl": "^0.1.2", "yargs": "^12.0.1" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^3.0.0", - "ava": "^0.25.0", - "proxyquire": "^2.0.1", - "sinon": "^7.0.0" + "chai": "^4.2.0", + "execa": "^1.0.0", + "mocha": "^5.2.0", + "uuid": "^3.3.2" } } diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index d56235c2401..1798e4316c6 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -16,32 +16,27 @@ 'use strict'; // [START translate_quickstart] -// Imports the Google Cloud client library -const {Translate} = require('@google-cloud/translate'); +async function quickstart( + projectId = 'YOUR_PROJECT_ID' // Your GCP Project Id +) { + // Imports the Google Cloud client library + const {Translate} = require('@google-cloud/translate'); -// Your Google Cloud Platform project ID -const projectId = 'YOUR_PROJECT_ID'; + // Instantiates a client + const translate = new Translate({projectId}); -// Instantiates a client -const translate = new Translate({ - projectId: projectId, -}); + // The text to translate + const text = 'Hello, world!'; -// The text to translate -const text = 'Hello, world!'; -// The target language -const target = 'ru'; + // The target language + const target = 'ru'; -// Translates some text into Russian -translate - .translate(text, target) - .then(results => { - const translation = results[0]; - - console.log(`Text: ${text}`); - console.log(`Translation: ${translation}`); - }) - .catch(err => { - console.error('ERROR:', err); - }); + // Translates some text into Russian + const [translation] = await translate.translate(text, target); + console.log(`Text: ${text}`); + console.log(`Translation: ${translation}`); +} // [END translate_quickstart] + +const args = process.argv.slice(2); +quickstart(...args).catch(console.error); diff --git a/packages/google-cloud-translate/test/mocha.opts b/packages/google-cloud-translate/test/mocha.opts index 8c60795e047..48bf1c3df18 100644 --- a/packages/google-cloud-translate/test/mocha.opts +++ b/packages/google-cloud-translate/test/mocha.opts @@ -1,4 +1,3 @@ ---require hard-rejection/register --require source-map-support/register --require intelli-espower-loader --timeout 10000 From b0506507fa0d563d419c5ca5daf9fcae3e48e884 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 20 Dec 2018 08:12:16 -0800 Subject: [PATCH 189/513] fix(deps): update dependency @google-cloud/common to ^0.29.0 (#201) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 74617355d70..901c9e67e43 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -42,7 +42,7 @@ "presystem-test": "npm run compile" }, "dependencies": { - "@google-cloud/common": "^0.28.0", + "@google-cloud/common": "^0.29.0", "@google-cloud/promisify": "^0.3.0", "arrify": "^1.0.1", "extend": "^3.0.1", From 8f12f9ec3816cdb4c98eebcf17a4eea321324439 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 10 Jan 2019 13:41:32 -0800 Subject: [PATCH 190/513] build: check broken links in generated docs (#202) --- packages/google-cloud-translate/.jsdoc.js | 4 ++-- packages/google-cloud-translate/package.json | 3 ++- packages/google-cloud-translate/synth.py | 5 +---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index b1e1d8d8721..bf11f3f28b1 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -20,7 +20,7 @@ module.exports = { opts: { readme: './README.md', package: './package.json', - template: './node_modules/ink-docstrap/template', + template: './node_modules/jsdoc-baseline', recurse: true, verbose: true, destination: './docs/' @@ -31,7 +31,7 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'src' + 'build/src' ], includePattern: '\\.js$' }, diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 901c9e67e43..9b6c354cce7 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -28,6 +28,7 @@ ], "scripts": { "docs": "jsdoc -c .jsdoc.js", + "predocs": "npm run compile", "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", "lint": "npm run check && eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", @@ -65,7 +66,7 @@ "eslint-plugin-node": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", "gts": "^0.9.0", - "ink-docstrap": "^1.3.2", + "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", "mocha": "^5.2.0", diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py index 005ba153053..1b1f82a3348 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/synth.py @@ -5,8 +5,5 @@ logging.basicConfig(level=logging.DEBUG) common_templates = gcp.CommonTemplates() -templates = common_templates.node_library( - package_name="@google-cloud/translate", - repo_name="googleapis/translate" -) +templates = common_templates.node_library(source_location='build/src') s.copy(templates) From 2811a84d49bbfe51cbbb99b3228c9a4099f9ea8e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 24 Jan 2019 08:44:18 -0800 Subject: [PATCH 191/513] fix(deps): update dependency @google-cloud/common to ^0.30.0 (#205) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 9b6c354cce7..7f4a413ee49 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -43,7 +43,7 @@ "presystem-test": "npm run compile" }, "dependencies": { - "@google-cloud/common": "^0.29.0", + "@google-cloud/common": "^0.30.0", "@google-cloud/promisify": "^0.3.0", "arrify": "^1.0.1", "extend": "^3.0.1", From d4a8ac8f6c8fa7f0d48efbabb73ad8a8703bd744 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 26 Jan 2019 13:38:24 -0500 Subject: [PATCH 192/513] chore(deps): update dependency eslint-config-prettier to v4 (#206) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7f4a413ee49..acb4f4d0f5f 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -62,7 +62,7 @@ "@types/request": "^2.47.1", "codecov": "^3.0.2", "eslint": "^5.0.0", - "eslint-config-prettier": "^3.0.0", + "eslint-config-prettier": "^4.0.0", "eslint-plugin-node": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", "gts": "^0.9.0", From d5752d1501161874aed907359f82184ee4150a69 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 1 Feb 2019 10:10:15 -0800 Subject: [PATCH 193/513] Automerge by dpebot Automerge by dpebot --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index acb4f4d0f5f..914d7c457cf 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -75,6 +75,6 @@ "prettier": "^1.13.5", "proxyquire": "^2.0.1", "source-map-support": "^0.5.6", - "typescript": "~3.2.0" + "typescript": "~3.3.0" } } From 5f55b83fc2c27a39151174933eafee11dbd6e4ba Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 7 Feb 2019 15:45:02 -0800 Subject: [PATCH 194/513] chore: move CONTRIBUTING.md to root (#211) --- .../google-cloud-translate/CONTRIBUTING.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 packages/google-cloud-translate/CONTRIBUTING.md diff --git a/packages/google-cloud-translate/CONTRIBUTING.md b/packages/google-cloud-translate/CONTRIBUTING.md new file mode 100644 index 00000000000..b958f235007 --- /dev/null +++ b/packages/google-cloud-translate/CONTRIBUTING.md @@ -0,0 +1,57 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA] + (https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA] + (https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Submit a pull request. + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + npm test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup From 418f7e3f15718a8ba777b7336ae6d8dd811fb261 Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Thu, 7 Feb 2019 18:49:00 -0800 Subject: [PATCH 195/513] docs: update contributing path in README (#212) --- packages/google-cloud-translate/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index f9fbe4b72dc..3f052306120 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -93,7 +93,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-translate/blob/master/.github/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-translate/blob/master/CONTRIBUTING.md). ## License From 8d6605f9b15b92f490896cf0aa1c8cc4b9d0485f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 10 Feb 2019 20:54:45 -0800 Subject: [PATCH 196/513] build: create docs test npm scripts (#214) --- packages/google-cloud-translate/package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 914d7c457cf..7ba196e2b99 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -40,7 +40,9 @@ "fix": "gts fix && eslint --fix '**/*.js'", "prepare": "npm run compile", "pretest": "npm run compile", - "presystem-test": "npm run compile" + "presystem-test": "npm run compile", + "docs-test": "blcl docs -r --exclude www.googleapis.com", + "predocs-test": "npm run docs" }, "dependencies": { "@google-cloud/common": "^0.30.0", @@ -75,6 +77,7 @@ "prettier": "^1.13.5", "proxyquire": "^2.0.1", "source-map-support": "^0.5.6", - "typescript": "~3.3.0" + "typescript": "~3.3.0", + "broken-link-checker-local": "^0.2.0" } } From 361607038918a16c8b91bc3c644dfb22736be9a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 11 Feb 2019 15:38:21 -0500 Subject: [PATCH 197/513] fix(deps): update dependency @google-cloud/common to ^0.31.0 (#209) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7ba196e2b99..5290d5766d3 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -45,7 +45,7 @@ "predocs-test": "npm run docs" }, "dependencies": { - "@google-cloud/common": "^0.30.0", + "@google-cloud/common": "^0.31.0", "@google-cloud/promisify": "^0.3.0", "arrify": "^1.0.1", "extend": "^3.0.1", From f22f11219c9f62db6cfe6a1602f3fc6eaacc91d2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 12 Feb 2019 12:08:19 -0500 Subject: [PATCH 198/513] fix(deps): update dependency yargs to v13 (#215) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index a9371ede36a..7f7817270c4 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -13,7 +13,7 @@ "dependencies": { "@google-cloud/translate": "^2.1.3", "@google-cloud/automl": "^0.1.2", - "yargs": "^12.0.1" + "yargs": "^13.0.0" }, "devDependencies": { "chai": "^4.2.0", From ded6c690a6b82e481322e26678b28343ff05aac3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 14 Feb 2019 08:21:59 -0800 Subject: [PATCH 199/513] fix(deps): update dependency @google-cloud/promisify to ^0.4.0 (#217) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 5290d5766d3..3493e7dc6b9 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -46,7 +46,7 @@ }, "dependencies": { "@google-cloud/common": "^0.31.0", - "@google-cloud/promisify": "^0.3.0", + "@google-cloud/promisify": "^0.4.0", "arrify": "^1.0.1", "extend": "^3.0.1", "is": "^3.2.1", From 8986438365ccbb1aaa3513dce2d9c8c698a698d6 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 14 Feb 2019 08:51:21 -0800 Subject: [PATCH 200/513] docs: update links in contrib guide (#218) --- packages/google-cloud-translate/CONTRIBUTING.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/CONTRIBUTING.md b/packages/google-cloud-translate/CONTRIBUTING.md index b958f235007..78aaa61b269 100644 --- a/packages/google-cloud-translate/CONTRIBUTING.md +++ b/packages/google-cloud-translate/CONTRIBUTING.md @@ -16,11 +16,9 @@ Please fill out either the individual or corporate Contributor License Agreement (CLA). * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA] - (https://developers.google.com/open-source/cla/individual). + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA] - (https://developers.google.com/open-source/cla/corporate). + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to From 4abbf9e1c01c3b0e523996b3f27662a0ec74a984 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 14 Feb 2019 13:06:06 -0800 Subject: [PATCH 201/513] build: use linkinator for docs test (#216) --- packages/google-cloud-translate/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 3493e7dc6b9..bec95063a21 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -41,7 +41,7 @@ "prepare": "npm run compile", "pretest": "npm run compile", "presystem-test": "npm run compile", - "docs-test": "blcl docs -r --exclude www.googleapis.com", + "docs-test": "linkinator docs -r --skip www.googleapis.com", "predocs-test": "npm run docs" }, "dependencies": { @@ -78,6 +78,6 @@ "proxyquire": "^2.0.1", "source-map-support": "^0.5.6", "typescript": "~3.3.0", - "broken-link-checker-local": "^0.2.0" + "linkinator": "^1.1.2" } } From 06dc20bba0e10c940b6bb73164a8e0b682aa5977 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 19 Feb 2019 15:41:36 -0500 Subject: [PATCH 202/513] chore(deps): update dependency mocha to v6 (#219) --- packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index bec95063a21..b908695112f 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -71,7 +71,7 @@ "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", - "mocha": "^5.2.0", + "mocha": "^6.0.0", "nyc": "^13.0.0", "power-assert": "^1.6.0", "prettier": "^1.13.5", diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 7f7817270c4..33d8b03d4e9 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -18,7 +18,7 @@ "devDependencies": { "chai": "^4.2.0", "execa": "^1.0.0", - "mocha": "^5.2.0", + "mocha": "^6.0.0", "uuid": "^3.3.2" } } From 2e51c1747386a33421bf062a0fbe71fea6a30322 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 5 Mar 2019 05:31:10 -0800 Subject: [PATCH 203/513] build: update release configuration This PR was generated using Autosynth. :rainbow: Here's the log from Synthtool: ``` synthtool > Executing /tmpfs/src/git/autosynth/working_repo/synth.py. .eslintignore .eslintrc.yml .github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/feature_request.md .github/ISSUE_TEMPLATE/support_request.md .jsdoc.js .kokoro/common.cfg .kokoro/continuous/node10/common.cfg .kokoro/continuous/node10/test.cfg .kokoro/continuous/node11/common.cfg .kokoro/continuous/node11/test.cfg .kokoro/continuous/node6/common.cfg .kokoro/continuous/node6/test.cfg .kokoro/continuous/node8/common.cfg .kokoro/continuous/node8/docs.cfg .kokoro/continuous/node8/lint.cfg .kokoro/continuous/node8/samples-test.cfg .kokoro/continuous/node8/system-test-grpcjs.cfg .kokoro/continuous/node8/system-test.cfg .kokoro/continuous/node8/test.cfg .kokoro/docs.sh .kokoro/lint.sh .kokoro/presubmit/node10/common.cfg .kokoro/presubmit/node10/test.cfg .kokoro/presubmit/node11/common.cfg .kokoro/presubmit/node11/test.cfg .kokoro/presubmit/node6/common.cfg .kokoro/presubmit/node6/test.cfg .kokoro/presubmit/node8/common.cfg .kokoro/presubmit/node8/docs.cfg .kokoro/presubmit/node8/lint.cfg .kokoro/presubmit/node8/samples-test.cfg .kokoro/presubmit/node8/system-test-grpcjs.cfg .kokoro/presubmit/node8/system-test.cfg .kokoro/presubmit/node8/test.cfg .kokoro/presubmit/windows/common.cfg .kokoro/presubmit/windows/test.cfg .kokoro/publish.sh .kokoro/release/publish.cfg .kokoro/samples-test.sh .kokoro/system-test.sh .kokoro/test.bat .kokoro/test.sh .kokoro/trampoline.sh .nycrc .prettierignore .prettierrc CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE codecov.yaml renovate.json synthtool > Cleaned up 2 temporary directories. synthtool > Wrote metadata to synth.metadata. ``` --- packages/google-cloud-translate/synth.metadata | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 9e26dfeeb6e..9ab51adf1b9 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1 +1,12 @@ -{} \ No newline at end of file +{ + "updateTime": "2019-03-05T12:28:15.740337Z", + "sources": [ + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2019.2.26" + } + } + ] +} \ No newline at end of file From ec78544aaaad1f96d74269ae54f7e0b565fdc46a Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 7 Mar 2019 18:06:22 -0800 Subject: [PATCH 204/513] build: Add docuploader credentials to node publish jobs (#222) --- packages/google-cloud-translate/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 9ab51adf1b9..7970b341845 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,11 +1,11 @@ { - "updateTime": "2019-03-05T12:28:15.740337Z", + "updateTime": "2019-03-08T00:45:46.433993Z", "sources": [ { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.2.26" + "version": "2019.1.16" } } ] From 6c46e46505489fa2806903d8962d3cf047c51eb9 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 12 Mar 2019 14:01:45 -0700 Subject: [PATCH 205/513] Release v2.1.4 (#224) --- packages/google-cloud-translate/CHANGELOG.md | 36 +++++++++++++++++++ packages/google-cloud-translate/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index c1d534cd50d..a174c5629ea 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,42 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## v2.1.4 + +03-12-2019 12:30 PDT + +This patch release has a few dependency bumps and doc updates. Enjoy! + +### Dependencies +- fix(deps): update dependency @google-cloud/promisify to ^0.4.0 ([#217](https://github.com/googleapis/nodejs-translate/pull/217)) +- fix(deps): update dependency yargs to v13 ([#215](https://github.com/googleapis/nodejs-translate/pull/215)) +- fix(deps): update dependency @google-cloud/common to ^0.31.0 ([#209](https://github.com/googleapis/nodejs-translate/pull/209)) + +### Documentation +- docs: update links in contrib guide ([#218](https://github.com/googleapis/nodejs-translate/pull/218)) +- docs: update contributing path in README ([#212](https://github.com/googleapis/nodejs-translate/pull/212)) +- docs: move CONTRIBUTING.md to root ([#211](https://github.com/googleapis/nodejs-translate/pull/211)) +- docs: add lint/fix example to contributing guide ([#208](https://github.com/googleapis/nodejs-translate/pull/208)) +- docs: brand issue - Translate API => Cloud Translation API ([#196](https://github.com/googleapis/nodejs-translate/pull/196)) + +### Internal / Testing Changes +- build: Add docuploader credentials to node publish jobs ([#222](https://github.com/googleapis/nodejs-translate/pull/222)) +- build: use node10 to run samples-test, system-test etc ([#221](https://github.com/googleapis/nodejs-translate/pull/221)) +- build: update release configuration +- chore(deps): update dependency mocha to v6 ([#219](https://github.com/googleapis/nodejs-translate/pull/219)) +- build: use linkinator for docs test ([#216](https://github.com/googleapis/nodejs-translate/pull/216)) +- build: create docs test npm scripts ([#214](https://github.com/googleapis/nodejs-translate/pull/214)) +- build: test using @grpc/grpc-js in CI ([#213](https://github.com/googleapis/nodejs-translate/pull/213)) +- chore(deps): update dependency eslint-config-prettier to v4 ([#206](https://github.com/googleapis/nodejs-translate/pull/206)) +- build: ignore googleapis.com in doc link check ([#204](https://github.com/googleapis/nodejs-translate/pull/204)) +- build: check broken links in generated docs ([#202](https://github.com/googleapis/nodejs-translate/pull/202)) +- refactor: modernize sample tests ([#199](https://github.com/googleapis/nodejs-translate/pull/199)) +- chore(build): inject yoshi automation key ([#195](https://github.com/googleapis/nodejs-translate/pull/195)) +- chore: update nyc and eslint configs ([#194](https://github.com/googleapis/nodejs-translate/pull/194)) +- chore: fix publish.sh permission +x ([#192](https://github.com/googleapis/nodejs-translate/pull/192)) +- fix(build): fix Kokoro release script ([#191](https://github.com/googleapis/nodejs-translate/pull/191)) +- build: add Kokoro configs for autorelease ([#190](https://github.com/googleapis/nodejs-translate/pull/190)) + ## v2.1.3 12-06-2018 17:12 PST diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index b908695112f..90d75879e1a 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "2.1.3", + "version": "2.1.4", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 33d8b03d4e9..203cb994f38 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -11,7 +11,7 @@ "test": "mocha system-test" }, "dependencies": { - "@google-cloud/translate": "^2.1.3", + "@google-cloud/translate": "^2.1.4", "@google-cloud/automl": "^0.1.2", "yargs": "^13.0.0" }, From 6433954b050f1f8d2726a3027d923eede65aeacc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 2 Apr 2019 12:47:16 -0400 Subject: [PATCH 206/513] chore(deps): update dependency typescript to ~3.4.0 (#231) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 90d75879e1a..785e9655f79 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -77,7 +77,7 @@ "prettier": "^1.13.5", "proxyquire": "^2.0.1", "source-map-support": "^0.5.6", - "typescript": "~3.3.0", + "typescript": "~3.4.0", "linkinator": "^1.1.2" } } From 1a8622544f4e4030e0c1cc9f27418b3739d6fba3 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Tue, 2 Apr 2019 14:42:04 -0700 Subject: [PATCH 207/513] feat: add version v3beta1 (#232) * feat: add version v3beta1 to nodejs-translate * chore(deps): update some vulnerable packages * npm run fix * fix timestamp dead links --- packages/google-cloud-translate/.gitignore | 1 + packages/google-cloud-translate/package.json | 16 +- .../v3beta1/translation_service.proto | 740 ++++++++++ packages/google-cloud-translate/src/index.ts | 584 +------- .../google-cloud-translate/src/v2/index.ts | 576 ++++++++ .../src/v3beta1/.eslintrc.yml | 3 + .../v3beta1/doc_translation_service.js | 853 ++++++++++++ .../doc/google/longrunning/doc_operations.js | 63 + .../v3beta1/doc/google/protobuf/doc_any.js | 136 ++ .../doc/google/protobuf/doc_timestamp.js | 113 ++ .../src/v3beta1/doc/google/rpc/doc_status.js | 95 ++ .../src/v3beta1/index.js | 19 + .../src/v3beta1/translation_service_client.js | 1204 +++++++++++++++++ .../translation_service_client_config.json | 66 + .../google-cloud-translate/synth.metadata | 31 +- packages/google-cloud-translate/synth.py | 41 + .../google-cloud-translate/test/.eslintrc.yml | 5 + .../test/gapic-v3beta1.js | 653 +++++++++ packages/google-cloud-translate/test/index.ts | 4 +- 19 files changed, 4641 insertions(+), 562 deletions(-) create mode 100644 packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto create mode 100644 packages/google-cloud-translate/src/v2/index.ts create mode 100644 packages/google-cloud-translate/src/v3beta1/.eslintrc.yml create mode 100644 packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js create mode 100644 packages/google-cloud-translate/src/v3beta1/doc/google/longrunning/doc_operations.js create mode 100644 packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js create mode 100644 packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js create mode 100644 packages/google-cloud-translate/src/v3beta1/doc/google/rpc/doc_status.js create mode 100644 packages/google-cloud-translate/src/v3beta1/index.js create mode 100644 packages/google-cloud-translate/src/v3beta1/translation_service_client.js create mode 100644 packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json create mode 100644 packages/google-cloud-translate/test/.eslintrc.yml create mode 100644 packages/google-cloud-translate/test/gapic-v3beta1.js diff --git a/packages/google-cloud-translate/.gitignore b/packages/google-cloud-translate/.gitignore index d0ac5fa36cb..4ebc92569bd 100644 --- a/packages/google-cloud-translate/.gitignore +++ b/packages/google-cloud-translate/.gitignore @@ -9,3 +9,4 @@ system-test/*key.json *.lock build package-lock.json +__pycache__ diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 785e9655f79..95c7aa75b57 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -36,7 +36,8 @@ "test": "nyc mocha build/test", "check": "gts check", "clean": "gts clean", - "compile": "tsc -p .", + "compile": "tsc -p . && npm run copy-js", + "copy-js": "cp -r src/v3beta1 build/src/ && cp -r protos build/ && cp test/*.js build/test", "fix": "gts fix && eslint --fix '**/*.js'", "prepare": "npm run compile", "pretest": "npm run compile", @@ -49,12 +50,15 @@ "@google-cloud/promisify": "^0.4.0", "arrify": "^1.0.1", "extend": "^3.0.1", + "google-gax": "^0.25.4", "is": "^3.2.1", "is-html": "^1.1.0", + "lodash.merge": "^4.6.1", + "protobufjs": "^6.8.8", "teeny-request": "^3.4.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^3.0.0", + "@google-cloud/nodejs-repo-tools": "^3.2.0", "@types/arrify": "^1.0.4", "@types/extend": "^3.0.0", "@types/is": "0.0.21", @@ -68,16 +72,16 @@ "eslint-plugin-node": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", "gts": "^0.9.0", - "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", + "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", + "linkinator": "^1.1.2", "mocha": "^6.0.0", - "nyc": "^13.0.0", + "nyc": "^13.3.0", "power-assert": "^1.6.0", "prettier": "^1.13.5", "proxyquire": "^2.0.1", "source-map-support": "^0.5.6", - "typescript": "~3.4.0", - "linkinator": "^1.1.2" + "typescript": "~3.4.0" } } diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto new file mode 100644 index 00000000000..e9e65baa35b --- /dev/null +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto @@ -0,0 +1,740 @@ +// Copyright 2019 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. +// + +syntax = "proto3"; + +package google.cloud.translation.v3beta1; + +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Translate.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/translate/v3beta1;translate"; +option java_multiple_files = true; +option java_outer_classname = "TranslationServiceProto"; +option java_package = "com.google.cloud.translate.v3beta1"; +option php_namespace = "Google\\Cloud\\Translate\\V3beta1"; +option ruby_package = "Google::Cloud::Translate::V3beta1"; + +// Proto file for the Cloud Translation API (v3beta1). + +// Provides natural language translation operations. +service TranslationService { + // Translates input text and returns translated text. + rpc TranslateText(TranslateTextRequest) returns (TranslateTextResponse) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*}:translateText" + body: "*" + }; + } + + // Detects the language of text within a request. + rpc DetectLanguage(DetectLanguageRequest) returns (DetectLanguageResponse) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*}:detectLanguage" + body: "*" + }; + } + + // Returns a list of supported languages for translation. + rpc GetSupportedLanguages(GetSupportedLanguagesRequest) returns (SupportedLanguages) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*}/supportedLanguages" + }; + } + + // Translates a large volume of text in asynchronous batch mode. + // This function provides real-time output as the inputs are being processed. + // If caller cancels a request, the partial results (for an input file, it's + // all or nothing) may still be available on the specified output location. + // + // This call returns immediately and you can + // use google.longrunning.Operation.name to poll the status of the call. + rpc BatchTranslateText(BatchTranslateTextRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*}:batchTranslateText" + body: "*" + }; + } + + // Creates a glossary and returns the long-running operation. Returns + // NOT_FOUND, if the project doesn't exist. + rpc CreateGlossary(CreateGlossaryRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*}/glossaries" + body: "glossary" + }; + } + + // Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't + // exist. + rpc ListGlossaries(ListGlossariesRequest) returns (ListGlossariesResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*}/glossaries" + }; + } + + // Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + // exist. + rpc GetGlossary(GetGlossaryRequest) returns (Glossary) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/glossaries/*}" + }; + } + + // Deletes a glossary, or cancels glossary construction + // if the glossary isn't created yet. + // Returns NOT_FOUND, if the glossary doesn't exist. + rpc DeleteGlossary(DeleteGlossaryRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/glossaries/*}" + }; + } +} + +// Configures which glossary should be used for a specific target language, +// and defines options for applying that glossary. +message TranslateTextGlossaryConfig { + // Required. Specifies the glossary used for this translation. Use + // this format: projects/*/locations/*/glossaries/* + string glossary = 1; + + // Optional. Indicates whether we should do a case-insensitive match. + // Default value is false if missing. + bool ignore_case = 2; +} + +// The request message for synchronous translation. +message TranslateTextRequest { + // Required. The content of the input in string format. + // We recommend the total contents to be less than 30k codepoints. + // Please use BatchTranslateText for larger text. + repeated string contents = 1; + + // Optional. The format of the source text, for example, "text/html", + // "text/plain". If left blank, the MIME type is assumed to be "text/html". + string mime_type = 3; + + // Optional. The BCP-47 language code of the input text if + // known, for example, "en-US" or "sr-Latn". Supported language codes are + // listed in Language Support. If the source language isn't specified, the API + // attempts to identify the source language automatically and returns the + // the source language within the response. + string source_language_code = 4; + + // Required. The BCP-47 language code to use for translation of the input + // text, set to one of the language codes listed in Language Support. + string target_language_code = 5; + + // Optional. Only used when making regionalized call. + // Format: + // projects/{project-id}/locations/{location-id}. + // + // Only custom model/glossary within the same location-id can be used. + // Otherwise 400 is returned. + string parent = 8; + + // Optional. The `model` type requested for this translation. + // + // The format depends on model type: + // 1. Custom models: + // projects/{project-id}/locations/{location-id}/models/{model-id}. + // 2. General (built-in) models: + // projects/{project-id}/locations/{location-id}/models/general/nmt + // projects/{project-id}/locations/{location-id}/models/general/base + // + // For global (non-regionalized) requests, use {location-id} 'global'. + // For example, + // projects/{project-id}/locations/global/models/general/nmt + // + // If missing, the system decides which google base model to use. + string model = 6; + + // Optional. Glossary to be applied. The glossary needs to be in the same + // region as the model, otherwise an INVALID_ARGUMENT error is returned. + TranslateTextGlossaryConfig glossary_config = 7; +} + +// The main language translation response message. +message TranslateTextResponse { + // Text translation responses with no glossary applied. + // This field has the same length as `contents` in TranslateTextRequest. + repeated Translation translations = 1; + + // Text translation responses if a glossary is provided in the request. + // This could be the same as 'translation' above if no terms apply. + // This field has the same length as `contents` in TranslateTextRequest. + repeated Translation glossary_translations = 3; +} + +// A single translation response. +message Translation { + // Text translated into the target language. + string translated_text = 1; + + // Only present when `model` is present in the request. + // This is same as `model` provided in the request. + string model = 2; + + // The BCP-47 language code of source text in the initial request, detected + // automatically, if no source language was passed within the initial + // request. If the source language was passed, auto-detection of the language + // does not occur and this field will be empty. + string detected_language_code = 4; + + // The `glossary_config` used for this translation. + TranslateTextGlossaryConfig glossary_config = 3; +} + +// The request message for language detection. +message DetectLanguageRequest { + // Optional. Only used when making regionalized call. + // Format: + // projects/{project-id}/locations/{location-id}. + // + // Only custom model within the same location-id can be used. + // Otherwise 400 is returned. + string parent = 5; + + // Optional. The language detection model to be used. + // projects/{project-id}/locations/{location-id}/models/language-detection/{model-id} + // If not specified, default will be used. + string model = 4; + + // Required. The source of the document from which to detect the language. + oneof source { + // The content of the input stored as a string. + string content = 1; + } + + // Optional. The format of the source text, for example, "text/html", + // "text/plain". If left blank, the MIME type is assumed to be "text/html". + string mime_type = 3; +} + +// The response message for language detection. +message DetectedLanguage { + // The BCP-47 language code of source content in the request, detected + // automatically. + string language_code = 1; + + // The confidence of the detection result for this language. + float confidence = 2; +} + +// The response message for language detection. +message DetectLanguageResponse { + // A list of detected languages sorted by detection confidence in descending + // order. The most probable language first. + repeated DetectedLanguage languages = 1; +} + +// The request message for discovering supported languages. +message GetSupportedLanguagesRequest { + // Optional. Used for making regionalized calls. + // Format: projects/{project-id}/locations/{location-id}. + // For global calls, use projects/{project-id}/locations/global. + // If missing, the call is treated as a global call. + // + // Only custom model within the same location-id can be used. + // Otherwise 400 is returned. + string parent = 3; + + // Optional. The language to use to return localized, human readable names + // of supported languages. If missing, default language is ENGLISH. + string display_language_code = 1; + + // Optional. Get supported languages of this model. + // The format depends on model type: + // 1. Custom models: + // projects/{project-id}/locations/{location-id}/models/{model-id}. + // 2. General (built-in) models: + // projects/{project-id}/locations/{location-id}/models/general/nmt + // projects/{project-id}/locations/{location-id}/models/general/base + // Returns languages supported by the specified model. + // If missing, we get supported languages of Google general NMT model. + string model = 2; +} + +// The response message for discovering supported languages. +message SupportedLanguages { + // A list of supported language responses. This list contains an entry + // for each language the Translation API supports. + repeated SupportedLanguage languages = 1; +} + +// A single supported language response corresponds to information related +// to one supported language. +message SupportedLanguage { + // Supported language code, generally consisting of its ISO 639-1 + // identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes + // including language and region identifiers are returned (for example, + // 'zh-TW' and 'zh-CN') + string language_code = 1; + + // Human readable name of the language localized in the display language + // specified in the request. + string display_name = 2; + + // Can be used as source language. + bool support_source = 3; + + // Can be used as target language. + bool support_target = 4; +} + +// The GCS location for the input content. +message GcsSource { + // Required. Source data URI. For example, `gs://my_bucket/my_object`. + string input_uri = 1; +} + +// Input configuration. +message InputConfig { + // Optional. Can be "text/plain" or "text/html". + // For `.tsv`, "text/html" is used if mime_type is missing. + // For `.html`, this field must be "text/html" or empty. + // For `.txt`, this field must be "text/plain" or empty. + string mime_type = 1; + + // Required. Specify the input. + oneof source { + // Required. Google Cloud Storage location for the source input. + // This can be a single file (for example, + // `gs://translation-test/input.tsv`) or a wildcard (for example, + // `gs://translation-test/*`). If a file extension is `.tsv`, it can + // contain either one or two columns. The first column (optional) is the id + // of the text request. If the first column is missing, we use the row + // number (0-based) from the input file as the ID in the output file. The + // second column is the actual text to be + // translated. We recommend each row be <= 10K Unicode codepoints, + // otherwise an error might be returned. + // + // The other supported file extensions are `.txt` or `.html`, which is + // treated as a single large chunk of text. + GcsSource gcs_source = 2; + } +} + +// The GCS location for the output content +message GcsDestination { + // Required. There must be no files under 'output_uri_prefix'. + // 'output_uri_prefix' must end with "/". Otherwise error 400 is returned. + string output_uri_prefix = 1; +} + +// Output configuration. +message OutputConfig { + // Required. The destination of output. + oneof destination { + // Google Cloud Storage destination for output content. + // For every single input file (for example, gs://a/b/c.[extension]), we + // generate at most 2 * n output files. (n is the # of target_language_codes + // in the BatchTranslateTextRequest). + // + // Output files (tsv) generated are compliant with RFC 4180 except that + // record delimiters are '\n' instead of '\r\n'. We don't provide any way to + // change record delimiters. + // + // While the input files are being processed, we write/update an index file + // 'index.csv' under 'output_uri_prefix' (for example, + // gs://translation-test/index.csv) The index file is generated/updated as + // new files are being translated. The format is: + // + // input_file,target_language_code,translations_file,errors_file, + // glossary_translations_file,glossary_errors_file + // + // input_file is one file we matched using gcs_source.input_uri. + // target_language_code is provided in the request. + // translations_file contains the translations. (details provided below) + // errors_file contains the errors during processing of the file. (details + // below). Both translations_file and errors_file could be empty + // strings if we have no content to output. + // glossary_translations_file,glossary_errors_file are always empty string + // if input_file is tsv. They could also be empty if we have no content to + // output. + // + // Once a row is present in index.csv, the input/output matching never + // changes. Callers should also expect all the content in input_file are + // processed and ready to be consumed (that is, No partial output file is + // written). + // + // The format of translations_file (for target language code 'trg') is: + // gs://translation_test/a_b_c_'trg'_translations.[extension] + // + // If the input file extension is tsv, the output has the following + // columns: + // Column 1: ID of the request provided in the input, if it's not + // provided in the input, then the input row number is used (0-based). + // Column 2: source sentence. + // Column 3: translation without applying a glossary. Empty string if there + // is an error. + // Column 4 (only present if a glossary is provided in the request): + // translation after applying the glossary. Empty string if there is an + // error applying the glossary. Could be same string as column 3 if there is + // no glossary applied. + // + // If input file extension is a txt or html, the translation is directly + // written to the output file. If glossary is requested, a separate + // glossary_translations_file has format of + // gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] + // + // The format of errors file (for target language code 'trg') is: + // gs://translation_test/a_b_c_'trg'_errors.[extension] + // + // If the input file extension is tsv, errors_file has the + // following Column 1: ID of the request provided in the input, if it's not + // provided in the input, then the input row number is used (0-based). + // Column 2: source sentence. + // Column 3: Error detail for the translation. Could be empty. + // Column 4 (only present if a glossary is provided in the request): + // Error when applying the glossary. + // + // If the input file extension is txt or html, glossary_error_file will be + // generated that contains error details. glossary_error_file has format of + // gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] + GcsDestination gcs_destination = 1; + } +} + +// The batch translation request. +message BatchTranslateTextRequest { + // Optional. Only used when making regionalized call. + // Format: + // projects/{project-id}/locations/{location-id}. + // + // Only custom models/glossaries within the same location-id can be used. + // Otherwise 400 is returned. + string parent = 1; + + // Required. Source language code. + string source_language_code = 2; + + // Required. Specify up to 10 language codes here. + repeated string target_language_codes = 3; + + // Optional. The models to use for translation. Map's key is target language + // code. Map's value is model name. Value can be a built-in general model, + // or a custom model built by AutoML. + // + // The value format depends on model type: + // 1. Custom models: + // projects/{project-id}/locations/{location-id}/models/{model-id}. + // 2. General (built-in) models: + // projects/{project-id}/locations/{location-id}/models/general/nmt + // projects/{project-id}/locations/{location-id}/models/general/base + // + // If the map is empty or a specific model is + // not requested for a language pair, then default google model is used. + map models = 4; + + // Required. Input configurations. + // The total number of files matched should be <= 1000. + // The total content size should be <= 100M Unicode codepoints. + // The files must use UTF-8 encoding. + repeated InputConfig input_configs = 5; + + // Required. Output configuration. + // If 2 input configs match to the same file (that is, same input path), + // we don't generate output for duplicate inputs. + OutputConfig output_config = 6; + + // Optional. Glossaries to be applied for translation. + // It's keyed by target language code. + map glossaries = 7; +} + +// State metadata for the batch translation operation. +message BatchTranslateMetadata { + // State of the job. + enum State { + // Invalid. + STATE_UNSPECIFIED = 0; + + // Request is being processed. + RUNNING = 1; + + // The batch is processed, and at least one item has been successfully + // processed. + SUCCEEDED = 2; + + // The batch is done and no item has been successfully processed. + FAILED = 3; + + // Request is in the process of being canceled after caller invoked + // longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4; + + // The batch is done after the user has called the + // longrunning.Operations.CancelOperation. Any records processed before the + // cancel command are output as specified in the request. + CANCELLED = 5; + } + + // The state of the operation. + State state = 1; + + // Number of successfully translated characters so far (Unicode codepoints). + int64 translated_characters = 2; + + // Number of characters that have failed to process so far (Unicode + // codepoints). + int64 failed_characters = 3; + + // Total number of characters (Unicode codepoints). + // This is the total number of codepoints from input files times the number of + // target languages. It appears here shortly after the call is submitted. + int64 total_characters = 4; + + // Time when the operation was submitted. + google.protobuf.Timestamp submit_time = 5; +} + +// Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by +// BatchTranslateText if at least one sentence is translated successfully. +message BatchTranslateResponse { + // Total number of characters (Unicode codepoints). + int64 total_characters = 1; + + // Number of successfully translated characters (Unicode codepoints). + int64 translated_characters = 2; + + // Number of characters that have failed to process (Unicode codepoints). + int64 failed_characters = 3; + + // Time when the operation was submitted. + google.protobuf.Timestamp submit_time = 4; + + // The time when the operation is finished and + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true. + google.protobuf.Timestamp end_time = 5; +} + +// Input configuration for glossaries. +message GlossaryInputConfig { + // Required. Specify the input. + oneof source { + // Required. Google Cloud Storage location of glossary data. + // File format is determined based on file name extension. API returns + // [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file + // formats. Wildcards are not allowed. This must be a single file in one of + // the following formats: + // + // For `UNIDIRECTIONAL` glossaries: + // + // - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. + // The first column is source text. The second column is target text. + // The file must not contain headers. That is, the first row is data, not + // column names. + // + // - TMX (`.tmx`): TMX file with parallel data defining source/target term + // pairs. + // + // For `EQUIVALENT_TERMS_SET` glossaries: + // + // - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms + // in multiple languages. The format is defined for Google Translation + // Toolkit and documented here: + // `https://support.google.com/translatortoolkit/answer/6306379?hl=en`. + GcsSource gcs_source = 1; + } +} + +// Represents a glossary built from user provided data. +message Glossary { + // Used with UNIDIRECTIONAL. + message LanguageCodePair { + // Required. The BCP-47 language code of the input text, for example, + // "en-US". Expected to be an exact match for GlossaryTerm.language_code. + string source_language_code = 1; + + // Required. The BCP-47 language code for translation output, for example, + // "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. + string target_language_code = 2; + } + + // Used with EQUIVALENT_TERMS_SET. + message LanguageCodesSet { + // The BCP-47 language code(s) for terms defined in the glossary. + // All entries are unique. The list contains at least two entries. + // Expected to be an exact match for GlossaryTerm.language_code. + repeated string language_codes = 1; + } + + // Required. The resource name of the glossary. Glossary names have the form + // `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`. + string name = 1; + + // Languages supported by the glossary. + oneof languages { + // Used with UNIDIRECTIONAL. + LanguageCodePair language_pair = 3; + + // Used with EQUIVALENT_TERMS_SET. + LanguageCodesSet language_codes_set = 4; + } + + // Required. Provides examples to build the glossary from. + // Total glossary must not exceed 10M Unicode codepoints. + GlossaryInputConfig input_config = 5; + + // Output only. The number of entries defined in the glossary. + int32 entry_count = 6; + + // Output only. When CreateGlossary was called. + google.protobuf.Timestamp submit_time = 7; + + // Output only. When the glossary creation was finished. + google.protobuf.Timestamp end_time = 8; +} + +// Request message for CreateGlossary. +message CreateGlossaryRequest { + // Required. The project name. + string parent = 1; + + // Required. The glossary to create. + Glossary glossary = 2; +} + +// Request message for GetGlossary. +message GetGlossaryRequest { + // Required. The name of the glossary to retrieve. + string name = 1; +} + +// Request message for DeleteGlossary. +message DeleteGlossaryRequest { + // Required. The name of the glossary to delete. + string name = 1; +} + +// Request message for ListGlossaries. +message ListGlossariesRequest { + // Required. The name of the project from which to list all of the glossaries. + string parent = 1; + + // Optional. Requested page size. The server may return fewer glossaries than + // requested. If unspecified, the server picks an appropriate default. + int32 page_size = 2; + + // Optional. A token identifying a page of results the server should return. + // Typically, this is the value of [ListGlossariesResponse.next_page_token] + // returned from the previous call to `ListGlossaries` method. + // The first page is returned if `page_token`is empty or missing. + string page_token = 3; + + // Optional. Filter specifying constraints of a list operation. + // For example, `tags.glossary_name="products*"`. + // If missing, no filtering is performed. + string filter = 4; +} + +// Response message for ListGlossaries. +message ListGlossariesResponse { + // The list of glossaries for a project. + repeated Glossary glossaries = 1; + + // A token to retrieve a page of results. Pass this value in the + // [ListGlossariesRequest.page_token] field in the subsequent call to + // `ListGlossaries` method to retrieve the next page of results. + string next_page_token = 2; +} + +// Stored in the [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by +// CreateGlossary. +message CreateGlossaryMetadata { + // Enumerates the possible states that the creation request can be in. + enum State { + // Invalid. + STATE_UNSPECIFIED = 0; + + // Request is being processed. + RUNNING = 1; + + // The glossary has been successfully created. + SUCCEEDED = 2; + + // Failed to create the glossary. + FAILED = 3; + + // Request is in the process of being canceled after caller invoked + // longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4; + + // The glossary creation request has been successfully canceled. + CANCELLED = 5; + } + + // The name of the glossary that is being created. + string name = 1; + + // The current state of the glossary creation operation. + State state = 2; + + // The time when the operation was submitted to the server. + google.protobuf.Timestamp submit_time = 3; +} + +// Stored in the [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by +// DeleteGlossary. +message DeleteGlossaryMetadata { + // Enumerates the possible states that the creation request can be in. + enum State { + // Invalid. + STATE_UNSPECIFIED = 0; + + // Request is being processed. + RUNNING = 1; + + // The glossary was successfully deleted. + SUCCEEDED = 2; + + // Failed to delete the glossary. + FAILED = 3; + + // Request is in the process of being canceled after caller invoked + // longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4; + + // The glossary deletion request has been successfully canceled. + CANCELLED = 5; + } + + // The name of the glossary that is being deleted. + string name = 1; + + // The current state of the glossary deletion operation. + State state = 2; + + // The time when the operation was submitted to the server. + google.protobuf.Timestamp submit_time = 3; +} + +// Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by +// DeleteGlossary. +message DeleteGlossaryResponse { + // The name of the deleted glossary. + string name = 1; + + // The time when the operation was submitted to the server. + google.protobuf.Timestamp submit_time = 2; + + // The time when the glossary deletion is finished and + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true. + google.protobuf.Timestamp end_time = 3; +} diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index e8e10b2eb30..879116bfd8b 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -14,583 +14,49 @@ * limitations under the License. */ -import {Service, util} from '@google-cloud/common'; -import {promisifyAll} from '@google-cloud/promisify'; -import * as arrify from 'arrify'; -import * as extend from 'extend'; -import {GoogleAuthOptions} from 'google-auth-library'; -import * as is from 'is'; - -const isHtml = require('is-html'); -import {DecorateRequestOptions, BodyResponseCallback} from '@google-cloud/common/build/src/util'; -import * as r from 'request'; -import {teenyRequest} from 'teeny-request'; - -const PKG = require('../../package.json'); - -/** - * Translate request options. - * - * @typedef {object} TranslateRequest - * @property {string} [format] Set the text's format as `html` or `text`. - * If not provided, we will try to auto-detect if the text given is HTML. - * If not, we set the format as `text`. - * @property {string} [from] The ISO 639-1 language code the source input - * is written in. - * @property {string} [model] Set the model type requested for this - * translation. Please refer to the upstream documentation for possible - * values. - * @property {string} to The ISO 639-1 language code to translate the - * input to. - */ -export interface TranslateRequest { - format?: string; - from?: string; - model?: string; - to?: string; -} - -/** - * @callback TranslateCallback - * @param {?Error} err Request error, if any. - * @param {object|object[]} translations If a single string input was given, a - * single translation is given. Otherwise, it is an array of translations. - * @param {object} apiResponse The full API response. - */ -export interface TranslateCallback { - (err: Error|null, translations?: T|null, apiResponse?: r.Response): void; -} - /** - * @typedef {object} DetectResult - * @property {string} 0.language The language code matched from the input. - * @property {number} [0.confidence] A float 0 - 1. The higher the number, the - * higher the confidence in language detection. Note, this is not always - * returned from the API. - * @property {object} 1 The full API response. + * @namespace v2 */ -export interface DetectResult { - language: string; - confidence: number; - input: string; -} - /** - * @callback DetectCallback - * @param {?Error} err Request error, if any. - * @param {object|object[]} results The detection results. - * @param {string} results.language The language code matched from the input. - * @param {number} [results.confidence] A float 0 - 1. The higher the number, the - * higher the confidence in language detection. Note, this is not always - * returned from the API. - * @param {object} apiResponse The full API response. + * @namespace google.cloud.translation.v3beta1 */ -export interface DetectCallback { - (err: Error|null, results?: T|null, apiResponse?: r.Response): void; -} - /** - * @typedef {object} LanguageResult - * @property {string} code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) - * language code. - * @property {string} name The language name. This can be translated into your - * preferred language with the `target` option. + * @namespace google.longrunning */ -export interface LanguageResult { - code: string; - name: string; -} - /** - * @callback GetLanguagesCallback - * @param {?Error} err Request error, if any. - * @param {object[]} results The languages supported by the API. - * @param {string} results.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) - * language code. - * @param {string} results.name The language name. This can be translated into your - * preferred language with the `target` option. - * @param {object} apiResponse The full API response. + * @namespace google.rpc */ -export interface GetLanguagesCallback { - (err: Error|null, results?: LanguageResult[]|null, - apiResponse?: r.Response): void; -} - /** - * @typedef {object} ClientConfig - * @property {string} [projectId] The project ID from the Google Developer's - * Console, e.g. 'grape-spaceship-123'. We will also check the environment - * variable `GCLOUD_PROJECT` for your project ID. If your app is running in - * an environment which supports {@link - * https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application - * Application Default Credentials}, your project ID will be detected - * automatically. - * @property {string} [key] An API key. You should prefer using a Service - * Account key file instead of an API key. - * @property {string} [keyFilename] Full path to the a .json, .pem, or .p12 key - * downloaded from the Google Developers Console. If you provide a path to a - * JSON file, the `projectId` option above is not necessary. NOTE: .pem and - * .p12 require you to specify the `email` option as well. - * @property {string} [email] Account email address. Required when using a .pem - * or .p12 keyFilename. - * @property {object} [credentials] Credentials object. - * @property {string} [credentials.client_email] - * @property {string} [credentials.private_key] - * @property {boolean} [autoRetry=true] Automatically retry requests if the - * response is related to rate limits or certain intermittent server errors. - * We will exponentially backoff subsequent requests by default. - * @property {number} [maxRetries=3] Maximum number of automatic retries - * attempted before returning the error. - * @property {Constructor} [promise] Custom promise module to use instead of - * native Promises. + * @namespace google.protobuf */ -export interface TranslateConfig extends GoogleAuthOptions { - key?: string; - autoRetry?: boolean; - maxRetries?: number; - request?: typeof r; -} +const v3beta1 = require('./v3beta1'); /** - * With [Google Translate](https://cloud.google.com/translate), you can - * dynamically translate text between thousands of language pairs. - * - * The Google Cloud Translation API lets websites and programs integrate with - * Google Translate programmatically. - * - * @class - * - * @see [Getting Started]{@link https://cloud.google.com/translate/v2/getting_started} - * @see [Identifying your application to Google]{@link https://cloud.google.com/translate/v2/using_rest#auth} - * - * @param {ClientConfig} [options] Configuration options. - * - * @example - * //- - * //

Custom Translation API

- * // - * // The environment variable, `GOOGLE_CLOUD_TRANSLATE_ENDPOINT`, is honored as - * // a custom backend which our library will send requests to. - * //- - * - * @example include:samples/quickstart.js - * region_tag:translate_quickstart - * Full quickstart example: - */ -class Translate extends Service { - options: TranslateConfig; - key?: string; - constructor(options?: TranslateConfig) { - let baseUrl = 'https://translation.googleapis.com/language/translate/v2'; - - if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { - baseUrl = process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT.replace(/\/+$/, ''); - } - - const config = { - baseUrl, - scopes: ['https://www.googleapis.com/auth/cloud-platform'], - packageJson: require('../../package.json'), - projectIdRequired: false, - requestModule: teenyRequest as typeof r, - }; - - super(config, options); - this.options = options || {}; - this.options.request = config.requestModule; - if (this.options.key) { - this.key = this.options.key; - } - } - - detect(input: string): Promise<[DetectResult, r.Response]>; - detect(input: string[]): Promise<[DetectResult[], r.Response]>; - detect(input: string, callback: DetectCallback): void; - detect(input: string[], callback: DetectCallback): void; - /** - * Detect the language used in a string or multiple strings. - * - * @see [Detect Language]{@link https://cloud.google.com/translate/v2/using_rest#detect-language} - * - * @param {string|string[]} input - The source string input. - * @param {DetectCallback} [callback] Callback function. - * @returns {Promise} - * - * @example - * const {Translate} = require('@google-cloud/translate'); - * - * const translate = new Translate(); - * - * //- - * // Detect the language from a single string input. - * //- - * translate.detect('Hello', (err, results) => { - * if (!err) { - * // results = { - * // language: 'en', - * // confidence: 1, - * // input: 'Hello' - * // } - * } - * }); - * - * //- - * // Detect the languages used in multiple strings. Note that the results are - * // now provided as an array. - * //- - * translate.detect([ - * 'Hello', - * 'Hola' - * ], (err, results) => { - * if (!err) { - * // results = [ - * // { - * // language: 'en', - * // confidence: 1, - * // input: 'Hello' - * // }, - * // { - * // language: 'es', - * // confidence: 1, - * // input: 'Hola' - * // } - * // ] - * } - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * translate.detect('Hello').then((data) => { - * const results = data[0]; - * const apiResponse = data[2]; - * }); - * - * @example include:samples/translate.js - * region_tag:translate_detect_language - * Here's a full example: - */ - detect( - input: string|string[], - callback?: DetectCallback| - DetectCallback): void|Promise<[DetectResult, r.Response]>| - Promise<[DetectResult[], r.Response]> { - const inputIsArray = Array.isArray(input); - input = arrify(input); - this.request( - { - method: 'POST', - uri: '/detect', - json: { - q: input, - }, - }, - (err, resp) => { - if (err) { - (callback as Function)(err, null, resp); - return; - } - - let results = resp.data.detections.map( - (detection: Array<{}>, index: number) => { - const result = extend({}, detection[0], { - input: input[index], - }); - - // Deprecated. - // tslint:disable-next-line no-any - delete (result as any).isReliable; - - return result; - }); - - if (input.length === 1 && !inputIsArray) { - results = results[0]; - } - - (callback as Function)(null, results, resp); - }); - } - - getLanguages(target?: string): Promise<[LanguageResult[], r.Response]>; - getLanguages(target: string, callback: GetLanguagesCallback): void; - getLanguages(callback: GetLanguagesCallback): void; - /** - * Get an array of all supported languages. - * - * @see [Discovering Supported Languages]{@link https://cloud.google.com/translate/v2/discovering-supported-languages-with-rest} - * - * @param {string} [target] Get the language names in a language other than - * English. - * @param {GetLanguagesCallback} [callback] Callback function. - * @returns {Promise} - * - * @example include:samples/translate.js - * region_tag:translate_list_codes - * Gets the language names in English: - * - * @example include:samples/translate.js - * region_tag:translate_list_language_names - * Gets the language names in a language other than English: - */ - getLanguages( - targetOrCallback?: string|GetLanguagesCallback, - callback?: GetLanguagesCallback): - void|Promise<[LanguageResult[], r.Response]> { - let target: string; - if (is.fn(targetOrCallback)) { - callback = targetOrCallback as GetLanguagesCallback; - target = 'en'; - } else { - target = targetOrCallback as string; - } - - const reqOpts = { - uri: '/languages', - useQuerystring: true, - qs: {}, - } as DecorateRequestOptions; - - if (target && is.string(target)) { - reqOpts.qs.target = target; - } - - this.request(reqOpts, (err, resp) => { - if (err) { - callback!(err, null, resp); - return; - } - - const languages = resp.data.languages.map( - (language: {language: string, name: string}) => { - return { - code: language.language, - name: language.name, - }; - }); - - callback!(null, languages, resp); - }); - } - - translate(input: string, options: TranslateRequest): - Promise<[string, r.Response]>; - translate(input: string[], options: TranslateRequest): - Promise<[string[], r.Response]>; - translate(input: string, to: string): Promise<[string, r.Response]>; - translate(input: string[], to: string): Promise<[string[], r.Response]>; - translate( - input: string, options: TranslateRequest, - callback: TranslateCallback): void; - translate(input: string, to: string, callback: TranslateCallback): - void; - translate( - input: string[], options: TranslateRequest, - callback: TranslateCallback): void; - translate(input: string[], to: string, callback: TranslateCallback): - void; - /** - * Translate a string or multiple strings into another language. - * - * @see [Translate Text](https://cloud.google.com/translate/v2/using_rest#Translate) - * - * @throws {Error} If `options` is provided as an object without a `to` - * property. - * - * @param {string|string[]} input The source string input. - * @param {string|TranslateRequest} [options] If a string, it is interpreted as the - * target ISO 639-1 language code to translate the source input to. (e.g. - * `en` for English). If an object, you may also specify the source - * language. - * @param {TranslateCallback} [callback] Callback function. - * @returns {Promise} - * - * @example - * //- - * // Pass a string and a language code to get the translation. - * //- - * translate.translate('Hello', 'es', (err, translation) => { - * if (!err) { - * // translation = 'Hola' - * } - * }); - * - * //- - * // The source language is auto-detected by default. To manually set it, - * // provide an object. - * //- - * const options = { - * from: 'en', - * to: 'es' - * }; - * - * translate.translate('Hello', options, (err, translation) => { - * if (!err) { - * // translation = 'Hola' - * } - * }); - * - * //- - * // Translate multiple strings of input. Note that the results are - * // now provided as an array. - * //- - * const input = [ - * 'Hello', - * 'How are you today?' - * ]; - * - * translate.translate(input, 'es', (err, translations) => { - * if (!err) { - * // translations = [ - * // 'Hola', - * // 'Como estas hoy?' - * // ] - * } - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * translate.translate('Hello', 'es').then((data) => { - * const translation = data[0]; - * const apiResponse = data[1]; - * }); - * - * @example include:samples/translate.js - * region_tag:translate_translate_text - * Full translation example: - * - * @example include:samples/translate.js - * region_tag:translate_text_with_model - * Translation using the premium model: - */ - translate( - inputs: string|string[], optionsOrTo: string|TranslateRequest, - callback?: TranslateCallback|TranslateCallback): - void|Promise<[string, r.Response]>|Promise<[string[], r.Response]> { - const inputIsArray = Array.isArray(inputs); - const input = arrify(inputs); - let options: TranslateRequest = {}; - if (typeof optionsOrTo === 'object') { - options = optionsOrTo as TranslateRequest; - } else if (typeof optionsOrTo === 'string') { - options = {to: optionsOrTo}; - } - - // tslint:disable-next-line no-any - const body: any = { - q: input, - format: options.format || (isHtml(input[0]) ? 'html' : 'text'), - }; - - if (is.string(options)) { - body.target = options; - } else { - if (options.from) { - body.source = options.from; - } - - if (options.to) { - body.target = options.to; - } - - if (options.model) { - body.model = options.model; - } - } - - if (!body.target) { - throw new Error( - 'A target language is required to perform a translation.'); - } - - this.request( - { - method: 'POST', - uri: '', - json: body, - }, - (err, resp) => { - if (err) { - (callback as Function)(err, null, resp); - return; - } - - let translations = resp.data.translations.map( - (x: {translatedText: string}) => x.translatedText); - - if (body.q.length === 1 && !inputIsArray) { - translations = translations[0]; - } - - (callback as Function)(err, translations, resp); - }); - } - - request(reqOpts: DecorateRequestOptions): Promise; - request(reqOpts: DecorateRequestOptions, callback: BodyResponseCallback): - void; - /** - * A custom request implementation. Requests to this API may optionally use an - * API key for an application, not a bearer token from a service account. This - * means it is possible to skip the `makeAuthenticatedRequest` portion of the - * typical request lifecycle, and manually authenticate the request here. - * - * @private - * - * @param {object} reqOpts - Request options that are passed to `request`. - * @param {function} callback - The callback function passed to `request`. - */ - request(reqOpts: DecorateRequestOptions, callback?: BodyResponseCallback): - void|Promise { - if (!this.key) { - super.request(reqOpts, callback!); - return; - } - - reqOpts.uri = this.baseUrl + reqOpts.uri; - reqOpts = extend(true, {}, reqOpts, { - qs: { - key: this.key, - }, - headers: { - 'User-Agent': util.getUserAgentFromPackageJson(PKG), - }, - }); - - util.makeRequest(reqOpts, this.options, callback!); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Translate, {exclude: ['request']}); - -/** - * The `@google-cloud/translate` package has a single default export, the - * {@link Translate} class. + * The `@google-cloud/translate` package has the following named exports: * + * - `{@link Translate}` class - constructor for v2 of the Translation API. * See {@link Translate} and {@link ClientConfig} for client methods and - * configuration options. + * configuration options. Provides TypeScript types out-of-the-box. + * - `v3beta1` - client for the v3beta1 backend service version. It exports: + * - `TranslationServiceClient` - Reference to {@link + * v3beta1.TranslationServiceClient} + * * * @module {constructor} @google-cloud/translate * @alias nodejs-translate * - * @example Install the client library with
Install the v2 client library with npm: npm install --save * @google-cloud/translate * - * @example Import the client library: + * @example Import the v2 client library: * const {Translate} = require('@google-cloud/translate'); * - * @example Create a client that uses Create a v2 client that uses Application Default Credentials * (ADC): const client = new Translate(); * - * @example Create a client with Create a v2 client with explicit credentials: const client * = new Translate({ projectId: 'your-project-id', keyFilename: * '/path/to/keyfile.json', @@ -599,5 +65,19 @@ promisifyAll(Translate, {exclude: ['request']}); * @example include:samples/quickstart.js * region_tag:translate_quickstart * Full quickstart example: + * + * @example Install the v3beta1 client library: + * npm install --save @google-cloud/translate + * + * @example Import the v3beta1 client library: + * const {TranslationServiceClient} = + * require('@google-cloud/translate').v3beta1; + */ +export * from './v2'; + +/** + * @type {object} + * @property {constructor} TranslationServiceClient + * Reference to {@link v3beta1.TranslationServiceClient} */ -export {Translate}; +export {v3beta1}; diff --git a/packages/google-cloud-translate/src/v2/index.ts b/packages/google-cloud-translate/src/v2/index.ts new file mode 100644 index 00000000000..a99bc0cbc73 --- /dev/null +++ b/packages/google-cloud-translate/src/v2/index.ts @@ -0,0 +1,576 @@ +// Copyright 2017, Google LLC All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {Service, util} from '@google-cloud/common'; +import {promisifyAll} from '@google-cloud/promisify'; +import * as arrify from 'arrify'; +import * as extend from 'extend'; +import {GoogleAuthOptions} from 'google-auth-library'; +import * as is from 'is'; + +const isHtml = require('is-html'); +import {DecorateRequestOptions, BodyResponseCallback} from '@google-cloud/common/build/src/util'; +import * as r from 'request'; +import {teenyRequest} from 'teeny-request'; + +const PKG = require('../../../package.json'); + +export interface TranslateRequest { + format?: string; + from?: string; + model?: string; + to?: string; +} + +export interface TranslateCallback { + (err: Error|null, translations?: T|null, apiResponse?: r.Response): void; +} + +export interface DetectResult { + language: string; + confidence: number; + input: string; +} + +export interface DetectCallback { + (err: Error|null, results?: T|null, apiResponse?: r.Response): void; +} + +export interface LanguageResult { + code: string; + name: string; +} + +export interface GetLanguagesCallback { + (err: Error|null, results?: LanguageResult[]|null, + apiResponse?: r.Response): void; +} + +export interface TranslateConfig extends GoogleAuthOptions { + key?: string; + autoRetry?: boolean; + maxRetries?: number; + request?: typeof r; +} + +/** + * @typedef {object} ClientConfig + * @memberof v2 + * @property {string} [projectId] The project ID from the Google Developer's + * Console, e.g. 'grape-spaceship-123'. We will also check the environment + * variable `GCLOUD_PROJECT` for your project ID. If your app is running in + * an environment which supports {@link + * https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application + * Application Default Credentials}, your project ID will be detected + * automatically. + * @property {string} [key] An API key. You should prefer using a Service + * Account key file instead of an API key. + * @property {string} [keyFilename] Full path to the a .json, .pem, or .p12 key + * downloaded from the Google Developers Console. If you provide a path to a + * JSON file, the `projectId` option above is not necessary. NOTE: .pem and + * .p12 require you to specify the `email` option as well. + * @property {string} [email] Account email address. Required when using a .pem + * or .p12 keyFilename. + * @property {object} [credentials] Credentials object. + * @property {string} [credentials.client_email] + * @property {string} [credentials.private_key] + * @property {boolean} [autoRetry=true] Automatically retry requests if the + * response is related to rate limits or certain intermittent server errors. + * We will exponentially backoff subsequent requests by default. + * @property {number} [maxRetries=3] Maximum number of automatic retries + * attempted before returning the error. + * @property {Constructor} [promise] Custom promise module to use instead of + * native Promises. + */ +/** + * With [Google Translate](https://cloud.google.com/translate), you can + * dynamically translate text between thousands of language pairs. + * + * The Google Cloud Translation API lets websites and programs integrate with + * Google Translate programmatically. + * + * @class + * @memberof v2 + * + * @see [Getting Started]{@link https://cloud.google.com/translate/v2/getting_started} + * @see [Identifying your application to Google]{@link https://cloud.google.com/translate/v2/using_rest#auth} + * + * @param {ClientConfig} [options] Configuration options. + * + * @example + * //- + * //

Custom Translation API

+ * // + * // The environment variable, `GOOGLE_CLOUD_TRANSLATE_ENDPOINT`, is honored as + * // a custom backend which our library will send requests to. + * //- + * + * @example include:samples/quickstart.js + * region_tag:translate_quickstart + * Full quickstart example: + */ +export class Translate extends Service { + options: TranslateConfig; + key?: string; + constructor(options?: TranslateConfig) { + let baseUrl = 'https://translation.googleapis.com/language/translate/v2'; + + if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { + baseUrl = process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT.replace(/\/+$/, ''); + } + + const config = { + baseUrl, + scopes: ['https://www.googleapis.com/auth/cloud-platform'], + packageJson: require('../../../package.json'), + projectIdRequired: false, + requestModule: teenyRequest as typeof r, + }; + + super(config, options); + this.options = options || {}; + this.options.request = config.requestModule; + if (this.options.key) { + this.key = this.options.key; + } + } + + detect(input: string): Promise<[DetectResult, r.Response]>; + detect(input: string[]): Promise<[DetectResult[], r.Response]>; + detect(input: string, callback: DetectCallback): void; + detect(input: string[], callback: DetectCallback): void; +/** + * @typedef {object} DetectResult + * @memberof v2 + * @property {string} 0.language The language code matched from the input. + * @property {number} [0.confidence] A float 0 - 1. The higher the number, the + * higher the confidence in language detection. Note, this is not always + * returned from the API. + * @property {object} 1 The full API response. + */ +/** + * @callback DetectCallback + * @memberof v2 + * @param {?Error} err Request error, if any. + * @param {object|object[]} results The detection results. + * @param {string} results.language The language code matched from the input. + * @param {number} [results.confidence] A float 0 - 1. The higher the number, the + * higher the confidence in language detection. Note, this is not always + * returned from the API. + * @param {object} apiResponse The full API response. + */ + /** + * Detect the language used in a string or multiple strings. + * + * @see [Detect Language]{@link https://cloud.google.com/translate/v2/using_rest#detect-language} + * + * @param {string|string[]} input - The source string input. + * @param {DetectCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {Translate} = require('@google-cloud/translate'); + * + * const translate = new Translate(); + * + * //- + * // Detect the language from a single string input. + * //- + * translate.detect('Hello', (err, results) => { + * if (!err) { + * // results = { + * // language: 'en', + * // confidence: 1, + * // input: 'Hello' + * // } + * } + * }); + * + * //- + * // Detect the languages used in multiple strings. Note that the results are + * // now provided as an array. + * //- + * translate.detect([ + * 'Hello', + * 'Hola' + * ], (err, results) => { + * if (!err) { + * // results = [ + * // { + * // language: 'en', + * // confidence: 1, + * // input: 'Hello' + * // }, + * // { + * // language: 'es', + * // confidence: 1, + * // input: 'Hola' + * // } + * // ] + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * translate.detect('Hello').then((data) => { + * const results = data[0]; + * const apiResponse = data[2]; + * }); + * + * @example include:samples/translate.js + * region_tag:translate_detect_language + * Here's a full example: + */ + detect( + input: string|string[], + callback?: DetectCallback| + DetectCallback): void|Promise<[DetectResult, r.Response]>| + Promise<[DetectResult[], r.Response]> { + const inputIsArray = Array.isArray(input); + input = arrify(input); + this.request( + { + method: 'POST', + uri: '/detect', + json: { + q: input, + }, + }, + (err, resp) => { + if (err) { + (callback as Function)(err, null, resp); + return; + } + + let results = resp.data.detections.map( + (detection: Array<{}>, index: number) => { + const result = extend({}, detection[0], { + input: input[index], + }); + + // Deprecated. + // tslint:disable-next-line no-any + delete (result as any).isReliable; + + return result; + }); + + if (input.length === 1 && !inputIsArray) { + results = results[0]; + } + + (callback as Function)(null, results, resp); + }); + } + + getLanguages(target?: string): Promise<[LanguageResult[], r.Response]>; + getLanguages(target: string, callback: GetLanguagesCallback): void; + getLanguages(callback: GetLanguagesCallback): void; +/** + * @typedef {object} LanguageResult + * @memberof v2 + * @property {string} code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * language code. + * @property {string} name The language name. This can be translated into your + * preferred language with the `target` option. + */ +/** + * @callback GetLanguagesCallback + * @memberof v2 + * @param {?Error} err Request error, if any. + * @param {object[]} results The languages supported by the API. + * @param {string} results.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * language code. + * @param {string} results.name The language name. This can be translated into your + * preferred language with the `target` option. + * @param {object} apiResponse The full API response. + */ + /** + * Get an array of all supported languages. + * + * @see [Discovering Supported Languages]{@link https://cloud.google.com/translate/v2/discovering-supported-languages-with-rest} + * + * @param {string} [target] Get the language names in a language other than + * English. + * @param {GetLanguagesCallback} [callback] Callback function. + * @returns {Promise} + * + * @example include:samples/translate.js + * region_tag:translate_list_codes + * Gets the language names in English: + * + * @example include:samples/translate.js + * region_tag:translate_list_language_names + * Gets the language names in a language other than English: + */ + getLanguages( + targetOrCallback?: string|GetLanguagesCallback, + callback?: GetLanguagesCallback): + void|Promise<[LanguageResult[], r.Response]> { + let target: string; + if (is.fn(targetOrCallback)) { + callback = targetOrCallback as GetLanguagesCallback; + target = 'en'; + } else { + target = targetOrCallback as string; + } + + const reqOpts = { + uri: '/languages', + useQuerystring: true, + qs: {}, + } as DecorateRequestOptions; + + if (target && is.string(target)) { + reqOpts.qs.target = target; + } + + this.request(reqOpts, (err, resp) => { + if (err) { + callback!(err, null, resp); + return; + } + + const languages = resp.data.languages.map( + (language: {language: string, name: string}) => { + return { + code: language.language, + name: language.name, + }; + }); + + callback!(null, languages, resp); + }); + } + + translate(input: string, options: TranslateRequest): + Promise<[string, r.Response]>; + translate(input: string[], options: TranslateRequest): + Promise<[string[], r.Response]>; + translate(input: string, to: string): Promise<[string, r.Response]>; + translate(input: string[], to: string): Promise<[string[], r.Response]>; + translate( + input: string, options: TranslateRequest, + callback: TranslateCallback): void; + translate(input: string, to: string, callback: TranslateCallback): + void; + translate( + input: string[], options: TranslateRequest, + callback: TranslateCallback): void; + translate(input: string[], to: string, callback: TranslateCallback): + void; +/** + * Translate request options. + * + * @typedef {object} TranslateRequest + * @memberof v2 + * @property {string} [format] Set the text's format as `html` or `text`. + * If not provided, we will try to auto-detect if the text given is HTML. + * If not, we set the format as `text`. + * @property {string} [from] The ISO 639-1 language code the source input + * is written in. + * @property {string} [model] Set the model type requested for this + * translation. Please refer to the upstream documentation for possible + * values. + * @property {string} to The ISO 639-1 language code to translate the + * input to. + */ +/** + * @callback TranslateCallback + * @memberof v2 + * @param {?Error} err Request error, if any. + * @param {object|object[]} translations If a single string input was given, a + * single translation is given. Otherwise, it is an array of translations. + * @param {object} apiResponse The full API response. + */ + /** + * Translate a string or multiple strings into another language. + * + * @see [Translate Text](https://cloud.google.com/translate/v2/using_rest#Translate) + * + * @throws {Error} If `options` is provided as an object without a `to` + * property. + * + * @param {string|string[]} input The source string input. + * @param {string|TranslateRequest} [options] If a string, it is interpreted as the + * target ISO 639-1 language code to translate the source input to. (e.g. + * `en` for English). If an object, you may also specify the source + * language. + * @param {TranslateCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * //- + * // Pass a string and a language code to get the translation. + * //- + * translate.translate('Hello', 'es', (err, translation) => { + * if (!err) { + * // translation = 'Hola' + * } + * }); + * + * //- + * // The source language is auto-detected by default. To manually set it, + * // provide an object. + * //- + * const options = { + * from: 'en', + * to: 'es' + * }; + * + * translate.translate('Hello', options, (err, translation) => { + * if (!err) { + * // translation = 'Hola' + * } + * }); + * + * //- + * // Translate multiple strings of input. Note that the results are + * // now provided as an array. + * //- + * const input = [ + * 'Hello', + * 'How are you today?' + * ]; + * + * translate.translate(input, 'es', (err, translations) => { + * if (!err) { + * // translations = [ + * // 'Hola', + * // 'Como estas hoy?' + * // ] + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * translate.translate('Hello', 'es').then((data) => { + * const translation = data[0]; + * const apiResponse = data[1]; + * }); + * + * @example include:samples/translate.js + * region_tag:translate_translate_text + * Full translation example: + * + * @example include:samples/translate.js + * region_tag:translate_text_with_model + * Translation using the premium model: + */ + translate( + inputs: string|string[], optionsOrTo: string|TranslateRequest, + callback?: TranslateCallback|TranslateCallback): + void|Promise<[string, r.Response]>|Promise<[string[], r.Response]> { + const inputIsArray = Array.isArray(inputs); + const input = arrify(inputs); + let options: TranslateRequest = {}; + if (typeof optionsOrTo === 'object') { + options = optionsOrTo as TranslateRequest; + } else if (typeof optionsOrTo === 'string') { + options = {to: optionsOrTo}; + } + + // tslint:disable-next-line no-any + const body: any = { + q: input, + format: options.format || (isHtml(input[0]) ? 'html' : 'text'), + }; + + if (is.string(options)) { + body.target = options; + } else { + if (options.from) { + body.source = options.from; + } + + if (options.to) { + body.target = options.to; + } + + if (options.model) { + body.model = options.model; + } + } + + if (!body.target) { + throw new Error( + 'A target language is required to perform a translation.'); + } + + this.request( + { + method: 'POST', + uri: '', + json: body, + }, + (err, resp) => { + if (err) { + (callback as Function)(err, null, resp); + return; + } + + let translations = resp.data.translations.map( + (x: {translatedText: string}) => x.translatedText); + + if (body.q.length === 1 && !inputIsArray) { + translations = translations[0]; + } + + (callback as Function)(err, translations, resp); + }); + } + + request(reqOpts: DecorateRequestOptions): Promise; + request(reqOpts: DecorateRequestOptions, callback: BodyResponseCallback): + void; + /** + * A custom request implementation. Requests to this API may optionally use an + * API key for an application, not a bearer token from a service account. This + * means it is possible to skip the `makeAuthenticatedRequest` portion of the + * typical request lifecycle, and manually authenticate the request here. + * + * @private + * + * @param {object} reqOpts - Request options that are passed to `request`. + * @param {function} callback - The callback function passed to `request`. + */ + request(reqOpts: DecorateRequestOptions, callback?: BodyResponseCallback): + void|Promise { + if (!this.key) { + super.request(reqOpts, callback!); + return; + } + + reqOpts.uri = this.baseUrl + reqOpts.uri; + reqOpts = extend(true, {}, reqOpts, { + qs: { + key: this.key, + }, + headers: { + 'User-Agent': util.getUserAgentFromPackageJson(PKG), + }, + }); + + util.makeRequest(reqOpts, this.options, callback!); + } +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(Translate, {exclude: ['request']}); diff --git a/packages/google-cloud-translate/src/v3beta1/.eslintrc.yml b/packages/google-cloud-translate/src/v3beta1/.eslintrc.yml new file mode 100644 index 00000000000..46afd952546 --- /dev/null +++ b/packages/google-cloud-translate/src/v3beta1/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + node/no-missing-require: off diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js b/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js new file mode 100644 index 00000000000..774640f0012 --- /dev/null +++ b/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js @@ -0,0 +1,853 @@ +// Copyright 2019 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 +// +// https://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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Configures which glossary should be used for a specific target language, + * and defines options for applying that glossary. + * + * @property {string} glossary + * Required. Specifies the glossary used for this translation. Use + * this format: projects/* /locations/* /glossaries/* + * + * @property {boolean} ignoreCase + * Optional. Indicates whether we should do a case-insensitive match. + * Default value is false if missing. + * + * @typedef TranslateTextGlossaryConfig + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.TranslateTextGlossaryConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const TranslateTextGlossaryConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The request message for synchronous translation. + * + * @property {string[]} contents + * Required. The content of the input in string format. + * We recommend the total contents to be less than 30k codepoints. + * Please use BatchTranslateText for larger text. + * + * @property {string} mimeType + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type is assumed to be "text/html". + * + * @property {string} sourceLanguageCode + * Optional. The BCP-47 language code of the input text if + * known, for example, "en-US" or "sr-Latn". Supported language codes are + * listed in Language Support. If the source language isn't specified, the API + * attempts to identify the source language automatically and returns the + * the source language within the response. + * + * @property {string} targetLanguageCode + * Required. The BCP-47 language code to use for translation of the input + * text, set to one of the language codes listed in Language Support. + * + * @property {string} parent + * Optional. Only used when making regionalized call. + * Format: + * projects/{project-id}/locations/{location-id}. + * + * Only custom model/glossary within the same location-id can be used. + * Otherwise 400 is returned. + * + * @property {string} model + * Optional. The `model` type requested for this translation. + * + * The format depends on model type: + * 1. Custom models: + * projects/{project-id}/locations/{location-id}/models/{model-id}. + * 2. General (built-in) models: + * projects/{project-id}/locations/{location-id}/models/general/nmt + * projects/{project-id}/locations/{location-id}/models/general/base + * + * For global (non-regionalized) requests, use {location-id} 'global'. + * For example, + * projects/{project-id}/locations/global/models/general/nmt + * + * If missing, the system decides which google base model to use. + * + * @property {Object} glossaryConfig + * Optional. Glossary to be applied. The glossary needs to be in the same + * region as the model, otherwise an INVALID_ARGUMENT error is returned. + * + * This object should have the same structure as [TranslateTextGlossaryConfig]{@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} + * + * @typedef TranslateTextRequest + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.TranslateTextRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const TranslateTextRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The main language translation response message. + * + * @property {Object[]} translations + * Text translation responses with no glossary applied. + * This field has the same length as `contents` in TranslateTextRequest. + * + * This object should have the same structure as [Translation]{@link google.cloud.translation.v3beta1.Translation} + * + * @property {Object[]} glossaryTranslations + * Text translation responses if a glossary is provided in the request. + * This could be the same as 'translation' above if no terms apply. + * This field has the same length as `contents` in TranslateTextRequest. + * + * This object should have the same structure as [Translation]{@link google.cloud.translation.v3beta1.Translation} + * + * @typedef TranslateTextResponse + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.TranslateTextResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const TranslateTextResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A single translation response. + * + * @property {string} translatedText + * Text translated into the target language. + * + * @property {string} model + * Only present when `model` is present in the request. + * This is same as `model` provided in the request. + * + * @property {string} detectedLanguageCode + * The BCP-47 language code of source text in the initial request, detected + * automatically, if no source language was passed within the initial + * request. If the source language was passed, auto-detection of the language + * does not occur and this field will be empty. + * + * @property {Object} glossaryConfig + * The `glossary_config` used for this translation. + * + * This object should have the same structure as [TranslateTextGlossaryConfig]{@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} + * + * @typedef Translation + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.Translation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const Translation = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The request message for language detection. + * + * @property {string} parent + * Optional. Only used when making regionalized call. + * Format: + * projects/{project-id}/locations/{location-id}. + * + * Only custom model within the same location-id can be used. + * Otherwise 400 is returned. + * + * @property {string} model + * Optional. The language detection model to be used. + * projects/{project-id}/locations/{location-id}/models/language-detection/{model-id} + * If not specified, default will be used. + * + * @property {string} content + * The content of the input stored as a string. + * + * @property {string} mimeType + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type is assumed to be "text/html". + * + * @typedef DetectLanguageRequest + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.DetectLanguageRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const DetectLanguageRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The response message for language detection. + * + * @property {string} languageCode + * The BCP-47 language code of source content in the request, detected + * automatically. + * + * @property {number} confidence + * The confidence of the detection result for this language. + * + * @typedef DetectedLanguage + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.DetectedLanguage definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const DetectedLanguage = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The response message for language detection. + * + * @property {Object[]} languages + * A list of detected languages sorted by detection confidence in descending + * order. The most probable language first. + * + * This object should have the same structure as [DetectedLanguage]{@link google.cloud.translation.v3beta1.DetectedLanguage} + * + * @typedef DetectLanguageResponse + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.DetectLanguageResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const DetectLanguageResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The request message for discovering supported languages. + * + * @property {string} parent + * Optional. Used for making regionalized calls. + * Format: projects/{project-id}/locations/{location-id}. + * For global calls, use projects/{project-id}/locations/global. + * If missing, the call is treated as a global call. + * + * Only custom model within the same location-id can be used. + * Otherwise 400 is returned. + * + * @property {string} displayLanguageCode + * Optional. The language to use to return localized, human readable names + * of supported languages. If missing, default language is ENGLISH. + * + * @property {string} model + * Optional. Get supported languages of this model. + * The format depends on model type: + * 1. Custom models: + * projects/{project-id}/locations/{location-id}/models/{model-id}. + * 2. General (built-in) models: + * projects/{project-id}/locations/{location-id}/models/general/nmt + * projects/{project-id}/locations/{location-id}/models/general/base + * Returns languages supported by the specified model. + * If missing, we get supported languages of Google general NMT model. + * + * @typedef GetSupportedLanguagesRequest + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.GetSupportedLanguagesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const GetSupportedLanguagesRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The response message for discovering supported languages. + * + * @property {Object[]} languages + * A list of supported language responses. This list contains an entry + * for each language the Translation API supports. + * + * This object should have the same structure as [SupportedLanguage]{@link google.cloud.translation.v3beta1.SupportedLanguage} + * + * @typedef SupportedLanguages + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.SupportedLanguages definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const SupportedLanguages = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A single supported language response corresponds to information related + * to one supported language. + * + * @property {string} languageCode + * Supported language code, generally consisting of its ISO 639-1 + * identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes + * including language and region identifiers are returned (for example, + * 'zh-TW' and 'zh-CN') + * + * @property {string} displayName + * Human readable name of the language localized in the display language + * specified in the request. + * + * @property {boolean} supportSource + * Can be used as source language. + * + * @property {boolean} supportTarget + * Can be used as target language. + * + * @typedef SupportedLanguage + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.SupportedLanguage definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const SupportedLanguage = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The GCS location for the input content. + * + * @property {string} inputUri + * Required. Source data URI. For example, `gs://my_bucket/my_object`. + * + * @typedef GcsSource + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.GcsSource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const GcsSource = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Input configuration. + * + * @property {string} mimeType + * Optional. Can be "text/plain" or "text/html". + * For `.tsv`, "text/html" is used if mime_type is missing. + * For `.html`, this field must be "text/html" or empty. + * For `.txt`, this field must be "text/plain" or empty. + * + * @property {Object} gcsSource + * Required. Google Cloud Storage location for the source input. + * This can be a single file (for example, + * `gs://translation-test/input.tsv`) or a wildcard (for example, + * `gs://translation-test/*`). If a file extension is `.tsv`, it can + * contain either one or two columns. The first column (optional) is the id + * of the text request. If the first column is missing, we use the row + * number (0-based) from the input file as the ID in the output file. The + * second column is the actual text to be + * translated. We recommend each row be <= 10K Unicode codepoints, + * otherwise an error might be returned. + * + * The other supported file extensions are `.txt` or `.html`, which is + * treated as a single large chunk of text. + * + * This object should have the same structure as [GcsSource]{@link google.cloud.translation.v3beta1.GcsSource} + * + * @typedef InputConfig + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.InputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const InputConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The GCS location for the output content + * + * @property {string} outputUriPrefix + * Required. There must be no files under 'output_uri_prefix'. + * 'output_uri_prefix' must end with "/". Otherwise error 400 is returned. + * + * @typedef GcsDestination + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const GcsDestination = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Output configuration. + * + * @property {Object} gcsDestination + * Google Cloud Storage destination for output content. + * For every single input file (for example, gs://a/b/c.[extension]), we + * generate at most 2 * n output files. (n is the # of target_language_codes + * in the BatchTranslateTextRequest). + * + * Output files (tsv) generated are compliant with RFC 4180 except that + * record delimiters are '\n' instead of '\r\n'. We don't provide any way to + * change record delimiters. + * + * While the input files are being processed, we write/update an index file + * 'index.csv' under 'output_uri_prefix' (for example, + * gs://translation-test/index.csv) The index file is generated/updated as + * new files are being translated. The format is: + * + * input_file,target_language_code,translations_file,errors_file, + * glossary_translations_file,glossary_errors_file + * + * input_file is one file we matched using gcs_source.input_uri. + * target_language_code is provided in the request. + * translations_file contains the translations. (details provided below) + * errors_file contains the errors during processing of the file. (details + * below). Both translations_file and errors_file could be empty + * strings if we have no content to output. + * glossary_translations_file,glossary_errors_file are always empty string + * if input_file is tsv. They could also be empty if we have no content to + * output. + * + * Once a row is present in index.csv, the input/output matching never + * changes. Callers should also expect all the content in input_file are + * processed and ready to be consumed (that is, No partial output file is + * written). + * + * The format of translations_file (for target language code 'trg') is: + * gs://translation_test/a_b_c_'trg'_translations.[extension] + * + * If the input file extension is tsv, the output has the following + * columns: + * Column 1: ID of the request provided in the input, if it's not + * provided in the input, then the input row number is used (0-based). + * Column 2: source sentence. + * Column 3: translation without applying a glossary. Empty string if there + * is an error. + * Column 4 (only present if a glossary is provided in the request): + * translation after applying the glossary. Empty string if there is an + * error applying the glossary. Could be same string as column 3 if there is + * no glossary applied. + * + * If input file extension is a txt or html, the translation is directly + * written to the output file. If glossary is requested, a separate + * glossary_translations_file has format of + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] + * + * The format of errors file (for target language code 'trg') is: + * gs://translation_test/a_b_c_'trg'_errors.[extension] + * + * If the input file extension is tsv, errors_file has the + * following Column 1: ID of the request provided in the input, if it's not + * provided in the input, then the input row number is used (0-based). + * Column 2: source sentence. + * Column 3: Error detail for the translation. Could be empty. + * Column 4 (only present if a glossary is provided in the request): + * Error when applying the glossary. + * + * If the input file extension is txt or html, glossary_error_file will be + * generated that contains error details. glossary_error_file has format of + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] + * + * This object should have the same structure as [GcsDestination]{@link google.cloud.translation.v3beta1.GcsDestination} + * + * @typedef OutputConfig + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const OutputConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The batch translation request. + * + * @property {string} parent + * Optional. Only used when making regionalized call. + * Format: + * projects/{project-id}/locations/{location-id}. + * + * Only custom models/glossaries within the same location-id can be used. + * Otherwise 400 is returned. + * + * @property {string} sourceLanguageCode + * Required. Source language code. + * + * @property {string[]} targetLanguageCodes + * Required. Specify up to 10 language codes here. + * + * @property {Object.} models + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is model name. Value can be a built-in general model, + * or a custom model built by AutoML. + * + * The value format depends on model type: + * 1. Custom models: + * projects/{project-id}/locations/{location-id}/models/{model-id}. + * 2. General (built-in) models: + * projects/{project-id}/locations/{location-id}/models/general/nmt + * projects/{project-id}/locations/{location-id}/models/general/base + * + * If the map is empty or a specific model is + * not requested for a language pair, then default google model is used. + * + * @property {Object[]} inputConfigs + * Required. Input configurations. + * The total number of files matched should be <= 1000. + * The total content size should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + * + * This object should have the same structure as [InputConfig]{@link google.cloud.translation.v3beta1.InputConfig} + * + * @property {Object} outputConfig + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + * + * This object should have the same structure as [OutputConfig]{@link google.cloud.translation.v3beta1.OutputConfig} + * + * @property {Object.} glossaries + * Optional. Glossaries to be applied for translation. + * It's keyed by target language code. + * + * @typedef BatchTranslateTextRequest + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.BatchTranslateTextRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const BatchTranslateTextRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * State metadata for the batch translation operation. + * + * @property {number} state + * The state of the operation. + * + * The number should be among the values of [State]{@link google.cloud.translation.v3beta1.State} + * + * @property {number} translatedCharacters + * Number of successfully translated characters so far (Unicode codepoints). + * + * @property {number} failedCharacters + * Number of characters that have failed to process so far (Unicode + * codepoints). + * + * @property {number} totalCharacters + * Total number of characters (Unicode codepoints). + * This is the total number of codepoints from input files times the number of + * target languages. It appears here shortly after the call is submitted. + * + * @property {Object} submitTime + * Time when the operation was submitted. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef BatchTranslateMetadata + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.BatchTranslateMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const BatchTranslateMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Stored in the google.longrunning.Operation.response field returned by + * BatchTranslateText if at least one sentence is translated successfully. + * + * @property {number} totalCharacters + * Total number of characters (Unicode codepoints). + * + * @property {number} translatedCharacters + * Number of successfully translated characters (Unicode codepoints). + * + * @property {number} failedCharacters + * Number of characters that have failed to process (Unicode codepoints). + * + * @property {Object} submitTime + * Time when the operation was submitted. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} endTime + * The time when the operation is finished and + * google.longrunning.Operation.done is set to true. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef BatchTranslateResponse + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.BatchTranslateResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const BatchTranslateResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Input configuration for glossaries. + * + * @property {Object} gcsSource + * Required. Google Cloud Storage location of glossary data. + * File format is determined based on file name extension. API returns + * [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file + * formats. Wildcards are not allowed. This must be a single file in one of + * the following formats: + * + * For `UNIDIRECTIONAL` glossaries: + * + * - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. + * The first column is source text. The second column is target text. + * The file must not contain headers. That is, the first row is data, not + * column names. + * + * - TMX (`.tmx`): TMX file with parallel data defining source/target term + * pairs. + * + * For `EQUIVALENT_TERMS_SET` glossaries: + * + * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms + * in multiple languages. The format is defined for Google Translation + * Toolkit and documented here: + * `https://support.google.com/translatortoolkit/answer/6306379?hl=en`. + * + * This object should have the same structure as [GcsSource]{@link google.cloud.translation.v3beta1.GcsSource} + * + * @typedef GlossaryInputConfig + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.GlossaryInputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const GlossaryInputConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Represents a glossary built from user provided data. + * + * @property {string} name + * Required. The resource name of the glossary. Glossary names have the form + * `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`. + * + * @property {Object} languagePair + * Used with UNIDIRECTIONAL. + * + * This object should have the same structure as [LanguageCodePair]{@link google.cloud.translation.v3beta1.LanguageCodePair} + * + * @property {Object} languageCodesSet + * Used with EQUIVALENT_TERMS_SET. + * + * This object should have the same structure as [LanguageCodesSet]{@link google.cloud.translation.v3beta1.LanguageCodesSet} + * + * @property {Object} inputConfig + * Required. Provides examples to build the glossary from. + * Total glossary must not exceed 10M Unicode codepoints. + * + * This object should have the same structure as [GlossaryInputConfig]{@link google.cloud.translation.v3beta1.GlossaryInputConfig} + * + * @property {number} entryCount + * Output only. The number of entries defined in the glossary. + * + * @property {Object} submitTime + * Output only. When CreateGlossary was called. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} endTime + * Output only. When the glossary creation was finished. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef Glossary + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.Glossary definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const Glossary = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Used with UNIDIRECTIONAL. + * + * @property {string} sourceLanguageCode + * Required. The BCP-47 language code of the input text, for example, + * "en-US". Expected to be an exact match for GlossaryTerm.language_code. + * + * @property {string} targetLanguageCode + * Required. The BCP-47 language code for translation output, for example, + * "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. + * + * @typedef LanguageCodePair + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.Glossary.LanguageCodePair definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ + LanguageCodePair: { + // This is for documentation. Actual contents will be loaded by gRPC. + }, + + /** + * Used with EQUIVALENT_TERMS_SET. + * + * @property {string[]} languageCodes + * The BCP-47 language code(s) for terms defined in the glossary. + * All entries are unique. The list contains at least two entries. + * Expected to be an exact match for GlossaryTerm.language_code. + * + * @typedef LanguageCodesSet + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.Glossary.LanguageCodesSet definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ + LanguageCodesSet: { + // This is for documentation. Actual contents will be loaded by gRPC. + } +}; + +/** + * Request message for CreateGlossary. + * + * @property {string} parent + * Required. The project name. + * + * @property {Object} glossary + * Required. The glossary to create. + * + * This object should have the same structure as [Glossary]{@link google.cloud.translation.v3beta1.Glossary} + * + * @typedef CreateGlossaryRequest + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.CreateGlossaryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const CreateGlossaryRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for GetGlossary. + * + * @property {string} name + * Required. The name of the glossary to retrieve. + * + * @typedef GetGlossaryRequest + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.GetGlossaryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const GetGlossaryRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for DeleteGlossary. + * + * @property {string} name + * Required. The name of the glossary to delete. + * + * @typedef DeleteGlossaryRequest + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.DeleteGlossaryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const DeleteGlossaryRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for ListGlossaries. + * + * @property {string} parent + * Required. The name of the project from which to list all of the glossaries. + * + * @property {number} pageSize + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * + * @property {string} pageToken + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * + * @property {string} filter + * Optional. Filter specifying constraints of a list operation. + * For example, `tags.glossary_name="products*"`. + * If missing, no filtering is performed. + * + * @typedef ListGlossariesRequest + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.ListGlossariesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const ListGlossariesRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for ListGlossaries. + * + * @property {Object[]} glossaries + * The list of glossaries for a project. + * + * This object should have the same structure as [Glossary]{@link google.cloud.translation.v3beta1.Glossary} + * + * @property {string} nextPageToken + * A token to retrieve a page of results. Pass this value in the + * [ListGlossariesRequest.page_token] field in the subsequent call to + * `ListGlossaries` method to retrieve the next page of results. + * + * @typedef ListGlossariesResponse + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.ListGlossariesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const ListGlossariesResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Stored in the google.longrunning.Operation.metadata field returned by + * CreateGlossary. + * + * @property {string} name + * The name of the glossary that is being created. + * + * @property {number} state + * The current state of the glossary creation operation. + * + * The number should be among the values of [State]{@link google.cloud.translation.v3beta1.State} + * + * @property {Object} submitTime + * The time when the operation was submitted to the server. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef CreateGlossaryMetadata + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.CreateGlossaryMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const CreateGlossaryMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Stored in the google.longrunning.Operation.metadata field returned by + * DeleteGlossary. + * + * @property {string} name + * The name of the glossary that is being deleted. + * + * @property {number} state + * The current state of the glossary deletion operation. + * + * The number should be among the values of [State]{@link google.cloud.translation.v3beta1.State} + * + * @property {Object} submitTime + * The time when the operation was submitted to the server. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.DeleteGlossaryMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const DeleteGlossaryMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Stored in the google.longrunning.Operation.response field returned by + * DeleteGlossary. + * + * @property {string} name + * The name of the deleted glossary. + * + * @property {Object} submitTime + * The time when the operation was submitted to the server. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} endTime + * The time when the glossary deletion is finished and + * google.longrunning.Operation.done is set to true. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef DeleteGlossaryResponse + * @memberof google.cloud.translation.v3beta1 + * @see [google.cloud.translation.v3beta1.DeleteGlossaryResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} + */ +const DeleteGlossaryResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-translate/src/v3beta1/doc/google/longrunning/doc_operations.js new file mode 100644 index 00000000000..4719aebdc91 --- /dev/null +++ b/packages/google-cloud-translate/src/v3beta1/doc/google/longrunning/doc_operations.js @@ -0,0 +1,63 @@ +// Copyright 2019 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 +// +// https://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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * This resource represents a long-running operation that is the result of a + * network API call. + * + * @property {string} name + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + * + * @property {Object} metadata + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @property {boolean} done + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + * + * @property {Object} error + * The error result of the operation in case of failure or cancellation. + * + * This object should have the same structure as [Status]{@link google.rpc.Status} + * + * @property {Object} response + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Operation + * @memberof google.longrunning + * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +const Operation = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js new file mode 100644 index 00000000000..f3278b34e66 --- /dev/null +++ b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js @@ -0,0 +1,136 @@ +// Copyright 2019 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 +// +// https://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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * # JSON + * + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message google.protobuf.Duration): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * @property {string} typeUrl + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a google.protobuf.Type + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * @property {string} value + * Must be a valid serialized protocol buffer of the above specified type. + * + * @typedef Any + * @memberof google.protobuf + * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} + */ +const Any = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js new file mode 100644 index 00000000000..b47f41c2b30 --- /dev/null +++ b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js @@ -0,0 +1,113 @@ +// Copyright 2019 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 +// +// https://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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A Timestamp represents a point in time independent of any time zone + * or calendar, represented as seconds and fractions of seconds at + * nanosecond resolution in UTC Epoch time. It is encoded using the + * Proleptic Gregorian Calendar which extends the Gregorian calendar + * backwards to year one. It is encoded assuming all minutes are 60 + * seconds long, i.e. leap seconds are "smeared" so that no leap second + * table is needed for interpretation. Range is from + * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. + * By restricting to that range, we ensure that we can convert to + * and from RFC 3339 date strings. + * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) + * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) to obtain a formatter capable of generating timestamps in this format. + * + * @property {number} seconds + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * @property {number} nanos + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * @typedef Timestamp + * @memberof google.protobuf + * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} + */ +const Timestamp = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-translate/src/v3beta1/doc/google/rpc/doc_status.js new file mode 100644 index 00000000000..432ab6bb928 --- /dev/null +++ b/packages/google-cloud-translate/src/v3beta1/doc/google/rpc/doc_status.js @@ -0,0 +1,95 @@ +// Copyright 2019 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 +// +// https://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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * + * - Simple to use and understand for most users + * - Flexible enough to meet unexpected needs + * + * # Overview + * + * The `Status` message contains three pieces of data: error code, error + * message, and error details. The error code should be an enum value of + * google.rpc.Code, but it may accept additional error codes + * if needed. The error message should be a developer-facing English message + * that helps developers *understand* and *resolve* the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may contain + * arbitrary information about the error. There is a predefined set of error + * detail types in the package `google.rpc` that can be used for common error + * conditions. + * + * # Language mapping + * + * The `Status` message is the logical representation of the error model, but it + * is not necessarily the actual wire format. When the `Status` message is + * exposed in different client libraries and different wire protocols, it can be + * mapped differently. For example, it will likely be mapped to some exceptions + * in Java, but more likely mapped to some error codes in C. + * + * # Other uses + * + * The error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a + * consistent developer experience across different environments. + * + * Example uses of this error model include: + * + * - Partial errors. If a service needs to return partial errors to the client, + * it may embed the `Status` in the normal response to indicate the partial + * errors. + * + * - Workflow errors. A typical workflow has multiple steps. Each step may + * have a `Status` message for error reporting. + * + * - Batch operations. If a client uses batch request and batch response, the + * `Status` message should be used directly inside batch response, one for + * each error sub-response. + * + * - Asynchronous operations. If an API call embeds asynchronous operation + * results in its response, the status of those operations should be + * represented directly using the `Status` message. + * + * - Logging. If some API errors are stored in logs, the message `Status` could + * be used directly after any stripping needed for security/privacy reasons. + * + * @property {number} code + * The status code, which should be an enum value of + * google.rpc.Code. + * + * @property {string} message + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized + * by the client. + * + * @property {Object[]} details + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Status + * @memberof google.rpc + * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} + */ +const Status = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/index.js b/packages/google-cloud-translate/src/v3beta1/index.js new file mode 100644 index 00000000000..2ee97b83a41 --- /dev/null +++ b/packages/google-cloud-translate/src/v3beta1/index.js @@ -0,0 +1,19 @@ +// Copyright 2019 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 +// +// https://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. + +'use strict'; + +const TranslationServiceClient = require('./translation_service_client'); + +module.exports.TranslationServiceClient = TranslationServiceClient; diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js new file mode 100644 index 00000000000..b228448d2fa --- /dev/null +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js @@ -0,0 +1,1204 @@ +// Copyright 2019 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 +// +// https://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. + +'use strict'; + +const gapicConfig = require('./translation_service_client_config.json'); +const gax = require('google-gax'); +const merge = require('lodash.merge'); +const path = require('path'); +const protobuf = require('protobufjs'); + +const VERSION = require('../../../package.json').version; + +/** + * Provides natural language translation operations. + * + * @class + * @memberof v3beta1 + */ +class TranslationServiceClient { + /** + * Construct an instance of TranslationServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.servicePath] - The domain name of the + * API remote host. + */ + constructor(opts) { + this._descriptors = {}; + + // Ensure that options include the service address and port. + opts = Object.assign( + { + clientConfig: {}, + port: this.constructor.port, + servicePath: this.constructor.servicePath, + }, + opts + ); + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = this.constructor.scopes; + const gaxGrpc = new gax.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth; + + // Determine the client header string. + const clientHeader = [ + `gl-node/${process.version}`, + `grpc/${gaxGrpc.grpcVersion}`, + `gax/${gax.version}`, + `gapic/${VERSION}`, + ]; + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + + // Load the applicable protos. + const protos = merge( + {}, + gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + 'google/cloud/translate/v3beta1/translation_service.proto' + ) + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + locationPathTemplate: new gax.PathTemplate( + 'projects/{project}/locations/{location}' + ), + glossaryPathTemplate: new gax.PathTemplate( + 'projects/{project}/locations/{location}/glossaries/{glossary}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this._descriptors.page = { + listGlossaries: new gax.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'glossaries' + ), + }; + let protoFilesRoot = new gax.GoogleProtoFilesRoot(); + protoFilesRoot = protobuf.loadSync( + path.join( + __dirname, + '..', + '..', + 'protos', + 'google/cloud/translate/v3beta1/translation_service.proto' + ), + protoFilesRoot + ); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + this.operationsClient = new gax.lro({ + auth: gaxGrpc.auth, + grpc: gaxGrpc.grpc, + }).operationsClient(opts); + + const batchTranslateTextResponse = protoFilesRoot.lookup( + 'google.cloud.translation.v3beta1.BatchTranslateResponse' + ); + const batchTranslateTextMetadata = protoFilesRoot.lookup( + 'google.cloud.translation.v3beta1.BatchTranslateMetadata' + ); + const createGlossaryResponse = protoFilesRoot.lookup( + 'google.cloud.translation.v3beta1.Glossary' + ); + const createGlossaryMetadata = protoFilesRoot.lookup( + 'google.cloud.translation.v3beta1.CreateGlossaryMetadata' + ); + const deleteGlossaryResponse = protoFilesRoot.lookup( + 'google.cloud.translation.v3beta1.DeleteGlossaryResponse' + ); + const deleteGlossaryMetadata = protoFilesRoot.lookup( + 'google.cloud.translation.v3beta1.DeleteGlossaryMetadata' + ); + + this._descriptors.longrunning = { + batchTranslateText: new gax.LongrunningDescriptor( + this.operationsClient, + batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), + batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) + ), + createGlossary: new gax.LongrunningDescriptor( + this.operationsClient, + createGlossaryResponse.decode.bind(createGlossaryResponse), + createGlossaryMetadata.decode.bind(createGlossaryMetadata) + ), + deleteGlossary: new gax.LongrunningDescriptor( + this.operationsClient, + deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), + deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata) + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.translation.v3beta1.TranslationService', + gapicConfig, + opts.clientConfig, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this._innerApiCalls = {}; + + // Put together the "service stub" for + // google.cloud.translation.v3beta1.TranslationService. + const translationServiceStub = gaxGrpc.createStub( + protos.google.cloud.translation.v3beta1.TranslationService, + opts + ); + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const translationServiceStubMethods = [ + 'translateText', + 'detectLanguage', + 'getSupportedLanguages', + 'batchTranslateText', + 'createGlossary', + 'listGlossaries', + 'getGlossary', + 'deleteGlossary', + ]; + for (const methodName of translationServiceStubMethods) { + this._innerApiCalls[methodName] = gax.createApiCall( + translationServiceStub.then( + stub => + function() { + const args = Array.prototype.slice.call(arguments, 0); + return stub[methodName].apply(stub, args); + }, + err => + function() { + throw err; + } + ), + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.longrunning[methodName] + ); + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'translate.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-translation', + ]; + } + + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId(callback) { + return this.auth.getProjectId(callback); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Translates input text and returns translated text. + * + * @param {Object} request + * The request object that will be sent. + * @param {string[]} request.contents + * Required. The content of the input in string format. + * We recommend the total contents to be less than 30k codepoints. + * Please use BatchTranslateText for larger text. + * @param {string} request.targetLanguageCode + * Required. The BCP-47 language code to use for translation of the input + * text, set to one of the language codes listed in Language Support. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type is assumed to be "text/html". + * @param {string} [request.sourceLanguageCode] + * Optional. The BCP-47 language code of the input text if + * known, for example, "en-US" or "sr-Latn". Supported language codes are + * listed in Language Support. If the source language isn't specified, the API + * attempts to identify the source language automatically and returns the + * the source language within the response. + * @param {string} [request.parent] + * Optional. Only used when making regionalized call. + * Format: + * projects/{project-id}/locations/{location-id}. + * + * Only custom model/glossary within the same location-id can be used. + * Otherwise 400 is returned. + * @param {string} [request.model] + * Optional. The `model` type requested for this translation. + * + * The format depends on model type: + * 1. Custom models: + * projects/{project-id}/locations/{location-id}/models/{model-id}. + * 2. General (built-in) models: + * projects/{project-id}/locations/{location-id}/models/general/nmt + * projects/{project-id}/locations/{location-id}/models/general/base + * + * For global (non-regionalized) requests, use {location-id} 'global'. + * For example, + * projects/{project-id}/locations/global/models/general/nmt + * + * If missing, the system decides which google base model to use. + * @param {Object} [request.glossaryConfig] + * Optional. Glossary to be applied. The glossary needs to be in the same + * region as the model, otherwise an INVALID_ARGUMENT error is returned. + * + * This object should have the same structure as [TranslateTextGlossaryConfig]{@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3beta1.TranslateTextResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3beta1.TranslateTextResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const translate = require('@google-cloud/translate'); + * + * const client = new translate.v3beta1.TranslationServiceClient({ + * // optional auth parameters. + * }); + * + * const contents = []; + * const targetLanguageCode = ''; + * const request = { + * contents: contents, + * targetLanguageCode: targetLanguageCode, + * }; + * client.translateText(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + translateText(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); + + return this._innerApiCalls.translateText(request, options, callback); + } + + /** + * Detects the language of text within a request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.parent] + * Optional. Only used when making regionalized call. + * Format: + * projects/{project-id}/locations/{location-id}. + * + * Only custom model within the same location-id can be used. + * Otherwise 400 is returned. + * @param {string} [request.model] + * Optional. The language detection model to be used. + * projects/{project-id}/locations/{location-id}/models/language-detection/{model-id} + * If not specified, default will be used. + * @param {string} [request.content] + * The content of the input stored as a string. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type is assumed to be "text/html". + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3beta1.DetectLanguageResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3beta1.DetectLanguageResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const translate = require('@google-cloud/translate'); + * + * const client = new translate.v3beta1.TranslationServiceClient({ + * // optional auth parameters. + * }); + * + * + * client.detectLanguage({}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + detectLanguage(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); + + return this._innerApiCalls.detectLanguage(request, options, callback); + } + + /** + * Returns a list of supported languages for translation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.parent] + * Optional. Used for making regionalized calls. + * Format: projects/{project-id}/locations/{location-id}. + * For global calls, use projects/{project-id}/locations/global. + * If missing, the call is treated as a global call. + * + * Only custom model within the same location-id can be used. + * Otherwise 400 is returned. + * @param {string} [request.displayLanguageCode] + * Optional. The language to use to return localized, human readable names + * of supported languages. If missing, default language is ENGLISH. + * @param {string} [request.model] + * Optional. Get supported languages of this model. + * The format depends on model type: + * 1. Custom models: + * projects/{project-id}/locations/{location-id}/models/{model-id}. + * 2. General (built-in) models: + * projects/{project-id}/locations/{location-id}/models/general/nmt + * projects/{project-id}/locations/{location-id}/models/general/base + * Returns languages supported by the specified model. + * If missing, we get supported languages of Google general NMT model. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [SupportedLanguages]{@link google.cloud.translation.v3beta1.SupportedLanguages}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3beta1.SupportedLanguages}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const translate = require('@google-cloud/translate'); + * + * const client = new translate.v3beta1.TranslationServiceClient({ + * // optional auth parameters. + * }); + * + * + * client.getSupportedLanguages({}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getSupportedLanguages(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); + + return this._innerApiCalls.getSupportedLanguages( + request, + options, + callback + ); + } + + /** + * Translates a large volume of text in asynchronous batch mode. + * This function provides real-time output as the inputs are being processed. + * If caller cancels a request, the partial results (for an input file, it's + * all or nothing) may still be available on the specified output location. + * + * This call returns immediately and you can + * use google.longrunning.Operation.name to poll the status of the call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.sourceLanguageCode + * Required. Source language code. + * @param {string[]} request.targetLanguageCodes + * Required. Specify up to 10 language codes here. + * @param {Object[]} request.inputConfigs + * Required. Input configurations. + * The total number of files matched should be <= 1000. + * The total content size should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + * + * This object should have the same structure as [InputConfig]{@link google.cloud.translation.v3beta1.InputConfig} + * @param {Object} request.outputConfig + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + * + * This object should have the same structure as [OutputConfig]{@link google.cloud.translation.v3beta1.OutputConfig} + * @param {string} [request.parent] + * Optional. Only used when making regionalized call. + * Format: + * projects/{project-id}/locations/{location-id}. + * + * Only custom models/glossaries within the same location-id can be used. + * Otherwise 400 is returned. + * @param {Object.} [request.models] + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is model name. Value can be a built-in general model, + * or a custom model built by AutoML. + * + * The value format depends on model type: + * 1. Custom models: + * projects/{project-id}/locations/{location-id}/models/{model-id}. + * 2. General (built-in) models: + * projects/{project-id}/locations/{location-id}/models/general/nmt + * projects/{project-id}/locations/{location-id}/models/general/base + * + * If the map is empty or a specific model is + * not requested for a language pair, then default google model is used. + * @param {Object.} [request.glossaries] + * Optional. Glossaries to be applied for translation. + * It's keyed by target language code. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const translate = require('@google-cloud/translate'); + * + * const client = new translate.v3beta1.TranslationServiceClient({ + * // optional auth parameters. + * }); + * + * const sourceLanguageCode = ''; + * const targetLanguageCodes = []; + * const inputConfigs = []; + * const outputConfig = {}; + * const request = { + * sourceLanguageCode: sourceLanguageCode, + * targetLanguageCodes: targetLanguageCodes, + * inputConfigs: inputConfigs, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the promise pattern. + * client.batchTranslateText(request) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Operation#promise starts polling for the completion of the LRO. + * return operation.promise(); + * }) + * .then(responses => { + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const sourceLanguageCode = ''; + * const targetLanguageCodes = []; + * const inputConfigs = []; + * const outputConfig = {}; + * const request = { + * sourceLanguageCode: sourceLanguageCode, + * targetLanguageCodes: targetLanguageCodes, + * inputConfigs: inputConfigs, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the event emitter pattern. + * client.batchTranslateText(request) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Adding a listener for the "complete" event starts polling for the + * // completion of the operation. + * operation.on('complete', (result, metadata, finalApiResponse) => { + * // doSomethingWith(result); + * }); + * + * // Adding a listener for the "progress" event causes the callback to be + * // called on any change in metadata when the operation is polled. + * operation.on('progress', (metadata, apiResponse) => { + * // doSomethingWith(metadata) + * }); + * + * // Adding a listener for the "error" event handles any errors found during polling. + * operation.on('error', err => { + * // throw(err); + * }); + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const sourceLanguageCode = ''; + * const targetLanguageCodes = []; + * const inputConfigs = []; + * const outputConfig = {}; + * const request = { + * sourceLanguageCode: sourceLanguageCode, + * targetLanguageCodes: targetLanguageCodes, + * inputConfigs: inputConfigs, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.batchTranslateText(request); + * + * const [response] = await operation.promise(); + */ + batchTranslateText(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); + + return this._innerApiCalls.batchTranslateText(request, options, callback); + } + + /** + * Creates a glossary and returns the long-running operation. Returns + * NOT_FOUND, if the project doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project name. + * @param {Object} request.glossary + * Required. The glossary to create. + * + * This object should have the same structure as [Glossary]{@link google.cloud.translation.v3beta1.Glossary} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const translate = require('@google-cloud/translate'); + * + * const client = new translate.v3beta1.TranslationServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * const glossary = {}; + * const request = { + * parent: formattedParent, + * glossary: glossary, + * }; + * + * // Handle the operation using the promise pattern. + * client.createGlossary(request) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Operation#promise starts polling for the completion of the LRO. + * return operation.promise(); + * }) + * .then(responses => { + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * const glossary = {}; + * const request = { + * parent: formattedParent, + * glossary: glossary, + * }; + * + * // Handle the operation using the event emitter pattern. + * client.createGlossary(request) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Adding a listener for the "complete" event starts polling for the + * // completion of the operation. + * operation.on('complete', (result, metadata, finalApiResponse) => { + * // doSomethingWith(result); + * }); + * + * // Adding a listener for the "progress" event causes the callback to be + * // called on any change in metadata when the operation is polled. + * operation.on('progress', (metadata, apiResponse) => { + * // doSomethingWith(metadata) + * }); + * + * // Adding a listener for the "error" event handles any errors found during polling. + * operation.on('error', err => { + * // throw(err); + * }); + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * const glossary = {}; + * const request = { + * parent: formattedParent, + * glossary: glossary, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.createGlossary(request); + * + * const [response] = await operation.promise(); + */ + createGlossary(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); + + return this._innerApiCalls.createGlossary(request, options, callback); + } + + /** + * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.parent] + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * For example, `tags.glossary_name="products*"`. + * If missing, no filtering is performed. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const translate = require('@google-cloud/translate'); + * + * const client = new translate.v3beta1.TranslationServiceClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * client.listGlossaries({}) + * .then(responses => { + * const resources = responses[0]; + * for (const resource of resources) { + * // doThingsWith(resource) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (const resource of resources) { + * // doThingsWith(resource); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listGlossaries(nextRequest, options).then(callback); + * } + * } + * client.listGlossaries({}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listGlossaries(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); + + return this._innerApiCalls.listGlossaries(request, options, callback); + } + + /** + * Equivalent to {@link listGlossaries}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGlossaries} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.parent] + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * For example, `tags.glossary_name="products*"`. + * If missing, no filtering is performed. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @returns {Stream} + * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary} on 'data' event. + * + * @example + * + * const translate = require('@google-cloud/translate'); + * + * const client = new translate.v3beta1.TranslationServiceClient({ + * // optional auth parameters. + * }); + * + * + * client.listGlossariesStream({}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listGlossariesStream(request, options) { + options = options || {}; + + return this._descriptors.page.listGlossaries.createStream( + this._innerApiCalls.listGlossaries, + request, + options + ); + } + + /** + * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to retrieve. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const translate = require('@google-cloud/translate'); + * + * const client = new translate.v3beta1.TranslationServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.glossaryPath('[PROJECT]', '[LOCATION]', '[GLOSSARY]'); + * client.getGlossary({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getGlossary(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); + + return this._innerApiCalls.getGlossary(request, options, callback); + } + + /** + * Deletes a glossary, or cancels glossary construction + * if the glossary isn't created yet. + * Returns NOT_FOUND, if the glossary doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to delete. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const translate = require('@google-cloud/translate'); + * + * const client = new translate.v3beta1.TranslationServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.glossaryPath('[PROJECT]', '[LOCATION]', '[GLOSSARY]'); + * + * // Handle the operation using the promise pattern. + * client.deleteGlossary({name: formattedName}) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Operation#promise starts polling for the completion of the LRO. + * return operation.promise(); + * }) + * .then(responses => { + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedName = client.glossaryPath('[PROJECT]', '[LOCATION]', '[GLOSSARY]'); + * + * // Handle the operation using the event emitter pattern. + * client.deleteGlossary({name: formattedName}) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Adding a listener for the "complete" event starts polling for the + * // completion of the operation. + * operation.on('complete', (result, metadata, finalApiResponse) => { + * // doSomethingWith(result); + * }); + * + * // Adding a listener for the "progress" event causes the callback to be + * // called on any change in metadata when the operation is polled. + * operation.on('progress', (metadata, apiResponse) => { + * // doSomethingWith(metadata) + * }); + * + * // Adding a listener for the "error" event handles any errors found during polling. + * operation.on('error', err => { + * // throw(err); + * }); + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedName = client.glossaryPath('[PROJECT]', '[LOCATION]', '[GLOSSARY]'); + * + * // Handle the operation using the await pattern. + * const [operation] = await client.deleteGlossary({name: formattedName}); + * + * const [response] = await operation.promise(); + */ + deleteGlossary(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); + + return this._innerApiCalls.deleteGlossary(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified location resource name string. + * + * @param {String} project + * @param {String} location + * @returns {String} + */ + locationPath(project, location) { + return this._pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Return a fully-qualified glossary resource name string. + * + * @param {String} project + * @param {String} location + * @param {String} glossary + * @returns {String} + */ + glossaryPath(project, location, glossary) { + return this._pathTemplates.glossaryPathTemplate.render({ + project: project, + location: location, + glossary: glossary, + }); + } + + /** + * Parse the locationName from a location resource. + * + * @param {String} locationName + * A fully-qualified path representing a location resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromLocationName(locationName) { + return this._pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the locationName from a location resource. + * + * @param {String} locationName + * A fully-qualified path representing a location resources. + * @returns {String} - A string representing the location. + */ + matchLocationFromLocationName(locationName) { + return this._pathTemplates.locationPathTemplate.match(locationName) + .location; + } + + /** + * Parse the glossaryName from a glossary resource. + * + * @param {String} glossaryName + * A fully-qualified path representing a glossary resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromGlossaryName(glossaryName) { + return this._pathTemplates.glossaryPathTemplate.match(glossaryName).project; + } + + /** + * Parse the glossaryName from a glossary resource. + * + * @param {String} glossaryName + * A fully-qualified path representing a glossary resources. + * @returns {String} - A string representing the location. + */ + matchLocationFromGlossaryName(glossaryName) { + return this._pathTemplates.glossaryPathTemplate.match(glossaryName) + .location; + } + + /** + * Parse the glossaryName from a glossary resource. + * + * @param {String} glossaryName + * A fully-qualified path representing a glossary resources. + * @returns {String} - A string representing the glossary. + */ + matchGlossaryFromGlossaryName(glossaryName) { + return this._pathTemplates.glossaryPathTemplate.match(glossaryName) + .glossary; + } +} + +module.exports = TranslationServiceClient; diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json new file mode 100644 index 00000000000..e9f8e606073 --- /dev/null +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.translation.v3beta1.TranslationService": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "TranslateText": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DetectLanguage": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSupportedLanguages": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchTranslateText": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateGlossary": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListGlossaries": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetGlossary": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteGlossary": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 7970b341845..5065f91d8db 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,11 +1,38 @@ { - "updateTime": "2019-03-08T00:45:46.433993Z", + "updateTime": "2019-04-02T00:58:49.841632Z", "sources": [ + { + "generator": { + "name": "artman", + "version": "0.16.22", + "dockerImage": "googleapis/artman@sha256:e7f9554322a8aa1416c122c918fdc4cdec8cfe816f027fc948dec0be7edef320" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "6c48ab5aef47dc14e02e2dc718d232a28067129d", + "internalRef": "241437588" + } + }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.1.16" + "version": "2019.2.26" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "translate", + "apiVersion": "v3beta1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/translate/artman_translate_v3beta1.yaml" } } ] diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py index 1b1f82a3348..12951621106 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/synth.py @@ -1,9 +1,50 @@ +# Copyright 2018 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. + +"""This script is used to synthesize generated parts of this library.""" + import synthtool as s import synthtool.gcp as gcp import logging import subprocess +# Run the gapic generator +gapic = gcp.GAPICGenerator() +versions = ['v3beta1'] +for version in versions: + library = gapic.node_library('translate', version) + s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) + +# Update path discovery due to build/ dir and TypeScript conversion. +s.replace("src/v3beta1/translation_service_client.js", "../../package.json", "../../../package.json") +s.replace("test/gapic-*.js", "../../package.json", "../../../package.json") + +# [START fix-dead-link] +s.replace('**/doc/google/protobuf/doc_timestamp.js', + 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', + r"https://\1)") + +s.replace('**/doc/google/protobuf/doc_timestamp.js', + 'toISOString\]', + 'toISOString)') +# [END fix-dead-link] + logging.basicConfig(level=logging.DEBUG) common_templates = gcp.CommonTemplates() templates = common_templates.node_library(source_location='build/src') s.copy(templates) + +# Node.js specific cleanup +subprocess.run(["npm", "install"]) +subprocess.run(["npm", "run", "fix"]) diff --git a/packages/google-cloud-translate/test/.eslintrc.yml b/packages/google-cloud-translate/test/.eslintrc.yml new file mode 100644 index 00000000000..fb2657e4cc9 --- /dev/null +++ b/packages/google-cloud-translate/test/.eslintrc.yml @@ -0,0 +1,5 @@ +--- +env: + mocha: true +rules: + node/no-missing-require: off diff --git a/packages/google-cloud-translate/test/gapic-v3beta1.js b/packages/google-cloud-translate/test/gapic-v3beta1.js new file mode 100644 index 00000000000..31be4271d46 --- /dev/null +++ b/packages/google-cloud-translate/test/gapic-v3beta1.js @@ -0,0 +1,653 @@ +// Copyright 2019 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 +// +// https://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. + +'use strict'; + +const assert = require('assert'); + +const translateModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +const error = new Error(); +error.code = FAKE_STATUS_CODE; + +describe('TranslationServiceClient', () => { + describe('translateText', () => { + it('invokes translateText without error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const contents = []; + const targetLanguageCode = 'targetLanguageCode1323228230'; + const request = { + contents: contents, + targetLanguageCode: targetLanguageCode, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.translateText = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.translateText(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes translateText with error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const contents = []; + const targetLanguageCode = 'targetLanguageCode1323228230'; + const request = { + contents: contents, + targetLanguageCode: targetLanguageCode, + }; + + // Mock Grpc layer + client._innerApiCalls.translateText = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.translateText(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('detectLanguage', () => { + it('invokes detectLanguage without error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const request = {}; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.detectLanguage(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes detectLanguage with error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const request = {}; + + // Mock Grpc layer + client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.detectLanguage(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('getSupportedLanguages', () => { + it('invokes getSupportedLanguages without error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const request = {}; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getSupportedLanguages(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getSupportedLanguages with error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const request = {}; + + // Mock Grpc layer + client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getSupportedLanguages(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('batchTranslateText', function() { + it('invokes batchTranslateText without error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const sourceLanguageCode = 'sourceLanguageCode1687263568'; + const targetLanguageCodes = []; + const inputConfigs = []; + const outputConfig = {}; + const request = { + sourceLanguageCode: sourceLanguageCode, + targetLanguageCodes: targetLanguageCodes, + inputConfigs: inputConfigs, + outputConfig: outputConfig, + }; + + // Mock response + const totalCharacters = 1368640955; + const translatedCharacters = 1337326221; + const failedCharacters = 1723028396; + const expectedResponse = { + totalCharacters: totalCharacters, + translatedCharacters: translatedCharacters, + failedCharacters: failedCharacters, + }; + + // Mock Grpc layer + client._innerApiCalls.batchTranslateText = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .batchTranslateText(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes batchTranslateText with error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const sourceLanguageCode = 'sourceLanguageCode1687263568'; + const targetLanguageCodes = []; + const inputConfigs = []; + const outputConfig = {}; + const request = { + sourceLanguageCode: sourceLanguageCode, + targetLanguageCodes: targetLanguageCodes, + inputConfigs: inputConfigs, + outputConfig: outputConfig, + }; + + // Mock Grpc layer + client._innerApiCalls.batchTranslateText = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .batchTranslateText(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.batchTranslateText + .responseDecoder instanceof Function + ); + assert( + client._descriptors.longrunning.batchTranslateText + .metadataDecoder instanceof Function + ); + }); + }); + + describe('createGlossary', function() { + it('invokes createGlossary without error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + const glossary = {}; + const request = { + parent: formattedParent, + glossary: glossary, + }; + + // Mock response + const name = 'name3373707'; + const entryCount = 811131134; + const expectedResponse = { + name: name, + entryCount: entryCount, + }; + + // Mock Grpc layer + client._innerApiCalls.createGlossary = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .createGlossary(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes createGlossary with error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + const glossary = {}; + const request = { + parent: formattedParent, + glossary: glossary, + }; + + // Mock Grpc layer + client._innerApiCalls.createGlossary = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .createGlossary(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.createGlossary + .responseDecoder instanceof Function + ); + assert( + client._descriptors.longrunning.createGlossary + .metadataDecoder instanceof Function + ); + }); + }); + + describe('listGlossaries', () => { + it('invokes listGlossaries without error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const request = {}; + + // Mock response + const nextPageToken = ''; + const glossariesElement = {}; + const glossaries = [glossariesElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + glossaries: glossaries, + }; + + // Mock Grpc layer + client._innerApiCalls.listGlossaries = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.glossaries); + }; + + client.listGlossaries(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.glossaries); + done(); + }); + }); + + it('invokes listGlossaries with error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const request = {}; + + // Mock Grpc layer + client._innerApiCalls.listGlossaries = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listGlossaries(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('getGlossary', () => { + it('invokes getGlossary without error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.glossaryPath( + '[PROJECT]', + '[LOCATION]', + '[GLOSSARY]' + ); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const entryCount = 811131134; + const expectedResponse = { + name: name2, + entryCount: entryCount, + }; + + // Mock Grpc layer + client._innerApiCalls.getGlossary = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getGlossary(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getGlossary with error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.glossaryPath( + '[PROJECT]', + '[LOCATION]', + '[GLOSSARY]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getGlossary = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getGlossary(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('deleteGlossary', function() { + it('invokes deleteGlossary without error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.glossaryPath( + '[PROJECT]', + '[LOCATION]', + '[GLOSSARY]' + ); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const expectedResponse = { + name: name2, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteGlossary = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .deleteGlossary(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes deleteGlossary with error', done => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.glossaryPath( + '[PROJECT]', + '[LOCATION]', + '[GLOSSARY]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteGlossary = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .deleteGlossary(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.deleteGlossary + .responseDecoder instanceof Function + ); + assert( + client._descriptors.longrunning.deleteGlossary + .metadataDecoder instanceof Function + ); + }); + }); +}); + +function mockSimpleGrpcMethod(expectedRequest, response, error) { + return function(actualRequest, options, callback) { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} + +function mockLongRunningGrpcMethod(expectedRequest, response, error) { + return request => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise: function() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index 9a4db673816..35de07d9d7c 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -57,7 +57,7 @@ class FakeService { } } -describe('Translate', () => { +describe('Translate v2', () => { const OPTIONS = { projectId: 'test-project', }; @@ -68,7 +68,7 @@ describe('Translate', () => { let translate: any; before(() => { - Translate = proxyquire('../src', { + Translate = proxyquire('../src/v2', { '@google-cloud/common': { util: fakeUtil, Service: FakeService, From 7d8aa65f45b016669d3f006c1e10e27303691b0e Mon Sep 17 00:00:00 2001 From: Rebecca Taylor Date: Tue, 2 Apr 2019 14:55:33 -0700 Subject: [PATCH 208/513] Release v3.0.0 (#233) --- packages/google-cloud-translate/CHANGELOG.md | 25 +++++++++++++++++++ packages/google-cloud-translate/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index a174c5629ea..0da157fd489 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,31 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## v3.0.0 + +BREAKING CHANGE: + +This release introduces the `grpc` dependency. + +In some environments, this will trigger a native compilation. + +### Implementation Changes + +### New Features + +- feat: add version v3beta1 ([#232](https://github.com/googleapis/nodejs-translate/pull/232)) + +### Dependencies + +- chore(deps): update dependency typescript to ~3.4.0 ([#231](https://github.com/googleapis/nodejs-translate/pull/231)) + +### Documentation + +### Internal / Testing Changes + +- chore: publish to npm using wombat ([#227](https://github.com/googleapis/nodejs-translate/pull/227)) +- build: use per-repo npm publish token ([#225](https://github.com/googleapis/nodejs-translate/pull/225)) + ## v2.1.4 03-12-2019 12:30 PDT diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 95c7aa75b57..4ebc1576e77 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "2.1.4", + "version": "3.0.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 203cb994f38..d6290d50f31 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -11,7 +11,7 @@ "test": "mocha system-test" }, "dependencies": { - "@google-cloud/translate": "^2.1.4", + "@google-cloud/translate": "^3.0.0", "@google-cloud/automl": "^0.1.2", "yargs": "^13.0.0" }, From 75bc7b08fa498f99a09f8a19cbf0ecd2f61d3eba Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 3 Apr 2019 12:25:19 -0700 Subject: [PATCH 209/513] fix(deps): update dependency @google-cloud/common to ^0.32.0 fix(deps): update dependency @google-cloud/common to ^0.32.0 This PR contains the following updates: | Package | Type | Update | Change | References | |---|---|---|---|---| | @​google-cloud/common | dependencies | minor | [`^0.31.0` -> `^0.32.0`](https://diff.intrinsic.com/@google-cloud/common/0.31.1/0.32.0) | [source](https://togithub.com/googleapis/nodejs-common) | --- ### Release Notes
googleapis/nodejs-common ### [`v0.32.0`](https://togithub.com/googleapis/nodejs-common/blob/master/CHANGELOG.md#v0320) [Compare Source](https://togithub.com/googleapis/nodejs-common/compare/v0.31.1...v0.32.0) 04-02-2019 15:11 PDT **BREAKING CHANGE**: This PR removes the ability to configure a custom implementation of the Request module. This was necessary when we were migrating from request to teeny-request, but that migration is now complete. All interfaces at accepted a custom implementation of request will no longer accept one. teeny-request is now just included in the box.
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is stale, or if you modify the PR title to begin with "`rebase!`". :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#googleapis/nodejs-translate). #235 automerged by dpebot --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 4ebc1576e77..b0d890c282b 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -46,7 +46,7 @@ "predocs-test": "npm run docs" }, "dependencies": { - "@google-cloud/common": "^0.31.0", + "@google-cloud/common": "^0.32.0", "@google-cloud/promisify": "^0.4.0", "arrify": "^1.0.1", "extend": "^3.0.1", From 7d653e27adff7118031586b8e88ee4d37ce8565c Mon Sep 17 00:00:00 2001 From: "Leah E. Cole" <6719667+leahecole@users.noreply.github.com> Date: Wed, 3 Apr 2019 14:54:28 -0700 Subject: [PATCH 210/513] docs(samples): Add samples for translate v3 beta (#234) --- packages/google-cloud-translate/samples/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index d6290d50f31..b390ebcc5f4 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -8,7 +8,7 @@ "node": ">=8" }, "scripts": { - "test": "mocha system-test" + "test": "mocha system-test --recursive --timeout 90000" }, "dependencies": { "@google-cloud/translate": "^3.0.0", @@ -18,6 +18,7 @@ "devDependencies": { "chai": "^4.2.0", "execa": "^1.0.0", + "@google-cloud/storage": "^2.4.3", "mocha": "^6.0.0", "uuid": "^3.3.2" } From 69913c6970bc04620070acd82dc2c91cb15371c0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 4 Apr 2019 08:37:58 -0700 Subject: [PATCH 211/513] fix(deps): update dependency @google-cloud/automl to ^0.2.0 (#236) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index b390ebcc5f4..944557f21ba 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/translate": "^3.0.0", - "@google-cloud/automl": "^0.1.2", + "@google-cloud/automl": "^0.2.0", "yargs": "^13.0.0" }, "devDependencies": { From b1b9eea6a92eb6fb22818834c6dc0f658ba3f451 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 4 Apr 2019 20:13:56 -0700 Subject: [PATCH 212/513] refactor: use execSync for tests (#237) --- .../samples/.eslintrc.yml | 1 + .../samples/package.json | 3 +- .../samples/test/quickstart.test.js | 32 +++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-translate/samples/test/quickstart.test.js diff --git a/packages/google-cloud-translate/samples/.eslintrc.yml b/packages/google-cloud-translate/samples/.eslintrc.yml index 282535f55f6..0aa37ac630e 100644 --- a/packages/google-cloud-translate/samples/.eslintrc.yml +++ b/packages/google-cloud-translate/samples/.eslintrc.yml @@ -1,3 +1,4 @@ --- rules: no-console: off + node/no-missing-require: off diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 944557f21ba..565009624d6 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -8,7 +8,7 @@ "node": ">=8" }, "scripts": { - "test": "mocha system-test --recursive --timeout 90000" + "test": "mocha --recursive --timeout 90000" }, "dependencies": { "@google-cloud/translate": "^3.0.0", @@ -17,7 +17,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "execa": "^1.0.0", "@google-cloud/storage": "^2.4.3", "mocha": "^6.0.0", "uuid": "^3.3.2" diff --git a/packages/google-cloud-translate/samples/test/quickstart.test.js b/packages/google-cloud-translate/samples/test/quickstart.test.js new file mode 100644 index 00000000000..36efd92428a --- /dev/null +++ b/packages/google-cloud-translate/samples/test/quickstart.test.js @@ -0,0 +1,32 @@ +/** + * Copyright 2017, Google, Inc. + * 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. + */ + +'use strict'; + +const {assert} = require('chai'); +const cp = require('child_process'); +const path = require('path'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); +const projectId = process.env.GCLOUD_PROJECT; + +describe('quickstart sample tests', () => { + it('should translate a string', async () => { + const stdout = execSync(`node quickstart ${projectId}`, {cwd}); + assert.match(stdout, new RegExp('Translation: Привет, мир!')); + }); +}); From 11435ed0c83dc32b734e58f1d1675ced1c2aaaf2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 5 Apr 2019 11:19:32 -0700 Subject: [PATCH 213/513] fix(deps): update dependency arrify to v2 fix(deps): update dependency arrify to v2 This PR contains the following updates: | Package | Type | Update | Change | References | |---|---|---|---|---| | arrify | dependencies | major | [`^1.0.1` -> `^2.0.0`](https://diff.intrinsic.com/arrify/1.0.1/2.0.0) | [source](https://togithub.com/sindresorhus/arrify) | --- ### Release Notes
sindresorhus/arrify ### [`v2.0.0`](https://togithub.com/sindresorhus/arrify/releases/v2.0.0) [Compare Source](https://togithub.com/sindresorhus/arrify/compare/v1.0.1...v2.0.0) Breaking: - Require Node.js 8 ([#​6](https://togithub.com/sindresorhus/arrify/issues/6)) [`8d6734f`](https://togithub.com/sindresorhus/arrify/commit/8d6734f) Enhancements: - Add TypeScript definition ([#​6](https://togithub.com/sindresorhus/arrify/issues/6)) [`8d6734f`](https://togithub.com/sindresorhus/arrify/commit/8d6734f)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is stale, or if you modify the PR title to begin with "`rebase!`". :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#googleapis/nodejs-translate). #239 automerged by dpebot --- packages/google-cloud-translate/package.json | 3 +-- packages/google-cloud-translate/src/v2/index.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index b0d890c282b..6a125b47a36 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -48,7 +48,7 @@ "dependencies": { "@google-cloud/common": "^0.32.0", "@google-cloud/promisify": "^0.4.0", - "arrify": "^1.0.1", + "arrify": "^2.0.0", "extend": "^3.0.1", "google-gax": "^0.25.4", "is": "^3.2.1", @@ -59,7 +59,6 @@ }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "^3.2.0", - "@types/arrify": "^1.0.4", "@types/extend": "^3.0.0", "@types/is": "0.0.21", "@types/mocha": "^5.2.4", diff --git a/packages/google-cloud-translate/src/v2/index.ts b/packages/google-cloud-translate/src/v2/index.ts index a99bc0cbc73..6ba42372217 100644 --- a/packages/google-cloud-translate/src/v2/index.ts +++ b/packages/google-cloud-translate/src/v2/index.ts @@ -14,7 +14,7 @@ import {Service, util} from '@google-cloud/common'; import {promisifyAll} from '@google-cloud/promisify'; -import * as arrify from 'arrify'; +import arrify = require('arrify'); import * as extend from 'extend'; import {GoogleAuthOptions} from 'google-auth-library'; import * as is from 'is'; From 19dfe3bdaf439265d58b8ab2435189f75a2ae383 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Tue, 9 Apr 2019 12:19:39 -0700 Subject: [PATCH 214/513] fix(build): include build/protos in npm package (#241) * fix(build): include build/* in npm package * Just include build/src and build/protos --- packages/google-cloud-translate/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 6a125b47a36..91f46676a03 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -12,6 +12,7 @@ "types": "build/src/index.d.ts", "files": [ "build/src", + "build/protos", "!build/src/**/*.map" ], "keywords": [ From 6cbc5114e00cc33f1cb009a66f604fd6f6d01fba Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Tue, 9 Apr 2019 12:29:24 -0700 Subject: [PATCH 215/513] Release v3.0.1 (#242) --- packages/google-cloud-translate/CHANGELOG.md | 19 +++++++++++++++++++ packages/google-cloud-translate/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 0da157fd489..86608ddf06f 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,25 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## v3.0.1 + +04-09-2019 12:19 PDT + +### Fixes +- fix(build): include build/protos in npm package ([#241](https://github.com/googleapis/nodejs-translate/pull/241)) + +### Dependencies +- fix(deps): update dependency @google-cloud/automl to ^0.2.0 ([#236](https://github.com/googleapis/nodejs-translate/pull/236)) +- fix(deps): update dependency arrify to v2 +- fix(deps): update dependency @google-cloud/common to ^0.32.0 + +### Documentation / Samples +- Change region tag to translate_translate_text_with_glossary_beta ([#240](https://github.com/googleapis/nodejs-translate/pull/240)) +- docs(samples): Add samples for translate v3 beta ([#234](https://github.com/googleapis/nodejs-translate/pull/234)) + +### Internal / Testing Changes +- refactor: use execSync for tests ([#237](https://github.com/googleapis/nodejs-translate/pull/237)) + ## v3.0.0 BREAKING CHANGE: diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 91f46676a03..89d0bddfce5 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "3.0.0", + "version": "3.0.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 565009624d6..5b7f439e377 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -11,7 +11,7 @@ "test": "mocha --recursive --timeout 90000" }, "dependencies": { - "@google-cloud/translate": "^3.0.0", + "@google-cloud/translate": "^3.0.1", "@google-cloud/automl": "^0.2.0", "yargs": "^13.0.0" }, From 4a3395dbd07cb24b473622157359749d277481a2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Mon, 22 Apr 2019 08:38:34 -0700 Subject: [PATCH 216/513] chore(docs): formatting updates (#244) --- .../v3beta1/doc/google/protobuf/doc_any.js | 3 ++- .../doc/google/protobuf/doc_timestamp.js | 26 ++++++++++--------- .../google-cloud-translate/synth.metadata | 12 ++++----- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js index f3278b34e66..9ff5d007807 100644 --- a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js @@ -98,7 +98,8 @@ * * @property {string} typeUrl * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. The last segment of the URL's path must represent + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent * the fully qualified name of the type (as in * `path/google.protobuf.Duration`). The name should be in a canonical form * (e.g., leading "." is not accepted). diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js index b47f41c2b30..98c19dbf0d3 100644 --- a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js @@ -16,17 +16,19 @@ // to be loaded as the JS file. /** - * A Timestamp represents a point in time independent of any time zone - * or calendar, represented as seconds and fractions of seconds at - * nanosecond resolution in UTC Epoch time. It is encoded using the - * Proleptic Gregorian Calendar which extends the Gregorian calendar - * backwards to year one. It is encoded assuming all minutes are 60 - * seconds long, i.e. leap seconds are "smeared" so that no leap second - * table is needed for interpretation. Range is from - * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. - * By restricting to that range, we ensure that we can convert to - * and from RFC 3339 date strings. - * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. * * # Examples * @@ -91,7 +93,7 @@ * method. In Python, a standard `datetime.datetime` object can be converted * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) to obtain a formatter capable of generating timestamps in this format. + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 5065f91d8db..be68fa20372 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-04-02T00:58:49.841632Z", + "updateTime": "2019-04-21T11:54:22.214354Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.22", - "dockerImage": "googleapis/artman@sha256:e7f9554322a8aa1416c122c918fdc4cdec8cfe816f027fc948dec0be7edef320" + "version": "0.16.26", + "dockerImage": "googleapis/artman@sha256:314eae2a40f6f7822db77365cf5f45bd513d628ae17773fd0473f460e7c2a665" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6c48ab5aef47dc14e02e2dc718d232a28067129d", - "internalRef": "241437588" + "sha": "3369c803f56d52662ea3792076deb8545183bdb0", + "internalRef": "244282812" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.2.26" + "version": "2019.4.10" } } ], From a63480fee2a4d7f7c6498fac0516dfa8f5927e56 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 22 Apr 2019 09:26:23 -0700 Subject: [PATCH 217/513] chore(deps): update dependency nyc to v14 chore(deps): update dependency nyc to v14 This PR contains the following updates: | Package | Type | Update | Change | References | |---|---|---|---|---| | nyc | devDependencies | major | [`^13.3.0` -> `^14.0.0`](https://diff.intrinsic.com/nyc/13.3.0/14.0.0) | [source](https://togithub.com/istanbuljs/nyc) | --- ### Release Notes
istanbuljs/nyc ### [`v14.0.0`](https://togithub.com/istanbuljs/nyc/blob/master/CHANGELOG.md#​1400httpsgithubcomistanbuljsnyccomparev1330v1400-2019-04-15) [Compare Source](https://togithub.com/istanbuljs/nyc/compare/v13.3.0...v14.0.0) ##### Bug Fixes - Add `cwd` option to instrument command ([#​1024](https://togithub.com/istanbuljs/nyc/issues/1024)) ([051d95a](https://togithub.com/istanbuljs/nyc/commit/051d95a)) - Add config values to hash salt ([#​988](https://togithub.com/istanbuljs/nyc/issues/988)) ([7ac325d](https://togithub.com/istanbuljs/nyc/commit/7ac325d)), closes [#​522](https://togithub.com/istanbuljs/nyc/issues/522) - Exclude negated not working with '--all' switch ([#​977](https://togithub.com/istanbuljs/nyc/issues/977)) ([91de23c](https://togithub.com/istanbuljs/nyc/commit/91de23c)) - Make --all work for transpiled code ([#​1047](https://togithub.com/istanbuljs/nyc/issues/1047)) ([18e04ba](https://togithub.com/istanbuljs/nyc/commit/18e04ba)) - Resolve absolute paths in nyc instrument ([#​1012](https://togithub.com/istanbuljs/nyc/issues/1012)) ([3cb1861](https://togithub.com/istanbuljs/nyc/commit/3cb1861)), closes [#​1014](https://togithub.com/istanbuljs/nyc/issues/1014) - Set processinfo pid/ppid to actual numbers ([#​1057](https://togithub.com/istanbuljs/nyc/issues/1057)) ([32f75b0](https://togithub.com/istanbuljs/nyc/commit/32f75b0)) - Use a single instance of nyc for all actions of main command. ([#​1059](https://togithub.com/istanbuljs/nyc/issues/1059)) ([b909575](https://togithub.com/istanbuljs/nyc/commit/b909575)) ##### Features - Add `delete` option to instrument command ([#​1005](https://togithub.com/istanbuljs/nyc/issues/1005)) ([d6db551](https://togithub.com/istanbuljs/nyc/commit/d6db551)) - Add `include` and `exclude` options to instrument command ([#​1007](https://togithub.com/istanbuljs/nyc/issues/1007)) ([8da097e](https://togithub.com/istanbuljs/nyc/commit/8da097e)) - Add processinfo index, add externalId ([#​1055](https://togithub.com/istanbuljs/nyc/issues/1055)) ([8dcf180](https://togithub.com/istanbuljs/nyc/commit/8dcf180)) - Add support for nyc.config.js ([#​1019](https://togithub.com/istanbuljs/nyc/issues/1019)) ([3b203c7](https://togithub.com/istanbuljs/nyc/commit/3b203c7)) - Add support to exclude files on coverage report generation ([#​982](https://togithub.com/istanbuljs/nyc/issues/982)) ([509c6aa](https://togithub.com/istanbuljs/nyc/commit/509c6aa)) - Add test-exclude args to check-coverage and report subcommands. ([0fc217e](https://togithub.com/istanbuljs/nyc/commit/0fc217e)) - Always build the processinfo temp dir ([#​1061](https://togithub.com/istanbuljs/nyc/issues/1061)) ([c213469](https://togithub.com/istanbuljs/nyc/commit/c213469)) - Enable `es-modules` option for nyc instrument command ([#​1006](https://togithub.com/istanbuljs/nyc/issues/1006)) ([596b120](https://togithub.com/istanbuljs/nyc/commit/596b120)) - Fix excludeAfterRemap functionality. ([36bcc0b](https://togithub.com/istanbuljs/nyc/commit/36bcc0b)) - Implement `nyc instrument --complete-copy` ([#​1056](https://togithub.com/istanbuljs/nyc/issues/1056)) ([2eb13c6](https://togithub.com/istanbuljs/nyc/commit/2eb13c6)) - Remove bundling ([#​1017](https://togithub.com/istanbuljs/nyc/issues/1017)) ([b25492a](https://togithub.com/istanbuljs/nyc/commit/b25492a)) - Support turning off node_modules default exclude via `exclude-node-modules` option ([#​912](https://togithub.com/istanbuljs/nyc/issues/912)) ([b7e16cd](https://togithub.com/istanbuljs/nyc/commit/b7e16cd)) - Add support for `--exclude-node-modules` to subcommands. ([#​1053](https://togithub.com/istanbuljs/nyc/issues/1053)) ([e597c46](https://togithub.com/istanbuljs/nyc/commit/e597c46)) ##### BREAKING CHANGES - The `--exclude-after-remap` option is now functional and enabled by default. This causes the `include` and `exclude` lists to be processed after using source maps to determine the original filename of sources. - Add a file named 'index.json' to the .nyc_output/processinfo directory, which has a different format from the other files in this dir. - Change the data type of the pid/ppid fields in processinfo files - `nyc instrument` now honors `include` and `exclude` settings, potentially resulting in some files that were previously instrumented being ignored. - The `plugins` option has been renamed to `parser-plugins`. - The logic involving include/exclude processing has changed. Results should be verified to ensure all desired sources have coverage data. - `nyc instrument` now enables the `--es-module` option by default. This can cause failures to instrument scripts which violate `'use strict'` rules.
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is stale, or if you modify the PR title to begin with "`rebase!`". :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#googleapis/nodejs-translate). #243 automerged by dpebot --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 89d0bddfce5..fe84d1dbcb4 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -77,7 +77,7 @@ "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "linkinator": "^1.1.2", "mocha": "^6.0.0", - "nyc": "^13.3.0", + "nyc": "^14.0.0", "power-assert": "^1.6.0", "prettier": "^1.13.5", "proxyquire": "^2.0.1", From 0aac62377d8810870ae82eb8f7f7c0bea73cc848 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 29 Apr 2019 15:05:38 -0700 Subject: [PATCH 218/513] update to .nycrc with --all enabled (#247) --- packages/google-cloud-translate/.nycrc | 40 +++++++++++--------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/packages/google-cloud-translate/.nycrc b/packages/google-cloud-translate/.nycrc index 88b001cb587..bfe4073a6ab 100644 --- a/packages/google-cloud-translate/.nycrc +++ b/packages/google-cloud-translate/.nycrc @@ -1,28 +1,22 @@ { "report-dir": "./.coverage", - "reporter": "lcov", + "reporter": ["text", "lcov"], "exclude": [ - "src/*{/*,/**/*}.js", - "src/*/v*/*.js", - "test/**/*.js", - "build/test" + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/docs", + "**/samples", + "**/scripts", + "**/src/**/v*/**/*.js", + "**/test", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" ], - "watermarks": { - "branches": [ - 95, - 100 - ], - "functions": [ - 95, - 100 - ], - "lines": [ - 95, - 100 - ], - "statements": [ - 95, - 100 - ] - } + "exclude-after-remap": false, + "all": true } From b0a7d528bb3b67ee0e84afb4ddb02ff27607d2e1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 30 Apr 2019 17:18:25 -0700 Subject: [PATCH 219/513] chore: update code formatting (#245) --- .../src/v3beta1/translation_service_client.js | 68 +++++++++---------- .../google-cloud-translate/synth.metadata | 10 +-- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js index b228448d2fa..2a3c6513044 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js @@ -101,12 +101,12 @@ class TranslationServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - locationPathTemplate: new gax.PathTemplate( - 'projects/{project}/locations/{location}' - ), glossaryPathTemplate: new gax.PathTemplate( 'projects/{project}/locations/{location}/glossaries/{glossary}' ), + locationPathTemplate: new gax.PathTemplate( + 'projects/{project}/locations/{location}' + ), }; // Some of the methods on this service return "paged" results, @@ -1113,58 +1113,35 @@ class TranslationServiceClient { // -------------------- /** - * Return a fully-qualified location resource name string. + * Return a fully-qualified glossary resource name string. * * @param {String} project * @param {String} location + * @param {String} glossary * @returns {String} */ - locationPath(project, location) { - return this._pathTemplates.locationPathTemplate.render({ + glossaryPath(project, location, glossary) { + return this._pathTemplates.glossaryPathTemplate.render({ project: project, location: location, + glossary: glossary, }); } /** - * Return a fully-qualified glossary resource name string. + * Return a fully-qualified location resource name string. * * @param {String} project * @param {String} location - * @param {String} glossary * @returns {String} */ - glossaryPath(project, location, glossary) { - return this._pathTemplates.glossaryPathTemplate.render({ + locationPath(project, location) { + return this._pathTemplates.locationPathTemplate.render({ project: project, location: location, - glossary: glossary, }); } - /** - * Parse the locationName from a location resource. - * - * @param {String} locationName - * A fully-qualified path representing a location resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromLocationName(locationName) { - return this._pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the locationName from a location resource. - * - * @param {String} locationName - * A fully-qualified path representing a location resources. - * @returns {String} - A string representing the location. - */ - matchLocationFromLocationName(locationName) { - return this._pathTemplates.locationPathTemplate.match(locationName) - .location; - } - /** * Parse the glossaryName from a glossary resource. * @@ -1199,6 +1176,29 @@ class TranslationServiceClient { return this._pathTemplates.glossaryPathTemplate.match(glossaryName) .glossary; } + + /** + * Parse the locationName from a location resource. + * + * @param {String} locationName + * A fully-qualified path representing a location resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromLocationName(locationName) { + return this._pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the locationName from a location resource. + * + * @param {String} locationName + * A fully-qualified path representing a location resources. + * @returns {String} - A string representing the location. + */ + matchLocationFromLocationName(locationName) { + return this._pathTemplates.locationPathTemplate.match(locationName) + .location; + } } module.exports = TranslationServiceClient; diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index be68fa20372..7d497de9555 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-04-21T11:54:22.214354Z", + "updateTime": "2019-04-23T11:20:24.602738Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.26", - "dockerImage": "googleapis/artman@sha256:314eae2a40f6f7822db77365cf5f45bd513d628ae17773fd0473f460e7c2a665" + "version": "0.17.0", + "dockerImage": "googleapis/artman@sha256:c58f4ec3838eb4e0718eb1bccc6512bd6850feaa85a360a9e38f6f848ec73bc2" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3369c803f56d52662ea3792076deb8545183bdb0", - "internalRef": "244282812" + "sha": "547e19e7df398e9290e8e3674d7351efc500f9b0", + "internalRef": "244712781" } }, { From 0194e182b64418f0311756f99dc3a5d7844ebebd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 2 May 2019 09:17:11 -0700 Subject: [PATCH 220/513] fix(deps): update dependency google-gax to ^0.26.0 (#248) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index fe84d1dbcb4..7b1ff035f2c 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -51,7 +51,7 @@ "@google-cloud/promisify": "^0.4.0", "arrify": "^2.0.0", "extend": "^3.0.1", - "google-gax": "^0.25.4", + "google-gax": "^0.26.0", "is": "^3.2.1", "is-html": "^1.1.0", "lodash.merge": "^4.6.1", From e27130c1c9aaa66503b77cea508c9b419f48646e Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 2 May 2019 11:32:09 -0700 Subject: [PATCH 221/513] build!: upgrade engines field to >=8.10.0 (#249) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7b1ff035f2c..0b877b80b10 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "author": "Google Inc.", "engines": { - "node": ">=6.0.0" + "node": ">=8.10.0" }, "repository": "googleapis/nodejs-translate", "main": "build/src/index.js", From fb5abd628d83796e58a9403df0376ddf7d5529d2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 3 May 2019 07:30:58 -0700 Subject: [PATCH 222/513] fix(deps): update dependency @google-cloud/promisify to v1 (#253) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 0b877b80b10..bb4f6cb7686 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -48,7 +48,7 @@ }, "dependencies": { "@google-cloud/common": "^0.32.0", - "@google-cloud/promisify": "^0.4.0", + "@google-cloud/promisify": "^1.0.0", "arrify": "^2.0.0", "extend": "^3.0.1", "google-gax": "^0.26.0", From 3b02c23d19555598f1b17d71ecc6cad13c6814ea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 3 May 2019 08:22:04 -0700 Subject: [PATCH 223/513] chore(deps): update dependency eslint-plugin-node to v9 (#252) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index bb4f6cb7686..a71a8d513cb 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -69,7 +69,7 @@ "codecov": "^3.0.2", "eslint": "^5.0.0", "eslint-config-prettier": "^4.0.0", - "eslint-plugin-node": "^8.0.0", + "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", "gts": "^0.9.0", "intelli-espower-loader": "^1.0.1", From bc9472babf0e78c98821cf006ce377bbe7d477f3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 3 May 2019 11:09:48 -0700 Subject: [PATCH 224/513] chore(deps): update dependency gts to v1 (#246) --- packages/google-cloud-translate/package.json | 2 +- .../system-test/translate.ts | 11 +- packages/google-cloud-translate/test/index.ts | 153 ++++++++++-------- 3 files changed, 96 insertions(+), 70 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index a71a8d513cb..4838323b237 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -71,7 +71,7 @@ "eslint-config-prettier": "^4.0.0", "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", - "gts": "^0.9.0", + "gts": "^1.0.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index c3a4252bd18..41e67e0f19d 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -90,7 +90,9 @@ describe('translate', () => { const [results] = await translate.translate(input, opts); const translation = results.split(/<\/*body>/g)[1].trim(); assert.strictEqual( - removeSymbols(translation), INPUT[0].expectedTranslation); + removeSymbols(translation), + INPUT[0].expectedTranslation + ); }); }); @@ -106,7 +108,7 @@ describe('translate', () => { it('should accept a target language', async () => { const [languages] = await translate.getLanguages('es'); - const englishResult = languages.filter((language) => { + const englishResult = languages.filter(language => { return language.code === 'en'; })[0]; assert.deepStrictEqual(englishResult, { @@ -120,12 +122,13 @@ describe('translate', () => { beforeEach(() => { if (!API_KEY) { throw new Error( - 'The `TRANSLATE_API_KEY` environment variable is required!'); + 'The `TRANSLATE_API_KEY` environment variable is required!' + ); } translate = new Translate({key: API_KEY}); }); - it('should use an API key to authenticate', (done) => { + it('should use an API key to authenticate', done => { translate.getLanguages(done); }); }); diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index 35de07d9d7c..f8c1dd78a06 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -15,7 +15,10 @@ */ import {DecorateRequestOptions, util} from '@google-cloud/common'; -import {BodyResponseCallback, MakeRequestConfig} from '@google-cloud/common/build/src/util'; +import { + BodyResponseCallback, + MakeRequestConfig, +} from '@google-cloud/common/build/src/util'; import * as pfy from '@google-cloud/promisify'; import * as assert from 'assert'; import * as extend from 'extend'; @@ -39,8 +42,10 @@ const fakePromisify = extend({}, pfy, { const fakeUtil = extend({}, util, { makeRequest( - opts: DecorateRequestOptions, cfg: MakeRequestConfig, - cb: BodyResponseCallback) { + opts: DecorateRequestOptions, + cfg: MakeRequestConfig, + cb: BodyResponseCallback + ) { if (makeRequestOverride) { return makeRequestOverride(opts, cfg, cb); } @@ -69,12 +74,12 @@ describe('Translate v2', () => { before(() => { Translate = proxyquire('../src/v2', { - '@google-cloud/common': { - util: fakeUtil, - Service: FakeService, - }, - '@google-cloud/promisify': fakePromisify - }).Translate; + '@google-cloud/common': { + util: fakeUtil, + Service: FakeService, + }, + '@google-cloud/promisify': fakePromisify, + }).Translate; }); beforeEach(() => { @@ -95,7 +100,7 @@ describe('Translate v2', () => { // tslint:disable-next-line no-any const calledWith = (translate as any).calledWith_[0]; const baseUrl = - 'https://translation.googleapis.com/language/translate/v2'; + 'https://translation.googleapis.com/language/translate/v2'; assert.strictEqual(calledWith.baseUrl, baseUrl); assert.deepStrictEqual(calledWith.scopes, [ @@ -243,13 +248,15 @@ describe('Translate v2', () => { it('should return an array if input was an array', done => { translate.detect( - [INPUT], (err: Error, results: {}, apiResponse_: {}) => { - assert.ifError(err); - assert.deepStrictEqual(results, [expectedResults]); - assert.strictEqual(apiResponse_, apiResponse); - assert.deepStrictEqual(apiResponse_, originalApiResponse); - done(); - }); + [INPUT], + (err: Error, results: {}, apiResponse_: {}) => { + assert.ifError(err); + assert.deepStrictEqual(results, [expectedResults]); + assert.strictEqual(apiResponse_, apiResponse); + assert.deepStrictEqual(apiResponse_, originalApiResponse); + done(); + } + ); }); }); }); @@ -291,12 +298,13 @@ describe('Translate v2', () => { it('should exec callback with error & API response', done => { translate.getLanguages( - (err: Error, languages: {}, apiResponse_: {}) => { - assert.strictEqual(err, error); - assert.strictEqual(languages, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); + (err: Error, languages: {}, apiResponse_: {}) => { + assert.strictEqual(err, error); + assert.strictEqual(languages, null); + assert.strictEqual(apiResponse_, apiResponse); + done(); + } + ); }); }); @@ -335,12 +343,13 @@ describe('Translate v2', () => { it('should exec callback with languages', done => { translate.getLanguages( - (err: Error, languages: {}, apiResponse_: {}) => { - assert.ifError(err); - assert.deepStrictEqual(languages, expectedResults); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); + (err: Error, languages: {}, apiResponse_: {}) => { + assert.ifError(err); + assert.deepStrictEqual(languages, expectedResults); + assert.strictEqual(apiResponse_, apiResponse); + done(); + } + ); }); }); }); @@ -382,11 +391,13 @@ describe('Translate v2', () => { }; translate.translate( - INPUT, { - from: SOURCE_LANG_CODE, - to: TARGET_LANG_CODE, - }, - assert.ifError); + INPUT, + { + from: SOURCE_LANG_CODE, + to: TARGET_LANG_CODE, + }, + assert.ifError + ); }); }); @@ -467,13 +478,15 @@ describe('Translate v2', () => { it('should exec callback with error & API response', done => { translate.translate( - INPUT, OPTIONS, - (err: Error, translations: {}, resp: r.Response) => { - assert.strictEqual(err, error); - assert.strictEqual(translations, null); - assert.strictEqual(resp, apiResponse); - done(); - }); + INPUT, + OPTIONS, + (err: Error, translations: {}, resp: r.Response) => { + assert.strictEqual(err, error); + assert.strictEqual(translations, null); + assert.strictEqual(resp, apiResponse); + done(); + } + ); }); }); @@ -500,13 +513,15 @@ describe('Translate v2', () => { it('should execute callback with results & API response', done => { translate.translate( - INPUT, OPTIONS, - (err: Error, translations: {}, resp: r.Response) => { - assert.ifError(err); - assert.deepStrictEqual(translations, expectedResults); - assert.strictEqual(resp, apiResponse); - done(); - }); + INPUT, + OPTIONS, + (err: Error, translations: {}, resp: r.Response) => { + assert.ifError(err); + assert.deepStrictEqual(translations, expectedResults); + assert.strictEqual(resp, apiResponse); + done(); + } + ); }); it('should execute callback with multiple results', done => { @@ -520,11 +535,14 @@ describe('Translate v2', () => { it('should return an array if input was an array', done => { translate.translate( - [INPUT], OPTIONS, (err: Error, translations: {}) => { - assert.ifError(err); - assert.deepStrictEqual(translations, [expectedResults]); - done(); - }); + [INPUT], + OPTIONS, + (err: Error, translations: {}) => { + assert.ifError(err); + assert.deepStrictEqual(translations, [expectedResults]); + done(); + } + ); }); }); }); @@ -550,11 +568,13 @@ describe('Translate v2', () => { }, }; - FakeService.prototype.request = - (reqOpts: r.Options, callback: Function) => { - assert.strictEqual(reqOpts, fakeOptions); - callback(); - }; + FakeService.prototype.request = ( + reqOpts: r.Options, + callback: Function + ) => { + assert.strictEqual(reqOpts, fakeOptions); + callback(); + }; translate.request(fakeOptions, done); }); @@ -573,7 +593,7 @@ describe('Translate v2', () => { const userAgent = 'user-agent/0.0.0'; const getUserAgentFn = fakeUtil.getUserAgentFromPackageJson; - fakeUtil.getUserAgentFromPackageJson = (packageJson) => { + fakeUtil.getUserAgentFromPackageJson = packageJson => { fakeUtil.getUserAgentFromPackageJson = getUserAgentFn; assert.deepStrictEqual(packageJson, pkgJson); return userAgent; @@ -600,12 +620,15 @@ describe('Translate v2', () => { expectedReqOpts.uri = translate.baseUrl + reqOpts.uri; - makeRequestOverride = - (reqOpts: r.Options, options: {}, callback: Function) => { - assert.deepStrictEqual(reqOpts, expectedReqOpts); - assert.strictEqual(options, translate.options); - callback(); // done() - }; + makeRequestOverride = ( + reqOpts: r.Options, + options: {}, + callback: Function + ) => { + assert.deepStrictEqual(reqOpts, expectedReqOpts); + assert.strictEqual(options, translate.options); + callback(); // done() + }; translate.request(reqOpts, done); }); From 7b601e0e4a1c67230fd6e20e3e4ae2c3eb8c2d11 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 6 May 2019 15:11:41 -0700 Subject: [PATCH 225/513] build: patch Windows container, fixing Node 10 (#255) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 4838323b237..6649b07f796 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -73,7 +73,7 @@ "eslint-plugin-prettier": "^3.0.0", "gts": "^1.0.0", "intelli-espower-loader": "^1.0.1", - "jsdoc": "^3.5.5", + "jsdoc": "3.5.5", "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "linkinator": "^1.1.2", "mocha": "^6.0.0", From 76d7dcad765ac1695e46917adbc2253ea05e27d6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Mon, 6 May 2019 22:49:03 -0700 Subject: [PATCH 226/513] build: switches to piping coverage to codecov from Node 10 --- packages/google-cloud-translate/synth.metadata | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 7d497de9555..3c3647d2f63 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-04-23T11:20:24.602738Z", + "updateTime": "2019-05-04T11:26:04.755328Z", "sources": [ { "generator": { "name": "artman", - "version": "0.17.0", - "dockerImage": "googleapis/artman@sha256:c58f4ec3838eb4e0718eb1bccc6512bd6850feaa85a360a9e38f6f848ec73bc2" + "version": "0.18.0", + "dockerImage": "googleapis/artman@sha256:29bd82cc42c43825fde408e63fc955f3f9d07ff9989243d7aa0f91a35c7884dc" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "547e19e7df398e9290e8e3674d7351efc500f9b0", - "internalRef": "244712781" + "sha": "39c876cca5403e7e8282ce2229033cc3cc02962c", + "internalRef": "246561601" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.4.10" + "version": "2019.5.2" } } ], From e9a0fb878a981bb96cc72913b79544cc0d799c04 Mon Sep 17 00:00:00 2001 From: "Leah E. Cole" <6719667+leahecole@users.noreply.github.com> Date: Wed, 8 May 2019 18:44:05 -0700 Subject: [PATCH 227/513] docs(samples): Translate with automl model sample (#238) --- packages/google-cloud-translate/samples/README.md | 1 - packages/google-cloud-translate/samples/package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 08dbdd6a944..ed53c6a4f61 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -202,4 +202,3 @@ For more information, see https://cloud.google.com/translate/docs [shell_img]: //gstatic.com/cloudssh/images/open-btn.png [shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md - diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 5b7f439e377..539e6f90ed5 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -11,8 +11,8 @@ "test": "mocha --recursive --timeout 90000" }, "dependencies": { - "@google-cloud/translate": "^3.0.1", "@google-cloud/automl": "^0.2.0", + "@google-cloud/translate": "^3.0.1", "yargs": "^13.0.0" }, "devDependencies": { From 2c67792e7a23cf1503581a62183fa4110b1bf058 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Wed, 8 May 2019 18:46:01 -0700 Subject: [PATCH 228/513] fix: DEADLINE_EXCEEDED is no longer retried (#259) --- .../src/v3beta1/translation_service_client_config.json | 1 - packages/google-cloud-translate/synth.metadata | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json index e9f8e606073..2f25822dc1c 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json @@ -3,7 +3,6 @@ "google.cloud.translation.v3beta1.TranslationService": { "retry_codes": { "idempotent": [ - "DEADLINE_EXCEEDED", "UNAVAILABLE" ], "non_idempotent": [] diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 3c3647d2f63..f9b8911f0c6 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-05-04T11:26:04.755328Z", + "updateTime": "2019-05-08T12:12:03.238211Z", "sources": [ { "generator": { "name": "artman", - "version": "0.18.0", - "dockerImage": "googleapis/artman@sha256:29bd82cc42c43825fde408e63fc955f3f9d07ff9989243d7aa0f91a35c7884dc" + "version": "0.19.0", + "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "39c876cca5403e7e8282ce2229033cc3cc02962c", - "internalRef": "246561601" + "sha": "51145ff7812d2bb44c1219d0b76dac92a8bd94b2", + "internalRef": "247143125" } }, { From 06206d99de5acb6cc44e7b6a8faca29d25df6965 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Fri, 10 May 2019 14:58:51 -0700 Subject: [PATCH 229/513] fix: DEADLINE_EXCEEDED is idempotent (#264) --- .../src/v3beta1/translation_service_client_config.json | 1 + packages/google-cloud-translate/synth.metadata | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json index 2f25822dc1c..e9f8e606073 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json @@ -3,6 +3,7 @@ "google.cloud.translation.v3beta1.TranslationService": { "retry_codes": { "idempotent": [ + "DEADLINE_EXCEEDED", "UNAVAILABLE" ], "non_idempotent": [] diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index f9b8911f0c6..65dfa510a4e 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-05-08T12:12:03.238211Z", + "updateTime": "2019-05-10T12:17:07.281806Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "51145ff7812d2bb44c1219d0b76dac92a8bd94b2", - "internalRef": "247143125" + "sha": "07883be5bf3c3233095e99d8e92b8094f5d7084a", + "internalRef": "247530843" } }, { From 78c60b2b2a27594933c35c0824f478b83ee6a383 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 10 May 2019 15:06:57 -0700 Subject: [PATCH 230/513] fix(deps): update dependency @google-cloud/common to v1 (#262) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 6649b07f796..d61965035bd 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -47,7 +47,7 @@ "predocs-test": "npm run docs" }, "dependencies": { - "@google-cloud/common": "^0.32.0", + "@google-cloud/common": "^1.0.0", "@google-cloud/promisify": "^1.0.0", "arrify": "^2.0.0", "extend": "^3.0.1", From bb2477b17f5f6a32972c0a2a758ee27defb66318 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 10 May 2019 15:07:17 -0700 Subject: [PATCH 231/513] fix(deps): update dependency google-gax to v1 (#263) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index d61965035bd..1ee151eb27f 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -51,7 +51,7 @@ "@google-cloud/promisify": "^1.0.0", "arrify": "^2.0.0", "extend": "^3.0.1", - "google-gax": "^0.26.0", + "google-gax": "^1.0.0", "is": "^3.2.1", "is-html": "^1.1.0", "lodash.merge": "^4.6.1", From dd4f3eeec9a65a6075158bea4993423f97ba140d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 13 May 2019 11:50:02 -0700 Subject: [PATCH 232/513] chore(deps): update dependency jsdoc to v3.6.2 (#265) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 1ee151eb27f..9f7a4baf320 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -73,7 +73,7 @@ "eslint-plugin-prettier": "^3.0.0", "gts": "^1.0.0", "intelli-espower-loader": "^1.0.1", - "jsdoc": "3.5.5", + "jsdoc": "^3.6.2", "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "linkinator": "^1.1.2", "mocha": "^6.0.0", From 0fa20e81e9049a52b841a20d1de06782f7c41814 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 13 May 2019 16:14:24 -0700 Subject: [PATCH 233/513] chore: release 4.0.0 (#266) --- packages/google-cloud-translate/CHANGELOG.md | 23 ++++++++++++++++++- packages/google-cloud-translate/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 86608ddf06f..a978580f83e 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,28 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [4.0.0](https://www.github.com/googleapis/nodejs-translate/compare/v3.0.1...v4.0.0) (2019-05-13) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/common to v1 ([#262](https://www.github.com/googleapis/nodejs-translate/issues/262)) ([269018b](https://www.github.com/googleapis/nodejs-translate/commit/269018b)) +* **deps:** update dependency google-gax to v1 ([#263](https://www.github.com/googleapis/nodejs-translate/issues/263)) ([95efe30](https://www.github.com/googleapis/nodejs-translate/commit/95efe30)) +* DEADLINE_EXCEEDED is idempotent ([#264](https://www.github.com/googleapis/nodejs-translate/issues/264)) ([1c222f8](https://www.github.com/googleapis/nodejs-translate/commit/1c222f8)) +* DEADLINE_EXCEEDED is no longer retried ([#259](https://www.github.com/googleapis/nodejs-translate/issues/259)) ([4ea044e](https://www.github.com/googleapis/nodejs-translate/commit/4ea044e)) +* **deps:** update dependency @google-cloud/promisify to v1 ([#253](https://www.github.com/googleapis/nodejs-translate/issues/253)) ([672f6da](https://www.github.com/googleapis/nodejs-translate/commit/672f6da)) +* **deps:** update dependency google-gax to ^0.26.0 ([#248](https://www.github.com/googleapis/nodejs-translate/issues/248)) ([4412bbf](https://www.github.com/googleapis/nodejs-translate/commit/4412bbf)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#249](https://www.github.com/googleapis/nodejs-translate/issues/249)) ([88ec9e2](https://www.github.com/googleapis/nodejs-translate/commit/88ec9e2)) + + +### BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#249) + ## v3.0.1 04-09-2019 12:19 PDT @@ -240,4 +262,3 @@ const translate = new Translate({ - Update proxyquire to the latest version 🚀 (#29) - Update mocha to the latest version 🚀 (#22) - Linting per prettier@1.9.0. (#21) - diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 9f7a4baf320..da1803fadce 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "3.0.1", + "version": "4.0.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 539e6f90ed5..0cad8fe1314 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/automl": "^0.2.0", - "@google-cloud/translate": "^3.0.1", + "@google-cloud/translate": "^4.0.0", "yargs": "^13.0.0" }, "devDependencies": { From 5b29d56ca4239ee24cc3dd8cae900faef3103d74 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 14 May 2019 09:56:49 -0700 Subject: [PATCH 234/513] fix(deps): update dependency @google-cloud/automl to v1 (#267) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 0cad8fe1314..7dc4c906d1f 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -11,7 +11,7 @@ "test": "mocha --recursive --timeout 90000" }, "dependencies": { - "@google-cloud/automl": "^0.2.0", + "@google-cloud/automl": "^1.0.0", "@google-cloud/translate": "^4.0.0", "yargs": "^13.0.0" }, From a392cfdd17d8d49f86dbf01a9888b96ba77a081e Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 17 May 2019 16:50:35 -0700 Subject: [PATCH 235/513] build: updated kokoro config for coverage and release-please (#269) --- packages/google-cloud-translate/synth.metadata | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 65dfa510a4e..a1de7e72ce9 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-05-10T12:17:07.281806Z", + "updateTime": "2019-05-17T19:53:41.693075Z", "sources": [ { "generator": { @@ -12,15 +12,15 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "07883be5bf3c3233095e99d8e92b8094f5d7084a", - "internalRef": "247530843" + "sha": "99efb1441b7c2aeb75c69f8baf9b61d4221bb744", + "internalRef": "248724297" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.5.2" + "version": "2019.4.10" } } ], From a71f2a5ba195144046ae684958fa21b7fb044e17 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 20 May 2019 07:51:23 -0700 Subject: [PATCH 236/513] chore: release 4.0.1 (#273) * updated CHANGELOG.md * updated package.json * updated samples/package.json --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index a978580f83e..f586efde77c 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [4.0.1](https://www.github.com/googleapis/nodejs-translate/compare/v4.0.0...v4.0.1) (2019-05-20) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/automl to v1 ([#267](https://www.github.com/googleapis/nodejs-translate/issues/267)) ([180d8f6](https://www.github.com/googleapis/nodejs-translate/commit/180d8f6)) + ## [4.0.0](https://www.github.com/googleapis/nodejs-translate/compare/v3.0.1...v4.0.0) (2019-05-13) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index da1803fadce..584677417ca 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "4.0.0", + "version": "4.0.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 7dc4c906d1f..19ab438e92c 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/automl": "^1.0.0", - "@google-cloud/translate": "^4.0.0", + "@google-cloud/translate": "^4.0.1", "yargs": "^13.0.0" }, "devDependencies": { From 299e5b6c2da2919a6378ad52cb9e4fa4c0aec4cf Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 20 May 2019 11:27:20 -0700 Subject: [PATCH 237/513] docs: generate new samples/README.md, README.md (#268) * Add README with instructions to run v3 translate * Remove extra blank line * docs: generate new samples/README.md, README.md * docs: finish porting over changes to samples/README.md * docs: add issue tracker link * chore: address code review * Move region tag --- .../.cloud-repo-tools.json | 16 -- .../.readme-partials.yml | 62 ++++++ .../.repo-metadata.json | 13 ++ packages/google-cloud-translate/README.md | 128 ++++++----- packages/google-cloud-translate/package.json | 2 - .../google-cloud-translate/samples/README.md | 203 ++++++------------ .../samples/package.json | 3 +- .../samples/quickstart.js | 6 +- .../google-cloud-translate/synth.metadata | 2 +- 9 files changed, 214 insertions(+), 221 deletions(-) delete mode 100644 packages/google-cloud-translate/.cloud-repo-tools.json create mode 100644 packages/google-cloud-translate/.readme-partials.yml create mode 100644 packages/google-cloud-translate/.repo-metadata.json diff --git a/packages/google-cloud-translate/.cloud-repo-tools.json b/packages/google-cloud-translate/.cloud-repo-tools.json deleted file mode 100644 index 65049e6bfe3..00000000000 --- a/packages/google-cloud-translate/.cloud-repo-tools.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "requiresKeyFile": true, - "requiresProjectId": true, - "product": "translate", - "client_reference_url": "https://cloud.google.com/nodejs/docs/reference/translate/latest/", - "release_quality": "ga", - "samples": [ - { - "id": "translate", - "name": "Translate", - "file": "translate.js", - "docs_link": "https://cloud.google.com/translate/docs", - "usage": "node translate.js --help" - } - ] -} diff --git a/packages/google-cloud-translate/.readme-partials.yml b/packages/google-cloud-translate/.readme-partials.yml new file mode 100644 index 00000000000..d4a8fcfe5d5 --- /dev/null +++ b/packages/google-cloud-translate/.readme-partials.yml @@ -0,0 +1,62 @@ +title: |- + The [Cloud Translation API](https://cloud.google.com/translate/docs/), + can dynamically translate text between thousands + of language pairs. The Cloud Translation API lets websites and programs + integrate with the translation service programmatically. The Cloud Translation + API is part of the larger Cloud Machine Learning API family. +samples_body: |- + ### Translate V3 Beta Samples + + #### Install Dependencies + + From the [root directory](https://github.com/googleapis/nodejs-translate) of the client library install the dependencies: + + ``` + npm install + ``` + + Change to the samples directory, link the google-cloud/translate library from the parent, and install its dependencies: + + ``` + cd samples/ + npm link ../ + npm install + ``` + + #### Run the Tests + + To run the tests for the entire sample, run + + ``` + npm test + ``` + + To run the tests for only the translate v3 samples, run + + ``` + npm run test-v3 + ``` + + To run the tests for a single translate v3 sample, run this command, substituting FILE_NAME with the name of a valid test file. + + ``` + ./node_modules/.bin/mocha test/v3beta1/FILE_NAME + ``` + + For example, to test the `translate_list_language_names_beta` sample, the command would be + + ``` + ./node_modules/.bin/mocha test/v3beta1/translate_list_language_names_beta.test.js + ``` + + To run a sample directly, call the file with the `node` command and any required CLI arguments: + + ``` + node v3beta1/FILE_NAME + ``` + + For example, to run the `translate_list_codes_beta` sample, you would run the following command, substituting your project ID in place of "your_project_id" + + ``` + node v3beta1/translate_list_codes_beta.js "your_project_id" + ``` diff --git a/packages/google-cloud-translate/.repo-metadata.json b/packages/google-cloud-translate/.repo-metadata.json new file mode 100644 index 00000000000..75cc91f75b7 --- /dev/null +++ b/packages/google-cloud-translate/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "name": "translate", + "name_pretty": "Cloud Translation", + "product_documentation": "https://cloud.google.com/translate/docs/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/translate/latest/", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559749", + "release_level": "ga", + "language": "nodejs", + "repo": "googleapis/nodejs-translate", + "distribution_name": "@google-cloud/translate", + "api_id": "translate.googleapis.com", + "requires_billing": true +} diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 3f052306120..c6db274ae3f 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -1,70 +1,90 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "To regenerate it, use `npm run generate-scaffolding`." +[//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google Cloud Translation API: Node.js Client](https://github.com/googleapis/nodejs-translate) +The [Cloud Translation API](https://cloud.google.com/translate/docs/), +can dynamically translate text between thousands +of language pairs. The Cloud Translation API lets websites and programs +integrate with the translation service programmatically. The Cloud Translation +API is part of the larger Cloud Machine Learning API family. -[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) + +[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/translate.svg)](https://www.npmjs.org/package/@google-cloud/translate) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-translate/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-translate) -The [Cloud Translation API](https://cloud.google.com/translate/docs), can dynamically translate text between thousands of language pairs. The Cloud Translation API lets websites and programs integrate with the translation service programmatically. The Cloud Translation API is part of the larger Cloud Machine Learning API family. -* [Using the client library](#using-the-client-library) + +Cloud Translation API Client Library for Node.js + + +* [Cloud Translation Node.js Client API Reference][client-docs] +* [Cloud Translation Documentation][product-docs] +* [github.com/googleapis/nodejs-translate](https://github.com/googleapis/nodejs-translate) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) * [Samples](#samples) * [Versioning](#versioning) * [Contributing](#contributing) * [License](#license) -## Using the client library +## Quickstart -1. [Select or create a Cloud Platform project][projects]. +### Before you begin +1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. - -1. [Enable the Google Cloud Translation API API][enable_api]. - +1. [Enable the Cloud Translation API][enable_api]. 1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. -1. Install the client library: +### Installing the client library + +```bash +npm install @google-cloud/translate +``` - npm install --save @google-cloud/translate -1. Try an example: +### Using the client library ```javascript -// Imports the Google Cloud client library -const {Translate} = require('@google-cloud/translate'); - -// Your Google Cloud Platform project ID -const projectId = 'YOUR_PROJECT_ID'; - -// Instantiates a client -const translate = new Translate({ - projectId: projectId, -}); - -// The text to translate -const text = 'Hello, world!'; -// The target language -const target = 'ru'; - -// Translates some text into Russian -translate - .translate(text, target) - .then(results => { - const translation = results[0]; - - console.log(`Text: ${text}`); - console.log(`Translation: ${translation}`); - }) - .catch(err => { - console.error('ERROR:', err); - }); +async function main( + projectId = 'YOUR_PROJECT_ID' // Your GCP Project Id +) { + // Imports the Google Cloud client library + const {Translate} = require('@google-cloud/translate'); + + // Instantiates a client + const translate = new Translate({projectId}); + + // The text to translate + const text = 'Hello, world!'; + + // The target language + const target = 'ru'; + + // Translates some text into Russian + const [translation] = await translate.translate(text, target); + console.log(`Text: ${text}`); + console.log(`Translation: ${translation}`); +} + ``` + + ## Samples Samples are in the [`samples/`](https://github.com/googleapis/nodejs-translate/tree/master/samples) directory. The samples' `README.md` @@ -72,21 +92,29 @@ has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | | Translate | [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/translate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/translate.js,samples/README.md) | -The [Cloud Translation API Node.js Client API Reference][client-docs] documentation + + +The [Cloud Translation Node.js Client API Reference][client-docs] documentation also contains samples. ## Versioning This library follows [Semantic Versioning](http://semver.org/). + This library is considered to be **General Availability (GA)**. This means it is stable; the code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with an extensive deprecation period. Issues and requests against **GA** libraries are addressed with the highest priority. + + + + More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages @@ -101,22 +129,10 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-translate/blob/master/LICENSE) -## What's Next - -* [Cloud Translation API Documentation][product-docs] -* [Cloud Translation API Node.js Client API Reference][client-docs] -* [github.com/googleapis/nodejs-translate](https://github.com/googleapis/nodejs-translate) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - [client-docs]: https://cloud.google.com/nodejs/docs/reference/translate/latest/ -[product-docs]: https://cloud.google.com/translate/docs +[product-docs]: https://cloud.google.com/translate/docs/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=translate.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started - +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 584677417ca..5e02b50d4cd 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -30,7 +30,6 @@ "scripts": { "docs": "jsdoc -c .jsdoc.js", "predocs": "npm run compile", - "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", "lint": "npm run check && eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha build/system-test --timeout 600000", @@ -59,7 +58,6 @@ "teeny-request": "^3.4.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^3.2.0", "@types/extend": "^3.0.0", "@types/is": "0.0.21", "@types/mocha": "^5.2.4", diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index ed53c6a4f61..c9c9e8da2c2 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -1,204 +1,123 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# Google Cloud Translation API: Node.js Samples +The [Cloud Translation API](https://cloud.google.com/translate/docs/), +can dynamically translate text between thousands +of language pairs. The Cloud Translation API lets websites and programs +integrate with the translation service programmatically. The Cloud Translation +API is part of the larger Cloud Machine Learning API family. Samples + [![Open in Cloud Shell][shell_img]][shell_link] -The [Cloud Translation API](https://cloud.google.com/translate/docs), can dynamically translate text between thousands of language pairs. The Cloud Translation API lets websites and programs integrate with the translation service programmatically. The Cloud Translation API is part of the larger Cloud Machine Learning API family. + ## Table of Contents * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Quickstart](#quickstart) * [Translate](#translate) ## Before you begin -Before running the samples, make sure you've followed the steps in the -[Before you begin section](../README.md#before-you-begin) of the client -library's README. +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-translate#using-the-client-library). -## Samples +### Translate V3 Beta Samples -### Translate +#### Install Dependencies -View the [source code][translate_0_code]. +From the [root directory](https://github.com/googleapis/nodejs-translate) of the client library install the dependencies: -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/translate.js,samples/README.md) +``` +npm install +``` -__Usage:__ `node translate.js --help` +Change to the samples directory, link the google-cloud/translate library from the parent, and install its dependencies: ``` -translate.js - -Commands: - translate.js detect Detects the language of one or more strings. - translate.js list [target] Lists available translation languages. To language names - in a language other than English, specify a target - language. - translate.js translate Translates one or more strings into the target language. - translate.js translate-with-model Translates one or more strings into the target language - using the specified model. +cd samples/ +npm link ../ +npm install +``` -Options: - --version Show version number [boolean] - --help Show help [boolean] +#### Run the Tests -Examples: - node translate.js detect "Hello world!" Detects the language of a string. - node translate.js detect "Hello world!" "Goodbye" Detects the languages of multiple strings. - node translate.js list Lists available translation languages with names in - English. - node translate.js list es Lists available translation languages with names in - Spanish. - node translate.js translate ru "Good morning!" Translates a string into Russian. - node translate.js translate ru "Good morning!" "Good night!" Translates multiple strings into Russian. - node translate.js translate-with-model ru nmt "Good Translates multiple strings into Russian using the - morning!" "Good night!" Premium model. +To run the tests for the entire sample, run -For more information, see https://cloud.google.com/translate/docs +``` +npm test ``` -[translate_0_docs]: https://cloud.google.com/translate/docs -[translate_0_code]: translate.js - -[shell_img]: //gstatic.com/cloudssh/images/open-btn.png -[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md +To run the tests for only the translate v3 samples, run -### automlTranslationDataset +``` +npm run test-v3 +``` -View the [source code][automlTranslationDataset_code]. +To run the tests for a single translate v3 sample, run this command, substituting FILE_NAME with the name of a valid test file. -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/automl/automlTranslationDataset.js,samples/README.md) +``` +./node_modules/.bin/mocha test/v3beta1/FILE_NAME +``` -__Usage:__ `node automlTranslationDataset.js --help` +For example, to test the `translate_list_language_names_beta` sample, the command would be ``` -automlTranslationDataset.js +./node_modules/.bin/mocha test/v3beta1/translate_list_language_names_beta.test.js +``` -Commands: - automlTranslationDataset.js create-dataset creates a new Dataset - automlTranslationDataset.js list-datasets list all Datasets - automlTranslationDataset.js get-dataset Get a Dataset - automlTranslationDataset.js delete-dataset Delete a dataset - automlTranslationDataset.js import-data Import labeled items into dataset +To run a sample directly, call the file with the `node` command and any required CLI arguments: -Options: - --version Show version number [boolean] - --computeRegion, -c region name e.g. "us-central1" [string] [default: "us-central1"] - --datasetName, -n Name of the Dataset [string] [default: "testDataSet"] - --datasetId, -i Id of the dataset [string] - --filter, -f Name of the Dataset to search for [string] [default: "translationDatasetMetadata:*"] - --multilabel, -m Type of the classification problem, False - MULTICLASS, True - MULTILABEL. - [string] [default: false] - --outputUri, -o URI (or local path) to export dataset [string] - --path, -p URI or local path to input .csv, or array of .csv paths - [string] [default: "gs://nodejs-docs-samples-vcm/en-ja.csv"] - --projectId, -z The GCLOUD_PROJECT string, e.g. "my-gcloud-project" [number] [default: "nodejs-docs-samples"] - --source, -s The source language to be translated from [string] - --target, -t The target language to be translated to [string] - --help Show help [boolean] +``` +node v3beta1/FILE_NAME +``` -Examples: - node automlTranslationDataset.js create-dataset -n "newDataSet" -s "en" -t "ja" - node automlTranslationDataset.js list-datasets -f "translationDatasetMetadata:*" - node automlTranslationDataset.js get-dataset -i "DATASETID" - node automlTranslationDataset.js delete-dataset -i "DATASETID" - node automlTranslationDataset.js import-data -i "dataSetId" -p "gs://myproject/mytraindata.csv" +For example, to run the `translate_list_codes_beta` sample, you would run the following command, substituting your project ID in place of "your_project_id" -For more information, see https://cloud.google.com/translate/docs +``` +node v3beta1/translate_list_codes_beta.js "your_project_id" ``` -[automlTranslationDataset_docs]: https://cloud.google.com/translate/docs -[automlTranslationDataset_code]: automl/automlTranslationDataset.js +## Samples -[shell_img]: //gstatic.com/cloudssh/images/open-btn.png -[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md -### automlTranslationModel -View the [source code][automlTranslationModel_code]. +### Quickstart -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/automl/automlTranslationModel.js,samples/README.md) +View the [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/quickstart.js). -__Usage:__ `node translate.js --help` +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) -``` -automlTranslationModel.js +__Usage:__ -Commands: - automlTranslationModel.js create-model creates a new Model - automlTranslationModel.js get-operation-status Gets status of current operation - automlTranslationModel.js list-models list all Models - automlTranslationModel.js get-model Get a Model - automlTranslationModel.js list-model-evaluations List model evaluations - automlTranslationModel.js get-model-evaluation Get model evaluation - automlTranslationModel.js delete-model Delete a Model -Options: - --version Show version number [boolean] - --computeRegion, -c region name e.g. "us-central1" [string] [default: "us-central1"] - --datasetId, -i Id of the dataset [string] - --filter, -f Name of the Dataset to search for [string] [default: ""] - --modelName, -m Name of the model [string] [default: false] - --modelId, -a Id of the model [string] [default: ""] - --modelEvaluationId, -e Id of the model evaluation [string] [default: ""] - --operationFullId, -o Full name of an operation [string] [default: ""] - --projectId, -z The GCLOUD_PROJECT string, e.g. "my-gcloud-project" [number] [default: "nodejs-docs-samples"] - --help Show help [boolean] +`node quickstart.js` -Examples: - node automlTranslationModel.js create-model -i "DatasetID" -m "myModelName" - node automlTranslationModel.js get-operation-status -i "datasetId" -o "OperationFullID" - node automlTranslationModel.js list-models -f "translationModelMetadata:*" - node automlTranslationModel.js get-model -a "ModelID" - node automlTranslationModel.js list-model-evaluations -a "ModelID" - node automlTranslationModel.js get-model-evaluation -a "ModelId" -e "ModelEvaluationID" - node automlTranslationModel.js delete-model -a "ModelID" -For more information, see https://cloud.google.com/translate/docs -``` +----- -[automlTranslationModel_docs]: https://cloud.google.com/translate/docs -[automlTranslationModel_code]: automl/automlTranslationModel.js -[shell_img]: //gstatic.com/cloudssh/images/open-btn.png -[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md -### automlTranslationPredict -View the [source code][automlTranslationPredict_code]. +### Translate -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/automl/automlTranslationPredict.js,samples/README.md) +View the [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/translate.js). -__Usage:__ `node translate.js --help` +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/translate.js,samples/README.md) -``` -automlTranslationPredict.js +__Usage:__ + + +`node translate.js` -Commands: - automlTranslationPredict.js predict classify the content -Options: - --version Show version number [boolean] - --computeRegion, -c region name e.g. "us-central1" [string] [default: "us-central1"] - --filePath, -f local text file path of the content to be classified - [string] [default: "./resources/testInput.txt"] - --modelId, -i Id of the model which will be used for text classification [string] - --projectId, -z The GCLOUD_PROJECT string, e.g. "my-gcloud-project" [number] [default: "203278707824"] - --translationAllowFallback, -t Use true if AutoML will fallback to use a Google translation model fortranslation - requests if the specified AutoML translation model cannotserve the request. Use false - to not use Google translation model. [string] [default: "False"] - --help Show help [boolean] -Examples: - node automlTranslationPredict.js predict -i "modelId" -f "./resources/testInput.txt" -t "False" -For more information, see https://cloud.google.com/translate/docs -``` -[automlTranslationPredict_docs]: https://cloud.google.com/translate/docs -[automlTranslationPredict_code]: automl/automlTranslationPredict.js -[shell_img]: //gstatic.com/cloudssh/images/open-btn.png +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/translate/docs/ diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 19ab438e92c..5300b63bf51 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -8,7 +8,8 @@ "node": ">=8" }, "scripts": { - "test": "mocha --recursive --timeout 90000" + "test": "mocha --recursive --timeout 90000", + "test-v3": "mocha ./test/v3beta1/*.js" }, "dependencies": { "@google-cloud/automl": "^1.0.0", diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index 1798e4316c6..65d00c900c7 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -15,10 +15,10 @@ 'use strict'; -// [START translate_quickstart] -async function quickstart( +async function main( projectId = 'YOUR_PROJECT_ID' // Your GCP Project Id ) { + // [START translate_quickstart] // Imports the Google Cloud client library const {Translate} = require('@google-cloud/translate'); @@ -39,4 +39,4 @@ async function quickstart( // [END translate_quickstart] const args = process.argv.slice(2); -quickstart(...args).catch(console.error); +main(...args).catch(console.error); diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index a1de7e72ce9..9883658ec27 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-05-17T19:53:41.693075Z", + "updateTime": "2019-05-17T22:13:39.352938Z", "sources": [ { "generator": { From 17b535f67ad13df45b4a8ecad18768c191eab3d8 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 23 May 2019 02:39:55 +0000 Subject: [PATCH 238/513] chore: use published jsdoc-baseline package (#276) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 5e02b50d4cd..4854471900e 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -72,7 +72,7 @@ "gts": "^1.0.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", - "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", + "jsdoc-baseline": "^0.1.0", "linkinator": "^1.1.2", "mocha": "^6.0.0", "nyc": "^14.0.0", From 2afef38519f3ce9dc838c43948dea10fd2e4c286 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 28 May 2019 08:28:46 -0700 Subject: [PATCH 239/513] fix(deps): update dependency is-html to v2 (#280) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 4854471900e..0f8568aacf6 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -52,7 +52,7 @@ "extend": "^3.0.1", "google-gax": "^1.0.0", "is": "^3.2.1", - "is-html": "^1.1.0", + "is-html": "^2.0.0", "lodash.merge": "^4.6.1", "protobufjs": "^6.8.8", "teeny-request": "^3.4.0" From 405f248eabdce82ad2b5f92a44aa1dc1f2a03e30 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 28 May 2019 08:51:22 -0700 Subject: [PATCH 240/513] refactor: drop dependency on lodash.merge and update links (#275) --- packages/google-cloud-translate/README.md | 3 - .../google-cloud-translate/samples/README.md | 58 +------------------ .../src/v3beta1/translation_service_client.js | 40 ++++++------- .../google-cloud-translate/synth.metadata | 12 ++-- 4 files changed, 25 insertions(+), 88 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index c6db274ae3f..9d07e4525b0 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -60,9 +60,6 @@ npm install @google-cloud/translate ### Using the client library ```javascript -async function main( - projectId = 'YOUR_PROJECT_ID' // Your GCP Project Id -) { // Imports the Google Cloud client library const {Translate} = require('@google-cloud/translate'); diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index c9c9e8da2c2..bb55292e85f 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -25,62 +25,6 @@ API is part of the larger Cloud Machine Learning API family. Samples Before running the samples, make sure you've followed the steps outlined in [Using the client library](https://github.com/googleapis/nodejs-translate#using-the-client-library). -### Translate V3 Beta Samples - -#### Install Dependencies - -From the [root directory](https://github.com/googleapis/nodejs-translate) of the client library install the dependencies: - -``` -npm install -``` - -Change to the samples directory, link the google-cloud/translate library from the parent, and install its dependencies: - -``` -cd samples/ -npm link ../ -npm install -``` - -#### Run the Tests - -To run the tests for the entire sample, run - -``` -npm test -``` - -To run the tests for only the translate v3 samples, run - -``` -npm run test-v3 -``` - -To run the tests for a single translate v3 sample, run this command, substituting FILE_NAME with the name of a valid test file. - -``` -./node_modules/.bin/mocha test/v3beta1/FILE_NAME -``` - -For example, to test the `translate_list_language_names_beta` sample, the command would be - -``` -./node_modules/.bin/mocha test/v3beta1/translate_list_language_names_beta.test.js -``` - -To run a sample directly, call the file with the `node` command and any required CLI arguments: - -``` -node v3beta1/FILE_NAME -``` - -For example, to run the `translate_list_codes_beta` sample, you would run the following command, substituting your project ID in place of "your_project_id" - -``` -node v3beta1/translate_list_codes_beta.js "your_project_id" -``` - ## Samples @@ -120,4 +64,4 @@ __Usage:__ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md -[product-docs]: https://cloud.google.com/translate/docs/ +[product-docs]: https://cloud.google.com/translate/docs/ \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js index 2a3c6513044..ae1ef1035eb 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js @@ -16,7 +16,6 @@ const gapicConfig = require('./translation_service_client_config.json'); const gax = require('google-gax'); -const merge = require('lodash.merge'); const path = require('path'); const protobuf = require('protobufjs'); @@ -89,12 +88,9 @@ class TranslationServiceClient { } // Load the applicable protos. - const protos = merge( - {}, - gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - 'google/cloud/translate/v3beta1/translation_service.proto' - ) + const protos = gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + ['google/cloud/translate/v3beta1/translation_service.proto'] ); // This API contains "path templates"; forward-slash-separated @@ -316,7 +312,7 @@ class TranslationServiceClient { * This object should have the same structure as [TranslateTextGlossaryConfig]{@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -388,7 +384,7 @@ class TranslationServiceClient { * "text/plain". If left blank, the MIME type is assumed to be "text/html". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -460,7 +456,7 @@ class TranslationServiceClient { * If missing, we get supported languages of Google general NMT model. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -562,13 +558,13 @@ class TranslationServiceClient { * It's keyed by target language code. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example @@ -691,13 +687,13 @@ class TranslationServiceClient { * This object should have the same structure as [Glossary]{@link google.cloud.translation.v3beta1.Glossary} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example @@ -814,7 +810,7 @@ class TranslationServiceClient { * If missing, no filtering is performed. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -925,7 +921,7 @@ class TranslationServiceClient { * If missing, no filtering is performed. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary} on 'data' event. * @@ -965,7 +961,7 @@ class TranslationServiceClient { * Required. The name of the glossary to retrieve. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1020,13 +1016,13 @@ class TranslationServiceClient { * Required. The name of the glossary to delete. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 9883658ec27..29530c228f4 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-05-17T22:13:39.352938Z", + "updateTime": "2019-05-21T11:28:08.403550Z", "sources": [ { "generator": { "name": "artman", - "version": "0.19.0", - "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" + "version": "0.20.0", + "dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "99efb1441b7c2aeb75c69f8baf9b61d4221bb744", - "internalRef": "248724297" + "sha": "32a10f69e2c9ce15bba13ab1ff928bacebb25160", + "internalRef": "249058354" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.4.10" + "version": "2019.5.2" } } ], From 87d712974da7c5b7abe9ef6a507dc0dd1b1bd3ce Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 28 May 2019 20:41:08 +0000 Subject: [PATCH 241/513] build: ignore proto files in test coverage (#282) --- packages/google-cloud-translate/.nycrc | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-translate/.nycrc b/packages/google-cloud-translate/.nycrc index bfe4073a6ab..83a421a0628 100644 --- a/packages/google-cloud-translate/.nycrc +++ b/packages/google-cloud-translate/.nycrc @@ -10,6 +10,7 @@ "**/samples", "**/scripts", "**/src/**/v*/**/*.js", + "**/protos", "**/test", ".jsdoc.js", "**/.jsdoc.js", From 1ccb9aa821843ef5675010ec48d1b75a8ceb3241 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 29 May 2019 10:36:20 -0700 Subject: [PATCH 242/513] docs: include section on beta samples in README (#283) --- .../google-cloud-translate/samples/README.md | 56 +++++++++++++++++++ .../google-cloud-translate/synth.metadata | 10 ++-- 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index bb55292e85f..4e835c86d71 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -25,6 +25,62 @@ API is part of the larger Cloud Machine Learning API family. Samples Before running the samples, make sure you've followed the steps outlined in [Using the client library](https://github.com/googleapis/nodejs-translate#using-the-client-library). +### Translate V3 Beta Samples + +#### Install Dependencies + +From the [root directory](https://github.com/googleapis/nodejs-translate) of the client library install the dependencies: + +``` +npm install +``` + +Change to the samples directory, link the google-cloud/translate library from the parent, and install its dependencies: + +``` +cd samples/ +npm link ../ +npm install +``` + +#### Run the Tests + +To run the tests for the entire sample, run + +``` +npm test +``` + +To run the tests for only the translate v3 samples, run + +``` +npm run test-v3 +``` + +To run the tests for a single translate v3 sample, run this command, substituting FILE_NAME with the name of a valid test file. + +``` +./node_modules/.bin/mocha test/v3beta1/FILE_NAME +``` + +For example, to test the `translate_list_language_names_beta` sample, the command would be + +``` +./node_modules/.bin/mocha test/v3beta1/translate_list_language_names_beta.test.js +``` + +To run a sample directly, call the file with the `node` command and any required CLI arguments: + +``` +node v3beta1/FILE_NAME +``` + +For example, to run the `translate_list_codes_beta` sample, you would run the following command, substituting your project ID in place of "your_project_id" + +``` +node v3beta1/translate_list_codes_beta.js "your_project_id" +``` + ## Samples diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 29530c228f4..88a89f706ac 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-05-21T11:28:08.403550Z", + "updateTime": "2019-05-29T11:22:38.021811Z", "sources": [ { "generator": { "name": "artman", - "version": "0.20.0", - "dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec" + "version": "0.21.0", + "dockerImage": "googleapis/artman@sha256:28d4271586772b275cd3bc95cb46bd227a24d3c9048de45dccdb7f3afb0bfba9" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "32a10f69e2c9ce15bba13ab1ff928bacebb25160", - "internalRef": "249058354" + "sha": "fa15c3006e27b87a20c7a9ffbb7bbe4149c61387", + "internalRef": "250401304" } }, { From 22e3b491b4064eda51bd3e6fda37ad29bbb87860 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 29 May 2019 22:30:10 +0000 Subject: [PATCH 243/513] fix(types): use Metadata types for apiResponse (#277) --- .../google-cloud-translate/src/v2/index.ts | 41 ++++++++----------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/packages/google-cloud-translate/src/v2/index.ts b/packages/google-cloud-translate/src/v2/index.ts index 6ba42372217..1f90e951c81 100644 --- a/packages/google-cloud-translate/src/v2/index.ts +++ b/packages/google-cloud-translate/src/v2/index.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {Service, util} from '@google-cloud/common'; +import {Service, util, Metadata} from '@google-cloud/common'; import {promisifyAll} from '@google-cloud/promisify'; import arrify = require('arrify'); import * as extend from 'extend'; @@ -21,8 +21,6 @@ import * as is from 'is'; const isHtml = require('is-html'); import {DecorateRequestOptions, BodyResponseCallback} from '@google-cloud/common/build/src/util'; -import * as r from 'request'; -import {teenyRequest} from 'teeny-request'; const PKG = require('../../../package.json'); @@ -34,7 +32,7 @@ export interface TranslateRequest { } export interface TranslateCallback { - (err: Error|null, translations?: T|null, apiResponse?: r.Response): void; + (err: Error|null, translations?: T|null, apiResponse?: Metadata): void; } export interface DetectResult { @@ -44,7 +42,7 @@ export interface DetectResult { } export interface DetectCallback { - (err: Error|null, results?: T|null, apiResponse?: r.Response): void; + (err: Error|null, results?: T|null, apiResponse?: Metadata): void; } export interface LanguageResult { @@ -54,14 +52,13 @@ export interface LanguageResult { export interface GetLanguagesCallback { (err: Error|null, results?: LanguageResult[]|null, - apiResponse?: r.Response): void; + apiResponse?: Metadata): void; } export interface TranslateConfig extends GoogleAuthOptions { key?: string; autoRetry?: boolean; maxRetries?: number; - request?: typeof r; } /** @@ -135,19 +132,17 @@ export class Translate extends Service { scopes: ['https://www.googleapis.com/auth/cloud-platform'], packageJson: require('../../../package.json'), projectIdRequired: false, - requestModule: teenyRequest as typeof r, }; super(config, options); this.options = options || {}; - this.options.request = config.requestModule; if (this.options.key) { this.key = this.options.key; } } - detect(input: string): Promise<[DetectResult, r.Response]>; - detect(input: string[]): Promise<[DetectResult[], r.Response]>; + detect(input: string): Promise<[DetectResult, Metadata]>; + detect(input: string[]): Promise<[DetectResult[], Metadata]>; detect(input: string, callback: DetectCallback): void; detect(input: string[], callback: DetectCallback): void; /** @@ -236,8 +231,8 @@ export class Translate extends Service { detect( input: string|string[], callback?: DetectCallback| - DetectCallback): void|Promise<[DetectResult, r.Response]>| - Promise<[DetectResult[], r.Response]> { + DetectCallback): void|Promise<[DetectResult, Metadata]>| + Promise<[DetectResult[], Metadata]> { const inputIsArray = Array.isArray(input); input = arrify(input); this.request( @@ -275,7 +270,7 @@ export class Translate extends Service { }); } - getLanguages(target?: string): Promise<[LanguageResult[], r.Response]>; + getLanguages(target?: string): Promise<[LanguageResult[], Metadata]>; getLanguages(target: string, callback: GetLanguagesCallback): void; getLanguages(callback: GetLanguagesCallback): void; /** @@ -318,7 +313,7 @@ export class Translate extends Service { getLanguages( targetOrCallback?: string|GetLanguagesCallback, callback?: GetLanguagesCallback): - void|Promise<[LanguageResult[], r.Response]> { + void|Promise<[LanguageResult[], Metadata]> { let target: string; if (is.fn(targetOrCallback)) { callback = targetOrCallback as GetLanguagesCallback; @@ -356,11 +351,11 @@ export class Translate extends Service { } translate(input: string, options: TranslateRequest): - Promise<[string, r.Response]>; + Promise<[string, Metadata]>; translate(input: string[], options: TranslateRequest): - Promise<[string[], r.Response]>; - translate(input: string, to: string): Promise<[string, r.Response]>; - translate(input: string[], to: string): Promise<[string[], r.Response]>; + Promise<[string[], Metadata]>; + translate(input: string, to: string): Promise<[string, Metadata]>; + translate(input: string[], to: string): Promise<[string[], Metadata]>; translate( input: string, options: TranslateRequest, callback: TranslateCallback): void; @@ -473,7 +468,7 @@ export class Translate extends Service { translate( inputs: string|string[], optionsOrTo: string|TranslateRequest, callback?: TranslateCallback|TranslateCallback): - void|Promise<[string, r.Response]>|Promise<[string[], r.Response]> { + void|Promise<[string, Metadata]>|Promise<[string[], Metadata]> { const inputIsArray = Array.isArray(inputs); const input = arrify(inputs); let options: TranslateRequest = {}; @@ -533,9 +528,6 @@ export class Translate extends Service { }); } - request(reqOpts: DecorateRequestOptions): Promise; - request(reqOpts: DecorateRequestOptions, callback: BodyResponseCallback): - void; /** * A custom request implementation. Requests to this API may optionally use an * API key for an application, not a bearer token from a service account. This @@ -547,8 +539,7 @@ export class Translate extends Service { * @param {object} reqOpts - Request options that are passed to `request`. * @param {function} callback - The callback function passed to `request`. */ - request(reqOpts: DecorateRequestOptions, callback?: BodyResponseCallback): - void|Promise { + request(reqOpts: DecorateRequestOptions, callback: BodyResponseCallback): void { if (!this.key) { super.request(reqOpts, callback!); return; From c83fc487bf1e481455b178c3a8db2d9771163037 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 30 May 2019 10:46:08 -0700 Subject: [PATCH 244/513] chore(deps): update dependency typescript to ~3.5.0 (#286) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 0f8568aacf6..f3320290acc 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -80,6 +80,6 @@ "prettier": "^1.13.5", "proxyquire": "^2.0.1", "source-map-support": "^0.5.6", - "typescript": "~3.4.0" + "typescript": "~3.5.0" } } From 437cca687e807b3283f52098ac0ae7811e4ca7ea Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 31 May 2019 13:06:41 +0000 Subject: [PATCH 245/513] feat: support apiEndpoint override (#285) --- packages/google-cloud-translate/package.json | 4 ++-- packages/google-cloud-translate/src/v2/index.ts | 12 +++++++++--- packages/google-cloud-translate/test/index.ts | 10 ++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index f3320290acc..0386b4a048d 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -46,7 +46,7 @@ "predocs-test": "npm run docs" }, "dependencies": { - "@google-cloud/common": "^1.0.0", + "@google-cloud/common": "^2.0.0", "@google-cloud/promisify": "^1.0.0", "arrify": "^2.0.0", "extend": "^3.0.1", @@ -74,7 +74,7 @@ "jsdoc": "^3.6.2", "jsdoc-baseline": "^0.1.0", "linkinator": "^1.1.2", - "mocha": "^6.0.0", + "mocha": "^6.1.4", "nyc": "^14.0.0", "power-assert": "^1.6.0", "prettier": "^1.13.5", diff --git a/packages/google-cloud-translate/src/v2/index.ts b/packages/google-cloud-translate/src/v2/index.ts index 1f90e951c81..169f9bc55cb 100644 --- a/packages/google-cloud-translate/src/v2/index.ts +++ b/packages/google-cloud-translate/src/v2/index.ts @@ -59,6 +59,11 @@ export interface TranslateConfig extends GoogleAuthOptions { key?: string; autoRetry?: boolean; maxRetries?: number; + /** + * The API endpoint of the service used to make requests. + * Defaults to `translation.googleapis.com`. + */ + apiEndpoint?: string; } /** @@ -120,14 +125,15 @@ export interface TranslateConfig extends GoogleAuthOptions { export class Translate extends Service { options: TranslateConfig; key?: string; - constructor(options?: TranslateConfig) { - let baseUrl = 'https://translation.googleapis.com/language/translate/v2'; - + constructor(options: TranslateConfig = {}) { + options.apiEndpoint = options.apiEndpoint || 'translation.googleapis.com'; + let baseUrl = `https://${options.apiEndpoint}/language/translate/v2`; if (process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT) { baseUrl = process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT.replace(/\/+$/, ''); } const config = { + apiEndpoint: options.apiEndpoint, baseUrl, scopes: ['https://www.googleapis.com/auth/cloud-platform'], packageJson: require('../../../package.json'), diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index f8c1dd78a06..2b4141ac0fd 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -110,6 +110,16 @@ describe('Translate v2', () => { assert.strictEqual(calledWith.projectIdRequired, false); }); + it('should allow apiEndpoint override', () => { + const apiEndpoint = 'fake.endpoint'; + translate = new Translate({ + projectId: 'test-project', + apiEndpoint, + }); + const calledWith = translate.calledWith_[0]; + assert.strictEqual(calledWith.apiEndpoint, apiEndpoint); + }); + describe('Using an API Key', () => { const KEY_OPTIONS = { key: 'api-key', From a420d9630737fc99bb99ed7a3829f7d170d3bb07 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 5 Jun 2019 09:56:30 -0700 Subject: [PATCH 246/513] feat: support apiEndpoint override in client constructor (#289) --- .../src/v3beta1/translation_service_client.js | 14 ++++++++++- .../google-cloud-translate/synth.metadata | 10 ++++---- .../test/gapic-v3beta1.js | 23 +++++++++++++++++++ 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js index ae1ef1035eb..90c8871516f 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js @@ -56,14 +56,18 @@ class TranslationServiceClient { * API remote host. */ constructor(opts) { + opts = opts || {}; this._descriptors = {}; + const servicePath = + opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; + // Ensure that options include the service address and port. opts = Object.assign( { clientConfig: {}, port: this.constructor.port, - servicePath: this.constructor.servicePath, + servicePath, }, opts ); @@ -231,6 +235,14 @@ class TranslationServiceClient { return 'translate.googleapis.com'; } + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'translate.googleapis.com'; + } + /** * The port for this API service. */ diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 88a89f706ac..da727dd0576 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-05-29T11:22:38.021811Z", + "updateTime": "2019-06-05T14:29:10.487929Z", "sources": [ { "generator": { "name": "artman", - "version": "0.21.0", - "dockerImage": "googleapis/artman@sha256:28d4271586772b275cd3bc95cb46bd227a24d3c9048de45dccdb7f3afb0bfba9" + "version": "0.23.1", + "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "fa15c3006e27b87a20c7a9ffbb7bbe4149c61387", - "internalRef": "250401304" + "sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b", + "internalRef": "251635729" } }, { diff --git a/packages/google-cloud-translate/test/gapic-v3beta1.js b/packages/google-cloud-translate/test/gapic-v3beta1.js index 31be4271d46..c1332cb8588 100644 --- a/packages/google-cloud-translate/test/gapic-v3beta1.js +++ b/packages/google-cloud-translate/test/gapic-v3beta1.js @@ -23,6 +23,29 @@ const error = new Error(); error.code = FAKE_STATUS_CODE; describe('TranslationServiceClient', () => { + it('has servicePath', () => { + const servicePath = + translateModule.v3beta1.TranslationServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + translateModule.v3beta1.TranslationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = translateModule.v3beta1.TranslationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no options', () => { + const client = new translateModule.v3beta1.TranslationServiceClient(); + assert(client); + }); + describe('translateText', () => { it('invokes translateText without error', done => { const client = new translateModule.v3beta1.TranslationServiceClient({ From 9861c23ab60e5b5afb9d73125dc9cd51e744ce12 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 7 Jun 2019 07:14:52 -0700 Subject: [PATCH 247/513] refactor: changes formatting of various statements --- packages/google-cloud-translate/synth.metadata | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index da727dd0576..b93e5ee0d80 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-06-05T14:29:10.487929Z", + "updateTime": "2019-06-07T11:25:18.096311Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b", - "internalRef": "251635729" + "sha": "15fdbe57306e3a56069af5e2595e9b1bb33b6123", + "internalRef": "251960694" } }, { From bddcaf53bdc7ef841129e05ba9a43cfe63725325 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 8 Jun 2019 12:42:40 -0700 Subject: [PATCH 248/513] docs: update proto comments for multiple methods (#291) --- .../v3beta1/translation_service.proto | 220 +++++++++++------- .../v3beta1/doc_translation_service.js | 196 +++++++++------- .../src/v3beta1/translation_service_client.js | 135 ++++++----- .../google-cloud-translate/synth.metadata | 10 +- 4 files changed, 336 insertions(+), 225 deletions(-) diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto index e9e65baa35b..fa20f01693f 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto @@ -18,8 +18,10 @@ syntax = "proto3"; package google.cloud.translation.v3beta1; import "google/api/annotations.proto"; +import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/client.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Translate.V3Beta1"; @@ -34,11 +36,17 @@ option ruby_package = "Google::Cloud::Translate::V3beta1"; // Provides natural language translation operations. service TranslationService { + option (google.api.default_host) = "translation.googleapis.com"; + // Translates input text and returns translated text. rpc TranslateText(TranslateTextRequest) returns (TranslateTextResponse) { option (google.api.http) = { post: "/v3beta1/{parent=projects/*/locations/*}:translateText" body: "*" + additional_bindings { + post: "/v3beta1/{parent=projects/*}:translateText" + body: "*" + } }; } @@ -47,6 +55,10 @@ service TranslationService { option (google.api.http) = { post: "/v3beta1/{parent=projects/*/locations/*}:detectLanguage" body: "*" + additional_bindings { + post: "/v3beta1/{parent=projects/*}:detectLanguage" + body: "*" + } }; } @@ -54,6 +66,9 @@ service TranslationService { rpc GetSupportedLanguages(GetSupportedLanguagesRequest) returns (SupportedLanguages) { option (google.api.http) = { get: "/v3beta1/{parent=projects/*/locations/*}/supportedLanguages" + additional_bindings { + get: "/v3beta1/{parent=projects/*}/supportedLanguages" + } }; } @@ -113,7 +128,7 @@ message TranslateTextGlossaryConfig { // this format: projects/*/locations/*/glossaries/* string glossary = 1; - // Optional. Indicates whether we should do a case-insensitive match. + // Optional. Indicates match is case-insensitive. // Default value is false if missing. bool ignore_case = 2; } @@ -121,63 +136,71 @@ message TranslateTextGlossaryConfig { // The request message for synchronous translation. message TranslateTextRequest { // Required. The content of the input in string format. - // We recommend the total contents to be less than 30k codepoints. - // Please use BatchTranslateText for larger text. + // We recommend the total content be less than 30k codepoints. + // Use BatchTranslateText for larger text. repeated string contents = 1; // Optional. The format of the source text, for example, "text/html", - // "text/plain". If left blank, the MIME type is assumed to be "text/html". + // "text/plain". If left blank, the MIME type defaults to "text/html". string mime_type = 3; // Optional. The BCP-47 language code of the input text if // known, for example, "en-US" or "sr-Latn". Supported language codes are // listed in Language Support. If the source language isn't specified, the API // attempts to identify the source language automatically and returns the - // the source language within the response. + // source language within the response. string source_language_code = 4; // Required. The BCP-47 language code to use for translation of the input // text, set to one of the language codes listed in Language Support. string target_language_code = 5; - // Optional. Only used when making regionalized call. - // Format: - // projects/{project-id}/locations/{location-id}. + // Required. Location to make a regional or global call. + // + // Format: `projects/{project-id}/locations/{location-id}`. + // + // For global calls, use `projects/{project-id}/locations/global`. // - // Only custom model/glossary within the same location-id can be used. - // Otherwise 400 is returned. + // Models and glossaries must be within the same region (have same + // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. string parent = 8; // Optional. The `model` type requested for this translation. // - // The format depends on model type: - // 1. Custom models: - // projects/{project-id}/locations/{location-id}/models/{model-id}. - // 2. General (built-in) models: - // projects/{project-id}/locations/{location-id}/models/general/nmt - // projects/{project-id}/locations/{location-id}/models/general/base + // The format depends on model type: + // + // - AutoML Translation models: + // `projects/{project-id}/locations/{location-id}/models/{model-id}` + // + // - General (built-in) models: + // `projects/{project-id}/locations/{location-id}/models/general/nmt`, + // `projects/{project-id}/locations/{location-id}/models/general/base` + // // - // For global (non-regionalized) requests, use {location-id} 'global'. + // For global (non-regionalized) requests, use `location-id` `global`. // For example, - // projects/{project-id}/locations/global/models/general/nmt + // `projects/{project-id}/locations/global/models/general/nmt`. // // If missing, the system decides which google base model to use. string model = 6; - // Optional. Glossary to be applied. The glossary needs to be in the same - // region as the model, otherwise an INVALID_ARGUMENT error is returned. + // Optional. Glossary to be applied. The glossary must be + // within the same region (have the same location-id) as the model, otherwise + // an INVALID_ARGUMENT (400) error is returned. TranslateTextGlossaryConfig glossary_config = 7; } -// The main language translation response message. message TranslateTextResponse { // Text translation responses with no glossary applied. - // This field has the same length as `contents` in TranslateTextRequest. + // This field has the same length as + // [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents]. repeated Translation translations = 1; // Text translation responses if a glossary is provided in the request. - // This could be the same as 'translation' above if no terms apply. - // This field has the same length as `contents` in TranslateTextRequest. + // This can be the same as + // [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply. + // This field has the same length as + // [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents]. repeated Translation glossary_translations = 3; } @@ -193,7 +216,7 @@ message Translation { // The BCP-47 language code of source text in the initial request, detected // automatically, if no source language was passed within the initial // request. If the source language was passed, auto-detection of the language - // does not occur and this field will be empty. + // does not occur and this field is empty. string detected_language_code = 4; // The `glossary_config` used for this translation. @@ -202,17 +225,25 @@ message Translation { // The request message for language detection. message DetectLanguageRequest { - // Optional. Only used when making regionalized call. - // Format: - // projects/{project-id}/locations/{location-id}. + // Required. Location to make a regional or global call. + // + // Format: `projects/{project-id}/locations/{location-id}`. // - // Only custom model within the same location-id can be used. - // Otherwise 400 is returned. + // For global calls, use `projects/{project-id}/locations/global`. + // + // Only models within the same region (has same location-id) can be used. + // Otherwise an INVALID_ARGUMENT (400) error is returned. string parent = 5; // Optional. The language detection model to be used. - // projects/{project-id}/locations/{location-id}/models/language-detection/{model-id} - // If not specified, default will be used. + // + // Format: + // `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` + // + // Only one language detection model is currently supported: + // `projects/{project-id}/locations/{location-id}/models/language-detection/default`. + // + // If not specified, the default model is used. string model = 4; // Required. The source of the document from which to detect the language. @@ -222,7 +253,7 @@ message DetectLanguageRequest { } // Optional. The format of the source text, for example, "text/html", - // "text/plain". If left blank, the MIME type is assumed to be "text/html". + // "text/plain". If left blank, the MIME type defaults to "text/html". string mime_type = 3; } @@ -245,28 +276,35 @@ message DetectLanguageResponse { // The request message for discovering supported languages. message GetSupportedLanguagesRequest { - // Optional. Used for making regionalized calls. - // Format: projects/{project-id}/locations/{location-id}. - // For global calls, use projects/{project-id}/locations/global. - // If missing, the call is treated as a global call. + // Required. Location to make a regional or global call. // - // Only custom model within the same location-id can be used. - // Otherwise 400 is returned. + // Format: `projects/{project-id}/locations/{location-id}`. + // + // For global calls, use `projects/{project-id}/locations/global`. + // + // Only models within the same region (have same location-id) can be used, + // otherwise an INVALID_ARGUMENT (400) error is returned. string parent = 3; // Optional. The language to use to return localized, human readable names - // of supported languages. If missing, default language is ENGLISH. + // of supported languages. If missing, then display names are not returned + // in a response. string display_language_code = 1; // Optional. Get supported languages of this model. + // // The format depends on model type: - // 1. Custom models: - // projects/{project-id}/locations/{location-id}/models/{model-id}. - // 2. General (built-in) models: - // projects/{project-id}/locations/{location-id}/models/general/nmt - // projects/{project-id}/locations/{location-id}/models/general/base + // + // - AutoML Translation models: + // `projects/{project-id}/locations/{location-id}/models/{model-id}` + // + // - General (built-in) models: + // `projects/{project-id}/locations/{location-id}/models/general/nmt`, + // `projects/{project-id}/locations/{location-id}/models/general/base` + // + // // Returns languages supported by the specified model. - // If missing, we get supported languages of Google general NMT model. + // If missing, we get supported languages of Google general base (PBMT) model. string model = 2; } @@ -297,13 +335,13 @@ message SupportedLanguage { bool support_target = 4; } -// The GCS location for the input content. +// The Google Cloud Storage location for the input content. message GcsSource { // Required. Source data URI. For example, `gs://my_bucket/my_object`. string input_uri = 1; } -// Input configuration. +// Input configuration for BatchTranslateText request. message InputConfig { // Optional. Can be "text/plain" or "text/html". // For `.tsv`, "text/html" is used if mime_type is missing. @@ -323,6 +361,11 @@ message InputConfig { // second column is the actual text to be // translated. We recommend each row be <= 10K Unicode codepoints, // otherwise an error might be returned. + // Note that the input tsv must be RFC 4180 compliant. + // + // You could use https://github.com/Clever/csvlint to check potential + // formatting errors in your tsv file. + // csvlint --delimiter='\t' your_input_file.tsv // // The other supported file extensions are `.txt` or `.html`, which is // treated as a single large chunk of text. @@ -330,14 +373,15 @@ message InputConfig { } } -// The GCS location for the output content +// The Google Cloud Storage location for the output content message GcsDestination { // Required. There must be no files under 'output_uri_prefix'. - // 'output_uri_prefix' must end with "/". Otherwise error 400 is returned. + // 'output_uri_prefix' must end with "/", otherwise an INVALID_ARGUMENT (400) + // error is returned.. string output_uri_prefix = 1; } -// Output configuration. +// Output configuration for BatchTranslateText request. message OutputConfig { // Required. The destination of output. oneof destination { @@ -364,13 +408,13 @@ message OutputConfig { // errors_file contains the errors during processing of the file. (details // below). Both translations_file and errors_file could be empty // strings if we have no content to output. - // glossary_translations_file,glossary_errors_file are always empty string - // if input_file is tsv. They could also be empty if we have no content to - // output. + // glossary_translations_file and glossary_errors_file are always empty + // strings if the input_file is tsv. They could also be empty if we have no + // content to output. // // Once a row is present in index.csv, the input/output matching never // changes. Callers should also expect all the content in input_file are - // processed and ready to be consumed (that is, No partial output file is + // processed and ready to be consumed (that is, no partial output file is // written). // // The format of translations_file (for target language code 'trg') is: @@ -396,8 +440,8 @@ message OutputConfig { // The format of errors file (for target language code 'trg') is: // gs://translation_test/a_b_c_'trg'_errors.[extension] // - // If the input file extension is tsv, errors_file has the - // following Column 1: ID of the request provided in the input, if it's not + // If the input file extension is tsv, errors_file contains the following: + // Column 1: ID of the request provided in the input, if it's not // provided in the input, then the input row number is used (0-based). // Column 2: source sentence. // Column 3: Error detail for the translation. Could be empty. @@ -413,12 +457,15 @@ message OutputConfig { // The batch translation request. message BatchTranslateTextRequest { - // Optional. Only used when making regionalized call. - // Format: - // projects/{project-id}/locations/{location-id}. + // Required. Location to make a regional call. + // + // Format: `projects/{project-id}/locations/{location-id}`. + // + // The `global` location is not supported for batch translation. // - // Only custom models/glossaries within the same location-id can be used. - // Otherwise 400 is returned. + // Only AutoML Translation models or glossaries within the same region (have + // the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + // error is returned. string parent = 1; // Required. Source language code. @@ -429,17 +476,20 @@ message BatchTranslateTextRequest { // Optional. The models to use for translation. Map's key is target language // code. Map's value is model name. Value can be a built-in general model, - // or a custom model built by AutoML. + // or an AutoML Translation model. // // The value format depends on model type: - // 1. Custom models: - // projects/{project-id}/locations/{location-id}/models/{model-id}. - // 2. General (built-in) models: - // projects/{project-id}/locations/{location-id}/models/general/nmt - // projects/{project-id}/locations/{location-id}/models/general/base + // + // - AutoML Translation models: + // `projects/{project-id}/locations/{location-id}/models/{model-id}` + // + // - General (built-in) models: + // `projects/{project-id}/locations/{location-id}/models/general/nmt`, + // `projects/{project-id}/locations/{location-id}/models/general/base` + // // // If the map is empty or a specific model is - // not requested for a language pair, then default google model is used. + // not requested for a language pair, then default google model (nmt) is used. map models = 4; // Required. Input configurations. @@ -468,11 +518,11 @@ message BatchTranslateMetadata { // Request is being processed. RUNNING = 1; - // The batch is processed, and at least one item has been successfully + // The batch is processed, and at least one item was successfully // processed. SUCCEEDED = 2; - // The batch is done and no item has been successfully processed. + // The batch is done and no item was successfully processed. FAILED = 3; // Request is in the process of being canceled after caller invoked @@ -497,7 +547,7 @@ message BatchTranslateMetadata { // Total number of characters (Unicode codepoints). // This is the total number of codepoints from input files times the number of - // target languages. It appears here shortly after the call is submitted. + // target languages and appears here shortly after the call is submitted. int64 total_characters = 4; // Time when the operation was submitted. @@ -529,12 +579,12 @@ message GlossaryInputConfig { // Required. Specify the input. oneof source { // Required. Google Cloud Storage location of glossary data. - // File format is determined based on file name extension. API returns + // File format is determined based on the filename extension. API returns // [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file // formats. Wildcards are not allowed. This must be a single file in one of // the following formats: // - // For `UNIDIRECTIONAL` glossaries: + // For unidirectional glossaries: // // - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. // The first column is source text. The second column is target text. @@ -544,19 +594,19 @@ message GlossaryInputConfig { // - TMX (`.tmx`): TMX file with parallel data defining source/target term // pairs. // - // For `EQUIVALENT_TERMS_SET` glossaries: + // For equivalent term sets glossaries: // // - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms // in multiple languages. The format is defined for Google Translation - // Toolkit and documented here: - // `https://support.google.com/translatortoolkit/answer/6306379?hl=en`. + // Toolkit and documented in [Use a + // glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). GcsSource gcs_source = 1; } } // Represents a glossary built from user provided data. message Glossary { - // Used with UNIDIRECTIONAL. + // Used with unidirectional glossaries. message LanguageCodePair { // Required. The BCP-47 language code of the input text, for example, // "en-US". Expected to be an exact match for GlossaryTerm.language_code. @@ -567,7 +617,7 @@ message Glossary { string target_language_code = 2; } - // Used with EQUIVALENT_TERMS_SET. + // Used with equivalent term set glossaries. message LanguageCodesSet { // The BCP-47 language code(s) for terms defined in the glossary. // All entries are unique. The list contains at least two entries. @@ -581,10 +631,10 @@ message Glossary { // Languages supported by the glossary. oneof languages { - // Used with UNIDIRECTIONAL. + // Used with unidirectional glossaries. LanguageCodePair language_pair = 3; - // Used with EQUIVALENT_TERMS_SET. + // Used with equivalent term set glossaries. LanguageCodesSet language_codes_set = 4; } @@ -639,7 +689,7 @@ message ListGlossariesRequest { string page_token = 3; // Optional. Filter specifying constraints of a list operation. - // For example, `tags.glossary_name="products*"`. + // Filtering is not supported yet, and the parameter currently has no effect. // If missing, no filtering is performed. string filter = 4; } @@ -666,7 +716,7 @@ message CreateGlossaryMetadata { // Request is being processed. RUNNING = 1; - // The glossary has been successfully created. + // The glossary was successfully created. SUCCEEDED = 2; // Failed to create the glossary. @@ -676,7 +726,7 @@ message CreateGlossaryMetadata { // longrunning.Operations.CancelOperation on the request id. CANCELLING = 4; - // The glossary creation request has been successfully canceled. + // The glossary creation request was successfully canceled. CANCELLED = 5; } @@ -711,7 +761,7 @@ message DeleteGlossaryMetadata { // longrunning.Operations.CancelOperation on the request id. CANCELLING = 4; - // The glossary deletion request has been successfully canceled. + // The glossary deletion request was successfully canceled. CANCELLED = 5; } diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js b/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js index 774640f0012..56bb2d839df 100644 --- a/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js +++ b/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js @@ -24,7 +24,7 @@ * this format: projects/* /locations/* /glossaries/* * * @property {boolean} ignoreCase - * Optional. Indicates whether we should do a case-insensitive match. + * Optional. Indicates match is case-insensitive. * Default value is false if missing. * * @typedef TranslateTextGlossaryConfig @@ -40,51 +40,57 @@ const TranslateTextGlossaryConfig = { * * @property {string[]} contents * Required. The content of the input in string format. - * We recommend the total contents to be less than 30k codepoints. - * Please use BatchTranslateText for larger text. + * We recommend the total content be less than 30k codepoints. + * Use BatchTranslateText for larger text. * * @property {string} mimeType * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type is assumed to be "text/html". + * "text/plain". If left blank, the MIME type defaults to "text/html". * * @property {string} sourceLanguageCode * Optional. The BCP-47 language code of the input text if * known, for example, "en-US" or "sr-Latn". Supported language codes are * listed in Language Support. If the source language isn't specified, the API * attempts to identify the source language automatically and returns the - * the source language within the response. + * source language within the response. * * @property {string} targetLanguageCode * Required. The BCP-47 language code to use for translation of the input * text, set to one of the language codes listed in Language Support. * * @property {string} parent - * Optional. Only used when making regionalized call. - * Format: - * projects/{project-id}/locations/{location-id}. + * Required. Location to make a regional or global call. + * + * Format: `projects/{project-id}/locations/{location-id}`. * - * Only custom model/glossary within the same location-id can be used. - * Otherwise 400 is returned. + * For global calls, use `projects/{project-id}/locations/global`. + * + * Models and glossaries must be within the same region (have same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. * * @property {string} model * Optional. The `model` type requested for this translation. * - * The format depends on model type: - * 1. Custom models: - * projects/{project-id}/locations/{location-id}/models/{model-id}. - * 2. General (built-in) models: - * projects/{project-id}/locations/{location-id}/models/general/nmt - * projects/{project-id}/locations/{location-id}/models/general/base + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-id}/locations/{location-id}/models/general/base` * - * For global (non-regionalized) requests, use {location-id} 'global'. + * + * For global (non-regionalized) requests, use `location-id` `global`. * For example, - * projects/{project-id}/locations/global/models/general/nmt + * `projects/{project-id}/locations/global/models/general/nmt`. * * If missing, the system decides which google base model to use. * * @property {Object} glossaryConfig - * Optional. Glossary to be applied. The glossary needs to be in the same - * region as the model, otherwise an INVALID_ARGUMENT error is returned. + * Optional. Glossary to be applied. The glossary must be + * within the same region (have the same location-id) as the model, otherwise + * an INVALID_ARGUMENT (400) error is returned. * * This object should have the same structure as [TranslateTextGlossaryConfig]{@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} * @@ -97,18 +103,19 @@ const TranslateTextRequest = { }; /** - * The main language translation response message. - * * @property {Object[]} translations * Text translation responses with no glossary applied. - * This field has the same length as `contents` in TranslateTextRequest. + * This field has the same length as + * `contents`. * * This object should have the same structure as [Translation]{@link google.cloud.translation.v3beta1.Translation} * * @property {Object[]} glossaryTranslations * Text translation responses if a glossary is provided in the request. - * This could be the same as 'translation' above if no terms apply. - * This field has the same length as `contents` in TranslateTextRequest. + * This can be the same as + * `translations` if no terms apply. + * This field has the same length as + * `contents`. * * This object should have the same structure as [Translation]{@link google.cloud.translation.v3beta1.Translation} * @@ -134,7 +141,7 @@ const TranslateTextResponse = { * The BCP-47 language code of source text in the initial request, detected * automatically, if no source language was passed within the initial * request. If the source language was passed, auto-detection of the language - * does not occur and this field will be empty. + * does not occur and this field is empty. * * @property {Object} glossaryConfig * The `glossary_config` used for this translation. @@ -153,24 +160,32 @@ const Translation = { * The request message for language detection. * * @property {string} parent - * Optional. Only used when making regionalized call. - * Format: - * projects/{project-id}/locations/{location-id}. + * Required. Location to make a regional or global call. + * + * Format: `projects/{project-id}/locations/{location-id}`. * - * Only custom model within the same location-id can be used. - * Otherwise 400 is returned. + * For global calls, use `projects/{project-id}/locations/global`. + * + * Only models within the same region (has same location-id) can be used. + * Otherwise an INVALID_ARGUMENT (400) error is returned. * * @property {string} model * Optional. The language detection model to be used. - * projects/{project-id}/locations/{location-id}/models/language-detection/{model-id} - * If not specified, default will be used. + * + * Format: + * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` + * + * Only one language detection model is currently supported: + * `projects/{project-id}/locations/{location-id}/models/language-detection/default`. + * + * If not specified, the default model is used. * * @property {string} content * The content of the input stored as a string. * * @property {string} mimeType * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type is assumed to be "text/html". + * "text/plain". If left blank, the MIME type defaults to "text/html". * * @typedef DetectLanguageRequest * @memberof google.cloud.translation.v3beta1 @@ -219,28 +234,35 @@ const DetectLanguageResponse = { * The request message for discovering supported languages. * * @property {string} parent - * Optional. Used for making regionalized calls. - * Format: projects/{project-id}/locations/{location-id}. - * For global calls, use projects/{project-id}/locations/global. - * If missing, the call is treated as a global call. + * Required. Location to make a regional or global call. * - * Only custom model within the same location-id can be used. - * Otherwise 400 is returned. + * Format: `projects/{project-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-id}/locations/global`. + * + * Only models within the same region (have same location-id) can be used, + * otherwise an INVALID_ARGUMENT (400) error is returned. * * @property {string} displayLanguageCode * Optional. The language to use to return localized, human readable names - * of supported languages. If missing, default language is ENGLISH. + * of supported languages. If missing, then display names are not returned + * in a response. * * @property {string} model * Optional. Get supported languages of this model. + * * The format depends on model type: - * 1. Custom models: - * projects/{project-id}/locations/{location-id}/models/{model-id}. - * 2. General (built-in) models: - * projects/{project-id}/locations/{location-id}/models/general/nmt - * projects/{project-id}/locations/{location-id}/models/general/base + * + * - AutoML Translation models: + * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-id}/locations/{location-id}/models/general/base` + * + * * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general NMT model. + * If missing, we get supported languages of Google general base (PBMT) model. * * @typedef GetSupportedLanguagesRequest * @memberof google.cloud.translation.v3beta1 @@ -296,7 +318,7 @@ const SupportedLanguage = { }; /** - * The GCS location for the input content. + * The Google Cloud Storage location for the input content. * * @property {string} inputUri * Required. Source data URI. For example, `gs://my_bucket/my_object`. @@ -310,7 +332,7 @@ const GcsSource = { }; /** - * Input configuration. + * Input configuration for BatchTranslateText request. * * @property {string} mimeType * Optional. Can be "text/plain" or "text/html". @@ -329,6 +351,11 @@ const GcsSource = { * second column is the actual text to be * translated. We recommend each row be <= 10K Unicode codepoints, * otherwise an error might be returned. + * Note that the input tsv must be RFC 4180 compliant. + * + * You could use https://github.com/Clever/csvlint to check potential + * formatting errors in your tsv file. + * csvlint --delimiter='\t' your_input_file.tsv * * The other supported file extensions are `.txt` or `.html`, which is * treated as a single large chunk of text. @@ -344,11 +371,12 @@ const InputConfig = { }; /** - * The GCS location for the output content + * The Google Cloud Storage location for the output content * * @property {string} outputUriPrefix * Required. There must be no files under 'output_uri_prefix'. - * 'output_uri_prefix' must end with "/". Otherwise error 400 is returned. + * 'output_uri_prefix' must end with "/", otherwise an INVALID_ARGUMENT (400) + * error is returned.. * * @typedef GcsDestination * @memberof google.cloud.translation.v3beta1 @@ -359,7 +387,7 @@ const GcsDestination = { }; /** - * Output configuration. + * Output configuration for BatchTranslateText request. * * @property {Object} gcsDestination * Google Cloud Storage destination for output content. @@ -385,13 +413,13 @@ const GcsDestination = { * errors_file contains the errors during processing of the file. (details * below). Both translations_file and errors_file could be empty * strings if we have no content to output. - * glossary_translations_file,glossary_errors_file are always empty string - * if input_file is tsv. They could also be empty if we have no content to - * output. + * glossary_translations_file and glossary_errors_file are always empty + * strings if the input_file is tsv. They could also be empty if we have no + * content to output. * * Once a row is present in index.csv, the input/output matching never * changes. Callers should also expect all the content in input_file are - * processed and ready to be consumed (that is, No partial output file is + * processed and ready to be consumed (that is, no partial output file is * written). * * The format of translations_file (for target language code 'trg') is: @@ -417,8 +445,8 @@ const GcsDestination = { * The format of errors file (for target language code 'trg') is: * gs://translation_test/a_b_c_'trg'_errors.[extension] * - * If the input file extension is tsv, errors_file has the - * following Column 1: ID of the request provided in the input, if it's not + * If the input file extension is tsv, errors_file contains the following: + * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). * Column 2: source sentence. * Column 3: Error detail for the translation. Could be empty. @@ -443,12 +471,15 @@ const OutputConfig = { * The batch translation request. * * @property {string} parent - * Optional. Only used when making regionalized call. - * Format: - * projects/{project-id}/locations/{location-id}. + * Required. Location to make a regional call. + * + * Format: `projects/{project-id}/locations/{location-id}`. + * + * The `global` location is not supported for batch translation. * - * Only custom models/glossaries within the same location-id can be used. - * Otherwise 400 is returned. + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. * * @property {string} sourceLanguageCode * Required. Source language code. @@ -459,17 +490,20 @@ const OutputConfig = { * @property {Object.} models * Optional. The models to use for translation. Map's key is target language * code. Map's value is model name. Value can be a built-in general model, - * or a custom model built by AutoML. + * or an AutoML Translation model. * * The value format depends on model type: - * 1. Custom models: - * projects/{project-id}/locations/{location-id}/models/{model-id}. - * 2. General (built-in) models: - * projects/{project-id}/locations/{location-id}/models/general/nmt - * projects/{project-id}/locations/{location-id}/models/general/base + * + * - AutoML Translation models: + * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-id}/locations/{location-id}/models/general/base` + * * * If the map is empty or a specific model is - * not requested for a language pair, then default google model is used. + * not requested for a language pair, then default google model (nmt) is used. * * @property {Object[]} inputConfigs * Required. Input configurations. @@ -516,7 +550,7 @@ const BatchTranslateTextRequest = { * @property {number} totalCharacters * Total number of characters (Unicode codepoints). * This is the total number of codepoints from input files times the number of - * target languages. It appears here shortly after the call is submitted. + * target languages and appears here shortly after the call is submitted. * * @property {Object} submitTime * Time when the operation was submitted. @@ -568,12 +602,12 @@ const BatchTranslateResponse = { * * @property {Object} gcsSource * Required. Google Cloud Storage location of glossary data. - * File format is determined based on file name extension. API returns + * File format is determined based on the filename extension. API returns * [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file * formats. Wildcards are not allowed. This must be a single file in one of * the following formats: * - * For `UNIDIRECTIONAL` glossaries: + * For unidirectional glossaries: * * - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. * The first column is source text. The second column is target text. @@ -583,12 +617,12 @@ const BatchTranslateResponse = { * - TMX (`.tmx`): TMX file with parallel data defining source/target term * pairs. * - * For `EQUIVALENT_TERMS_SET` glossaries: + * For equivalent term sets glossaries: * * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms * in multiple languages. The format is defined for Google Translation - * Toolkit and documented here: - * `https://support.google.com/translatortoolkit/answer/6306379?hl=en`. + * Toolkit and documented in [Use a + * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). * * This object should have the same structure as [GcsSource]{@link google.cloud.translation.v3beta1.GcsSource} * @@ -608,12 +642,12 @@ const GlossaryInputConfig = { * `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`. * * @property {Object} languagePair - * Used with UNIDIRECTIONAL. + * Used with unidirectional glossaries. * * This object should have the same structure as [LanguageCodePair]{@link google.cloud.translation.v3beta1.LanguageCodePair} * * @property {Object} languageCodesSet - * Used with EQUIVALENT_TERMS_SET. + * Used with equivalent term set glossaries. * * This object should have the same structure as [LanguageCodesSet]{@link google.cloud.translation.v3beta1.LanguageCodesSet} * @@ -644,7 +678,7 @@ const Glossary = { // This is for documentation. Actual contents will be loaded by gRPC. /** - * Used with UNIDIRECTIONAL. + * Used with unidirectional glossaries. * * @property {string} sourceLanguageCode * Required. The BCP-47 language code of the input text, for example, @@ -663,7 +697,7 @@ const Glossary = { }, /** - * Used with EQUIVALENT_TERMS_SET. + * Used with equivalent term set glossaries. * * @property {string[]} languageCodes * The BCP-47 language code(s) for terms defined in the glossary. @@ -744,7 +778,7 @@ const DeleteGlossaryRequest = { * * @property {string} filter * Optional. Filter specifying constraints of a list operation. - * For example, `tags.glossary_name="products*"`. + * Filtering is not supported yet, and the parameter currently has no effect. * If missing, no filtering is performed. * * @typedef ListGlossariesRequest diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js index 90c8871516f..1237e06686c 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js @@ -281,45 +281,51 @@ class TranslationServiceClient { * The request object that will be sent. * @param {string[]} request.contents * Required. The content of the input in string format. - * We recommend the total contents to be less than 30k codepoints. - * Please use BatchTranslateText for larger text. + * We recommend the total content be less than 30k codepoints. + * Use BatchTranslateText for larger text. * @param {string} request.targetLanguageCode * Required. The BCP-47 language code to use for translation of the input * text, set to one of the language codes listed in Language Support. * @param {string} [request.mimeType] * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type is assumed to be "text/html". + * "text/plain". If left blank, the MIME type defaults to "text/html". * @param {string} [request.sourceLanguageCode] * Optional. The BCP-47 language code of the input text if * known, for example, "en-US" or "sr-Latn". Supported language codes are * listed in Language Support. If the source language isn't specified, the API * attempts to identify the source language automatically and returns the - * the source language within the response. + * source language within the response. * @param {string} [request.parent] - * Optional. Only used when making regionalized call. - * Format: - * projects/{project-id}/locations/{location-id}. + * Required. Location to make a regional or global call. + * + * Format: `projects/{project-id}/locations/{location-id}`. * - * Only custom model/glossary within the same location-id can be used. - * Otherwise 400 is returned. + * For global calls, use `projects/{project-id}/locations/global`. + * + * Models and glossaries must be within the same region (have same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. * @param {string} [request.model] * Optional. The `model` type requested for this translation. * - * The format depends on model type: - * 1. Custom models: - * projects/{project-id}/locations/{location-id}/models/{model-id}. - * 2. General (built-in) models: - * projects/{project-id}/locations/{location-id}/models/general/nmt - * projects/{project-id}/locations/{location-id}/models/general/base + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-id}/locations/{location-id}/models/general/base` + * * - * For global (non-regionalized) requests, use {location-id} 'global'. + * For global (non-regionalized) requests, use `location-id` `global`. * For example, - * projects/{project-id}/locations/global/models/general/nmt + * `projects/{project-id}/locations/global/models/general/nmt`. * * If missing, the system decides which google base model to use. * @param {Object} [request.glossaryConfig] - * Optional. Glossary to be applied. The glossary needs to be in the same - * region as the model, otherwise an INVALID_ARGUMENT error is returned. + * Optional. Glossary to be applied. The glossary must be + * within the same region (have the same location-id) as the model, otherwise + * an INVALID_ARGUMENT (400) error is returned. * * This object should have the same structure as [TranslateTextGlossaryConfig]{@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} * @param {Object} [options] @@ -379,21 +385,29 @@ class TranslationServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} [request.parent] - * Optional. Only used when making regionalized call. - * Format: - * projects/{project-id}/locations/{location-id}. + * Required. Location to make a regional or global call. + * + * Format: `projects/{project-id}/locations/{location-id}`. * - * Only custom model within the same location-id can be used. - * Otherwise 400 is returned. + * For global calls, use `projects/{project-id}/locations/global`. + * + * Only models within the same region (has same location-id) can be used. + * Otherwise an INVALID_ARGUMENT (400) error is returned. * @param {string} [request.model] * Optional. The language detection model to be used. - * projects/{project-id}/locations/{location-id}/models/language-detection/{model-id} - * If not specified, default will be used. + * + * Format: + * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` + * + * Only one language detection model is currently supported: + * `projects/{project-id}/locations/{location-id}/models/language-detection/default`. + * + * If not specified, the default model is used. * @param {string} [request.content] * The content of the input stored as a string. * @param {string} [request.mimeType] * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type is assumed to be "text/html". + * "text/plain". If left blank, the MIME type defaults to "text/html". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -446,26 +460,33 @@ class TranslationServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} [request.parent] - * Optional. Used for making regionalized calls. - * Format: projects/{project-id}/locations/{location-id}. - * For global calls, use projects/{project-id}/locations/global. - * If missing, the call is treated as a global call. + * Required. Location to make a regional or global call. * - * Only custom model within the same location-id can be used. - * Otherwise 400 is returned. + * Format: `projects/{project-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-id}/locations/global`. + * + * Only models within the same region (have same location-id) can be used, + * otherwise an INVALID_ARGUMENT (400) error is returned. * @param {string} [request.displayLanguageCode] * Optional. The language to use to return localized, human readable names - * of supported languages. If missing, default language is ENGLISH. + * of supported languages. If missing, then display names are not returned + * in a response. * @param {string} [request.model] * Optional. Get supported languages of this model. + * * The format depends on model type: - * 1. Custom models: - * projects/{project-id}/locations/{location-id}/models/{model-id}. - * 2. General (built-in) models: - * projects/{project-id}/locations/{location-id}/models/general/nmt - * projects/{project-id}/locations/{location-id}/models/general/base + * + * - AutoML Translation models: + * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-id}/locations/{location-id}/models/general/base` + * + * * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general NMT model. + * If missing, we get supported languages of Google general base (PBMT) model. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -545,26 +566,32 @@ class TranslationServiceClient { * * This object should have the same structure as [OutputConfig]{@link google.cloud.translation.v3beta1.OutputConfig} * @param {string} [request.parent] - * Optional. Only used when making regionalized call. - * Format: - * projects/{project-id}/locations/{location-id}. + * Required. Location to make a regional call. + * + * Format: `projects/{project-id}/locations/{location-id}`. + * + * The `global` location is not supported for batch translation. * - * Only custom models/glossaries within the same location-id can be used. - * Otherwise 400 is returned. + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. * @param {Object.} [request.models] * Optional. The models to use for translation. Map's key is target language * code. Map's value is model name. Value can be a built-in general model, - * or a custom model built by AutoML. + * or an AutoML Translation model. * * The value format depends on model type: - * 1. Custom models: - * projects/{project-id}/locations/{location-id}/models/{model-id}. - * 2. General (built-in) models: - * projects/{project-id}/locations/{location-id}/models/general/nmt - * projects/{project-id}/locations/{location-id}/models/general/base + * + * - AutoML Translation models: + * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-id}/locations/{location-id}/models/general/base` + * * * If the map is empty or a specific model is - * not requested for a language pair, then default google model is used. + * not requested for a language pair, then default google model (nmt) is used. * @param {Object.} [request.glossaries] * Optional. Glossaries to be applied for translation. * It's keyed by target language code. @@ -818,7 +845,7 @@ class TranslationServiceClient { * resources in a page. * @param {string} [request.filter] * Optional. Filter specifying constraints of a list operation. - * For example, `tags.glossary_name="products*"`. + * Filtering is not supported yet, and the parameter currently has no effect. * If missing, no filtering is performed. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, @@ -929,7 +956,7 @@ class TranslationServiceClient { * resources in a page. * @param {string} [request.filter] * Optional. Filter specifying constraints of a list operation. - * For example, `tags.glossary_name="products*"`. + * Filtering is not supported yet, and the parameter currently has no effect. * If missing, no filtering is performed. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index b93e5ee0d80..96edf5c6976 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-07T11:25:18.096311Z", + "updateTime": "2019-06-08T11:23:51.226917Z", "sources": [ { "generator": { "name": "artman", - "version": "0.23.1", - "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0" + "version": "0.24.0", + "dockerImage": "googleapis/artman@sha256:ce425884865f57f18307e597bca1a74a3619b7098688d4995261f3ffb3488681" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "15fdbe57306e3a56069af5e2595e9b1bb33b6123", - "internalRef": "251960694" + "sha": "a12347ec47a7f3d18e35f2effc4295c0b0983213", + "internalRef": "252108410" } }, { From d2ee31f4d3bc373216ea7912cfe8aa7cd1c346ad Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 11 Jun 2019 10:00:00 -0700 Subject: [PATCH 249/513] fix(deps): update dependency teeny-request to v4 (#292) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 0386b4a048d..1d18615ee1a 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -55,7 +55,7 @@ "is-html": "^2.0.0", "lodash.merge": "^4.6.1", "protobufjs": "^6.8.8", - "teeny-request": "^3.4.0" + "teeny-request": "^4.0.0" }, "devDependencies": { "@types/extend": "^3.0.0", From d437a378ba2e0cba758ea781edb6b667f9b7cb96 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 12 Jun 2019 08:07:23 -0700 Subject: [PATCH 250/513] docs: update return type in jsdoc for Buffers (#293) --- .../src/v3beta1/doc/google/protobuf/doc_any.js | 2 +- packages/google-cloud-translate/synth.metadata | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js index 9ff5d007807..cdd2fc80e49 100644 --- a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js @@ -125,7 +125,7 @@ * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. * - * @property {string} value + * @property {Buffer} value * Must be a valid serialized protocol buffer of the above specified type. * * @typedef Any diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 96edf5c6976..d2f711e11fd 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-08T11:23:51.226917Z", + "updateTime": "2019-06-12T11:26:48.631298Z", "sources": [ { "generator": { "name": "artman", - "version": "0.24.0", - "dockerImage": "googleapis/artman@sha256:ce425884865f57f18307e597bca1a74a3619b7098688d4995261f3ffb3488681" + "version": "0.24.1", + "dockerImage": "googleapis/artman@sha256:6018498e15310260dc9b03c9d576608908ed9fbabe42e1494ff3d827fea27b19" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a12347ec47a7f3d18e35f2effc4295c0b0983213", - "internalRef": "252108410" + "sha": "f117dac435e96ebe58d85280a3faf2350c4d4219", + "internalRef": "252714985" } }, { From 8e0a846ee8e65bbac4680f7dedafa201b58eb84b Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 13 Jun 2019 07:22:17 -0700 Subject: [PATCH 251/513] fix(docs): move to new client docs URL (#294) --- packages/google-cloud-translate/.repo-metadata.json | 4 ++-- packages/google-cloud-translate/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/.repo-metadata.json b/packages/google-cloud-translate/.repo-metadata.json index 75cc91f75b7..580ea4a1cc3 100644 --- a/packages/google-cloud-translate/.repo-metadata.json +++ b/packages/google-cloud-translate/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "translate", "name_pretty": "Cloud Translation", "product_documentation": "https://cloud.google.com/translate/docs/", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/translate/latest/", + "client_documentation": "https://googleapis.dev/nodejs/translate/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/559749", "release_level": "ga", "language": "nodejs", @@ -10,4 +10,4 @@ "distribution_name": "@google-cloud/translate", "api_id": "translate.googleapis.com", "requires_billing": true -} +} \ No newline at end of file diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 9d07e4525b0..59c5742ccda 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -126,7 +126,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-translate/blob/master/LICENSE) -[client-docs]: https://cloud.google.com/nodejs/docs/reference/translate/latest/ +[client-docs]: https://googleapis.dev/nodejs/translate/latest [product-docs]: https://cloud.google.com/translate/docs/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 5f1998328a58c03aa52c3d2accd18a376ed33b74 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 14 Jun 2019 07:43:47 -0700 Subject: [PATCH 252/513] chore: release 4.1.0 (#295) * updated CHANGELOG.md * updated package.json * updated samples/package.json --- packages/google-cloud-translate/CHANGELOG.md | 16 ++++++++++++++++ packages/google-cloud-translate/package.json | 2 +- .../google-cloud-translate/samples/package.json | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index f586efde77c..900afb23c4b 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,22 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [4.1.0](https://www.github.com/googleapis/nodejs-translate/compare/v4.0.1...v4.1.0) (2019-06-14) + + +### Bug Fixes + +* **deps:** update dependency is-html to v2 ([#280](https://www.github.com/googleapis/nodejs-translate/issues/280)) ([00187c9](https://www.github.com/googleapis/nodejs-translate/commit/00187c9)) +* **deps:** update dependency teeny-request to v4 ([#292](https://www.github.com/googleapis/nodejs-translate/issues/292)) ([5d608f2](https://www.github.com/googleapis/nodejs-translate/commit/5d608f2)) +* **docs:** move to new client docs URL ([#294](https://www.github.com/googleapis/nodejs-translate/issues/294)) ([ecb6cab](https://www.github.com/googleapis/nodejs-translate/commit/ecb6cab)) +* **types:** use Metadata types for apiResponse ([#277](https://www.github.com/googleapis/nodejs-translate/issues/277)) ([cf7899f](https://www.github.com/googleapis/nodejs-translate/commit/cf7899f)) + + +### Features + +* support apiEndpoint override ([#285](https://www.github.com/googleapis/nodejs-translate/issues/285)) ([dc8fe12](https://www.github.com/googleapis/nodejs-translate/commit/dc8fe12)) +* support apiEndpoint override in client constructor ([#289](https://www.github.com/googleapis/nodejs-translate/issues/289)) ([35f1229](https://www.github.com/googleapis/nodejs-translate/commit/35f1229)) + ### [4.0.1](https://www.github.com/googleapis/nodejs-translate/compare/v4.0.0...v4.0.1) (2019-05-20) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 1d18615ee1a..3b54e2da48e 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "4.0.1", + "version": "4.1.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 5300b63bf51..9079f00b095 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@google-cloud/automl": "^1.0.0", - "@google-cloud/translate": "^4.0.1", + "@google-cloud/translate": "^4.1.0", "yargs": "^13.0.0" }, "devDependencies": { From 33e8cc49ef9fa13b77d7c9ec56afd43cf5974b49 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 18 Jun 2019 13:16:59 -0700 Subject: [PATCH 253/513] build: switch to GitHub magic proxy, for release-please (#297) --- packages/google-cloud-translate/synth.metadata | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index d2f711e11fd..d2c41145dc2 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-12T11:26:48.631298Z", + "updateTime": "2019-06-18T01:05:53.990731Z", "sources": [ { "generator": { "name": "artman", - "version": "0.24.1", - "dockerImage": "googleapis/artman@sha256:6018498e15310260dc9b03c9d576608908ed9fbabe42e1494ff3d827fea27b19" + "version": "0.26.0", + "dockerImage": "googleapis/artman@sha256:6db0735b0d3beec5b887153a2a7c7411fc7bb53f73f6f389a822096bd14a3a15" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f117dac435e96ebe58d85280a3faf2350c4d4219", - "internalRef": "252714985" + "sha": "384aa843867c4d17756d14a01f047b6368494d32", + "internalRef": "253675319" } }, { From 082d8e95f35ed40dd28e658dad99e280bb37f35d Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 25 Jun 2019 16:42:37 -0700 Subject: [PATCH 254/513] fix(docs): link to reference docs section on googleapis.dev (#298) * fix(docs): reference docs should link to section of googleapis.dev with API reference * fix(docs): make anchors work in jsdoc --- packages/google-cloud-translate/.jsdoc.js | 3 +++ packages/google-cloud-translate/README.md | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index bf11f3f28b1..725c1a98054 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -41,5 +41,8 @@ module.exports = { sourceFiles: false, systemName: '@google-cloud/translate', theme: 'lumen' + }, + markdown: { + idInHeadings: true } }; diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 59c5742ccda..fa71e562211 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -126,10 +126,12 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-translate/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/translate/latest +[client-docs]: https://googleapis.dev/nodejs/translate/latest#reference [product-docs]: https://cloud.google.com/translate/docs/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=translate.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file +[auth]: https://cloud.google.com/docs/authentication/getting-started + + From 4d05c510e7accf0f4cd6dfb2a769e626fc25b08a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 28 Jun 2019 10:07:45 -0700 Subject: [PATCH 255/513] build: use config file for linkinator (#300) --- packages/google-cloud-translate/linkinator.config.json | 7 +++++++ packages/google-cloud-translate/package.json | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-translate/linkinator.config.json diff --git a/packages/google-cloud-translate/linkinator.config.json b/packages/google-cloud-translate/linkinator.config.json new file mode 100644 index 00000000000..d780d6bfff5 --- /dev/null +++ b/packages/google-cloud-translate/linkinator.config.json @@ -0,0 +1,7 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com" + ] +} diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 3b54e2da48e..87403424b23 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -42,7 +42,7 @@ "prepare": "npm run compile", "pretest": "npm run compile", "presystem-test": "npm run compile", - "docs-test": "linkinator docs -r --skip www.googleapis.com", + "docs-test": "linkinator docs", "predocs-test": "npm run docs" }, "dependencies": { @@ -73,7 +73,7 @@ "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-baseline": "^0.1.0", - "linkinator": "^1.1.2", + "linkinator": "^1.5.0", "mocha": "^6.1.4", "nyc": "^14.0.0", "power-assert": "^1.6.0", From 5fd40bd05fab117248d5ab7a38c0c78c2d7f2d50 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 29 Jun 2019 14:37:12 -0700 Subject: [PATCH 256/513] chore: release 4.1.1 (#299) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 900afb23c4b..b54b37438b6 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [4.1.1](https://www.github.com/googleapis/nodejs-translate/compare/v4.1.0...v4.1.1) (2019-06-29) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#298](https://www.github.com/googleapis/nodejs-translate/issues/298)) ([d49a68e](https://www.github.com/googleapis/nodejs-translate/commit/d49a68e)) + ## [4.1.0](https://www.github.com/googleapis/nodejs-translate/compare/v4.0.1...v4.1.0) (2019-06-14) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 87403424b23..0caf31a27d0 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "4.1.0", + "version": "4.1.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 9079f00b095..1d6efd01bc9 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@google-cloud/automl": "^1.0.0", - "@google-cloud/translate": "^4.1.0", + "@google-cloud/translate": "^4.1.1", "yargs": "^13.0.0" }, "devDependencies": { From 481481ed285216f16eafa9707b74e8926fb3cb4e Mon Sep 17 00:00:00 2001 From: Cyd La Luz Date: Tue, 23 Jul 2019 13:36:41 -0700 Subject: [PATCH 257/513] fix(deps): drop unused dependency lodash.merge, related to sec vulnerability (fixes #301) (#302) --- packages/google-cloud-translate/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 0caf31a27d0..af081de70a3 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -53,7 +53,6 @@ "google-gax": "^1.0.0", "is": "^3.2.1", "is-html": "^2.0.0", - "lodash.merge": "^4.6.1", "protobufjs": "^6.8.8", "teeny-request": "^4.0.0" }, From 01da5041d3910006fd993a5096c2bf7cd0712c69 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 23 Jul 2019 13:49:39 -0700 Subject: [PATCH 258/513] chore: release 4.1.2 (#303) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index b54b37438b6..87a26b2e3a4 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [4.1.2](https://www.github.com/googleapis/nodejs-translate/compare/v4.1.1...v4.1.2) (2019-07-23) + + +### Bug Fixes + +* **deps:** drop unused dependency lodash.merge, related to sec vulnerability (fixes [#301](https://www.github.com/googleapis/nodejs-translate/issues/301)) ([#302](https://www.github.com/googleapis/nodejs-translate/issues/302)) ([018efd4](https://www.github.com/googleapis/nodejs-translate/commit/018efd4)) + ### [4.1.1](https://www.github.com/googleapis/nodejs-translate/compare/v4.1.0...v4.1.1) (2019-06-29) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index af081de70a3..79f2ae91b14 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "4.1.1", + "version": "4.1.2", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 1d6efd01bc9..db974b547dd 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@google-cloud/automl": "^1.0.0", - "@google-cloud/translate": "^4.1.1", + "@google-cloud/translate": "^4.1.2", "yargs": "^13.0.0" }, "devDependencies": { From 4c919a34f3f9f28462b05b79751d6bb3f082730a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 26 Jul 2019 19:00:09 +0300 Subject: [PATCH 259/513] chore(deps): update linters (#305) --- packages/google-cloud-translate/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 79f2ae91b14..2feb9c41ea4 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -64,8 +64,8 @@ "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", "codecov": "^3.0.2", - "eslint": "^5.0.0", - "eslint-config-prettier": "^4.0.0", + "eslint": "^6.0.0", + "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", "gts": "^1.0.0", From f23ee5afecb3409aec108d74193c13733d65751f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 26 Jul 2019 20:44:45 +0300 Subject: [PATCH 260/513] chore(deps): update dependency @google-cloud/storage to v3 (#304) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index db974b547dd..3c43b0495f4 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "chai": "^4.2.0", - "@google-cloud/storage": "^2.4.3", + "@google-cloud/storage": "^3.0.0", "mocha": "^6.0.0", "uuid": "^3.3.2" } From d0caf91d174e69200fe0b3d13b30f6e813dfa47d Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 31 Jul 2019 09:01:25 -0700 Subject: [PATCH 261/513] docs: use the jsdoc-fresh theme (#307) --- packages/google-cloud-translate/.jsdoc.js | 2 +- packages/google-cloud-translate/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index 725c1a98054..64ae6681f8e 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -20,7 +20,7 @@ module.exports = { opts: { readme: './README.md', package: './package.json', - template: './node_modules/jsdoc-baseline', + template: './node_modules/jsdoc-fresh', recurse: true, verbose: true, destination: './docs/' diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 2feb9c41ea4..2229cc2e9d7 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -71,7 +71,7 @@ "gts": "^1.0.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", - "jsdoc-baseline": "^0.1.0", + "jsdoc-fresh": "^1.0.1", "linkinator": "^1.5.0", "mocha": "^6.1.4", "nyc": "^14.0.0", From 4b2d675d3d97ed5b1c6cbdeb78a25bb5e3ac24ab Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 31 Jul 2019 16:07:09 -0700 Subject: [PATCH 262/513] docs: document apiEndpoint over servicePath (#308) --- .../src/v3beta1/translation_service_client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js index 1237e06686c..421927823b6 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js @@ -52,7 +52,7 @@ class TranslationServiceClient { * your project ID will be detected automatically. * @param {function} [options.promise] - Custom promise module to use instead * of native Promises. - * @param {string} [options.servicePath] - The domain name of the + * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ constructor(opts) { From 3864672679e819c5f88cdb22233abd5781bd12c6 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 1 Aug 2019 11:37:35 -0700 Subject: [PATCH 263/513] chore(deps): drop unused teeny dependency (#312) --- packages/google-cloud-translate/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 2229cc2e9d7..07e7762ca8e 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -53,8 +53,7 @@ "google-gax": "^1.0.0", "is": "^3.2.1", "is-html": "^2.0.0", - "protobufjs": "^6.8.8", - "teeny-request": "^4.0.0" + "protobufjs": "^6.8.8" }, "devDependencies": { "@types/extend": "^3.0.0", From 5dae66f7d9c4eb0c3c99cb6264a85932a418318a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 2 Aug 2019 15:31:30 -0700 Subject: [PATCH 264/513] fix: allow calls with no request, add JSON proto (#313) --- .../google-cloud-translate/protos/protos.json | 1926 +++++++++++++++++ .../src/service_proto_list.json | 1 + .../src/v3beta1/translation_service_client.js | 8 + .../google-cloud-translate/synth.metadata | 10 +- 4 files changed, 1940 insertions(+), 5 deletions(-) create mode 100644 packages/google-cloud-translate/protos/protos.json create mode 100644 packages/google-cloud-translate/src/service_proto_list.json diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json new file mode 100644 index 00000000000..e244d263390 --- /dev/null +++ b/packages/google-cloud-translate/protos/protos.json @@ -0,0 +1,1926 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "translation": { + "nested": { + "v3beta1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Translate.V3Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/translate/v3beta1;translate", + "java_multiple_files": true, + "java_outer_classname": "TranslationServiceProto", + "java_package": "com.google.cloud.translate.v3beta1", + "php_namespace": "Google\\Cloud\\Translate\\V3beta1", + "ruby_package": "Google::Cloud::Translate::V3beta1" + }, + "nested": { + "TranslationService": { + "options": { + "(google.api.default_host)": "translation.googleapis.com" + }, + "methods": { + "TranslateText": { + "requestType": "TranslateTextRequest", + "responseType": "TranslateTextResponse", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}:translateText", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v3beta1/{parent=projects/*}:translateText", + "(google.api.http).additional_bindings.body": "*" + } + }, + "DetectLanguage": { + "requestType": "DetectLanguageRequest", + "responseType": "DetectLanguageResponse", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}:detectLanguage", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v3beta1/{parent=projects/*}:detectLanguage", + "(google.api.http).additional_bindings.body": "*" + } + }, + "GetSupportedLanguages": { + "requestType": "GetSupportedLanguagesRequest", + "responseType": "SupportedLanguages", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*}/supportedLanguages", + "(google.api.http).additional_bindings.get": "/v3beta1/{parent=projects/*}/supportedLanguages" + } + }, + "BatchTranslateText": { + "requestType": "BatchTranslateTextRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}:batchTranslateText", + "(google.api.http).body": "*" + } + }, + "CreateGlossary": { + "requestType": "CreateGlossaryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}/glossaries", + "(google.api.http).body": "glossary" + } + }, + "ListGlossaries": { + "requestType": "ListGlossariesRequest", + "responseType": "ListGlossariesResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*}/glossaries" + } + }, + "GetGlossary": { + "requestType": "GetGlossaryRequest", + "responseType": "Glossary", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/glossaries/*}" + } + }, + "DeleteGlossary": { + "requestType": "DeleteGlossaryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/glossaries/*}" + } + } + } + }, + "TranslateTextGlossaryConfig": { + "fields": { + "glossary": { + "type": "string", + "id": 1 + }, + "ignoreCase": { + "type": "bool", + "id": 2 + } + } + }, + "TranslateTextRequest": { + "fields": { + "contents": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 3 + }, + "sourceLanguageCode": { + "type": "string", + "id": 4 + }, + "targetLanguageCode": { + "type": "string", + "id": 5 + }, + "parent": { + "type": "string", + "id": 8 + }, + "model": { + "type": "string", + "id": 6 + }, + "glossaryConfig": { + "type": "TranslateTextGlossaryConfig", + "id": 7 + } + } + }, + "TranslateTextResponse": { + "fields": { + "translations": { + "rule": "repeated", + "type": "Translation", + "id": 1 + }, + "glossaryTranslations": { + "rule": "repeated", + "type": "Translation", + "id": 3 + } + } + }, + "Translation": { + "fields": { + "translatedText": { + "type": "string", + "id": 1 + }, + "model": { + "type": "string", + "id": 2 + }, + "detectedLanguageCode": { + "type": "string", + "id": 4 + }, + "glossaryConfig": { + "type": "TranslateTextGlossaryConfig", + "id": 3 + } + } + }, + "DetectLanguageRequest": { + "oneofs": { + "source": { + "oneof": [ + "content" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 5 + }, + "model": { + "type": "string", + "id": 4 + }, + "content": { + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 3 + } + } + }, + "DetectedLanguage": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "DetectLanguageResponse": { + "fields": { + "languages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 1 + } + } + }, + "GetSupportedLanguagesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 3 + }, + "displayLanguageCode": { + "type": "string", + "id": 1 + }, + "model": { + "type": "string", + "id": 2 + } + } + }, + "SupportedLanguages": { + "fields": { + "languages": { + "rule": "repeated", + "type": "SupportedLanguage", + "id": 1 + } + } + }, + "SupportedLanguage": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "supportSource": { + "type": "bool", + "id": 3 + }, + "supportTarget": { + "type": "bool", + "id": 4 + } + } + }, + "GcsSource": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + } + } + }, + "InputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "mimeType": { + "type": "string", + "id": 1 + }, + "gcsSource": { + "type": "GcsSource", + "id": 2 + } + } + }, + "GcsDestination": { + "fields": { + "outputUriPrefix": { + "type": "string", + "id": 1 + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + } + } + }, + "BatchTranslateTextRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "sourceLanguageCode": { + "type": "string", + "id": 2 + }, + "targetLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "models": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "inputConfigs": { + "rule": "repeated", + "type": "InputConfig", + "id": 5 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 6 + }, + "glossaries": { + "keyType": "string", + "type": "TranslateTextGlossaryConfig", + "id": 7 + } + } + }, + "BatchTranslateMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "translatedCharacters": { + "type": "int64", + "id": 2 + }, + "failedCharacters": { + "type": "int64", + "id": 3 + }, + "totalCharacters": { + "type": "int64", + "id": 4 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "SUCCEEDED": 2, + "FAILED": 3, + "CANCELLING": 4, + "CANCELLED": 5 + } + } + } + }, + "BatchTranslateResponse": { + "fields": { + "totalCharacters": { + "type": "int64", + "id": 1 + }, + "translatedCharacters": { + "type": "int64", + "id": 2 + }, + "failedCharacters": { + "type": "int64", + "id": 3 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "GlossaryInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + } + } + }, + "Glossary": { + "oneofs": { + "languages": { + "oneof": [ + "languagePair", + "languageCodesSet" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "languagePair": { + "type": "LanguageCodePair", + "id": 3 + }, + "languageCodesSet": { + "type": "LanguageCodesSet", + "id": 4 + }, + "inputConfig": { + "type": "GlossaryInputConfig", + "id": 5 + }, + "entryCount": { + "type": "int32", + "id": 6 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + } + }, + "nested": { + "LanguageCodePair": { + "fields": { + "sourceLanguageCode": { + "type": "string", + "id": 1 + }, + "targetLanguageCode": { + "type": "string", + "id": 2 + } + } + }, + "LanguageCodesSet": { + "fields": { + "languageCodes": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "CreateGlossaryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "glossary": { + "type": "Glossary", + "id": 2 + } + } + }, + "GetGlossaryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteGlossaryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListGlossariesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListGlossariesResponse": { + "fields": { + "glossaries": { + "rule": "repeated", + "type": "Glossary", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateGlossaryMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "state": { + "type": "State", + "id": 2 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "SUCCEEDED": 2, + "FAILED": 3, + "CANCELLING": 4, + "CANCELLED": 5 + } + } + } + }, + "DeleteGlossaryMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "state": { + "type": "State", + "id": 2 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "SUCCEEDED": 2, + "FAILED": 3, + "CANCELLING": 4, + "CANCELLED": 5 + } + } + } + }, + "DeleteGlossaryResponse": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "protobuf": { + "options": { + "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": false + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}" + } + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}" + } + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}" + } + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*" + } + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-translate/src/service_proto_list.json b/packages/google-cloud-translate/src/service_proto_list.json new file mode 100644 index 00000000000..8702c148be3 --- /dev/null +++ b/packages/google-cloud-translate/src/service_proto_list.json @@ -0,0 +1 @@ +["../protos/google/cloud/translate/v3beta1/translation_service.proto"] \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js index 421927823b6..d4c4fde45f3 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js @@ -367,6 +367,7 @@ class TranslationServiceClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -442,6 +443,7 @@ class TranslationServiceClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -521,6 +523,7 @@ class TranslationServiceClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -700,6 +703,7 @@ class TranslationServiceClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -817,6 +821,7 @@ class TranslationServiceClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -919,6 +924,7 @@ class TranslationServiceClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -1032,6 +1038,7 @@ class TranslationServiceClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -1131,6 +1138,7 @@ class TranslationServiceClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index d2c41145dc2..d3e8bb02dc1 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-18T01:05:53.990731Z", + "updateTime": "2019-08-02T11:29:03.380641Z", "sources": [ { "generator": { "name": "artman", - "version": "0.26.0", - "dockerImage": "googleapis/artman@sha256:6db0735b0d3beec5b887153a2a7c7411fc7bb53f73f6f389a822096bd14a3a15" + "version": "0.32.0", + "dockerImage": "googleapis/artman@sha256:6929f343c400122d85818195b18613330a12a014bffc1e08499550d40571479d" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "384aa843867c4d17756d14a01f047b6368494d32", - "internalRef": "253675319" + "sha": "3a40d3a5f5e5a33fd49888a8a33ed021f65c0ccf", + "internalRef": "261297518" } }, { From 1ab232763e031984a62bc5880158dc7b03e22e41 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 5 Aug 2019 10:00:59 -0700 Subject: [PATCH 265/513] chore: release 4.1.3 (#315) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 87a26b2e3a4..d8c928ce503 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [4.1.3](https://www.github.com/googleapis/nodejs-translate/compare/v4.1.2...v4.1.3) (2019-08-05) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([#313](https://www.github.com/googleapis/nodejs-translate/issues/313)) ([01afc09](https://www.github.com/googleapis/nodejs-translate/commit/01afc09)) + ### [4.1.2](https://www.github.com/googleapis/nodejs-translate/compare/v4.1.1...v4.1.2) (2019-07-23) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 07e7762ca8e..934ec318181 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "4.1.2", + "version": "4.1.3", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 3c43b0495f4..b923a7a99d6 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@google-cloud/automl": "^1.0.0", - "@google-cloud/translate": "^4.1.2", + "@google-cloud/translate": "^4.1.3", "yargs": "^13.0.0" }, "devDependencies": { From ea9911b952464a8cab28b046787f8b39394a9eec Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sat, 17 Aug 2019 13:43:37 -0700 Subject: [PATCH 266/513] fix(deps): use the latest extend (#316) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 934ec318181..3f8cd83597e 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -49,7 +49,7 @@ "@google-cloud/common": "^2.0.0", "@google-cloud/promisify": "^1.0.0", "arrify": "^2.0.0", - "extend": "^3.0.1", + "extend": "^3.0.2", "google-gax": "^1.0.0", "is": "^3.2.1", "is-html": "^2.0.0", From 7f5b10142cddfb1f458b686e8648af7820e9d1fd Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 20 Aug 2019 20:23:27 +0300 Subject: [PATCH 267/513] fix(deps): update dependency yargs to v14 --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index b923a7a99d6..a6c5cfba5c2 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -14,7 +14,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/translate": "^4.1.3", - "yargs": "^13.0.0" + "yargs": "^14.0.0" }, "devDependencies": { "chai": "^4.2.0", From ab3b611af522eed12b366ee26a6e11b7dcf1677b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Aug 2019 13:02:33 -0700 Subject: [PATCH 268/513] fix: use correct version for x-goog-api-client header --- .../src/v3beta1/translation_service_client.js | 2 +- packages/google-cloud-translate/synth.metadata | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js index d4c4fde45f3..9d6ea8e2576 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js @@ -82,7 +82,7 @@ class TranslationServiceClient { // Determine the client header string. const clientHeader = [ - `gl-node/${process.version}`, + `gl-node/${process.versions.node}`, `grpc/${gaxGrpc.grpcVersion}`, `gax/${gax.version}`, `gapic/${VERSION}`, diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index d3e8bb02dc1..ccc628eb36f 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-02T11:29:03.380641Z", + "updateTime": "2019-08-21T11:25:42.073188Z", "sources": [ { "generator": { "name": "artman", - "version": "0.32.0", - "dockerImage": "googleapis/artman@sha256:6929f343c400122d85818195b18613330a12a014bffc1e08499550d40571479d" + "version": "0.34.0", + "dockerImage": "googleapis/artman@sha256:38a27ba6245f96c3e86df7acb2ebcc33b4f186d9e475efe2d64303aec3d4e0ea" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3a40d3a5f5e5a33fd49888a8a33ed021f65c0ccf", - "internalRef": "261297518" + "sha": "11592a15391951348a64f5c303399733b1c5b3b2", + "internalRef": "264425502" } }, { From feeb75a63b5c13add4ff98000684a7f1b880740f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 28 Aug 2019 09:09:39 -0700 Subject: [PATCH 269/513] fix(docs): stop linking reference documents to anchor --- packages/google-cloud-translate/README.md | 4 +--- .../src/v3beta1/doc/google/protobuf/doc_timestamp.js | 10 ++++++---- packages/google-cloud-translate/synth.metadata | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index fa71e562211..95c6e96dc3e 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -126,12 +126,10 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-translate/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/translate/latest#reference +[client-docs]: https://googleapis.dev/nodejs/translate/latest [product-docs]: https://cloud.google.com/translate/docs/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=translate.googleapis.com [auth]: https://cloud.google.com/docs/authentication/getting-started - - diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js index 98c19dbf0d3..c457acc0c7d 100644 --- a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js @@ -89,11 +89,13 @@ * 01:30 UTC on January 15, 2017. * * In JavaScript, one can convert a Date object to this format using the - * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) - * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index ccc628eb36f..02bc3f82e38 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-21T11:25:42.073188Z", + "updateTime": "2019-08-28T11:23:43.481205Z", "sources": [ { "generator": { "name": "artman", - "version": "0.34.0", - "dockerImage": "googleapis/artman@sha256:38a27ba6245f96c3e86df7acb2ebcc33b4f186d9e475efe2d64303aec3d4e0ea" + "version": "0.35.1", + "dockerImage": "googleapis/artman@sha256:b11c7ea0d0831c54016fb50f4b796d24d1971439b30fbc32a369ba1ac887c384" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "11592a15391951348a64f5c303399733b1c5b3b2", - "internalRef": "264425502" + "sha": "dbd38035c35083507e2f0b839985cf17e212cb1c", + "internalRef": "265796259" } }, { From 989db7076cd18f5c4a8ffababc8bc9c27232f430 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 29 Aug 2019 18:36:08 +0300 Subject: [PATCH 270/513] chore(deps): update dependency typescript to ~3.6.0 (#321) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 3f8cd83597e..fbaea867e69 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -78,6 +78,6 @@ "prettier": "^1.13.5", "proxyquire": "^2.0.1", "source-map-support": "^0.5.6", - "typescript": "~3.5.0" + "typescript": "~3.6.0" } } From d8d32561c2655aa644dbe1116172f9db3ce2244c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 3 Sep 2019 14:05:32 -0700 Subject: [PATCH 271/513] feat: load protos from JSON, grpc-fallback support * [CHANGE ME] Re-generated to pick up changes in the API or client library generator. * fixes * fix webpack.config.js * no browser support yet --- .../src/service_proto_list.json | 1 - .../src/v3beta1/translation_service_client.js | 101 +++++++++++------- .../translation_service_proto_list.json | 3 + .../google-cloud-translate/synth.metadata | 10 +- packages/google-cloud-translate/synth.py | 3 +- .../test/gapic-v3beta1.js | 7 ++ .../google-cloud-translate/webpack.config.js | 46 ++++++++ 7 files changed, 123 insertions(+), 48 deletions(-) delete mode 100644 packages/google-cloud-translate/src/service_proto_list.json create mode 100644 packages/google-cloud-translate/src/v3beta1/translation_service_proto_list.json create mode 100644 packages/google-cloud-translate/webpack.config.js diff --git a/packages/google-cloud-translate/src/service_proto_list.json b/packages/google-cloud-translate/src/service_proto_list.json deleted file mode 100644 index 8702c148be3..00000000000 --- a/packages/google-cloud-translate/src/service_proto_list.json +++ /dev/null @@ -1 +0,0 @@ -["../protos/google/cloud/translate/v3beta1/translation_service.proto"] \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js index 9d6ea8e2576..5f062c384f9 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./translation_service_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../../package.json').version; @@ -59,6 +58,16 @@ class TranslationServiceClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -75,36 +84,51 @@ class TranslationServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/translate/v3beta1/translation_service.proto'] + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - glossaryPathTemplate: new gax.PathTemplate( + glossaryPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/glossaries/{glossary}' ), - locationPathTemplate: new gax.PathTemplate( + locationPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), }; @@ -113,28 +137,21 @@ class TranslationServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - listGlossaries: new gax.PageDescriptor( + listGlossaries: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'glossaries' ), }; - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/translate/v3beta1/translation_service.proto' - ), - protoFilesRoot - ); + + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -159,17 +176,17 @@ class TranslationServiceClient { ); this._descriptors.longrunning = { - batchTranslateText: new gax.LongrunningDescriptor( + batchTranslateText: new gaxModule.LongrunningDescriptor( this.operationsClient, batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) ), - createGlossary: new gax.LongrunningDescriptor( + createGlossary: new gaxModule.LongrunningDescriptor( this.operationsClient, createGlossaryResponse.decode.bind(createGlossaryResponse), createGlossaryMetadata.decode.bind(createGlossaryMetadata) ), - deleteGlossary: new gax.LongrunningDescriptor( + deleteGlossary: new gaxModule.LongrunningDescriptor( this.operationsClient, deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata) @@ -192,7 +209,11 @@ class TranslationServiceClient { // Put together the "service stub" for // google.cloud.translation.v3beta1.TranslationService. const translationServiceStub = gaxGrpc.createStub( - protos.google.cloud.translation.v3beta1.TranslationService, + opts.fallback + ? protos.lookupService( + 'google.cloud.translation.v3beta1.TranslationService' + ) + : protos.google.cloud.translation.v3beta1.TranslationService, opts ); @@ -209,18 +230,16 @@ class TranslationServiceClient { 'deleteGlossary', ]; for (const methodName of translationServiceStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - translationServiceStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = translationServiceStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.page[methodName] || this._descriptors.longrunning[methodName] diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_proto_list.json b/packages/google-cloud-translate/src/v3beta1/translation_service_proto_list.json new file mode 100644 index 00000000000..a50dcfc7d4f --- /dev/null +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/translate/v3beta1/translation_service.proto" +] diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 02bc3f82e38..cf33b52f17b 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-28T11:23:43.481205Z", + "updateTime": "2019-08-31T11:21:47.616048Z", "sources": [ { "generator": { "name": "artman", - "version": "0.35.1", - "dockerImage": "googleapis/artman@sha256:b11c7ea0d0831c54016fb50f4b796d24d1971439b30fbc32a369ba1ac887c384" + "version": "0.36.1", + "dockerImage": "googleapis/artman@sha256:7c20f006c7a62d9d782e2665647d52290c37a952ef3cd134624d5dd62b3f71bd" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dbd38035c35083507e2f0b839985cf17e212cb1c", - "internalRef": "265796259" + "sha": "82809578652607c8ee29d9e199c21f28f81a03e0", + "internalRef": "266247326" } }, { diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py index 12951621106..ef762fb6e71 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/synth.py @@ -24,7 +24,8 @@ versions = ['v3beta1'] for version in versions: library = gapic.node_library('translate', version) - s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) + s.copy(library, excludes=['src/index.js', 'src/browser.js', 'README.md', 'package.json']) +# note: no browser.js support until we fully support TypeScript # Update path discovery due to build/ dir and TypeScript conversion. s.replace("src/v3beta1/translation_service_client.js", "../../package.json", "../../../package.json") diff --git a/packages/google-cloud-translate/test/gapic-v3beta1.js b/packages/google-cloud-translate/test/gapic-v3beta1.js index c1332cb8588..4a93ded58d7 100644 --- a/packages/google-cloud-translate/test/gapic-v3beta1.js +++ b/packages/google-cloud-translate/test/gapic-v3beta1.js @@ -46,6 +46,13 @@ describe('TranslationServiceClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new translateModule.v3beta1.TranslationServiceClient({ + fallback: true, + }); + assert(client); + }); + describe('translateText', () => { it('invokes translateText without error', done => { const client = new translateModule.v3beta1.TranslationServiceClient({ diff --git a/packages/google-cloud-translate/webpack.config.js b/packages/google-cloud-translate/webpack.config.js new file mode 100644 index 00000000000..7eeb99c5e5b --- /dev/null +++ b/packages/google-cloud-translate/webpack.config.js @@ -0,0 +1,46 @@ +// Copyright 2019 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 +// +// https://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. + +module.exports = { + entry: './src/browser.js', + output: { + library: 'translate', + filename: './translate.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + extensions: ['.js', '.json'], + }, + module: { + rules: [ + { + test: /node_modules[\\/]retry-request[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https-proxy-agent[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken[\\/]/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; From b3f11fbaa32bd5a490298c1cf0ee5cd762cad4f9 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 5 Sep 2019 21:42:08 +0300 Subject: [PATCH 272/513] chore(deps): update dependency eslint-plugin-node to v10 (#325) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index fbaea867e69..f2be04272af 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -65,7 +65,7 @@ "codecov": "^3.0.2", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^9.0.0", + "eslint-plugin-node": "^10.0.0", "eslint-plugin-prettier": "^3.0.0", "gts": "^1.0.0", "intelli-espower-loader": "^1.0.1", From ac2cb08704083d34762fc4ece05c0e2c775e6df9 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 6 Sep 2019 18:40:50 -0400 Subject: [PATCH 273/513] update .nycrc ignore rules (#326) --- packages/google-cloud-translate/.nycrc | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-translate/.nycrc b/packages/google-cloud-translate/.nycrc index 83a421a0628..23e322204ec 100644 --- a/packages/google-cloud-translate/.nycrc +++ b/packages/google-cloud-translate/.nycrc @@ -6,6 +6,7 @@ "**/.coverage", "**/apis", "**/benchmark", + "**/conformance", "**/docs", "**/samples", "**/scripts", From 72e25523edd7e20877e6ff4309f1211d7eb3e7c6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 18 Sep 2019 05:01:06 -0700 Subject: [PATCH 274/513] build: switch to releasing with GitHub bot (#329) --- packages/google-cloud-translate/synth.metadata | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index cf33b52f17b..0fe94328003 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-31T11:21:47.616048Z", + "updateTime": "2019-09-18T11:32:17.166893Z", "sources": [ { "generator": { "name": "artman", - "version": "0.36.1", - "dockerImage": "googleapis/artman@sha256:7c20f006c7a62d9d782e2665647d52290c37a952ef3cd134624d5dd62b3f71bd" + "version": "0.36.3", + "dockerImage": "googleapis/artman@sha256:66ca01f27ef7dc50fbfb7743b67028115a6a8acf43b2d82f9fc826de008adac4" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "82809578652607c8ee29d9e199c21f28f81a03e0", - "internalRef": "266247326" + "sha": "4aeb1260230bbf56c9d958ff28dfb3eba019fcd0", + "internalRef": "269598918" } }, { From 29b5673ffaba52f689cd40c6050cb8c959bea3d0 Mon Sep 17 00:00:00 2001 From: Elizabeth Crowdus Date: Wed, 25 Sep 2019 14:55:43 -0500 Subject: [PATCH 275/513] feat: samples for hybrid glossaries tutorial (#327) * feat: Node.js samples for hybrid glossaries tutorial * fix: lint * fix: header * fix: adding package.json --- packages/google-cloud-translate/samples/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index a6c5cfba5c2..08b07603abf 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -13,12 +13,14 @@ }, "dependencies": { "@google-cloud/automl": "^1.0.0", + "@google-cloud/text-to-speech": "^1.1.4", "@google-cloud/translate": "^4.1.3", + "@google-cloud/vision": "^1.2.0", "yargs": "^14.0.0" }, "devDependencies": { + "@google-cloud/storage": "^3.2.1", "chai": "^4.2.0", - "@google-cloud/storage": "^3.0.0", "mocha": "^6.0.0", "uuid": "^3.3.2" } From 76dfb3db161fc41db36c05c8ba8643633719b627 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 27 Sep 2019 12:29:32 -0700 Subject: [PATCH 276/513] feat: add label support (#331) chore: add protos/ to .eslintignore feat: .d.ts for protos --- packages/google-cloud-translate/.eslintignore | 1 + packages/google-cloud-translate/README.md | 1 + .../v3beta1/translation_service.proto | 215 +- .../google-cloud-translate/protos/protos.d.ts | 8296 ++++++ .../google-cloud-translate/protos/protos.js | 20975 ++++++++++++++++ .../google-cloud-translate/protos/protos.json | 297 +- .../google-cloud-translate/samples/README.md | 18 + .../v3beta1/doc_translation_service.js | 70 +- .../src/v3beta1/translation_service_client.js | 127 +- .../translation_service_client_config.json | 2 +- .../google-cloud-translate/synth.metadata | 10 +- .../test/gapic-v3beta1.js | 38 +- 12 files changed, 29874 insertions(+), 176 deletions(-) create mode 100644 packages/google-cloud-translate/protos/protos.d.ts create mode 100644 packages/google-cloud-translate/protos/protos.js diff --git a/packages/google-cloud-translate/.eslintignore b/packages/google-cloud-translate/.eslintignore index f0c7aead4bf..09b31fe735a 100644 --- a/packages/google-cloud-translate/.eslintignore +++ b/packages/google-cloud-translate/.eslintignore @@ -2,3 +2,4 @@ src/**/doc/* build/ docs/ +protos/ diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 95c6e96dc3e..a7cc11142e3 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -89,6 +89,7 @@ has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Hybrid Glossaries | [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/hybridGlossaries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/hybridGlossaries.js,samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | | Translate | [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/translate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/translate.js,samples/README.md) | diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto index fa20f01693f..f1fca1857aa 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto @@ -18,10 +18,11 @@ syntax = "proto3"; package google.cloud.translation.v3beta1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/client.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Translate.V3Beta1"; @@ -36,7 +37,10 @@ option ruby_package = "Google::Cloud::Translate::V3beta1"; // Provides natural language translation operations. service TranslationService { - option (google.api.default_host) = "translation.googleapis.com"; + option (google.api.default_host) = "translate.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-translation"; // Translates input text and returns translated text. rpc TranslateText(TranslateTextRequest) returns (TranslateTextResponse) { @@ -60,6 +64,7 @@ service TranslationService { body: "*" } }; + option (google.api.method_signature) = "parent,model,mime_type"; } // Returns a list of supported languages for translation. @@ -70,6 +75,7 @@ service TranslationService { get: "/v3beta1/{parent=projects/*}/supportedLanguages" } }; + option (google.api.method_signature) = "parent,display_language_code,model"; } // Translates a large volume of text in asynchronous batch mode. @@ -84,6 +90,10 @@ service TranslationService { post: "/v3beta1/{parent=projects/*/locations/*}:batchTranslateText" body: "*" }; + option (google.longrunning.operation_info) = { + response_type: "BatchTranslateResponse" + metadata_type: "BatchTranslateMetadata" + }; } // Creates a glossary and returns the long-running operation. Returns @@ -93,6 +103,11 @@ service TranslationService { post: "/v3beta1/{parent=projects/*/locations/*}/glossaries" body: "glossary" }; + option (google.api.method_signature) = "parent,glossary"; + option (google.longrunning.operation_info) = { + response_type: "Glossary" + metadata_type: "CreateGlossaryMetadata" + }; } // Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't @@ -101,6 +116,7 @@ service TranslationService { option (google.api.http) = { get: "/v3beta1/{parent=projects/*/locations/*}/glossaries" }; + option (google.api.method_signature) = "parent"; } // Gets a glossary. Returns NOT_FOUND, if the glossary doesn't @@ -109,6 +125,7 @@ service TranslationService { option (google.api.http) = { get: "/v3beta1/{name=projects/*/locations/*/glossaries/*}" }; + option (google.api.method_signature) = "name"; } // Deletes a glossary, or cancels glossary construction @@ -118,6 +135,11 @@ service TranslationService { option (google.api.http) = { delete: "/v3beta1/{name=projects/*/locations/*/glossaries/*}" }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "DeleteGlossaryResponse" + metadata_type: "DeleteGlossaryMetadata" + }; } } @@ -126,11 +148,11 @@ service TranslationService { message TranslateTextGlossaryConfig { // Required. Specifies the glossary used for this translation. Use // this format: projects/*/locations/*/glossaries/* - string glossary = 1; + string glossary = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Indicates match is case-insensitive. // Default value is false if missing. - bool ignore_case = 2; + bool ignore_case = 2 [(google.api.field_behavior) = OPTIONAL]; } // The request message for synchronous translation. @@ -138,32 +160,43 @@ message TranslateTextRequest { // Required. The content of the input in string format. // We recommend the total content be less than 30k codepoints. // Use BatchTranslateText for larger text. - repeated string contents = 1; + repeated string contents = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The format of the source text, for example, "text/html", // "text/plain". If left blank, the MIME type defaults to "text/html". - string mime_type = 3; + string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The BCP-47 language code of the input text if // known, for example, "en-US" or "sr-Latn". Supported language codes are // listed in Language Support. If the source language isn't specified, the API // attempts to identify the source language automatically and returns the // source language within the response. - string source_language_code = 4; + string source_language_code = 4 [(google.api.field_behavior) = OPTIONAL]; // Required. The BCP-47 language code to use for translation of the input // text, set to one of the language codes listed in Language Support. - string target_language_code = 5; + string target_language_code = 5 [(google.api.field_behavior) = REQUIRED]; - // Required. Location to make a regional or global call. + // Required. Project or location to make a call. Must refer to a caller's + // project. // - // Format: `projects/{project-id}/locations/{location-id}`. + // Format: `projects/{project-id}` or + // `projects/{project-id}/locations/{location-id}`. // - // For global calls, use `projects/{project-id}/locations/global`. + // For global calls, use `projects/{project-id}/locations/global` or + // `projects/{project-id}`. + // + // Non-global location is required for requests using AutoML models or + // custom glossaries. // // Models and glossaries must be within the same region (have same // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - string parent = 8; + string parent = 8 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // Optional. The `model` type requested for this translation. // @@ -182,12 +215,22 @@ message TranslateTextRequest { // `projects/{project-id}/locations/global/models/general/nmt`. // // If missing, the system decides which google base model to use. - string model = 6; + string model = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. Glossary to be applied. The glossary must be // within the same region (have the same location-id) as the model, otherwise // an INVALID_ARGUMENT (400) error is returned. - TranslateTextGlossaryConfig glossary_config = 7; + TranslateTextGlossaryConfig glossary_config = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels with user-defined metadata for the request. + // + // Label keys and values can be no longer than 63 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + // + // See https://cloud.google.com/translate/docs/labels for more information. + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; } message TranslateTextResponse { @@ -225,15 +268,23 @@ message Translation { // The request message for language detection. message DetectLanguageRequest { - // Required. Location to make a regional or global call. + // Required. Project or location to make a call. Must refer to a caller's + // project. // - // Format: `projects/{project-id}/locations/{location-id}`. + // Format: `projects/{project-id}/locations/{location-id}` or + // `projects/{project-id}`. // - // For global calls, use `projects/{project-id}/locations/global`. + // For global calls, use `projects/{project-id}/locations/global` or + // `projects/{project-id}`. // // Only models within the same region (has same location-id) can be used. // Otherwise an INVALID_ARGUMENT (400) error is returned. - string parent = 5; + string parent = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // Optional. The language detection model to be used. // @@ -244,7 +295,7 @@ message DetectLanguageRequest { // `projects/{project-id}/locations/{location-id}/models/language-detection/default`. // // If not specified, the default model is used. - string model = 4; + string model = 4 [(google.api.field_behavior) = OPTIONAL]; // Required. The source of the document from which to detect the language. oneof source { @@ -254,7 +305,17 @@ message DetectLanguageRequest { // Optional. The format of the source text, for example, "text/html", // "text/plain". If left blank, the MIME type defaults to "text/html". - string mime_type = 3; + string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels with user-defined metadata for the request. + // + // Label keys and values can be no longer than 63 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + // + // See https://cloud.google.com/translate/docs/labels for more information. + map labels = 6; } // The response message for language detection. @@ -276,20 +337,30 @@ message DetectLanguageResponse { // The request message for discovering supported languages. message GetSupportedLanguagesRequest { - // Required. Location to make a regional or global call. + // Required. Project or location to make a call. Must refer to a caller's + // project. // - // Format: `projects/{project-id}/locations/{location-id}`. + // Format: `projects/{project-id}` or + // `projects/{project-id}/locations/{location-id}`. // - // For global calls, use `projects/{project-id}/locations/global`. + // For global calls, use `projects/{project-id}/locations/global` or + // `projects/{project-id}`. + // + // Non-global location is required for AutoML models. // // Only models within the same region (have same location-id) can be used, // otherwise an INVALID_ARGUMENT (400) error is returned. - string parent = 3; + string parent = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // Optional. The language to use to return localized, human readable names // of supported languages. If missing, then display names are not returned // in a response. - string display_language_code = 1; + string display_language_code = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. Get supported languages of this model. // @@ -305,7 +376,7 @@ message GetSupportedLanguagesRequest { // // Returns languages supported by the specified model. // If missing, we get supported languages of Google general base (PBMT) model. - string model = 2; + string model = 2 [(google.api.field_behavior) = OPTIONAL]; } // The response message for discovering supported languages. @@ -338,7 +409,7 @@ message SupportedLanguage { // The Google Cloud Storage location for the input content. message GcsSource { // Required. Source data URI. For example, `gs://my_bucket/my_object`. - string input_uri = 1; + string input_uri = 1 [(google.api.field_behavior) = REQUIRED]; } // Input configuration for BatchTranslateText request. @@ -347,7 +418,7 @@ message InputConfig { // For `.tsv`, "text/html" is used if mime_type is missing. // For `.html`, this field must be "text/html" or empty. // For `.txt`, this field must be "text/plain" or empty. - string mime_type = 1; + string mime_type = 1 [(google.api.field_behavior) = OPTIONAL]; // Required. Specify the input. oneof source { @@ -373,12 +444,12 @@ message InputConfig { } } -// The Google Cloud Storage location for the output content +// The Google Cloud Storage location for the output content. message GcsDestination { // Required. There must be no files under 'output_uri_prefix'. - // 'output_uri_prefix' must end with "/", otherwise an INVALID_ARGUMENT (400) - // error is returned.. - string output_uri_prefix = 1; + // 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an + // INVALID_ARGUMENT (400) error is returned. + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; } // Output configuration for BatchTranslateText request. @@ -457,7 +528,7 @@ message OutputConfig { // The batch translation request. message BatchTranslateTextRequest { - // Required. Location to make a regional call. + // Required. Location to make a call. Must refer to a caller's project. // // Format: `projects/{project-id}/locations/{location-id}`. // @@ -466,13 +537,18 @@ message BatchTranslateTextRequest { // Only AutoML Translation models or glossaries within the same region (have // the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) // error is returned. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // Required. Source language code. - string source_language_code = 2; + string source_language_code = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Specify up to 10 language codes here. - repeated string target_language_codes = 3; + repeated string target_language_codes = 3 [(google.api.field_behavior) = REQUIRED]; // Optional. The models to use for translation. Map's key is target language // code. Map's value is model name. Value can be a built-in general model, @@ -490,22 +566,32 @@ message BatchTranslateTextRequest { // // If the map is empty or a specific model is // not requested for a language pair, then default google model (nmt) is used. - map models = 4; + map models = 4 [(google.api.field_behavior) = OPTIONAL]; // Required. Input configurations. // The total number of files matched should be <= 1000. // The total content size should be <= 100M Unicode codepoints. // The files must use UTF-8 encoding. - repeated InputConfig input_configs = 5; + repeated InputConfig input_configs = 5 [(google.api.field_behavior) = REQUIRED]; // Required. Output configuration. // If 2 input configs match to the same file (that is, same input path), // we don't generate output for duplicate inputs. - OutputConfig output_config = 6; + OutputConfig output_config = 6 [(google.api.field_behavior) = REQUIRED]; // Optional. Glossaries to be applied for translation. // It's keyed by target language code. - map glossaries = 7; + map glossaries = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels with user-defined metadata for the request. + // + // Label keys and values can be no longer than 63 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + // + // See https://cloud.google.com/translate/docs/labels for more information. + map labels = 9 [(google.api.field_behavior) = OPTIONAL]; } // State metadata for the batch translation operation. @@ -606,6 +692,11 @@ message GlossaryInputConfig { // Represents a glossary built from user provided data. message Glossary { + option (google.api.resource) = { + type: "translate.googleapis.com/Glossary" + pattern: "projects/{project}/locations/{location}/glossaries/{glossary}" + }; + // Used with unidirectional glossaries. message LanguageCodePair { // Required. The BCP-47 language code of the input text, for example, @@ -627,7 +718,7 @@ message Glossary { // Required. The resource name of the glossary. Glossary names have the form // `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`. - string name = 1; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // Languages supported by the glossary. oneof languages { @@ -643,55 +734,75 @@ message Glossary { GlossaryInputConfig input_config = 5; // Output only. The number of entries defined in the glossary. - int32 entry_count = 6; + int32 entry_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. When CreateGlossary was called. - google.protobuf.Timestamp submit_time = 7; + google.protobuf.Timestamp submit_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. When the glossary creation was finished. - google.protobuf.Timestamp end_time = 8; + google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request message for CreateGlossary. message CreateGlossaryRequest { // Required. The project name. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // Required. The glossary to create. - Glossary glossary = 2; + Glossary glossary = 2 [(google.api.field_behavior) = REQUIRED]; } // Request message for GetGlossary. message GetGlossaryRequest { // Required. The name of the glossary to retrieve. - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "translate.googleapis.com/Glossary" + } + ]; } // Request message for DeleteGlossary. message DeleteGlossaryRequest { // Required. The name of the glossary to delete. - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "translate.googleapis.com/Glossary" + } + ]; } // Request message for ListGlossaries. message ListGlossariesRequest { // Required. The name of the project from which to list all of the glossaries. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // Optional. Requested page size. The server may return fewer glossaries than // requested. If unspecified, the server picks an appropriate default. - int32 page_size = 2; + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. A token identifying a page of results the server should return. // Typically, this is the value of [ListGlossariesResponse.next_page_token] // returned from the previous call to `ListGlossaries` method. // The first page is returned if `page_token`is empty or missing. - string page_token = 3; + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Filter specifying constraints of a list operation. // Filtering is not supported yet, and the parameter currently has no effect. // If missing, no filtering is performed. - string filter = 4; + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; } // Response message for ListGlossaries. diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts new file mode 100644 index 00000000000..979b9314b1c --- /dev/null +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -0,0 +1,8296 @@ +import * as $protobuf from "protobufjs"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace translation. */ + namespace translation { + + /** Namespace v3beta1. */ + namespace v3beta1 { + + /** Represents a TranslationService */ + class TranslationService extends $protobuf.rpc.Service { + + /** + * Constructs a new TranslationService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new TranslationService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): TranslationService; + + /** + * Calls TranslateText. + * @param request TranslateTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TranslateTextResponse + */ + public translateText(request: google.cloud.translation.v3beta1.ITranslateTextRequest, callback: google.cloud.translation.v3beta1.TranslationService.TranslateTextCallback): void; + + /** + * Calls TranslateText. + * @param request TranslateTextRequest message or plain object + * @returns Promise + */ + public translateText(request: google.cloud.translation.v3beta1.ITranslateTextRequest): Promise; + + /** + * Calls DetectLanguage. + * @param request DetectLanguageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DetectLanguageResponse + */ + public detectLanguage(request: google.cloud.translation.v3beta1.IDetectLanguageRequest, callback: google.cloud.translation.v3beta1.TranslationService.DetectLanguageCallback): void; + + /** + * Calls DetectLanguage. + * @param request DetectLanguageRequest message or plain object + * @returns Promise + */ + public detectLanguage(request: google.cloud.translation.v3beta1.IDetectLanguageRequest): Promise; + + /** + * Calls GetSupportedLanguages. + * @param request GetSupportedLanguagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SupportedLanguages + */ + public getSupportedLanguages(request: google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, callback: google.cloud.translation.v3beta1.TranslationService.GetSupportedLanguagesCallback): void; + + /** + * Calls GetSupportedLanguages. + * @param request GetSupportedLanguagesRequest message or plain object + * @returns Promise + */ + public getSupportedLanguages(request: google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest): Promise; + + /** + * Calls BatchTranslateText. + * @param request BatchTranslateTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchTranslateText(request: google.cloud.translation.v3beta1.IBatchTranslateTextRequest, callback: google.cloud.translation.v3beta1.TranslationService.BatchTranslateTextCallback): void; + + /** + * Calls BatchTranslateText. + * @param request BatchTranslateTextRequest message or plain object + * @returns Promise + */ + public batchTranslateText(request: google.cloud.translation.v3beta1.IBatchTranslateTextRequest): Promise; + + /** + * Calls CreateGlossary. + * @param request CreateGlossaryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGlossary(request: google.cloud.translation.v3beta1.ICreateGlossaryRequest, callback: google.cloud.translation.v3beta1.TranslationService.CreateGlossaryCallback): void; + + /** + * Calls CreateGlossary. + * @param request CreateGlossaryRequest message or plain object + * @returns Promise + */ + public createGlossary(request: google.cloud.translation.v3beta1.ICreateGlossaryRequest): Promise; + + /** + * Calls ListGlossaries. + * @param request ListGlossariesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGlossariesResponse + */ + public listGlossaries(request: google.cloud.translation.v3beta1.IListGlossariesRequest, callback: google.cloud.translation.v3beta1.TranslationService.ListGlossariesCallback): void; + + /** + * Calls ListGlossaries. + * @param request ListGlossariesRequest message or plain object + * @returns Promise + */ + public listGlossaries(request: google.cloud.translation.v3beta1.IListGlossariesRequest): Promise; + + /** + * Calls GetGlossary. + * @param request GetGlossaryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Glossary + */ + public getGlossary(request: google.cloud.translation.v3beta1.IGetGlossaryRequest, callback: google.cloud.translation.v3beta1.TranslationService.GetGlossaryCallback): void; + + /** + * Calls GetGlossary. + * @param request GetGlossaryRequest message or plain object + * @returns Promise + */ + public getGlossary(request: google.cloud.translation.v3beta1.IGetGlossaryRequest): Promise; + + /** + * Calls DeleteGlossary. + * @param request DeleteGlossaryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGlossary(request: google.cloud.translation.v3beta1.IDeleteGlossaryRequest, callback: google.cloud.translation.v3beta1.TranslationService.DeleteGlossaryCallback): void; + + /** + * Calls DeleteGlossary. + * @param request DeleteGlossaryRequest message or plain object + * @returns Promise + */ + public deleteGlossary(request: google.cloud.translation.v3beta1.IDeleteGlossaryRequest): Promise; + } + + namespace TranslationService { + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#translateText}. + * @param error Error, if any + * @param [response] TranslateTextResponse + */ + type TranslateTextCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.TranslateTextResponse) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#detectLanguage}. + * @param error Error, if any + * @param [response] DetectLanguageResponse + */ + type DetectLanguageCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.DetectLanguageResponse) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#getSupportedLanguages}. + * @param error Error, if any + * @param [response] SupportedLanguages + */ + type GetSupportedLanguagesCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.SupportedLanguages) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#batchTranslateText}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchTranslateTextCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#createGlossary}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGlossaryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#listGlossaries}. + * @param error Error, if any + * @param [response] ListGlossariesResponse + */ + type ListGlossariesCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.ListGlossariesResponse) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#getGlossary}. + * @param error Error, if any + * @param [response] Glossary + */ + type GetGlossaryCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.Glossary) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#deleteGlossary}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGlossaryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a TranslateTextGlossaryConfig. */ + interface ITranslateTextGlossaryConfig { + + /** TranslateTextGlossaryConfig glossary */ + glossary?: (string|null); + + /** TranslateTextGlossaryConfig ignoreCase */ + ignoreCase?: (boolean|null); + } + + /** Represents a TranslateTextGlossaryConfig. */ + class TranslateTextGlossaryConfig implements ITranslateTextGlossaryConfig { + + /** + * Constructs a new TranslateTextGlossaryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig); + + /** TranslateTextGlossaryConfig glossary. */ + public glossary: string; + + /** TranslateTextGlossaryConfig ignoreCase. */ + public ignoreCase: boolean; + + /** + * Creates a new TranslateTextGlossaryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslateTextGlossaryConfig instance + */ + public static create(properties?: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig): google.cloud.translation.v3beta1.TranslateTextGlossaryConfig; + + /** + * Encodes the specified TranslateTextGlossaryConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.verify|verify} messages. + * @param message TranslateTextGlossaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslateTextGlossaryConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.verify|verify} messages. + * @param message TranslateTextGlossaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslateTextGlossaryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslateTextGlossaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.TranslateTextGlossaryConfig; + + /** + * Decodes a TranslateTextGlossaryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslateTextGlossaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.TranslateTextGlossaryConfig; + + /** + * Verifies a TranslateTextGlossaryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslateTextGlossaryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslateTextGlossaryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.TranslateTextGlossaryConfig; + + /** + * Creates a plain object from a TranslateTextGlossaryConfig message. Also converts values to other types if specified. + * @param message TranslateTextGlossaryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.TranslateTextGlossaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslateTextGlossaryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TranslateTextRequest. */ + interface ITranslateTextRequest { + + /** TranslateTextRequest contents */ + contents?: (string[]|null); + + /** TranslateTextRequest mimeType */ + mimeType?: (string|null); + + /** TranslateTextRequest sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslateTextRequest targetLanguageCode */ + targetLanguageCode?: (string|null); + + /** TranslateTextRequest parent */ + parent?: (string|null); + + /** TranslateTextRequest model */ + model?: (string|null); + + /** TranslateTextRequest glossaryConfig */ + glossaryConfig?: (google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null); + + /** TranslateTextRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a TranslateTextRequest. */ + class TranslateTextRequest implements ITranslateTextRequest { + + /** + * Constructs a new TranslateTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.ITranslateTextRequest); + + /** TranslateTextRequest contents. */ + public contents: string[]; + + /** TranslateTextRequest mimeType. */ + public mimeType: string; + + /** TranslateTextRequest sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslateTextRequest targetLanguageCode. */ + public targetLanguageCode: string; + + /** TranslateTextRequest parent. */ + public parent: string; + + /** TranslateTextRequest model. */ + public model: string; + + /** TranslateTextRequest glossaryConfig. */ + public glossaryConfig?: (google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null); + + /** TranslateTextRequest labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new TranslateTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslateTextRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.ITranslateTextRequest): google.cloud.translation.v3beta1.TranslateTextRequest; + + /** + * Encodes the specified TranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateTextRequest.verify|verify} messages. + * @param message TranslateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.ITranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateTextRequest.verify|verify} messages. + * @param message TranslateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.ITranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslateTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.TranslateTextRequest; + + /** + * Decodes a TranslateTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.TranslateTextRequest; + + /** + * Verifies a TranslateTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslateTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.TranslateTextRequest; + + /** + * Creates a plain object from a TranslateTextRequest message. Also converts values to other types if specified. + * @param message TranslateTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.TranslateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslateTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TranslateTextResponse. */ + interface ITranslateTextResponse { + + /** TranslateTextResponse translations */ + translations?: (google.cloud.translation.v3beta1.ITranslation[]|null); + + /** TranslateTextResponse glossaryTranslations */ + glossaryTranslations?: (google.cloud.translation.v3beta1.ITranslation[]|null); + } + + /** Represents a TranslateTextResponse. */ + class TranslateTextResponse implements ITranslateTextResponse { + + /** + * Constructs a new TranslateTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.ITranslateTextResponse); + + /** TranslateTextResponse translations. */ + public translations: google.cloud.translation.v3beta1.ITranslation[]; + + /** TranslateTextResponse glossaryTranslations. */ + public glossaryTranslations: google.cloud.translation.v3beta1.ITranslation[]; + + /** + * Creates a new TranslateTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslateTextResponse instance + */ + public static create(properties?: google.cloud.translation.v3beta1.ITranslateTextResponse): google.cloud.translation.v3beta1.TranslateTextResponse; + + /** + * Encodes the specified TranslateTextResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateTextResponse.verify|verify} messages. + * @param message TranslateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.ITranslateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslateTextResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateTextResponse.verify|verify} messages. + * @param message TranslateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.ITranslateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslateTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.TranslateTextResponse; + + /** + * Decodes a TranslateTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.TranslateTextResponse; + + /** + * Verifies a TranslateTextResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslateTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslateTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.TranslateTextResponse; + + /** + * Creates a plain object from a TranslateTextResponse message. Also converts values to other types if specified. + * @param message TranslateTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.TranslateTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslateTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Translation. */ + interface ITranslation { + + /** Translation translatedText */ + translatedText?: (string|null); + + /** Translation model */ + model?: (string|null); + + /** Translation detectedLanguageCode */ + detectedLanguageCode?: (string|null); + + /** Translation glossaryConfig */ + glossaryConfig?: (google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null); + } + + /** Represents a Translation. */ + class Translation implements ITranslation { + + /** + * Constructs a new Translation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.ITranslation); + + /** Translation translatedText. */ + public translatedText: string; + + /** Translation model. */ + public model: string; + + /** Translation detectedLanguageCode. */ + public detectedLanguageCode: string; + + /** Translation glossaryConfig. */ + public glossaryConfig?: (google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null); + + /** + * Creates a new Translation instance using the specified properties. + * @param [properties] Properties to set + * @returns Translation instance + */ + public static create(properties?: google.cloud.translation.v3beta1.ITranslation): google.cloud.translation.v3beta1.Translation; + + /** + * Encodes the specified Translation message. Does not implicitly {@link google.cloud.translation.v3beta1.Translation.verify|verify} messages. + * @param message Translation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.ITranslation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Translation message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Translation.verify|verify} messages. + * @param message Translation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.ITranslation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Translation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Translation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.Translation; + + /** + * Decodes a Translation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Translation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.Translation; + + /** + * Verifies a Translation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Translation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Translation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.Translation; + + /** + * Creates a plain object from a Translation message. Also converts values to other types if specified. + * @param message Translation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.Translation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Translation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectLanguageRequest. */ + interface IDetectLanguageRequest { + + /** DetectLanguageRequest parent */ + parent?: (string|null); + + /** DetectLanguageRequest model */ + model?: (string|null); + + /** DetectLanguageRequest content */ + content?: (string|null); + + /** DetectLanguageRequest mimeType */ + mimeType?: (string|null); + + /** DetectLanguageRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a DetectLanguageRequest. */ + class DetectLanguageRequest implements IDetectLanguageRequest { + + /** + * Constructs a new DetectLanguageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IDetectLanguageRequest); + + /** DetectLanguageRequest parent. */ + public parent: string; + + /** DetectLanguageRequest model. */ + public model: string; + + /** DetectLanguageRequest content. */ + public content: string; + + /** DetectLanguageRequest mimeType. */ + public mimeType: string; + + /** DetectLanguageRequest labels. */ + public labels: { [k: string]: string }; + + /** DetectLanguageRequest source. */ + public source?: "content"; + + /** + * Creates a new DetectLanguageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectLanguageRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IDetectLanguageRequest): google.cloud.translation.v3beta1.DetectLanguageRequest; + + /** + * Encodes the specified DetectLanguageRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.DetectLanguageRequest.verify|verify} messages. + * @param message DetectLanguageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IDetectLanguageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectLanguageRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DetectLanguageRequest.verify|verify} messages. + * @param message DetectLanguageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IDetectLanguageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectLanguageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectLanguageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DetectLanguageRequest; + + /** + * Decodes a DetectLanguageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectLanguageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DetectLanguageRequest; + + /** + * Verifies a DetectLanguageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectLanguageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectLanguageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DetectLanguageRequest; + + /** + * Creates a plain object from a DetectLanguageRequest message. Also converts values to other types if specified. + * @param message DetectLanguageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.DetectLanguageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectLanguageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectedLanguage. */ + interface IDetectedLanguage { + + /** DetectedLanguage languageCode */ + languageCode?: (string|null); + + /** DetectedLanguage confidence */ + confidence?: (number|null); + } + + /** Represents a DetectedLanguage. */ + class DetectedLanguage implements IDetectedLanguage { + + /** + * Constructs a new DetectedLanguage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IDetectedLanguage); + + /** DetectedLanguage languageCode. */ + public languageCode: string; + + /** DetectedLanguage confidence. */ + public confidence: number; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedLanguage instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IDetectedLanguage): google.cloud.translation.v3beta1.DetectedLanguage; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.translation.v3beta1.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DetectedLanguage; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DetectedLanguage; + + /** + * Verifies a DetectedLanguage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedLanguage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DetectedLanguage; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @param message DetectedLanguage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.DetectedLanguage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedLanguage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectLanguageResponse. */ + interface IDetectLanguageResponse { + + /** DetectLanguageResponse languages */ + languages?: (google.cloud.translation.v3beta1.IDetectedLanguage[]|null); + } + + /** Represents a DetectLanguageResponse. */ + class DetectLanguageResponse implements IDetectLanguageResponse { + + /** + * Constructs a new DetectLanguageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IDetectLanguageResponse); + + /** DetectLanguageResponse languages. */ + public languages: google.cloud.translation.v3beta1.IDetectedLanguage[]; + + /** + * Creates a new DetectLanguageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectLanguageResponse instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IDetectLanguageResponse): google.cloud.translation.v3beta1.DetectLanguageResponse; + + /** + * Encodes the specified DetectLanguageResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.DetectLanguageResponse.verify|verify} messages. + * @param message DetectLanguageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IDetectLanguageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectLanguageResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DetectLanguageResponse.verify|verify} messages. + * @param message DetectLanguageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IDetectLanguageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectLanguageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectLanguageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DetectLanguageResponse; + + /** + * Decodes a DetectLanguageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectLanguageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DetectLanguageResponse; + + /** + * Verifies a DetectLanguageResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectLanguageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectLanguageResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DetectLanguageResponse; + + /** + * Creates a plain object from a DetectLanguageResponse message. Also converts values to other types if specified. + * @param message DetectLanguageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.DetectLanguageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectLanguageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetSupportedLanguagesRequest. */ + interface IGetSupportedLanguagesRequest { + + /** GetSupportedLanguagesRequest parent */ + parent?: (string|null); + + /** GetSupportedLanguagesRequest displayLanguageCode */ + displayLanguageCode?: (string|null); + + /** GetSupportedLanguagesRequest model */ + model?: (string|null); + } + + /** Represents a GetSupportedLanguagesRequest. */ + class GetSupportedLanguagesRequest implements IGetSupportedLanguagesRequest { + + /** + * Constructs a new GetSupportedLanguagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest); + + /** GetSupportedLanguagesRequest parent. */ + public parent: string; + + /** GetSupportedLanguagesRequest displayLanguageCode. */ + public displayLanguageCode: string; + + /** GetSupportedLanguagesRequest model. */ + public model: string; + + /** + * Creates a new GetSupportedLanguagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSupportedLanguagesRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest): google.cloud.translation.v3beta1.GetSupportedLanguagesRequest; + + /** + * Encodes the specified GetSupportedLanguagesRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.GetSupportedLanguagesRequest.verify|verify} messages. + * @param message GetSupportedLanguagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSupportedLanguagesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GetSupportedLanguagesRequest.verify|verify} messages. + * @param message GetSupportedLanguagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSupportedLanguagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSupportedLanguagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.GetSupportedLanguagesRequest; + + /** + * Decodes a GetSupportedLanguagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSupportedLanguagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.GetSupportedLanguagesRequest; + + /** + * Verifies a GetSupportedLanguagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSupportedLanguagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSupportedLanguagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.GetSupportedLanguagesRequest; + + /** + * Creates a plain object from a GetSupportedLanguagesRequest message. Also converts values to other types if specified. + * @param message GetSupportedLanguagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.GetSupportedLanguagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSupportedLanguagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SupportedLanguages. */ + interface ISupportedLanguages { + + /** SupportedLanguages languages */ + languages?: (google.cloud.translation.v3beta1.ISupportedLanguage[]|null); + } + + /** Represents a SupportedLanguages. */ + class SupportedLanguages implements ISupportedLanguages { + + /** + * Constructs a new SupportedLanguages. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.ISupportedLanguages); + + /** SupportedLanguages languages. */ + public languages: google.cloud.translation.v3beta1.ISupportedLanguage[]; + + /** + * Creates a new SupportedLanguages instance using the specified properties. + * @param [properties] Properties to set + * @returns SupportedLanguages instance + */ + public static create(properties?: google.cloud.translation.v3beta1.ISupportedLanguages): google.cloud.translation.v3beta1.SupportedLanguages; + + /** + * Encodes the specified SupportedLanguages message. Does not implicitly {@link google.cloud.translation.v3beta1.SupportedLanguages.verify|verify} messages. + * @param message SupportedLanguages message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.ISupportedLanguages, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupportedLanguages message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.SupportedLanguages.verify|verify} messages. + * @param message SupportedLanguages message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.ISupportedLanguages, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupportedLanguages message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupportedLanguages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.SupportedLanguages; + + /** + * Decodes a SupportedLanguages message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupportedLanguages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.SupportedLanguages; + + /** + * Verifies a SupportedLanguages message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SupportedLanguages message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupportedLanguages + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.SupportedLanguages; + + /** + * Creates a plain object from a SupportedLanguages message. Also converts values to other types if specified. + * @param message SupportedLanguages + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.SupportedLanguages, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupportedLanguages to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SupportedLanguage. */ + interface ISupportedLanguage { + + /** SupportedLanguage languageCode */ + languageCode?: (string|null); + + /** SupportedLanguage displayName */ + displayName?: (string|null); + + /** SupportedLanguage supportSource */ + supportSource?: (boolean|null); + + /** SupportedLanguage supportTarget */ + supportTarget?: (boolean|null); + } + + /** Represents a SupportedLanguage. */ + class SupportedLanguage implements ISupportedLanguage { + + /** + * Constructs a new SupportedLanguage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.ISupportedLanguage); + + /** SupportedLanguage languageCode. */ + public languageCode: string; + + /** SupportedLanguage displayName. */ + public displayName: string; + + /** SupportedLanguage supportSource. */ + public supportSource: boolean; + + /** SupportedLanguage supportTarget. */ + public supportTarget: boolean; + + /** + * Creates a new SupportedLanguage instance using the specified properties. + * @param [properties] Properties to set + * @returns SupportedLanguage instance + */ + public static create(properties?: google.cloud.translation.v3beta1.ISupportedLanguage): google.cloud.translation.v3beta1.SupportedLanguage; + + /** + * Encodes the specified SupportedLanguage message. Does not implicitly {@link google.cloud.translation.v3beta1.SupportedLanguage.verify|verify} messages. + * @param message SupportedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.ISupportedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupportedLanguage message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.SupportedLanguage.verify|verify} messages. + * @param message SupportedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.ISupportedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupportedLanguage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupportedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.SupportedLanguage; + + /** + * Decodes a SupportedLanguage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupportedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.SupportedLanguage; + + /** + * Verifies a SupportedLanguage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SupportedLanguage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupportedLanguage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.SupportedLanguage; + + /** + * Creates a plain object from a SupportedLanguage message. Also converts values to other types if specified. + * @param message SupportedLanguage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.SupportedLanguage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupportedLanguage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource inputUri */ + inputUri?: (string|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IGcsSource); + + /** GcsSource inputUri. */ + public inputUri: string; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IGcsSource): google.cloud.translation.v3beta1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.translation.v3beta1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.GcsSource; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.GcsSource; + + /** + * Verifies a GcsSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.GcsSource; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InputConfig. */ + interface IInputConfig { + + /** InputConfig mimeType */ + mimeType?: (string|null); + + /** InputConfig gcsSource */ + gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IInputConfig); + + /** InputConfig mimeType. */ + public mimeType: string; + + /** InputConfig gcsSource. */ + public gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); + + /** InputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IInputConfig): google.cloud.translation.v3beta1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.InputConfig; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.InputConfig; + + /** + * Verifies an InputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.InputConfig; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @param message InputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination outputUriPrefix */ + outputUriPrefix?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IGcsDestination); + + /** GcsDestination outputUriPrefix. */ + public outputUriPrefix: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IGcsDestination): google.cloud.translation.v3beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.translation.v3beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.GcsDestination; + + /** + * Verifies a GcsDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.translation.v3beta1.IGcsDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.translation.v3beta1.IGcsDestination|null); + + /** OutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IOutputConfig): google.cloud.translation.v3beta1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.OutputConfig; + + /** + * Verifies an OutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchTranslateTextRequest. */ + interface IBatchTranslateTextRequest { + + /** BatchTranslateTextRequest parent */ + parent?: (string|null); + + /** BatchTranslateTextRequest sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** BatchTranslateTextRequest targetLanguageCodes */ + targetLanguageCodes?: (string[]|null); + + /** BatchTranslateTextRequest models */ + models?: ({ [k: string]: string }|null); + + /** BatchTranslateTextRequest inputConfigs */ + inputConfigs?: (google.cloud.translation.v3beta1.IInputConfig[]|null); + + /** BatchTranslateTextRequest outputConfig */ + outputConfig?: (google.cloud.translation.v3beta1.IOutputConfig|null); + + /** BatchTranslateTextRequest glossaries */ + glossaries?: ({ [k: string]: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig }|null); + + /** BatchTranslateTextRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a BatchTranslateTextRequest. */ + class BatchTranslateTextRequest implements IBatchTranslateTextRequest { + + /** + * Constructs a new BatchTranslateTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateTextRequest); + + /** BatchTranslateTextRequest parent. */ + public parent: string; + + /** BatchTranslateTextRequest sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** BatchTranslateTextRequest targetLanguageCodes. */ + public targetLanguageCodes: string[]; + + /** BatchTranslateTextRequest models. */ + public models: { [k: string]: string }; + + /** BatchTranslateTextRequest inputConfigs. */ + public inputConfigs: google.cloud.translation.v3beta1.IInputConfig[]; + + /** BatchTranslateTextRequest outputConfig. */ + public outputConfig?: (google.cloud.translation.v3beta1.IOutputConfig|null); + + /** BatchTranslateTextRequest glossaries. */ + public glossaries: { [k: string]: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig }; + + /** BatchTranslateTextRequest labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new BatchTranslateTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchTranslateTextRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IBatchTranslateTextRequest): google.cloud.translation.v3beta1.BatchTranslateTextRequest; + + /** + * Encodes the specified BatchTranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateTextRequest.verify|verify} messages. + * @param message BatchTranslateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IBatchTranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchTranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateTextRequest.verify|verify} messages. + * @param message BatchTranslateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchTranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchTranslateTextRequest; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchTranslateTextRequest; + + /** + * Verifies a BatchTranslateTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchTranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchTranslateTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchTranslateTextRequest; + + /** + * Creates a plain object from a BatchTranslateTextRequest message. Also converts values to other types if specified. + * @param message BatchTranslateTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.BatchTranslateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchTranslateTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchTranslateMetadata. */ + interface IBatchTranslateMetadata { + + /** BatchTranslateMetadata state */ + state?: (google.cloud.translation.v3beta1.BatchTranslateMetadata.State|null); + + /** BatchTranslateMetadata translatedCharacters */ + translatedCharacters?: (number|Long|null); + + /** BatchTranslateMetadata failedCharacters */ + failedCharacters?: (number|Long|null); + + /** BatchTranslateMetadata totalCharacters */ + totalCharacters?: (number|Long|null); + + /** BatchTranslateMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchTranslateMetadata. */ + class BatchTranslateMetadata implements IBatchTranslateMetadata { + + /** + * Constructs a new BatchTranslateMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateMetadata); + + /** BatchTranslateMetadata state. */ + public state: google.cloud.translation.v3beta1.BatchTranslateMetadata.State; + + /** BatchTranslateMetadata translatedCharacters. */ + public translatedCharacters: (number|Long); + + /** BatchTranslateMetadata failedCharacters. */ + public failedCharacters: (number|Long); + + /** BatchTranslateMetadata totalCharacters. */ + public totalCharacters: (number|Long); + + /** BatchTranslateMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchTranslateMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchTranslateMetadata instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IBatchTranslateMetadata): google.cloud.translation.v3beta1.BatchTranslateMetadata; + + /** + * Encodes the specified BatchTranslateMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateMetadata.verify|verify} messages. + * @param message BatchTranslateMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IBatchTranslateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchTranslateMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateMetadata.verify|verify} messages. + * @param message BatchTranslateMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchTranslateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchTranslateMetadata; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchTranslateMetadata; + + /** + * Verifies a BatchTranslateMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchTranslateMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchTranslateMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchTranslateMetadata; + + /** + * Creates a plain object from a BatchTranslateMetadata message. Also converts values to other types if specified. + * @param message BatchTranslateMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.BatchTranslateMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchTranslateMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BatchTranslateMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } + + /** Properties of a BatchTranslateResponse. */ + interface IBatchTranslateResponse { + + /** BatchTranslateResponse totalCharacters */ + totalCharacters?: (number|Long|null); + + /** BatchTranslateResponse translatedCharacters */ + translatedCharacters?: (number|Long|null); + + /** BatchTranslateResponse failedCharacters */ + failedCharacters?: (number|Long|null); + + /** BatchTranslateResponse submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchTranslateResponse endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchTranslateResponse. */ + class BatchTranslateResponse implements IBatchTranslateResponse { + + /** + * Constructs a new BatchTranslateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateResponse); + + /** BatchTranslateResponse totalCharacters. */ + public totalCharacters: (number|Long); + + /** BatchTranslateResponse translatedCharacters. */ + public translatedCharacters: (number|Long); + + /** BatchTranslateResponse failedCharacters. */ + public failedCharacters: (number|Long); + + /** BatchTranslateResponse submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchTranslateResponse endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchTranslateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchTranslateResponse instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IBatchTranslateResponse): google.cloud.translation.v3beta1.BatchTranslateResponse; + + /** + * Encodes the specified BatchTranslateResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateResponse.verify|verify} messages. + * @param message BatchTranslateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IBatchTranslateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchTranslateResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateResponse.verify|verify} messages. + * @param message BatchTranslateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchTranslateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchTranslateResponse; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchTranslateResponse; + + /** + * Verifies a BatchTranslateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchTranslateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchTranslateResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchTranslateResponse; + + /** + * Creates a plain object from a BatchTranslateResponse message. Also converts values to other types if specified. + * @param message BatchTranslateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.BatchTranslateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchTranslateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GlossaryInputConfig. */ + interface IGlossaryInputConfig { + + /** GlossaryInputConfig gcsSource */ + gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); + } + + /** Represents a GlossaryInputConfig. */ + class GlossaryInputConfig implements IGlossaryInputConfig { + + /** + * Constructs a new GlossaryInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IGlossaryInputConfig); + + /** GlossaryInputConfig gcsSource. */ + public gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); + + /** GlossaryInputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new GlossaryInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GlossaryInputConfig instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IGlossaryInputConfig): google.cloud.translation.v3beta1.GlossaryInputConfig; + + /** + * Encodes the specified GlossaryInputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.GlossaryInputConfig.verify|verify} messages. + * @param message GlossaryInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IGlossaryInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GlossaryInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GlossaryInputConfig.verify|verify} messages. + * @param message GlossaryInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IGlossaryInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.GlossaryInputConfig; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.GlossaryInputConfig; + + /** + * Verifies a GlossaryInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GlossaryInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GlossaryInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.GlossaryInputConfig; + + /** + * Creates a plain object from a GlossaryInputConfig message. Also converts values to other types if specified. + * @param message GlossaryInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.GlossaryInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GlossaryInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Glossary. */ + interface IGlossary { + + /** Glossary name */ + name?: (string|null); + + /** Glossary languagePair */ + languagePair?: (google.cloud.translation.v3beta1.Glossary.ILanguageCodePair|null); + + /** Glossary languageCodesSet */ + languageCodesSet?: (google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet|null); + + /** Glossary inputConfig */ + inputConfig?: (google.cloud.translation.v3beta1.IGlossaryInputConfig|null); + + /** Glossary entryCount */ + entryCount?: (number|null); + + /** Glossary submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** Glossary endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Glossary. */ + class Glossary implements IGlossary { + + /** + * Constructs a new Glossary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IGlossary); + + /** Glossary name. */ + public name: string; + + /** Glossary languagePair. */ + public languagePair?: (google.cloud.translation.v3beta1.Glossary.ILanguageCodePair|null); + + /** Glossary languageCodesSet. */ + public languageCodesSet?: (google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet|null); + + /** Glossary inputConfig. */ + public inputConfig?: (google.cloud.translation.v3beta1.IGlossaryInputConfig|null); + + /** Glossary entryCount. */ + public entryCount: number; + + /** Glossary submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** Glossary endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Glossary languages. */ + public languages?: ("languagePair"|"languageCodesSet"); + + /** + * Creates a new Glossary instance using the specified properties. + * @param [properties] Properties to set + * @returns Glossary instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IGlossary): google.cloud.translation.v3beta1.Glossary; + + /** + * Encodes the specified Glossary message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.verify|verify} messages. + * @param message Glossary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IGlossary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Glossary message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.verify|verify} messages. + * @param message Glossary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IGlossary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Glossary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.Glossary; + + /** + * Decodes a Glossary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.Glossary; + + /** + * Verifies a Glossary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Glossary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Glossary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.Glossary; + + /** + * Creates a plain object from a Glossary message. Also converts values to other types if specified. + * @param message Glossary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.Glossary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Glossary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Glossary { + + /** Properties of a LanguageCodePair. */ + interface ILanguageCodePair { + + /** LanguageCodePair sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** LanguageCodePair targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a LanguageCodePair. */ + class LanguageCodePair implements ILanguageCodePair { + + /** + * Constructs a new LanguageCodePair. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.Glossary.ILanguageCodePair); + + /** LanguageCodePair sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** LanguageCodePair targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new LanguageCodePair instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageCodePair instance + */ + public static create(properties?: google.cloud.translation.v3beta1.Glossary.ILanguageCodePair): google.cloud.translation.v3beta1.Glossary.LanguageCodePair; + + /** + * Encodes the specified LanguageCodePair message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify|verify} messages. + * @param message LanguageCodePair message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.Glossary.ILanguageCodePair, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageCodePair message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify|verify} messages. + * @param message LanguageCodePair message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.Glossary.ILanguageCodePair, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.Glossary.LanguageCodePair; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.Glossary.LanguageCodePair; + + /** + * Verifies a LanguageCodePair message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LanguageCodePair message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageCodePair + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.Glossary.LanguageCodePair; + + /** + * Creates a plain object from a LanguageCodePair message. Also converts values to other types if specified. + * @param message LanguageCodePair + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.Glossary.LanguageCodePair, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageCodePair to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LanguageCodesSet. */ + interface ILanguageCodesSet { + + /** LanguageCodesSet languageCodes */ + languageCodes?: (string[]|null); + } + + /** Represents a LanguageCodesSet. */ + class LanguageCodesSet implements ILanguageCodesSet { + + /** + * Constructs a new LanguageCodesSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet); + + /** LanguageCodesSet languageCodes. */ + public languageCodes: string[]; + + /** + * Creates a new LanguageCodesSet instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageCodesSet instance + */ + public static create(properties?: google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet): google.cloud.translation.v3beta1.Glossary.LanguageCodesSet; + + /** + * Encodes the specified LanguageCodesSet message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify|verify} messages. + * @param message LanguageCodesSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageCodesSet message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify|verify} messages. + * @param message LanguageCodesSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.Glossary.LanguageCodesSet; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.Glossary.LanguageCodesSet; + + /** + * Verifies a LanguageCodesSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LanguageCodesSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageCodesSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.Glossary.LanguageCodesSet; + + /** + * Creates a plain object from a LanguageCodesSet message. Also converts values to other types if specified. + * @param message LanguageCodesSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.Glossary.LanguageCodesSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageCodesSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a CreateGlossaryRequest. */ + interface ICreateGlossaryRequest { + + /** CreateGlossaryRequest parent */ + parent?: (string|null); + + /** CreateGlossaryRequest glossary */ + glossary?: (google.cloud.translation.v3beta1.IGlossary|null); + } + + /** Represents a CreateGlossaryRequest. */ + class CreateGlossaryRequest implements ICreateGlossaryRequest { + + /** + * Constructs a new CreateGlossaryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.ICreateGlossaryRequest); + + /** CreateGlossaryRequest parent. */ + public parent: string; + + /** CreateGlossaryRequest glossary. */ + public glossary?: (google.cloud.translation.v3beta1.IGlossary|null); + + /** + * Creates a new CreateGlossaryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGlossaryRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.ICreateGlossaryRequest): google.cloud.translation.v3beta1.CreateGlossaryRequest; + + /** + * Encodes the specified CreateGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryRequest.verify|verify} messages. + * @param message CreateGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.ICreateGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryRequest.verify|verify} messages. + * @param message CreateGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.ICreateGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.CreateGlossaryRequest; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.CreateGlossaryRequest; + + /** + * Verifies a CreateGlossaryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGlossaryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.CreateGlossaryRequest; + + /** + * Creates a plain object from a CreateGlossaryRequest message. Also converts values to other types if specified. + * @param message CreateGlossaryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.CreateGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGlossaryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetGlossaryRequest. */ + interface IGetGlossaryRequest { + + /** GetGlossaryRequest name */ + name?: (string|null); + } + + /** Represents a GetGlossaryRequest. */ + class GetGlossaryRequest implements IGetGlossaryRequest { + + /** + * Constructs a new GetGlossaryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IGetGlossaryRequest); + + /** GetGlossaryRequest name. */ + public name: string; + + /** + * Creates a new GetGlossaryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGlossaryRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IGetGlossaryRequest): google.cloud.translation.v3beta1.GetGlossaryRequest; + + /** + * Encodes the specified GetGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.GetGlossaryRequest.verify|verify} messages. + * @param message GetGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IGetGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GetGlossaryRequest.verify|verify} messages. + * @param message GetGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IGetGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.GetGlossaryRequest; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.GetGlossaryRequest; + + /** + * Verifies a GetGlossaryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGlossaryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.GetGlossaryRequest; + + /** + * Creates a plain object from a GetGlossaryRequest message. Also converts values to other types if specified. + * @param message GetGlossaryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.GetGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGlossaryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteGlossaryRequest. */ + interface IDeleteGlossaryRequest { + + /** DeleteGlossaryRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGlossaryRequest. */ + class DeleteGlossaryRequest implements IDeleteGlossaryRequest { + + /** + * Constructs a new DeleteGlossaryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryRequest); + + /** DeleteGlossaryRequest name. */ + public name: string; + + /** + * Creates a new DeleteGlossaryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlossaryRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryRequest): google.cloud.translation.v3beta1.DeleteGlossaryRequest; + + /** + * Encodes the specified DeleteGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryRequest.verify|verify} messages. + * @param message DeleteGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IDeleteGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryRequest.verify|verify} messages. + * @param message DeleteGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IDeleteGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DeleteGlossaryRequest; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DeleteGlossaryRequest; + + /** + * Verifies a DeleteGlossaryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlossaryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DeleteGlossaryRequest; + + /** + * Creates a plain object from a DeleteGlossaryRequest message. Also converts values to other types if specified. + * @param message DeleteGlossaryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.DeleteGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlossaryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlossariesRequest. */ + interface IListGlossariesRequest { + + /** ListGlossariesRequest parent */ + parent?: (string|null); + + /** ListGlossariesRequest pageSize */ + pageSize?: (number|null); + + /** ListGlossariesRequest pageToken */ + pageToken?: (string|null); + + /** ListGlossariesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListGlossariesRequest. */ + class ListGlossariesRequest implements IListGlossariesRequest { + + /** + * Constructs a new ListGlossariesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IListGlossariesRequest); + + /** ListGlossariesRequest parent. */ + public parent: string; + + /** ListGlossariesRequest pageSize. */ + public pageSize: number; + + /** ListGlossariesRequest pageToken. */ + public pageToken: string; + + /** ListGlossariesRequest filter. */ + public filter: string; + + /** + * Creates a new ListGlossariesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlossariesRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IListGlossariesRequest): google.cloud.translation.v3beta1.ListGlossariesRequest; + + /** + * Encodes the specified ListGlossariesRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesRequest.verify|verify} messages. + * @param message ListGlossariesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IListGlossariesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlossariesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesRequest.verify|verify} messages. + * @param message ListGlossariesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IListGlossariesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.ListGlossariesRequest; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.ListGlossariesRequest; + + /** + * Verifies a ListGlossariesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlossariesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlossariesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.ListGlossariesRequest; + + /** + * Creates a plain object from a ListGlossariesRequest message. Also converts values to other types if specified. + * @param message ListGlossariesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.ListGlossariesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlossariesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlossariesResponse. */ + interface IListGlossariesResponse { + + /** ListGlossariesResponse glossaries */ + glossaries?: (google.cloud.translation.v3beta1.IGlossary[]|null); + + /** ListGlossariesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListGlossariesResponse. */ + class ListGlossariesResponse implements IListGlossariesResponse { + + /** + * Constructs a new ListGlossariesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IListGlossariesResponse); + + /** ListGlossariesResponse glossaries. */ + public glossaries: google.cloud.translation.v3beta1.IGlossary[]; + + /** ListGlossariesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListGlossariesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlossariesResponse instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IListGlossariesResponse): google.cloud.translation.v3beta1.ListGlossariesResponse; + + /** + * Encodes the specified ListGlossariesResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesResponse.verify|verify} messages. + * @param message ListGlossariesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IListGlossariesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlossariesResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesResponse.verify|verify} messages. + * @param message ListGlossariesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IListGlossariesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.ListGlossariesResponse; + + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.ListGlossariesResponse; + + /** + * Verifies a ListGlossariesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlossariesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlossariesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.ListGlossariesResponse; + + /** + * Creates a plain object from a ListGlossariesResponse message. Also converts values to other types if specified. + * @param message ListGlossariesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.ListGlossariesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlossariesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateGlossaryMetadata. */ + interface ICreateGlossaryMetadata { + + /** CreateGlossaryMetadata name */ + name?: (string|null); + + /** CreateGlossaryMetadata state */ + state?: (google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|null); + + /** CreateGlossaryMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateGlossaryMetadata. */ + class CreateGlossaryMetadata implements ICreateGlossaryMetadata { + + /** + * Constructs a new CreateGlossaryMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.ICreateGlossaryMetadata); + + /** CreateGlossaryMetadata name. */ + public name: string; + + /** CreateGlossaryMetadata state. */ + public state: google.cloud.translation.v3beta1.CreateGlossaryMetadata.State; + + /** CreateGlossaryMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateGlossaryMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGlossaryMetadata instance + */ + public static create(properties?: google.cloud.translation.v3beta1.ICreateGlossaryMetadata): google.cloud.translation.v3beta1.CreateGlossaryMetadata; + + /** + * Encodes the specified CreateGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryMetadata.verify|verify} messages. + * @param message CreateGlossaryMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.ICreateGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryMetadata.verify|verify} messages. + * @param message CreateGlossaryMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.ICreateGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.CreateGlossaryMetadata; + + /** + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.CreateGlossaryMetadata; + + /** + * Verifies a CreateGlossaryMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGlossaryMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.CreateGlossaryMetadata; + + /** + * Creates a plain object from a CreateGlossaryMetadata message. Also converts values to other types if specified. + * @param message CreateGlossaryMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.CreateGlossaryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGlossaryMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace CreateGlossaryMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } + + /** Properties of a DeleteGlossaryMetadata. */ + interface IDeleteGlossaryMetadata { + + /** DeleteGlossaryMetadata name */ + name?: (string|null); + + /** DeleteGlossaryMetadata state */ + state?: (google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|null); + + /** DeleteGlossaryMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DeleteGlossaryMetadata. */ + class DeleteGlossaryMetadata implements IDeleteGlossaryMetadata { + + /** + * Constructs a new DeleteGlossaryMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryMetadata); + + /** DeleteGlossaryMetadata name. */ + public name: string; + + /** DeleteGlossaryMetadata state. */ + public state: google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State; + + /** DeleteGlossaryMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DeleteGlossaryMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlossaryMetadata instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryMetadata): google.cloud.translation.v3beta1.DeleteGlossaryMetadata; + + /** + * Encodes the specified DeleteGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryMetadata.verify|verify} messages. + * @param message DeleteGlossaryMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IDeleteGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryMetadata.verify|verify} messages. + * @param message DeleteGlossaryMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IDeleteGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DeleteGlossaryMetadata; + + /** + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DeleteGlossaryMetadata; + + /** + * Verifies a DeleteGlossaryMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlossaryMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DeleteGlossaryMetadata; + + /** + * Creates a plain object from a DeleteGlossaryMetadata message. Also converts values to other types if specified. + * @param message DeleteGlossaryMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.DeleteGlossaryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlossaryMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DeleteGlossaryMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } + + /** Properties of a DeleteGlossaryResponse. */ + interface IDeleteGlossaryResponse { + + /** DeleteGlossaryResponse name */ + name?: (string|null); + + /** DeleteGlossaryResponse submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** DeleteGlossaryResponse endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DeleteGlossaryResponse. */ + class DeleteGlossaryResponse implements IDeleteGlossaryResponse { + + /** + * Constructs a new DeleteGlossaryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryResponse); + + /** DeleteGlossaryResponse name. */ + public name: string; + + /** DeleteGlossaryResponse submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** DeleteGlossaryResponse endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DeleteGlossaryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlossaryResponse instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryResponse): google.cloud.translation.v3beta1.DeleteGlossaryResponse; + + /** + * Encodes the specified DeleteGlossaryResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryResponse.verify|verify} messages. + * @param message DeleteGlossaryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IDeleteGlossaryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlossaryResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryResponse.verify|verify} messages. + * @param message DeleteGlossaryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IDeleteGlossaryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlossaryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DeleteGlossaryResponse; + + /** + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlossaryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DeleteGlossaryResponse; + + /** + * Verifies a DeleteGlossaryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlossaryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlossaryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DeleteGlossaryResponse; + + /** + * Creates a plain object from a DeleteGlossaryResponse message. Also converts values to other types if specified. + * @param message DeleteGlossaryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.DeleteGlossaryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlossaryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get: string; + + /** HttpRule put. */ + public put: string; + + /** HttpRule post. */ + public post: string; + + /** HttpRule delete. */ + public delete: string; + + /** HttpRule patch. */ + public patch: string; + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: google.api.ResourceDescriptor.History; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: google.protobuf.FieldDescriptorProto.Label; + + /** FieldDescriptorProto type. */ + public type: google.protobuf.FieldDescriptorProto.Type; + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: google.protobuf.FileOptions.OptimizeMode; + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: google.protobuf.FieldOptions.CType; + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: google.protobuf.FieldOptions.JSType; + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: Uint8Array; + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: Uint8Array; + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations#listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js new file mode 100644 index 00000000000..d78ca750b0d --- /dev/null +++ b/packages/google-cloud-translate/protos/protos.js @@ -0,0 +1,20975 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("protobufjs/minimal")); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.translation = (function() { + + /** + * Namespace translation. + * @memberof google.cloud + * @namespace + */ + var translation = {}; + + translation.v3beta1 = (function() { + + /** + * Namespace v3beta1. + * @memberof google.cloud.translation + * @namespace + */ + var v3beta1 = {}; + + v3beta1.TranslationService = (function() { + + /** + * Constructs a new TranslationService service. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a TranslationService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function TranslationService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TranslationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TranslationService; + + /** + * Creates new TranslationService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.translation.v3beta1.TranslationService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {TranslationService} RPC service. Useful where requests and/or responses are streamed. + */ + TranslationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#translateText}. + * @memberof google.cloud.translation.v3beta1.TranslationService + * @typedef TranslateTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.translation.v3beta1.TranslateTextResponse} [response] TranslateTextResponse + */ + + /** + * Calls TranslateText. + * @function translateText + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.ITranslateTextRequest} request TranslateTextRequest message or plain object + * @param {google.cloud.translation.v3beta1.TranslationService.TranslateTextCallback} callback Node-style callback called with the error, if any, and TranslateTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.translateText = function translateText(request, callback) { + return this.rpcCall(translateText, $root.google.cloud.translation.v3beta1.TranslateTextRequest, $root.google.cloud.translation.v3beta1.TranslateTextResponse, request, callback); + }, "name", { value: "TranslateText" }); + + /** + * Calls TranslateText. + * @function translateText + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.ITranslateTextRequest} request TranslateTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#detectLanguage}. + * @memberof google.cloud.translation.v3beta1.TranslationService + * @typedef DetectLanguageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.translation.v3beta1.DetectLanguageResponse} [response] DetectLanguageResponse + */ + + /** + * Calls DetectLanguage. + * @function detectLanguage + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IDetectLanguageRequest} request DetectLanguageRequest message or plain object + * @param {google.cloud.translation.v3beta1.TranslationService.DetectLanguageCallback} callback Node-style callback called with the error, if any, and DetectLanguageResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.detectLanguage = function detectLanguage(request, callback) { + return this.rpcCall(detectLanguage, $root.google.cloud.translation.v3beta1.DetectLanguageRequest, $root.google.cloud.translation.v3beta1.DetectLanguageResponse, request, callback); + }, "name", { value: "DetectLanguage" }); + + /** + * Calls DetectLanguage. + * @function detectLanguage + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IDetectLanguageRequest} request DetectLanguageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#getSupportedLanguages}. + * @memberof google.cloud.translation.v3beta1.TranslationService + * @typedef GetSupportedLanguagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.translation.v3beta1.SupportedLanguages} [response] SupportedLanguages + */ + + /** + * Calls GetSupportedLanguages. + * @function getSupportedLanguages + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest} request GetSupportedLanguagesRequest message or plain object + * @param {google.cloud.translation.v3beta1.TranslationService.GetSupportedLanguagesCallback} callback Node-style callback called with the error, if any, and SupportedLanguages + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.getSupportedLanguages = function getSupportedLanguages(request, callback) { + return this.rpcCall(getSupportedLanguages, $root.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest, $root.google.cloud.translation.v3beta1.SupportedLanguages, request, callback); + }, "name", { value: "GetSupportedLanguages" }); + + /** + * Calls GetSupportedLanguages. + * @function getSupportedLanguages + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest} request GetSupportedLanguagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#batchTranslateText}. + * @memberof google.cloud.translation.v3beta1.TranslationService + * @typedef BatchTranslateTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchTranslateText. + * @function batchTranslateText + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest} request BatchTranslateTextRequest message or plain object + * @param {google.cloud.translation.v3beta1.TranslationService.BatchTranslateTextCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.batchTranslateText = function batchTranslateText(request, callback) { + return this.rpcCall(batchTranslateText, $root.google.cloud.translation.v3beta1.BatchTranslateTextRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchTranslateText" }); + + /** + * Calls BatchTranslateText. + * @function batchTranslateText + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest} request BatchTranslateTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#createGlossary}. + * @memberof google.cloud.translation.v3beta1.TranslationService + * @typedef CreateGlossaryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGlossary. + * @function createGlossary + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest} request CreateGlossaryRequest message or plain object + * @param {google.cloud.translation.v3beta1.TranslationService.CreateGlossaryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.createGlossary = function createGlossary(request, callback) { + return this.rpcCall(createGlossary, $root.google.cloud.translation.v3beta1.CreateGlossaryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGlossary" }); + + /** + * Calls CreateGlossary. + * @function createGlossary + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest} request CreateGlossaryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#listGlossaries}. + * @memberof google.cloud.translation.v3beta1.TranslationService + * @typedef ListGlossariesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.translation.v3beta1.ListGlossariesResponse} [response] ListGlossariesResponse + */ + + /** + * Calls ListGlossaries. + * @function listGlossaries + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IListGlossariesRequest} request ListGlossariesRequest message or plain object + * @param {google.cloud.translation.v3beta1.TranslationService.ListGlossariesCallback} callback Node-style callback called with the error, if any, and ListGlossariesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.listGlossaries = function listGlossaries(request, callback) { + return this.rpcCall(listGlossaries, $root.google.cloud.translation.v3beta1.ListGlossariesRequest, $root.google.cloud.translation.v3beta1.ListGlossariesResponse, request, callback); + }, "name", { value: "ListGlossaries" }); + + /** + * Calls ListGlossaries. + * @function listGlossaries + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IListGlossariesRequest} request ListGlossariesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#getGlossary}. + * @memberof google.cloud.translation.v3beta1.TranslationService + * @typedef GetGlossaryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.translation.v3beta1.Glossary} [response] Glossary + */ + + /** + * Calls GetGlossary. + * @function getGlossary + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest} request GetGlossaryRequest message or plain object + * @param {google.cloud.translation.v3beta1.TranslationService.GetGlossaryCallback} callback Node-style callback called with the error, if any, and Glossary + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.getGlossary = function getGlossary(request, callback) { + return this.rpcCall(getGlossary, $root.google.cloud.translation.v3beta1.GetGlossaryRequest, $root.google.cloud.translation.v3beta1.Glossary, request, callback); + }, "name", { value: "GetGlossary" }); + + /** + * Calls GetGlossary. + * @function getGlossary + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest} request GetGlossaryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#deleteGlossary}. + * @memberof google.cloud.translation.v3beta1.TranslationService + * @typedef DeleteGlossaryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGlossary. + * @function deleteGlossary + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest} request DeleteGlossaryRequest message or plain object + * @param {google.cloud.translation.v3beta1.TranslationService.DeleteGlossaryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.deleteGlossary = function deleteGlossary(request, callback) { + return this.rpcCall(deleteGlossary, $root.google.cloud.translation.v3beta1.DeleteGlossaryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGlossary" }); + + /** + * Calls DeleteGlossary. + * @function deleteGlossary + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest} request DeleteGlossaryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TranslationService; + })(); + + v3beta1.TranslateTextGlossaryConfig = (function() { + + /** + * Properties of a TranslateTextGlossaryConfig. + * @memberof google.cloud.translation.v3beta1 + * @interface ITranslateTextGlossaryConfig + * @property {string|null} [glossary] TranslateTextGlossaryConfig glossary + * @property {boolean|null} [ignoreCase] TranslateTextGlossaryConfig ignoreCase + */ + + /** + * Constructs a new TranslateTextGlossaryConfig. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a TranslateTextGlossaryConfig. + * @implements ITranslateTextGlossaryConfig + * @constructor + * @param {google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig=} [properties] Properties to set + */ + function TranslateTextGlossaryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslateTextGlossaryConfig glossary. + * @member {string} glossary + * @memberof google.cloud.translation.v3beta1.TranslateTextGlossaryConfig + * @instance + */ + TranslateTextGlossaryConfig.prototype.glossary = ""; + + /** + * TranslateTextGlossaryConfig ignoreCase. + * @member {boolean} ignoreCase + * @memberof google.cloud.translation.v3beta1.TranslateTextGlossaryConfig + * @instance + */ + TranslateTextGlossaryConfig.prototype.ignoreCase = false; + + /** + * Creates a new TranslateTextGlossaryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.TranslateTextGlossaryConfig + * @static + * @param {google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} TranslateTextGlossaryConfig instance + */ + TranslateTextGlossaryConfig.create = function create(properties) { + return new TranslateTextGlossaryConfig(properties); + }; + + /** + * Encodes the specified TranslateTextGlossaryConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.TranslateTextGlossaryConfig + * @static + * @param {google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig} message TranslateTextGlossaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateTextGlossaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.glossary != null && message.hasOwnProperty("glossary")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.glossary); + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignoreCase); + return writer; + }; + + /** + * Encodes the specified TranslateTextGlossaryConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.TranslateTextGlossaryConfig + * @static + * @param {google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig} message TranslateTextGlossaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateTextGlossaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslateTextGlossaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.TranslateTextGlossaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} TranslateTextGlossaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateTextGlossaryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.glossary = reader.string(); + break; + case 2: + message.ignoreCase = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslateTextGlossaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.TranslateTextGlossaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} TranslateTextGlossaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateTextGlossaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslateTextGlossaryConfig message. + * @function verify + * @memberof google.cloud.translation.v3beta1.TranslateTextGlossaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslateTextGlossaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.glossary != null && message.hasOwnProperty("glossary")) + if (!$util.isString(message.glossary)) + return "glossary: string expected"; + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + if (typeof message.ignoreCase !== "boolean") + return "ignoreCase: boolean expected"; + return null; + }; + + /** + * Creates a TranslateTextGlossaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.TranslateTextGlossaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} TranslateTextGlossaryConfig + */ + TranslateTextGlossaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig) + return object; + var message = new $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig(); + if (object.glossary != null) + message.glossary = String(object.glossary); + if (object.ignoreCase != null) + message.ignoreCase = Boolean(object.ignoreCase); + return message; + }; + + /** + * Creates a plain object from a TranslateTextGlossaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.TranslateTextGlossaryConfig + * @static + * @param {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} message TranslateTextGlossaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslateTextGlossaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.glossary = ""; + object.ignoreCase = false; + } + if (message.glossary != null && message.hasOwnProperty("glossary")) + object.glossary = message.glossary; + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + object.ignoreCase = message.ignoreCase; + return object; + }; + + /** + * Converts this TranslateTextGlossaryConfig to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.TranslateTextGlossaryConfig + * @instance + * @returns {Object.} JSON object + */ + TranslateTextGlossaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TranslateTextGlossaryConfig; + })(); + + v3beta1.TranslateTextRequest = (function() { + + /** + * Properties of a TranslateTextRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface ITranslateTextRequest + * @property {Array.|null} [contents] TranslateTextRequest contents + * @property {string|null} [mimeType] TranslateTextRequest mimeType + * @property {string|null} [sourceLanguageCode] TranslateTextRequest sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslateTextRequest targetLanguageCode + * @property {string|null} [parent] TranslateTextRequest parent + * @property {string|null} [model] TranslateTextRequest model + * @property {google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null} [glossaryConfig] TranslateTextRequest glossaryConfig + * @property {Object.|null} [labels] TranslateTextRequest labels + */ + + /** + * Constructs a new TranslateTextRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a TranslateTextRequest. + * @implements ITranslateTextRequest + * @constructor + * @param {google.cloud.translation.v3beta1.ITranslateTextRequest=} [properties] Properties to set + */ + function TranslateTextRequest(properties) { + this.contents = []; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslateTextRequest contents. + * @member {Array.} contents + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.contents = $util.emptyArray; + + /** + * TranslateTextRequest mimeType. + * @member {string} mimeType + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.mimeType = ""; + + /** + * TranslateTextRequest sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.sourceLanguageCode = ""; + + /** + * TranslateTextRequest targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.targetLanguageCode = ""; + + /** + * TranslateTextRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.parent = ""; + + /** + * TranslateTextRequest model. + * @member {string} model + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.model = ""; + + /** + * TranslateTextRequest glossaryConfig. + * @member {google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null|undefined} glossaryConfig + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.glossaryConfig = null; + + /** + * TranslateTextRequest labels. + * @member {Object.} labels + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new TranslateTextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @static + * @param {google.cloud.translation.v3beta1.ITranslateTextRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.TranslateTextRequest} TranslateTextRequest instance + */ + TranslateTextRequest.create = function create(properties) { + return new TranslateTextRequest(properties); + }; + + /** + * Encodes the specified TranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateTextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @static + * @param {google.cloud.translation.v3beta1.ITranslateTextRequest} message TranslateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contents != null && message.contents.length) + for (var i = 0; i < message.contents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.contents[i]); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetLanguageCode); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.model); + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.parent); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @static + * @param {google.cloud.translation.v3beta1.ITranslateTextRequest} message TranslateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslateTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.TranslateTextRequest} TranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.TranslateTextRequest(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push(reader.string()); + break; + case 3: + message.mimeType = reader.string(); + break; + case 4: + message.sourceLanguageCode = reader.string(); + break; + case 5: + message.targetLanguageCode = reader.string(); + break; + case 8: + message.parent = reader.string(); + break; + case 6: + message.model = reader.string(); + break; + case 7: + message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + case 10: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslateTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.TranslateTextRequest} TranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslateTextRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslateTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contents != null && message.hasOwnProperty("contents")) { + if (!Array.isArray(message.contents)) + return "contents: array expected"; + for (var i = 0; i < message.contents.length; ++i) + if (!$util.isString(message.contents[i])) + return "contents: string[] expected"; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) { + var error = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.verify(message.glossaryConfig); + if (error) + return "glossaryConfig." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a TranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.TranslateTextRequest} TranslateTextRequest + */ + TranslateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.TranslateTextRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.TranslateTextRequest(); + if (object.contents) { + if (!Array.isArray(object.contents)) + throw TypeError(".google.cloud.translation.v3beta1.TranslateTextRequest.contents: array expected"); + message.contents = []; + for (var i = 0; i < object.contents.length; ++i) + message.contents[i] = String(object.contents[i]); + } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + if (object.parent != null) + message.parent = String(object.parent); + if (object.model != null) + message.model = String(object.model); + if (object.glossaryConfig != null) { + if (typeof object.glossaryConfig !== "object") + throw TypeError(".google.cloud.translation.v3beta1.TranslateTextRequest.glossaryConfig: object expected"); + message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.fromObject(object.glossaryConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.translation.v3beta1.TranslateTextRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a TranslateTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @static + * @param {google.cloud.translation.v3beta1.TranslateTextRequest} message TranslateTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslateTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contents = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.mimeType = ""; + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + object.model = ""; + object.glossaryConfig = null; + object.parent = ""; + } + if (message.contents && message.contents.length) { + object.contents = []; + for (var j = 0; j < message.contents.length; ++j) + object.contents[j] = message.contents[j]; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + object.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.toObject(message.glossaryConfig, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this TranslateTextRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @instance + * @returns {Object.} JSON object + */ + TranslateTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TranslateTextRequest; + })(); + + v3beta1.TranslateTextResponse = (function() { + + /** + * Properties of a TranslateTextResponse. + * @memberof google.cloud.translation.v3beta1 + * @interface ITranslateTextResponse + * @property {Array.|null} [translations] TranslateTextResponse translations + * @property {Array.|null} [glossaryTranslations] TranslateTextResponse glossaryTranslations + */ + + /** + * Constructs a new TranslateTextResponse. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a TranslateTextResponse. + * @implements ITranslateTextResponse + * @constructor + * @param {google.cloud.translation.v3beta1.ITranslateTextResponse=} [properties] Properties to set + */ + function TranslateTextResponse(properties) { + this.translations = []; + this.glossaryTranslations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslateTextResponse translations. + * @member {Array.} translations + * @memberof google.cloud.translation.v3beta1.TranslateTextResponse + * @instance + */ + TranslateTextResponse.prototype.translations = $util.emptyArray; + + /** + * TranslateTextResponse glossaryTranslations. + * @member {Array.} glossaryTranslations + * @memberof google.cloud.translation.v3beta1.TranslateTextResponse + * @instance + */ + TranslateTextResponse.prototype.glossaryTranslations = $util.emptyArray; + + /** + * Creates a new TranslateTextResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.TranslateTextResponse + * @static + * @param {google.cloud.translation.v3beta1.ITranslateTextResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.TranslateTextResponse} TranslateTextResponse instance + */ + TranslateTextResponse.create = function create(properties) { + return new TranslateTextResponse(properties); + }; + + /** + * Encodes the specified TranslateTextResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateTextResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.TranslateTextResponse + * @static + * @param {google.cloud.translation.v3beta1.ITranslateTextResponse} message TranslateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.translations != null && message.translations.length) + for (var i = 0; i < message.translations.length; ++i) + $root.google.cloud.translation.v3beta1.Translation.encode(message.translations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.glossaryTranslations != null && message.glossaryTranslations.length) + for (var i = 0; i < message.glossaryTranslations.length; ++i) + $root.google.cloud.translation.v3beta1.Translation.encode(message.glossaryTranslations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranslateTextResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.TranslateTextResponse + * @static + * @param {google.cloud.translation.v3beta1.ITranslateTextResponse} message TranslateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslateTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.TranslateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.TranslateTextResponse} TranslateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.TranslateTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.translations && message.translations.length)) + message.translations = []; + message.translations.push($root.google.cloud.translation.v3beta1.Translation.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.glossaryTranslations && message.glossaryTranslations.length)) + message.glossaryTranslations = []; + message.glossaryTranslations.push($root.google.cloud.translation.v3beta1.Translation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslateTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.TranslateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.TranslateTextResponse} TranslateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslateTextResponse message. + * @function verify + * @memberof google.cloud.translation.v3beta1.TranslateTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslateTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.translations != null && message.hasOwnProperty("translations")) { + if (!Array.isArray(message.translations)) + return "translations: array expected"; + for (var i = 0; i < message.translations.length; ++i) { + var error = $root.google.cloud.translation.v3beta1.Translation.verify(message.translations[i]); + if (error) + return "translations." + error; + } + } + if (message.glossaryTranslations != null && message.hasOwnProperty("glossaryTranslations")) { + if (!Array.isArray(message.glossaryTranslations)) + return "glossaryTranslations: array expected"; + for (var i = 0; i < message.glossaryTranslations.length; ++i) { + var error = $root.google.cloud.translation.v3beta1.Translation.verify(message.glossaryTranslations[i]); + if (error) + return "glossaryTranslations." + error; + } + } + return null; + }; + + /** + * Creates a TranslateTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.TranslateTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.TranslateTextResponse} TranslateTextResponse + */ + TranslateTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.TranslateTextResponse) + return object; + var message = new $root.google.cloud.translation.v3beta1.TranslateTextResponse(); + if (object.translations) { + if (!Array.isArray(object.translations)) + throw TypeError(".google.cloud.translation.v3beta1.TranslateTextResponse.translations: array expected"); + message.translations = []; + for (var i = 0; i < object.translations.length; ++i) { + if (typeof object.translations[i] !== "object") + throw TypeError(".google.cloud.translation.v3beta1.TranslateTextResponse.translations: object expected"); + message.translations[i] = $root.google.cloud.translation.v3beta1.Translation.fromObject(object.translations[i]); + } + } + if (object.glossaryTranslations) { + if (!Array.isArray(object.glossaryTranslations)) + throw TypeError(".google.cloud.translation.v3beta1.TranslateTextResponse.glossaryTranslations: array expected"); + message.glossaryTranslations = []; + for (var i = 0; i < object.glossaryTranslations.length; ++i) { + if (typeof object.glossaryTranslations[i] !== "object") + throw TypeError(".google.cloud.translation.v3beta1.TranslateTextResponse.glossaryTranslations: object expected"); + message.glossaryTranslations[i] = $root.google.cloud.translation.v3beta1.Translation.fromObject(object.glossaryTranslations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TranslateTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.TranslateTextResponse + * @static + * @param {google.cloud.translation.v3beta1.TranslateTextResponse} message TranslateTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslateTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.translations = []; + object.glossaryTranslations = []; + } + if (message.translations && message.translations.length) { + object.translations = []; + for (var j = 0; j < message.translations.length; ++j) + object.translations[j] = $root.google.cloud.translation.v3beta1.Translation.toObject(message.translations[j], options); + } + if (message.glossaryTranslations && message.glossaryTranslations.length) { + object.glossaryTranslations = []; + for (var j = 0; j < message.glossaryTranslations.length; ++j) + object.glossaryTranslations[j] = $root.google.cloud.translation.v3beta1.Translation.toObject(message.glossaryTranslations[j], options); + } + return object; + }; + + /** + * Converts this TranslateTextResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.TranslateTextResponse + * @instance + * @returns {Object.} JSON object + */ + TranslateTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TranslateTextResponse; + })(); + + v3beta1.Translation = (function() { + + /** + * Properties of a Translation. + * @memberof google.cloud.translation.v3beta1 + * @interface ITranslation + * @property {string|null} [translatedText] Translation translatedText + * @property {string|null} [model] Translation model + * @property {string|null} [detectedLanguageCode] Translation detectedLanguageCode + * @property {google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null} [glossaryConfig] Translation glossaryConfig + */ + + /** + * Constructs a new Translation. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a Translation. + * @implements ITranslation + * @constructor + * @param {google.cloud.translation.v3beta1.ITranslation=} [properties] Properties to set + */ + function Translation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Translation translatedText. + * @member {string} translatedText + * @memberof google.cloud.translation.v3beta1.Translation + * @instance + */ + Translation.prototype.translatedText = ""; + + /** + * Translation model. + * @member {string} model + * @memberof google.cloud.translation.v3beta1.Translation + * @instance + */ + Translation.prototype.model = ""; + + /** + * Translation detectedLanguageCode. + * @member {string} detectedLanguageCode + * @memberof google.cloud.translation.v3beta1.Translation + * @instance + */ + Translation.prototype.detectedLanguageCode = ""; + + /** + * Translation glossaryConfig. + * @member {google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null|undefined} glossaryConfig + * @memberof google.cloud.translation.v3beta1.Translation + * @instance + */ + Translation.prototype.glossaryConfig = null; + + /** + * Creates a new Translation instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.Translation + * @static + * @param {google.cloud.translation.v3beta1.ITranslation=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.Translation} Translation instance + */ + Translation.create = function create(properties) { + return new Translation(properties); + }; + + /** + * Encodes the specified Translation message. Does not implicitly {@link google.cloud.translation.v3beta1.Translation.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.Translation + * @static + * @param {google.cloud.translation.v3beta1.ITranslation} message Translation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Translation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.translatedText != null && message.hasOwnProperty("translatedText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.translatedText); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.detectedLanguageCode); + return writer; + }; + + /** + * Encodes the specified Translation message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Translation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.Translation + * @static + * @param {google.cloud.translation.v3beta1.ITranslation} message Translation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Translation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Translation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.Translation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.Translation} Translation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Translation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.Translation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.translatedText = reader.string(); + break; + case 2: + message.model = reader.string(); + break; + case 4: + message.detectedLanguageCode = reader.string(); + break; + case 3: + message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Translation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.Translation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.Translation} Translation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Translation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Translation message. + * @function verify + * @memberof google.cloud.translation.v3beta1.Translation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Translation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.translatedText != null && message.hasOwnProperty("translatedText")) + if (!$util.isString(message.translatedText)) + return "translatedText: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + if (!$util.isString(message.detectedLanguageCode)) + return "detectedLanguageCode: string expected"; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) { + var error = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.verify(message.glossaryConfig); + if (error) + return "glossaryConfig." + error; + } + return null; + }; + + /** + * Creates a Translation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.Translation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.Translation} Translation + */ + Translation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.Translation) + return object; + var message = new $root.google.cloud.translation.v3beta1.Translation(); + if (object.translatedText != null) + message.translatedText = String(object.translatedText); + if (object.model != null) + message.model = String(object.model); + if (object.detectedLanguageCode != null) + message.detectedLanguageCode = String(object.detectedLanguageCode); + if (object.glossaryConfig != null) { + if (typeof object.glossaryConfig !== "object") + throw TypeError(".google.cloud.translation.v3beta1.Translation.glossaryConfig: object expected"); + message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.fromObject(object.glossaryConfig); + } + return message; + }; + + /** + * Creates a plain object from a Translation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.Translation + * @static + * @param {google.cloud.translation.v3beta1.Translation} message Translation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Translation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.translatedText = ""; + object.model = ""; + object.glossaryConfig = null; + object.detectedLanguageCode = ""; + } + if (message.translatedText != null && message.hasOwnProperty("translatedText")) + object.translatedText = message.translatedText; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + object.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.toObject(message.glossaryConfig, options); + if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + object.detectedLanguageCode = message.detectedLanguageCode; + return object; + }; + + /** + * Converts this Translation to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.Translation + * @instance + * @returns {Object.} JSON object + */ + Translation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Translation; + })(); + + v3beta1.DetectLanguageRequest = (function() { + + /** + * Properties of a DetectLanguageRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface IDetectLanguageRequest + * @property {string|null} [parent] DetectLanguageRequest parent + * @property {string|null} [model] DetectLanguageRequest model + * @property {string|null} [content] DetectLanguageRequest content + * @property {string|null} [mimeType] DetectLanguageRequest mimeType + * @property {Object.|null} [labels] DetectLanguageRequest labels + */ + + /** + * Constructs a new DetectLanguageRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a DetectLanguageRequest. + * @implements IDetectLanguageRequest + * @constructor + * @param {google.cloud.translation.v3beta1.IDetectLanguageRequest=} [properties] Properties to set + */ + function DetectLanguageRequest(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectLanguageRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @instance + */ + DetectLanguageRequest.prototype.parent = ""; + + /** + * DetectLanguageRequest model. + * @member {string} model + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @instance + */ + DetectLanguageRequest.prototype.model = ""; + + /** + * DetectLanguageRequest content. + * @member {string} content + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @instance + */ + DetectLanguageRequest.prototype.content = ""; + + /** + * DetectLanguageRequest mimeType. + * @member {string} mimeType + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @instance + */ + DetectLanguageRequest.prototype.mimeType = ""; + + /** + * DetectLanguageRequest labels. + * @member {Object.} labels + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @instance + */ + DetectLanguageRequest.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DetectLanguageRequest source. + * @member {"content"|undefined} source + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @instance + */ + Object.defineProperty(DetectLanguageRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["content"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DetectLanguageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @static + * @param {google.cloud.translation.v3beta1.IDetectLanguageRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.DetectLanguageRequest} DetectLanguageRequest instance + */ + DetectLanguageRequest.create = function create(properties) { + return new DetectLanguageRequest(properties); + }; + + /** + * Encodes the specified DetectLanguageRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.DetectLanguageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @static + * @param {google.cloud.translation.v3beta1.IDetectLanguageRequest} message DetectLanguageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectLanguageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.model); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified DetectLanguageRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DetectLanguageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @static + * @param {google.cloud.translation.v3beta1.IDetectLanguageRequest} message DetectLanguageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectLanguageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectLanguageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.DetectLanguageRequest} DetectLanguageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectLanguageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DetectLanguageRequest(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + message.parent = reader.string(); + break; + case 4: + message.model = reader.string(); + break; + case 1: + message.content = reader.string(); + break; + case 3: + message.mimeType = reader.string(); + break; + case 6: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectLanguageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.DetectLanguageRequest} DetectLanguageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectLanguageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectLanguageRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectLanguageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.content != null && message.hasOwnProperty("content")) { + properties.source = 1; + if (!$util.isString(message.content)) + return "content: string expected"; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a DetectLanguageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.DetectLanguageRequest} DetectLanguageRequest + */ + DetectLanguageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.DetectLanguageRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.DetectLanguageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.model != null) + message.model = String(object.model); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.translation.v3beta1.DetectLanguageRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a DetectLanguageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @static + * @param {google.cloud.translation.v3beta1.DetectLanguageRequest} message DetectLanguageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectLanguageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.mimeType = ""; + object.model = ""; + object.parent = ""; + } + if (message.content != null && message.hasOwnProperty("content")) { + object.content = message.content; + if (options.oneofs) + object.source = "content"; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this DetectLanguageRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @instance + * @returns {Object.} JSON object + */ + DetectLanguageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectLanguageRequest; + })(); + + v3beta1.DetectedLanguage = (function() { + + /** + * Properties of a DetectedLanguage. + * @memberof google.cloud.translation.v3beta1 + * @interface IDetectedLanguage + * @property {string|null} [languageCode] DetectedLanguage languageCode + * @property {number|null} [confidence] DetectedLanguage confidence + */ + + /** + * Constructs a new DetectedLanguage. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a DetectedLanguage. + * @implements IDetectedLanguage + * @constructor + * @param {google.cloud.translation.v3beta1.IDetectedLanguage=} [properties] Properties to set + */ + function DetectedLanguage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectedLanguage languageCode. + * @member {string} languageCode + * @memberof google.cloud.translation.v3beta1.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.languageCode = ""; + + /** + * DetectedLanguage confidence. + * @member {number} confidence + * @memberof google.cloud.translation.v3beta1.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.confidence = 0; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.DetectedLanguage + * @static + * @param {google.cloud.translation.v3beta1.IDetectedLanguage=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.DetectedLanguage} DetectedLanguage instance + */ + DetectedLanguage.create = function create(properties) { + return new DetectedLanguage(properties); + }; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.translation.v3beta1.DetectedLanguage.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.DetectedLanguage + * @static + * @param {google.cloud.translation.v3beta1.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DetectedLanguage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.DetectedLanguage + * @static + * @param {google.cloud.translation.v3beta1.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DetectedLanguage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.languageCode = reader.string(); + break; + case 2: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedLanguage message. + * @function verify + * @memberof google.cloud.translation.v3beta1.DetectedLanguage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedLanguage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.DetectedLanguage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.DetectedLanguage} DetectedLanguage + */ + DetectedLanguage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.DetectedLanguage) + return object; + var message = new $root.google.cloud.translation.v3beta1.DetectedLanguage(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.DetectedLanguage + * @static + * @param {google.cloud.translation.v3beta1.DetectedLanguage} message DetectedLanguage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedLanguage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.languageCode = ""; + object.confidence = 0; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this DetectedLanguage to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.DetectedLanguage + * @instance + * @returns {Object.} JSON object + */ + DetectedLanguage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectedLanguage; + })(); + + v3beta1.DetectLanguageResponse = (function() { + + /** + * Properties of a DetectLanguageResponse. + * @memberof google.cloud.translation.v3beta1 + * @interface IDetectLanguageResponse + * @property {Array.|null} [languages] DetectLanguageResponse languages + */ + + /** + * Constructs a new DetectLanguageResponse. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a DetectLanguageResponse. + * @implements IDetectLanguageResponse + * @constructor + * @param {google.cloud.translation.v3beta1.IDetectLanguageResponse=} [properties] Properties to set + */ + function DetectLanguageResponse(properties) { + this.languages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectLanguageResponse languages. + * @member {Array.} languages + * @memberof google.cloud.translation.v3beta1.DetectLanguageResponse + * @instance + */ + DetectLanguageResponse.prototype.languages = $util.emptyArray; + + /** + * Creates a new DetectLanguageResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.DetectLanguageResponse + * @static + * @param {google.cloud.translation.v3beta1.IDetectLanguageResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.DetectLanguageResponse} DetectLanguageResponse instance + */ + DetectLanguageResponse.create = function create(properties) { + return new DetectLanguageResponse(properties); + }; + + /** + * Encodes the specified DetectLanguageResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.DetectLanguageResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.DetectLanguageResponse + * @static + * @param {google.cloud.translation.v3beta1.IDetectLanguageResponse} message DetectLanguageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectLanguageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languages != null && message.languages.length) + for (var i = 0; i < message.languages.length; ++i) + $root.google.cloud.translation.v3beta1.DetectedLanguage.encode(message.languages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DetectLanguageResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DetectLanguageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.DetectLanguageResponse + * @static + * @param {google.cloud.translation.v3beta1.IDetectLanguageResponse} message DetectLanguageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectLanguageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectLanguageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.DetectLanguageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.DetectLanguageResponse} DetectLanguageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectLanguageResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DetectLanguageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.languages && message.languages.length)) + message.languages = []; + message.languages.push($root.google.cloud.translation.v3beta1.DetectedLanguage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectLanguageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.DetectLanguageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.DetectLanguageResponse} DetectLanguageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectLanguageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectLanguageResponse message. + * @function verify + * @memberof google.cloud.translation.v3beta1.DetectLanguageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectLanguageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languages != null && message.hasOwnProperty("languages")) { + if (!Array.isArray(message.languages)) + return "languages: array expected"; + for (var i = 0; i < message.languages.length; ++i) { + var error = $root.google.cloud.translation.v3beta1.DetectedLanguage.verify(message.languages[i]); + if (error) + return "languages." + error; + } + } + return null; + }; + + /** + * Creates a DetectLanguageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.DetectLanguageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.DetectLanguageResponse} DetectLanguageResponse + */ + DetectLanguageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.DetectLanguageResponse) + return object; + var message = new $root.google.cloud.translation.v3beta1.DetectLanguageResponse(); + if (object.languages) { + if (!Array.isArray(object.languages)) + throw TypeError(".google.cloud.translation.v3beta1.DetectLanguageResponse.languages: array expected"); + message.languages = []; + for (var i = 0; i < object.languages.length; ++i) { + if (typeof object.languages[i] !== "object") + throw TypeError(".google.cloud.translation.v3beta1.DetectLanguageResponse.languages: object expected"); + message.languages[i] = $root.google.cloud.translation.v3beta1.DetectedLanguage.fromObject(object.languages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DetectLanguageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.DetectLanguageResponse + * @static + * @param {google.cloud.translation.v3beta1.DetectLanguageResponse} message DetectLanguageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectLanguageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languages = []; + if (message.languages && message.languages.length) { + object.languages = []; + for (var j = 0; j < message.languages.length; ++j) + object.languages[j] = $root.google.cloud.translation.v3beta1.DetectedLanguage.toObject(message.languages[j], options); + } + return object; + }; + + /** + * Converts this DetectLanguageResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.DetectLanguageResponse + * @instance + * @returns {Object.} JSON object + */ + DetectLanguageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectLanguageResponse; + })(); + + v3beta1.GetSupportedLanguagesRequest = (function() { + + /** + * Properties of a GetSupportedLanguagesRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface IGetSupportedLanguagesRequest + * @property {string|null} [parent] GetSupportedLanguagesRequest parent + * @property {string|null} [displayLanguageCode] GetSupportedLanguagesRequest displayLanguageCode + * @property {string|null} [model] GetSupportedLanguagesRequest model + */ + + /** + * Constructs a new GetSupportedLanguagesRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a GetSupportedLanguagesRequest. + * @implements IGetSupportedLanguagesRequest + * @constructor + * @param {google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest=} [properties] Properties to set + */ + function GetSupportedLanguagesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSupportedLanguagesRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @instance + */ + GetSupportedLanguagesRequest.prototype.parent = ""; + + /** + * GetSupportedLanguagesRequest displayLanguageCode. + * @member {string} displayLanguageCode + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @instance + */ + GetSupportedLanguagesRequest.prototype.displayLanguageCode = ""; + + /** + * GetSupportedLanguagesRequest model. + * @member {string} model + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @instance + */ + GetSupportedLanguagesRequest.prototype.model = ""; + + /** + * Creates a new GetSupportedLanguagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @static + * @param {google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.GetSupportedLanguagesRequest} GetSupportedLanguagesRequest instance + */ + GetSupportedLanguagesRequest.create = function create(properties) { + return new GetSupportedLanguagesRequest(properties); + }; + + /** + * Encodes the specified GetSupportedLanguagesRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.GetSupportedLanguagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @static + * @param {google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest} message GetSupportedLanguagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSupportedLanguagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayLanguageCode != null && message.hasOwnProperty("displayLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayLanguageCode); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); + return writer; + }; + + /** + * Encodes the specified GetSupportedLanguagesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GetSupportedLanguagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @static + * @param {google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest} message GetSupportedLanguagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSupportedLanguagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSupportedLanguagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.GetSupportedLanguagesRequest} GetSupportedLanguagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSupportedLanguagesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.parent = reader.string(); + break; + case 1: + message.displayLanguageCode = reader.string(); + break; + case 2: + message.model = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSupportedLanguagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.GetSupportedLanguagesRequest} GetSupportedLanguagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSupportedLanguagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSupportedLanguagesRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSupportedLanguagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.displayLanguageCode != null && message.hasOwnProperty("displayLanguageCode")) + if (!$util.isString(message.displayLanguageCode)) + return "displayLanguageCode: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a GetSupportedLanguagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.GetSupportedLanguagesRequest} GetSupportedLanguagesRequest + */ + GetSupportedLanguagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.displayLanguageCode != null) + message.displayLanguageCode = String(object.displayLanguageCode); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a GetSupportedLanguagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @static + * @param {google.cloud.translation.v3beta1.GetSupportedLanguagesRequest} message GetSupportedLanguagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSupportedLanguagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayLanguageCode = ""; + object.model = ""; + object.parent = ""; + } + if (message.displayLanguageCode != null && message.hasOwnProperty("displayLanguageCode")) + object.displayLanguageCode = message.displayLanguageCode; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this GetSupportedLanguagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @instance + * @returns {Object.} JSON object + */ + GetSupportedLanguagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSupportedLanguagesRequest; + })(); + + v3beta1.SupportedLanguages = (function() { + + /** + * Properties of a SupportedLanguages. + * @memberof google.cloud.translation.v3beta1 + * @interface ISupportedLanguages + * @property {Array.|null} [languages] SupportedLanguages languages + */ + + /** + * Constructs a new SupportedLanguages. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a SupportedLanguages. + * @implements ISupportedLanguages + * @constructor + * @param {google.cloud.translation.v3beta1.ISupportedLanguages=} [properties] Properties to set + */ + function SupportedLanguages(properties) { + this.languages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SupportedLanguages languages. + * @member {Array.} languages + * @memberof google.cloud.translation.v3beta1.SupportedLanguages + * @instance + */ + SupportedLanguages.prototype.languages = $util.emptyArray; + + /** + * Creates a new SupportedLanguages instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.SupportedLanguages + * @static + * @param {google.cloud.translation.v3beta1.ISupportedLanguages=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.SupportedLanguages} SupportedLanguages instance + */ + SupportedLanguages.create = function create(properties) { + return new SupportedLanguages(properties); + }; + + /** + * Encodes the specified SupportedLanguages message. Does not implicitly {@link google.cloud.translation.v3beta1.SupportedLanguages.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.SupportedLanguages + * @static + * @param {google.cloud.translation.v3beta1.ISupportedLanguages} message SupportedLanguages message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedLanguages.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languages != null && message.languages.length) + for (var i = 0; i < message.languages.length; ++i) + $root.google.cloud.translation.v3beta1.SupportedLanguage.encode(message.languages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SupportedLanguages message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.SupportedLanguages.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.SupportedLanguages + * @static + * @param {google.cloud.translation.v3beta1.ISupportedLanguages} message SupportedLanguages message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedLanguages.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupportedLanguages message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.SupportedLanguages + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.SupportedLanguages} SupportedLanguages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedLanguages.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.SupportedLanguages(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.languages && message.languages.length)) + message.languages = []; + message.languages.push($root.google.cloud.translation.v3beta1.SupportedLanguage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupportedLanguages message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.SupportedLanguages + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.SupportedLanguages} SupportedLanguages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedLanguages.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupportedLanguages message. + * @function verify + * @memberof google.cloud.translation.v3beta1.SupportedLanguages + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupportedLanguages.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languages != null && message.hasOwnProperty("languages")) { + if (!Array.isArray(message.languages)) + return "languages: array expected"; + for (var i = 0; i < message.languages.length; ++i) { + var error = $root.google.cloud.translation.v3beta1.SupportedLanguage.verify(message.languages[i]); + if (error) + return "languages." + error; + } + } + return null; + }; + + /** + * Creates a SupportedLanguages message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.SupportedLanguages + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.SupportedLanguages} SupportedLanguages + */ + SupportedLanguages.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.SupportedLanguages) + return object; + var message = new $root.google.cloud.translation.v3beta1.SupportedLanguages(); + if (object.languages) { + if (!Array.isArray(object.languages)) + throw TypeError(".google.cloud.translation.v3beta1.SupportedLanguages.languages: array expected"); + message.languages = []; + for (var i = 0; i < object.languages.length; ++i) { + if (typeof object.languages[i] !== "object") + throw TypeError(".google.cloud.translation.v3beta1.SupportedLanguages.languages: object expected"); + message.languages[i] = $root.google.cloud.translation.v3beta1.SupportedLanguage.fromObject(object.languages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SupportedLanguages message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.SupportedLanguages + * @static + * @param {google.cloud.translation.v3beta1.SupportedLanguages} message SupportedLanguages + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupportedLanguages.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languages = []; + if (message.languages && message.languages.length) { + object.languages = []; + for (var j = 0; j < message.languages.length; ++j) + object.languages[j] = $root.google.cloud.translation.v3beta1.SupportedLanguage.toObject(message.languages[j], options); + } + return object; + }; + + /** + * Converts this SupportedLanguages to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.SupportedLanguages + * @instance + * @returns {Object.} JSON object + */ + SupportedLanguages.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SupportedLanguages; + })(); + + v3beta1.SupportedLanguage = (function() { + + /** + * Properties of a SupportedLanguage. + * @memberof google.cloud.translation.v3beta1 + * @interface ISupportedLanguage + * @property {string|null} [languageCode] SupportedLanguage languageCode + * @property {string|null} [displayName] SupportedLanguage displayName + * @property {boolean|null} [supportSource] SupportedLanguage supportSource + * @property {boolean|null} [supportTarget] SupportedLanguage supportTarget + */ + + /** + * Constructs a new SupportedLanguage. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a SupportedLanguage. + * @implements ISupportedLanguage + * @constructor + * @param {google.cloud.translation.v3beta1.ISupportedLanguage=} [properties] Properties to set + */ + function SupportedLanguage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SupportedLanguage languageCode. + * @member {string} languageCode + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @instance + */ + SupportedLanguage.prototype.languageCode = ""; + + /** + * SupportedLanguage displayName. + * @member {string} displayName + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @instance + */ + SupportedLanguage.prototype.displayName = ""; + + /** + * SupportedLanguage supportSource. + * @member {boolean} supportSource + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @instance + */ + SupportedLanguage.prototype.supportSource = false; + + /** + * SupportedLanguage supportTarget. + * @member {boolean} supportTarget + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @instance + */ + SupportedLanguage.prototype.supportTarget = false; + + /** + * Creates a new SupportedLanguage instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @static + * @param {google.cloud.translation.v3beta1.ISupportedLanguage=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.SupportedLanguage} SupportedLanguage instance + */ + SupportedLanguage.create = function create(properties) { + return new SupportedLanguage(properties); + }; + + /** + * Encodes the specified SupportedLanguage message. Does not implicitly {@link google.cloud.translation.v3beta1.SupportedLanguage.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @static + * @param {google.cloud.translation.v3beta1.ISupportedLanguage} message SupportedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedLanguage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.supportSource != null && message.hasOwnProperty("supportSource")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.supportSource); + if (message.supportTarget != null && message.hasOwnProperty("supportTarget")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.supportTarget); + return writer; + }; + + /** + * Encodes the specified SupportedLanguage message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.SupportedLanguage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @static + * @param {google.cloud.translation.v3beta1.ISupportedLanguage} message SupportedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedLanguage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupportedLanguage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.SupportedLanguage} SupportedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedLanguage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.SupportedLanguage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.languageCode = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.supportSource = reader.bool(); + break; + case 4: + message.supportTarget = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupportedLanguage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.SupportedLanguage} SupportedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedLanguage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupportedLanguage message. + * @function verify + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupportedLanguage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.supportSource != null && message.hasOwnProperty("supportSource")) + if (typeof message.supportSource !== "boolean") + return "supportSource: boolean expected"; + if (message.supportTarget != null && message.hasOwnProperty("supportTarget")) + if (typeof message.supportTarget !== "boolean") + return "supportTarget: boolean expected"; + return null; + }; + + /** + * Creates a SupportedLanguage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.SupportedLanguage} SupportedLanguage + */ + SupportedLanguage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.SupportedLanguage) + return object; + var message = new $root.google.cloud.translation.v3beta1.SupportedLanguage(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.supportSource != null) + message.supportSource = Boolean(object.supportSource); + if (object.supportTarget != null) + message.supportTarget = Boolean(object.supportTarget); + return message; + }; + + /** + * Creates a plain object from a SupportedLanguage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @static + * @param {google.cloud.translation.v3beta1.SupportedLanguage} message SupportedLanguage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupportedLanguage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.languageCode = ""; + object.displayName = ""; + object.supportSource = false; + object.supportTarget = false; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.supportSource != null && message.hasOwnProperty("supportSource")) + object.supportSource = message.supportSource; + if (message.supportTarget != null && message.hasOwnProperty("supportTarget")) + object.supportTarget = message.supportTarget; + return object; + }; + + /** + * Converts this SupportedLanguage to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @instance + * @returns {Object.} JSON object + */ + SupportedLanguage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SupportedLanguage; + })(); + + v3beta1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.translation.v3beta1 + * @interface IGcsSource + * @property {string|null} [inputUri] GcsSource inputUri + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.translation.v3beta1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsSource inputUri. + * @member {string} inputUri + * @memberof google.cloud.translation.v3beta1.GcsSource + * @instance + */ + GcsSource.prototype.inputUri = ""; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.GcsSource + * @static + * @param {google.cloud.translation.v3beta1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.translation.v3beta1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.GcsSource + * @static + * @param {google.cloud.translation.v3beta1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.GcsSource + * @static + * @param {google.cloud.translation.v3beta1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSource message. + * @function verify + * @memberof google.cloud.translation.v3beta1.GcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + return null; + }; + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.GcsSource) + return object; + var message = new $root.google.cloud.translation.v3beta1.GcsSource(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.GcsSource + * @static + * @param {google.cloud.translation.v3beta1.GcsSource} message GcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputUri = ""; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsSource; + })(); + + v3beta1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.translation.v3beta1 + * @interface IInputConfig + * @property {string|null} [mimeType] InputConfig mimeType + * @property {google.cloud.translation.v3beta1.IGcsSource|null} [gcsSource] InputConfig gcsSource + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.translation.v3beta1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputConfig mimeType. + * @member {string} mimeType + * @memberof google.cloud.translation.v3beta1.InputConfig + * @instance + */ + InputConfig.prototype.mimeType = ""; + + /** + * InputConfig gcsSource. + * @member {google.cloud.translation.v3beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.translation.v3beta1.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.translation.v3beta1.InputConfig + * @instance + */ + Object.defineProperty(InputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.InputConfig + * @static + * @param {google.cloud.translation.v3beta1.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.InputConfig + * @static + * @param {google.cloud.translation.v3beta1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + $root.google.cloud.translation.v3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.InputConfig + * @static + * @param {google.cloud.translation.v3beta1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.InputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mimeType = reader.string(); + break; + case 2: + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputConfig message. + * @function verify + * @memberof google.cloud.translation.v3beta1.InputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.translation.v3beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + return null; + }; + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.InputConfig) + return object; + var message = new $root.google.cloud.translation.v3beta1.InputConfig(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.translation.v3beta1.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.InputConfig + * @static + * @param {google.cloud.translation.v3beta1.InputConfig} message InputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mimeType = ""; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.InputConfig + * @instance + * @returns {Object.} JSON object + */ + InputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InputConfig; + })(); + + v3beta1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.translation.v3beta1 + * @interface IGcsDestination + * @property {string|null} [outputUriPrefix] GcsDestination outputUriPrefix + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.translation.v3beta1.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDestination outputUriPrefix. + * @member {string} outputUriPrefix + * @memberof google.cloud.translation.v3beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.outputUriPrefix = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.GcsDestination + * @static + * @param {google.cloud.translation.v3beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.translation.v3beta1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.GcsDestination + * @static + * @param {google.cloud.translation.v3beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.GcsDestination + * @static + * @param {google.cloud.translation.v3beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputUriPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.translation.v3beta1.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + if (!$util.isString(message.outputUriPrefix)) + return "outputUriPrefix: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.GcsDestination) + return object; + var message = new $root.google.cloud.translation.v3beta1.GcsDestination(); + if (object.outputUriPrefix != null) + message.outputUriPrefix = String(object.outputUriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.GcsDestination + * @static + * @param {google.cloud.translation.v3beta1.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUriPrefix = ""; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + object.outputUriPrefix = message.outputUriPrefix; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + v3beta1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.translation.v3beta1 + * @interface IOutputConfig + * @property {google.cloud.translation.v3beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.translation.v3beta1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.translation.v3beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.translation.v3beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.translation.v3beta1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.OutputConfig + * @static + * @param {google.cloud.translation.v3beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.OutputConfig + * @static + * @param {google.cloud.translation.v3beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.translation.v3beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.OutputConfig + * @static + * @param {google.cloud.translation.v3beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.translation.v3beta1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.translation.v3beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.OutputConfig) + return object; + var message = new $root.google.cloud.translation.v3beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.translation.v3beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.OutputConfig + * @static + * @param {google.cloud.translation.v3beta1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputConfig; + })(); + + v3beta1.BatchTranslateTextRequest = (function() { + + /** + * Properties of a BatchTranslateTextRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface IBatchTranslateTextRequest + * @property {string|null} [parent] BatchTranslateTextRequest parent + * @property {string|null} [sourceLanguageCode] BatchTranslateTextRequest sourceLanguageCode + * @property {Array.|null} [targetLanguageCodes] BatchTranslateTextRequest targetLanguageCodes + * @property {Object.|null} [models] BatchTranslateTextRequest models + * @property {Array.|null} [inputConfigs] BatchTranslateTextRequest inputConfigs + * @property {google.cloud.translation.v3beta1.IOutputConfig|null} [outputConfig] BatchTranslateTextRequest outputConfig + * @property {Object.|null} [glossaries] BatchTranslateTextRequest glossaries + * @property {Object.|null} [labels] BatchTranslateTextRequest labels + */ + + /** + * Constructs a new BatchTranslateTextRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a BatchTranslateTextRequest. + * @implements IBatchTranslateTextRequest + * @constructor + * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest=} [properties] Properties to set + */ + function BatchTranslateTextRequest(properties) { + this.targetLanguageCodes = []; + this.models = {}; + this.inputConfigs = []; + this.glossaries = {}; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchTranslateTextRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.parent = ""; + + /** + * BatchTranslateTextRequest sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.sourceLanguageCode = ""; + + /** + * BatchTranslateTextRequest targetLanguageCodes. + * @member {Array.} targetLanguageCodes + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.targetLanguageCodes = $util.emptyArray; + + /** + * BatchTranslateTextRequest models. + * @member {Object.} models + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.models = $util.emptyObject; + + /** + * BatchTranslateTextRequest inputConfigs. + * @member {Array.} inputConfigs + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.inputConfigs = $util.emptyArray; + + /** + * BatchTranslateTextRequest outputConfig. + * @member {google.cloud.translation.v3beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.outputConfig = null; + + /** + * BatchTranslateTextRequest glossaries. + * @member {Object.} glossaries + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.glossaries = $util.emptyObject; + + /** + * BatchTranslateTextRequest labels. + * @member {Object.} labels + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new BatchTranslateTextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.BatchTranslateTextRequest} BatchTranslateTextRequest instance + */ + BatchTranslateTextRequest.create = function create(properties) { + return new BatchTranslateTextRequest(properties); + }; + + /** + * Encodes the specified BatchTranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateTextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest} message BatchTranslateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) + for (var i = 0; i < message.targetLanguageCodes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); + if (message.models != null && message.hasOwnProperty("models")) + for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); + if (message.inputConfigs != null && message.inputConfigs.length) + for (var i = 0; i < message.inputConfigs.length; ++i) + $root.google.cloud.translation.v3beta1.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.translation.v3beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.glossaries != null && message.hasOwnProperty("glossaries")) + for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchTranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest} message BatchTranslateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.BatchTranslateTextRequest} BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateTextRequest(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.sourceLanguageCode = reader.string(); + break; + case 3: + if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) + message.targetLanguageCodes = []; + message.targetLanguageCodes.push(reader.string()); + break; + case 4: + reader.skip().pos++; + if (message.models === $util.emptyObject) + message.models = {}; + key = reader.string(); + reader.pos++; + message.models[key] = reader.string(); + break; + case 5: + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.translation.v3beta1.InputConfig.decode(reader, reader.uint32())); + break; + case 6: + message.outputConfig = $root.google.cloud.translation.v3beta1.OutputConfig.decode(reader, reader.uint32()); + break; + case 7: + reader.skip().pos++; + if (message.glossaries === $util.emptyObject) + message.glossaries = {}; + key = reader.string(); + reader.pos++; + message.glossaries[key] = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + case 9: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.BatchTranslateTextRequest} BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchTranslateTextRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchTranslateTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCodes != null && message.hasOwnProperty("targetLanguageCodes")) { + if (!Array.isArray(message.targetLanguageCodes)) + return "targetLanguageCodes: array expected"; + for (var i = 0; i < message.targetLanguageCodes.length; ++i) + if (!$util.isString(message.targetLanguageCodes[i])) + return "targetLanguageCodes: string[] expected"; + } + if (message.models != null && message.hasOwnProperty("models")) { + if (!$util.isObject(message.models)) + return "models: object expected"; + var key = Object.keys(message.models); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.models[key[i]])) + return "models: string{k:string} expected"; + } + if (message.inputConfigs != null && message.hasOwnProperty("inputConfigs")) { + if (!Array.isArray(message.inputConfigs)) + return "inputConfigs: array expected"; + for (var i = 0; i < message.inputConfigs.length; ++i) { + var error = $root.google.cloud.translation.v3beta1.InputConfig.verify(message.inputConfigs[i]); + if (error) + return "inputConfigs." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.translation.v3beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.glossaries != null && message.hasOwnProperty("glossaries")) { + if (!$util.isObject(message.glossaries)) + return "glossaries: object expected"; + var key = Object.keys(message.glossaries); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.verify(message.glossaries[key[i]]); + if (error) + return "glossaries." + error; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchTranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.BatchTranslateTextRequest} BatchTranslateTextRequest + */ + BatchTranslateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.BatchTranslateTextRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.BatchTranslateTextRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCodes) { + if (!Array.isArray(object.targetLanguageCodes)) + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.targetLanguageCodes: array expected"); + message.targetLanguageCodes = []; + for (var i = 0; i < object.targetLanguageCodes.length; ++i) + message.targetLanguageCodes[i] = String(object.targetLanguageCodes[i]); + } + if (object.models) { + if (typeof object.models !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.models: object expected"); + message.models = {}; + for (var keys = Object.keys(object.models), i = 0; i < keys.length; ++i) + message.models[keys[i]] = String(object.models[keys[i]]); + } + if (object.inputConfigs) { + if (!Array.isArray(object.inputConfigs)) + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.inputConfigs: array expected"); + message.inputConfigs = []; + for (var i = 0; i < object.inputConfigs.length; ++i) { + if (typeof object.inputConfigs[i] !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.inputConfigs: object expected"); + message.inputConfigs[i] = $root.google.cloud.translation.v3beta1.InputConfig.fromObject(object.inputConfigs[i]); + } + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.translation.v3beta1.OutputConfig.fromObject(object.outputConfig); + } + if (object.glossaries) { + if (typeof object.glossaries !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.glossaries: object expected"); + message.glossaries = {}; + for (var keys = Object.keys(object.glossaries), i = 0; i < keys.length; ++i) { + if (typeof object.glossaries[keys[i]] !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.glossaries: object expected"); + message.glossaries[keys[i]] = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.fromObject(object.glossaries[keys[i]]); + } + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchTranslateTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3beta1.BatchTranslateTextRequest} message BatchTranslateTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchTranslateTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targetLanguageCodes = []; + object.inputConfigs = []; + } + if (options.objects || options.defaults) { + object.models = {}; + object.glossaries = {}; + object.labels = {}; + } + if (options.defaults) { + object.parent = ""; + object.sourceLanguageCode = ""; + object.outputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCodes && message.targetLanguageCodes.length) { + object.targetLanguageCodes = []; + for (var j = 0; j < message.targetLanguageCodes.length; ++j) + object.targetLanguageCodes[j] = message.targetLanguageCodes[j]; + } + var keys2; + if (message.models && (keys2 = Object.keys(message.models)).length) { + object.models = {}; + for (var j = 0; j < keys2.length; ++j) + object.models[keys2[j]] = message.models[keys2[j]]; + } + if (message.inputConfigs && message.inputConfigs.length) { + object.inputConfigs = []; + for (var j = 0; j < message.inputConfigs.length; ++j) + object.inputConfigs[j] = $root.google.cloud.translation.v3beta1.InputConfig.toObject(message.inputConfigs[j], options); + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.translation.v3beta1.OutputConfig.toObject(message.outputConfig, options); + if (message.glossaries && (keys2 = Object.keys(message.glossaries)).length) { + object.glossaries = {}; + for (var j = 0; j < keys2.length; ++j) + object.glossaries[keys2[j]] = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.toObject(message.glossaries[keys2[j]], options); + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchTranslateTextRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + * @returns {Object.} JSON object + */ + BatchTranslateTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchTranslateTextRequest; + })(); + + v3beta1.BatchTranslateMetadata = (function() { + + /** + * Properties of a BatchTranslateMetadata. + * @memberof google.cloud.translation.v3beta1 + * @interface IBatchTranslateMetadata + * @property {google.cloud.translation.v3beta1.BatchTranslateMetadata.State|null} [state] BatchTranslateMetadata state + * @property {number|Long|null} [translatedCharacters] BatchTranslateMetadata translatedCharacters + * @property {number|Long|null} [failedCharacters] BatchTranslateMetadata failedCharacters + * @property {number|Long|null} [totalCharacters] BatchTranslateMetadata totalCharacters + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateMetadata submitTime + */ + + /** + * Constructs a new BatchTranslateMetadata. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a BatchTranslateMetadata. + * @implements IBatchTranslateMetadata + * @constructor + * @param {google.cloud.translation.v3beta1.IBatchTranslateMetadata=} [properties] Properties to set + */ + function BatchTranslateMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchTranslateMetadata state. + * @member {google.cloud.translation.v3beta1.BatchTranslateMetadata.State} state + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.state = 0; + + /** + * BatchTranslateMetadata translatedCharacters. + * @member {number|Long} translatedCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateMetadata failedCharacters. + * @member {number|Long} failedCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateMetadata totalCharacters. + * @member {number|Long} totalCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.submitTime = null; + + /** + * Creates a new BatchTranslateMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.BatchTranslateMetadata} BatchTranslateMetadata instance + */ + BatchTranslateMetadata.create = function create(properties) { + return new BatchTranslateMetadata(properties); + }; + + /** + * Encodes the specified BatchTranslateMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateMetadata} message BatchTranslateMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalCharacters); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchTranslateMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateMetadata} message BatchTranslateMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.BatchTranslateMetadata} BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.translatedCharacters = reader.int64(); + break; + case 3: + message.failedCharacters = reader.int64(); + break; + case 4: + message.totalCharacters = reader.int64(); + break; + case 5: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.BatchTranslateMetadata} BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchTranslateMetadata message. + * @function verify + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchTranslateMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) + return "translatedCharacters: integer|Long expected"; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) + return "failedCharacters: integer|Long expected"; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) + return "totalCharacters: integer|Long expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + return null; + }; + + /** + * Creates a BatchTranslateMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.BatchTranslateMetadata} BatchTranslateMetadata + */ + BatchTranslateMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.BatchTranslateMetadata) + return object; + var message = new $root.google.cloud.translation.v3beta1.BatchTranslateMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.translatedCharacters != null) + if ($util.Long) + (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; + else if (typeof object.translatedCharacters === "string") + message.translatedCharacters = parseInt(object.translatedCharacters, 10); + else if (typeof object.translatedCharacters === "number") + message.translatedCharacters = object.translatedCharacters; + else if (typeof object.translatedCharacters === "object") + message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); + if (object.failedCharacters != null) + if ($util.Long) + (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; + else if (typeof object.failedCharacters === "string") + message.failedCharacters = parseInt(object.failedCharacters, 10); + else if (typeof object.failedCharacters === "number") + message.failedCharacters = object.failedCharacters; + else if (typeof object.failedCharacters === "object") + message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); + if (object.totalCharacters != null) + if ($util.Long) + (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; + else if (typeof object.totalCharacters === "string") + message.totalCharacters = parseInt(object.totalCharacters, 10); + else if (typeof object.totalCharacters === "number") + message.totalCharacters = object.totalCharacters; + else if (typeof object.totalCharacters === "object") + message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchTranslateMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3beta1.BatchTranslateMetadata} message BatchTranslateMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchTranslateMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCharacters = options.longs === String ? "0" : 0; + object.submitTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.BatchTranslateMetadata.State[message.state] : message.state; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (typeof message.translatedCharacters === "number") + object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; + else + object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (typeof message.failedCharacters === "number") + object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; + else + object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (typeof message.totalCharacters === "number") + object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; + else + object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + return object; + }; + + /** + * Converts this BatchTranslateMetadata to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchTranslateMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.translation.v3beta1.BatchTranslateMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + BatchTranslateMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return BatchTranslateMetadata; + })(); + + v3beta1.BatchTranslateResponse = (function() { + + /** + * Properties of a BatchTranslateResponse. + * @memberof google.cloud.translation.v3beta1 + * @interface IBatchTranslateResponse + * @property {number|Long|null} [totalCharacters] BatchTranslateResponse totalCharacters + * @property {number|Long|null} [translatedCharacters] BatchTranslateResponse translatedCharacters + * @property {number|Long|null} [failedCharacters] BatchTranslateResponse failedCharacters + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateResponse submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] BatchTranslateResponse endTime + */ + + /** + * Constructs a new BatchTranslateResponse. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a BatchTranslateResponse. + * @implements IBatchTranslateResponse + * @constructor + * @param {google.cloud.translation.v3beta1.IBatchTranslateResponse=} [properties] Properties to set + */ + function BatchTranslateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchTranslateResponse totalCharacters. + * @member {number|Long} totalCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateResponse translatedCharacters. + * @member {number|Long} translatedCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateResponse failedCharacters. + * @member {number|Long} failedCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateResponse submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.submitTime = null; + + /** + * BatchTranslateResponse endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.endTime = null; + + /** + * Creates a new BatchTranslateResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.BatchTranslateResponse} BatchTranslateResponse instance + */ + BatchTranslateResponse.create = function create(properties) { + return new BatchTranslateResponse(properties); + }; + + /** + * Encodes the specified BatchTranslateResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateResponse} message BatchTranslateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalCharacters); + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchTranslateResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateResponse} message BatchTranslateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.BatchTranslateResponse} BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalCharacters = reader.int64(); + break; + case 2: + message.translatedCharacters = reader.int64(); + break; + case 3: + message.failedCharacters = reader.int64(); + break; + case 4: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.BatchTranslateResponse} BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchTranslateResponse message. + * @function verify + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchTranslateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) + return "totalCharacters: integer|Long expected"; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) + return "translatedCharacters: integer|Long expected"; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) + return "failedCharacters: integer|Long expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a BatchTranslateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.BatchTranslateResponse} BatchTranslateResponse + */ + BatchTranslateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.BatchTranslateResponse) + return object; + var message = new $root.google.cloud.translation.v3beta1.BatchTranslateResponse(); + if (object.totalCharacters != null) + if ($util.Long) + (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; + else if (typeof object.totalCharacters === "string") + message.totalCharacters = parseInt(object.totalCharacters, 10); + else if (typeof object.totalCharacters === "number") + message.totalCharacters = object.totalCharacters; + else if (typeof object.totalCharacters === "object") + message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); + if (object.translatedCharacters != null) + if ($util.Long) + (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; + else if (typeof object.translatedCharacters === "string") + message.translatedCharacters = parseInt(object.translatedCharacters, 10); + else if (typeof object.translatedCharacters === "number") + message.translatedCharacters = object.translatedCharacters; + else if (typeof object.translatedCharacters === "object") + message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); + if (object.failedCharacters != null) + if ($util.Long) + (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; + else if (typeof object.failedCharacters === "string") + message.failedCharacters = parseInt(object.failedCharacters, 10); + else if (typeof object.failedCharacters === "number") + message.failedCharacters = object.failedCharacters; + else if (typeof object.failedCharacters === "object") + message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateResponse.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateResponse.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchTranslateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3beta1.BatchTranslateResponse} message BatchTranslateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchTranslateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCharacters = options.longs === String ? "0" : 0; + object.submitTime = null; + object.endTime = null; + } + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (typeof message.totalCharacters === "number") + object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; + else + object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (typeof message.translatedCharacters === "number") + object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; + else + object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (typeof message.failedCharacters === "number") + object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; + else + object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this BatchTranslateResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @instance + * @returns {Object.} JSON object + */ + BatchTranslateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchTranslateResponse; + })(); + + v3beta1.GlossaryInputConfig = (function() { + + /** + * Properties of a GlossaryInputConfig. + * @memberof google.cloud.translation.v3beta1 + * @interface IGlossaryInputConfig + * @property {google.cloud.translation.v3beta1.IGcsSource|null} [gcsSource] GlossaryInputConfig gcsSource + */ + + /** + * Constructs a new GlossaryInputConfig. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a GlossaryInputConfig. + * @implements IGlossaryInputConfig + * @constructor + * @param {google.cloud.translation.v3beta1.IGlossaryInputConfig=} [properties] Properties to set + */ + function GlossaryInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GlossaryInputConfig gcsSource. + * @member {google.cloud.translation.v3beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @instance + */ + GlossaryInputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GlossaryInputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @instance + */ + Object.defineProperty(GlossaryInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GlossaryInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3beta1.IGlossaryInputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.GlossaryInputConfig} GlossaryInputConfig instance + */ + GlossaryInputConfig.create = function create(properties) { + return new GlossaryInputConfig(properties); + }; + + /** + * Encodes the specified GlossaryInputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.GlossaryInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3beta1.IGlossaryInputConfig} message GlossaryInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlossaryInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + $root.google.cloud.translation.v3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GlossaryInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GlossaryInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3beta1.IGlossaryInputConfig} message GlossaryInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlossaryInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.GlossaryInputConfig} GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlossaryInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.GlossaryInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.GlossaryInputConfig} GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlossaryInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GlossaryInputConfig message. + * @function verify + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GlossaryInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.translation.v3beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + return null; + }; + + /** + * Creates a GlossaryInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.GlossaryInputConfig} GlossaryInputConfig + */ + GlossaryInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.GlossaryInputConfig) + return object; + var message = new $root.google.cloud.translation.v3beta1.GlossaryInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.translation.v3beta1.GlossaryInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from a GlossaryInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3beta1.GlossaryInputConfig} message GlossaryInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GlossaryInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this GlossaryInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @instance + * @returns {Object.} JSON object + */ + GlossaryInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GlossaryInputConfig; + })(); + + v3beta1.Glossary = (function() { + + /** + * Properties of a Glossary. + * @memberof google.cloud.translation.v3beta1 + * @interface IGlossary + * @property {string|null} [name] Glossary name + * @property {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair|null} [languagePair] Glossary languagePair + * @property {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet|null} [languageCodesSet] Glossary languageCodesSet + * @property {google.cloud.translation.v3beta1.IGlossaryInputConfig|null} [inputConfig] Glossary inputConfig + * @property {number|null} [entryCount] Glossary entryCount + * @property {google.protobuf.ITimestamp|null} [submitTime] Glossary submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] Glossary endTime + */ + + /** + * Constructs a new Glossary. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a Glossary. + * @implements IGlossary + * @constructor + * @param {google.cloud.translation.v3beta1.IGlossary=} [properties] Properties to set + */ + function Glossary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Glossary name. + * @member {string} name + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.name = ""; + + /** + * Glossary languagePair. + * @member {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair|null|undefined} languagePair + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.languagePair = null; + + /** + * Glossary languageCodesSet. + * @member {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet|null|undefined} languageCodesSet + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.languageCodesSet = null; + + /** + * Glossary inputConfig. + * @member {google.cloud.translation.v3beta1.IGlossaryInputConfig|null|undefined} inputConfig + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.inputConfig = null; + + /** + * Glossary entryCount. + * @member {number} entryCount + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.entryCount = 0; + + /** + * Glossary submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.submitTime = null; + + /** + * Glossary endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.endTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Glossary languages. + * @member {"languagePair"|"languageCodesSet"|undefined} languages + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Object.defineProperty(Glossary.prototype, "languages", { + get: $util.oneOfGetter($oneOfFields = ["languagePair", "languageCodesSet"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Glossary instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {google.cloud.translation.v3beta1.IGlossary=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.Glossary} Glossary instance + */ + Glossary.create = function create(properties) { + return new Glossary(properties); + }; + + /** + * Encodes the specified Glossary message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {google.cloud.translation.v3beta1.IGlossary} message Glossary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Glossary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.languagePair != null && message.hasOwnProperty("languagePair")) + $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.encode(message.languagePair, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) + $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.encode(message.languageCodesSet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.translation.v3beta1.GlossaryInputConfig.encode(message.inputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.entryCount); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Glossary message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {google.cloud.translation.v3beta1.IGlossary} message Glossary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Glossary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Glossary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.Glossary} Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Glossary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.Glossary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.languagePair = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.decode(reader, reader.uint32()); + break; + case 4: + message.languageCodesSet = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.decode(reader, reader.uint32()); + break; + case 5: + message.inputConfig = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.decode(reader, reader.uint32()); + break; + case 6: + message.entryCount = reader.int32(); + break; + case 7: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Glossary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.Glossary} Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Glossary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Glossary message. + * @function verify + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Glossary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languagePair != null && message.hasOwnProperty("languagePair")) { + properties.languages = 1; + { + var error = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify(message.languagePair); + if (error) + return "languagePair." + error; + } + } + if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) { + if (properties.languages === 1) + return "languages: multiple values"; + properties.languages = 1; + { + var error = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify(message.languageCodesSet); + if (error) + return "languageCodesSet." + error; + } + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + if (!$util.isInteger(message.entryCount)) + return "entryCount: integer expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a Glossary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.Glossary} Glossary + */ + Glossary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.Glossary) + return object; + var message = new $root.google.cloud.translation.v3beta1.Glossary(); + if (object.name != null) + message.name = String(object.name); + if (object.languagePair != null) { + if (typeof object.languagePair !== "object") + throw TypeError(".google.cloud.translation.v3beta1.Glossary.languagePair: object expected"); + message.languagePair = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.fromObject(object.languagePair); + } + if (object.languageCodesSet != null) { + if (typeof object.languageCodesSet !== "object") + throw TypeError(".google.cloud.translation.v3beta1.Glossary.languageCodesSet: object expected"); + message.languageCodesSet = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.fromObject(object.languageCodesSet); + } + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.translation.v3beta1.Glossary.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.fromObject(object.inputConfig); + } + if (object.entryCount != null) + message.entryCount = object.entryCount | 0; + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.Glossary.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.Glossary.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a Glossary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {google.cloud.translation.v3beta1.Glossary} message Glossary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Glossary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputConfig = null; + object.entryCount = 0; + object.submitTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languagePair != null && message.hasOwnProperty("languagePair")) { + object.languagePair = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.toObject(message.languagePair, options); + if (options.oneofs) + object.languages = "languagePair"; + } + if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) { + object.languageCodesSet = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.toObject(message.languageCodesSet, options); + if (options.oneofs) + object.languages = "languageCodesSet"; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.toObject(message.inputConfig, options); + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + object.entryCount = message.entryCount; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this Glossary to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + * @returns {Object.} JSON object + */ + Glossary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Glossary.LanguageCodePair = (function() { + + /** + * Properties of a LanguageCodePair. + * @memberof google.cloud.translation.v3beta1.Glossary + * @interface ILanguageCodePair + * @property {string|null} [sourceLanguageCode] LanguageCodePair sourceLanguageCode + * @property {string|null} [targetLanguageCode] LanguageCodePair targetLanguageCode + */ + + /** + * Constructs a new LanguageCodePair. + * @memberof google.cloud.translation.v3beta1.Glossary + * @classdesc Represents a LanguageCodePair. + * @implements ILanguageCodePair + * @constructor + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair=} [properties] Properties to set + */ + function LanguageCodePair(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageCodePair sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @instance + */ + LanguageCodePair.prototype.sourceLanguageCode = ""; + + /** + * LanguageCodePair targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @instance + */ + LanguageCodePair.prototype.targetLanguageCode = ""; + + /** + * Creates a new LanguageCodePair instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} LanguageCodePair instance + */ + LanguageCodePair.create = function create(properties) { + return new LanguageCodePair(properties); + }; + + /** + * Encodes the specified LanguageCodePair message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair} message LanguageCodePair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodePair.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified LanguageCodePair message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair} message LanguageCodePair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodePair.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodePair.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourceLanguageCode = reader.string(); + break; + case 2: + message.targetLanguageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodePair.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageCodePair message. + * @function verify + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageCodePair.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a LanguageCodePair message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} LanguageCodePair + */ + LanguageCodePair.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair) + return object; + var message = new $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair(); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a LanguageCodePair message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} message LanguageCodePair + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageCodePair.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this LanguageCodePair to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @instance + * @returns {Object.} JSON object + */ + LanguageCodePair.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LanguageCodePair; + })(); + + Glossary.LanguageCodesSet = (function() { + + /** + * Properties of a LanguageCodesSet. + * @memberof google.cloud.translation.v3beta1.Glossary + * @interface ILanguageCodesSet + * @property {Array.|null} [languageCodes] LanguageCodesSet languageCodes + */ + + /** + * Constructs a new LanguageCodesSet. + * @memberof google.cloud.translation.v3beta1.Glossary + * @classdesc Represents a LanguageCodesSet. + * @implements ILanguageCodesSet + * @constructor + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet=} [properties] Properties to set + */ + function LanguageCodesSet(properties) { + this.languageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageCodesSet languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @instance + */ + LanguageCodesSet.prototype.languageCodes = $util.emptyArray; + + /** + * Creates a new LanguageCodesSet instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} LanguageCodesSet instance + */ + LanguageCodesSet.create = function create(properties) { + return new LanguageCodesSet(properties); + }; + + /** + * Encodes the specified LanguageCodesSet message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet} message LanguageCodesSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodesSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCodes[i]); + return writer; + }; + + /** + * Encodes the specified LanguageCodesSet message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet} message LanguageCodesSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodesSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodesSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodesSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageCodesSet message. + * @function verify + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageCodesSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + return null; + }; + + /** + * Creates a LanguageCodesSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} LanguageCodesSet + */ + LanguageCodesSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet) + return object; + var message = new $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet(); + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + return message; + }; + + /** + * Creates a plain object from a LanguageCodesSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} message LanguageCodesSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageCodesSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageCodes = []; + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + return object; + }; + + /** + * Converts this LanguageCodesSet to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @instance + * @returns {Object.} JSON object + */ + LanguageCodesSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LanguageCodesSet; + })(); + + return Glossary; + })(); + + v3beta1.CreateGlossaryRequest = (function() { + + /** + * Properties of a CreateGlossaryRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface ICreateGlossaryRequest + * @property {string|null} [parent] CreateGlossaryRequest parent + * @property {google.cloud.translation.v3beta1.IGlossary|null} [glossary] CreateGlossaryRequest glossary + */ + + /** + * Constructs a new CreateGlossaryRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a CreateGlossaryRequest. + * @implements ICreateGlossaryRequest + * @constructor + * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest=} [properties] Properties to set + */ + function CreateGlossaryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGlossaryRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @instance + */ + CreateGlossaryRequest.prototype.parent = ""; + + /** + * CreateGlossaryRequest glossary. + * @member {google.cloud.translation.v3beta1.IGlossary|null|undefined} glossary + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @instance + */ + CreateGlossaryRequest.prototype.glossary = null; + + /** + * Creates a new CreateGlossaryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.CreateGlossaryRequest} CreateGlossaryRequest instance + */ + CreateGlossaryRequest.create = function create(properties) { + return new CreateGlossaryRequest(properties); + }; + + /** + * Encodes the specified CreateGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest} message CreateGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGlossaryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.glossary != null && message.hasOwnProperty("glossary")) + $root.google.cloud.translation.v3beta1.Glossary.encode(message.glossary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest} message CreateGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.CreateGlossaryRequest} CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGlossaryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.CreateGlossaryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.glossary = $root.google.cloud.translation.v3beta1.Glossary.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.CreateGlossaryRequest} CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGlossaryRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGlossaryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.glossary != null && message.hasOwnProperty("glossary")) { + var error = $root.google.cloud.translation.v3beta1.Glossary.verify(message.glossary); + if (error) + return "glossary." + error; + } + return null; + }; + + /** + * Creates a CreateGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.CreateGlossaryRequest} CreateGlossaryRequest + */ + CreateGlossaryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.CreateGlossaryRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.CreateGlossaryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.glossary != null) { + if (typeof object.glossary !== "object") + throw TypeError(".google.cloud.translation.v3beta1.CreateGlossaryRequest.glossary: object expected"); + message.glossary = $root.google.cloud.translation.v3beta1.Glossary.fromObject(object.glossary); + } + return message; + }; + + /** + * Creates a plain object from a CreateGlossaryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.CreateGlossaryRequest} message CreateGlossaryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGlossaryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.glossary = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.glossary != null && message.hasOwnProperty("glossary")) + object.glossary = $root.google.cloud.translation.v3beta1.Glossary.toObject(message.glossary, options); + return object; + }; + + /** + * Converts this CreateGlossaryRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGlossaryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateGlossaryRequest; + })(); + + v3beta1.GetGlossaryRequest = (function() { + + /** + * Properties of a GetGlossaryRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface IGetGlossaryRequest + * @property {string|null} [name] GetGlossaryRequest name + */ + + /** + * Constructs a new GetGlossaryRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a GetGlossaryRequest. + * @implements IGetGlossaryRequest + * @constructor + * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest=} [properties] Properties to set + */ + function GetGlossaryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGlossaryRequest name. + * @member {string} name + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @instance + */ + GetGlossaryRequest.prototype.name = ""; + + /** + * Creates a new GetGlossaryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.GetGlossaryRequest} GetGlossaryRequest instance + */ + GetGlossaryRequest.create = function create(properties) { + return new GetGlossaryRequest(properties); + }; + + /** + * Encodes the specified GetGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.GetGlossaryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest} message GetGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlossaryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GetGlossaryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest} message GetGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.GetGlossaryRequest} GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlossaryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.GetGlossaryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.GetGlossaryRequest} GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGlossaryRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGlossaryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.GetGlossaryRequest} GetGlossaryRequest + */ + GetGlossaryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.GetGlossaryRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.GetGlossaryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGlossaryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.GetGlossaryRequest} message GetGlossaryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGlossaryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetGlossaryRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @instance + * @returns {Object.} JSON object + */ + GetGlossaryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGlossaryRequest; + })(); + + v3beta1.DeleteGlossaryRequest = (function() { + + /** + * Properties of a DeleteGlossaryRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface IDeleteGlossaryRequest + * @property {string|null} [name] DeleteGlossaryRequest name + */ + + /** + * Constructs a new DeleteGlossaryRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a DeleteGlossaryRequest. + * @implements IDeleteGlossaryRequest + * @constructor + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest=} [properties] Properties to set + */ + function DeleteGlossaryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlossaryRequest name. + * @member {string} name + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @instance + */ + DeleteGlossaryRequest.prototype.name = ""; + + /** + * Creates a new DeleteGlossaryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryRequest} DeleteGlossaryRequest instance + */ + DeleteGlossaryRequest.create = function create(properties) { + return new DeleteGlossaryRequest(properties); + }; + + /** + * Encodes the specified DeleteGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest} message DeleteGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest} message DeleteGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryRequest} DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryRequest} DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlossaryRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlossaryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryRequest} DeleteGlossaryRequest + */ + DeleteGlossaryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.DeleteGlossaryRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGlossaryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.DeleteGlossaryRequest} message DeleteGlossaryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlossaryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteGlossaryRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGlossaryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteGlossaryRequest; + })(); + + v3beta1.ListGlossariesRequest = (function() { + + /** + * Properties of a ListGlossariesRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface IListGlossariesRequest + * @property {string|null} [parent] ListGlossariesRequest parent + * @property {number|null} [pageSize] ListGlossariesRequest pageSize + * @property {string|null} [pageToken] ListGlossariesRequest pageToken + * @property {string|null} [filter] ListGlossariesRequest filter + */ + + /** + * Constructs a new ListGlossariesRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a ListGlossariesRequest. + * @implements IListGlossariesRequest + * @constructor + * @param {google.cloud.translation.v3beta1.IListGlossariesRequest=} [properties] Properties to set + */ + function ListGlossariesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGlossariesRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.parent = ""; + + /** + * ListGlossariesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.pageSize = 0; + + /** + * ListGlossariesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.pageToken = ""; + + /** + * ListGlossariesRequest filter. + * @member {string} filter + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.filter = ""; + + /** + * Creates a new ListGlossariesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3beta1.IListGlossariesRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.ListGlossariesRequest} ListGlossariesRequest instance + */ + ListGlossariesRequest.create = function create(properties) { + return new ListGlossariesRequest(properties); + }; + + /** + * Encodes the specified ListGlossariesRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3beta1.IListGlossariesRequest} message ListGlossariesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListGlossariesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3beta1.IListGlossariesRequest} message ListGlossariesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.ListGlossariesRequest} ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.ListGlossariesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.ListGlossariesRequest} ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlossariesRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlossariesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListGlossariesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.ListGlossariesRequest} ListGlossariesRequest + */ + ListGlossariesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.ListGlossariesRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.ListGlossariesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListGlossariesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3beta1.ListGlossariesRequest} message ListGlossariesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlossariesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListGlossariesRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @instance + * @returns {Object.} JSON object + */ + ListGlossariesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListGlossariesRequest; + })(); + + v3beta1.ListGlossariesResponse = (function() { + + /** + * Properties of a ListGlossariesResponse. + * @memberof google.cloud.translation.v3beta1 + * @interface IListGlossariesResponse + * @property {Array.|null} [glossaries] ListGlossariesResponse glossaries + * @property {string|null} [nextPageToken] ListGlossariesResponse nextPageToken + */ + + /** + * Constructs a new ListGlossariesResponse. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a ListGlossariesResponse. + * @implements IListGlossariesResponse + * @constructor + * @param {google.cloud.translation.v3beta1.IListGlossariesResponse=} [properties] Properties to set + */ + function ListGlossariesResponse(properties) { + this.glossaries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGlossariesResponse glossaries. + * @member {Array.} glossaries + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @instance + */ + ListGlossariesResponse.prototype.glossaries = $util.emptyArray; + + /** + * ListGlossariesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @instance + */ + ListGlossariesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListGlossariesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3beta1.IListGlossariesResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.ListGlossariesResponse} ListGlossariesResponse instance + */ + ListGlossariesResponse.create = function create(properties) { + return new ListGlossariesResponse(properties); + }; + + /** + * Encodes the specified ListGlossariesResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3beta1.IListGlossariesResponse} message ListGlossariesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.glossaries != null && message.glossaries.length) + for (var i = 0; i < message.glossaries.length; ++i) + $root.google.cloud.translation.v3beta1.Glossary.encode(message.glossaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListGlossariesResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3beta1.IListGlossariesResponse} message ListGlossariesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.ListGlossariesResponse} ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.ListGlossariesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.glossaries && message.glossaries.length)) + message.glossaries = []; + message.glossaries.push($root.google.cloud.translation.v3beta1.Glossary.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.ListGlossariesResponse} ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlossariesResponse message. + * @function verify + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlossariesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.glossaries != null && message.hasOwnProperty("glossaries")) { + if (!Array.isArray(message.glossaries)) + return "glossaries: array expected"; + for (var i = 0; i < message.glossaries.length; ++i) { + var error = $root.google.cloud.translation.v3beta1.Glossary.verify(message.glossaries[i]); + if (error) + return "glossaries." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListGlossariesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.ListGlossariesResponse} ListGlossariesResponse + */ + ListGlossariesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.ListGlossariesResponse) + return object; + var message = new $root.google.cloud.translation.v3beta1.ListGlossariesResponse(); + if (object.glossaries) { + if (!Array.isArray(object.glossaries)) + throw TypeError(".google.cloud.translation.v3beta1.ListGlossariesResponse.glossaries: array expected"); + message.glossaries = []; + for (var i = 0; i < object.glossaries.length; ++i) { + if (typeof object.glossaries[i] !== "object") + throw TypeError(".google.cloud.translation.v3beta1.ListGlossariesResponse.glossaries: object expected"); + message.glossaries[i] = $root.google.cloud.translation.v3beta1.Glossary.fromObject(object.glossaries[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListGlossariesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3beta1.ListGlossariesResponse} message ListGlossariesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlossariesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.glossaries = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.glossaries && message.glossaries.length) { + object.glossaries = []; + for (var j = 0; j < message.glossaries.length; ++j) + object.glossaries[j] = $root.google.cloud.translation.v3beta1.Glossary.toObject(message.glossaries[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListGlossariesResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @instance + * @returns {Object.} JSON object + */ + ListGlossariesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListGlossariesResponse; + })(); + + v3beta1.CreateGlossaryMetadata = (function() { + + /** + * Properties of a CreateGlossaryMetadata. + * @memberof google.cloud.translation.v3beta1 + * @interface ICreateGlossaryMetadata + * @property {string|null} [name] CreateGlossaryMetadata name + * @property {google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|null} [state] CreateGlossaryMetadata state + * @property {google.protobuf.ITimestamp|null} [submitTime] CreateGlossaryMetadata submitTime + */ + + /** + * Constructs a new CreateGlossaryMetadata. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a CreateGlossaryMetadata. + * @implements ICreateGlossaryMetadata + * @constructor + * @param {google.cloud.translation.v3beta1.ICreateGlossaryMetadata=} [properties] Properties to set + */ + function CreateGlossaryMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGlossaryMetadata name. + * @member {string} name + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @instance + */ + CreateGlossaryMetadata.prototype.name = ""; + + /** + * CreateGlossaryMetadata state. + * @member {google.cloud.translation.v3beta1.CreateGlossaryMetadata.State} state + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @instance + */ + CreateGlossaryMetadata.prototype.state = 0; + + /** + * CreateGlossaryMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @instance + */ + CreateGlossaryMetadata.prototype.submitTime = null; + + /** + * Creates a new CreateGlossaryMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @static + * @param {google.cloud.translation.v3beta1.ICreateGlossaryMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.CreateGlossaryMetadata} CreateGlossaryMetadata instance + */ + CreateGlossaryMetadata.create = function create(properties) { + return new CreateGlossaryMetadata(properties); + }; + + /** + * Encodes the specified CreateGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @static + * @param {google.cloud.translation.v3beta1.ICreateGlossaryMetadata} message CreateGlossaryMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGlossaryMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @static + * @param {google.cloud.translation.v3beta1.ICreateGlossaryMetadata} message CreateGlossaryMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGlossaryMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.CreateGlossaryMetadata} CreateGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGlossaryMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.CreateGlossaryMetadata} CreateGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGlossaryMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGlossaryMetadata message. + * @function verify + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGlossaryMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + return null; + }; + + /** + * Creates a CreateGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.CreateGlossaryMetadata} CreateGlossaryMetadata + */ + CreateGlossaryMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata) + return object; + var message = new $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.CreateGlossaryMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateGlossaryMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @static + * @param {google.cloud.translation.v3beta1.CreateGlossaryMetadata} message CreateGlossaryMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGlossaryMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.submitTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata.State[message.state] : message.state; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + return object; + }; + + /** + * Converts this CreateGlossaryMetadata to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateGlossaryMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.translation.v3beta1.CreateGlossaryMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + CreateGlossaryMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return CreateGlossaryMetadata; + })(); + + v3beta1.DeleteGlossaryMetadata = (function() { + + /** + * Properties of a DeleteGlossaryMetadata. + * @memberof google.cloud.translation.v3beta1 + * @interface IDeleteGlossaryMetadata + * @property {string|null} [name] DeleteGlossaryMetadata name + * @property {google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|null} [state] DeleteGlossaryMetadata state + * @property {google.protobuf.ITimestamp|null} [submitTime] DeleteGlossaryMetadata submitTime + */ + + /** + * Constructs a new DeleteGlossaryMetadata. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a DeleteGlossaryMetadata. + * @implements IDeleteGlossaryMetadata + * @constructor + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryMetadata=} [properties] Properties to set + */ + function DeleteGlossaryMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlossaryMetadata name. + * @member {string} name + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @instance + */ + DeleteGlossaryMetadata.prototype.name = ""; + + /** + * DeleteGlossaryMetadata state. + * @member {google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State} state + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @instance + */ + DeleteGlossaryMetadata.prototype.state = 0; + + /** + * DeleteGlossaryMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @instance + */ + DeleteGlossaryMetadata.prototype.submitTime = null; + + /** + * Creates a new DeleteGlossaryMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @static + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} DeleteGlossaryMetadata instance + */ + DeleteGlossaryMetadata.create = function create(properties) { + return new DeleteGlossaryMetadata(properties); + }; + + /** + * Encodes the specified DeleteGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @static + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryMetadata} message DeleteGlossaryMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @static + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryMetadata} message DeleteGlossaryMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} DeleteGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} DeleteGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlossaryMetadata message. + * @function verify + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlossaryMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + return null; + }; + + /** + * Creates a DeleteGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} DeleteGlossaryMetadata + */ + DeleteGlossaryMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata) + return object; + var message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.DeleteGlossaryMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + return message; + }; + + /** + * Creates a plain object from a DeleteGlossaryMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @static + * @param {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} message DeleteGlossaryMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlossaryMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.submitTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State[message.state] : message.state; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + return object; + }; + + /** + * Converts this DeleteGlossaryMetadata to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteGlossaryMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + DeleteGlossaryMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return DeleteGlossaryMetadata; + })(); + + v3beta1.DeleteGlossaryResponse = (function() { + + /** + * Properties of a DeleteGlossaryResponse. + * @memberof google.cloud.translation.v3beta1 + * @interface IDeleteGlossaryResponse + * @property {string|null} [name] DeleteGlossaryResponse name + * @property {google.protobuf.ITimestamp|null} [submitTime] DeleteGlossaryResponse submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] DeleteGlossaryResponse endTime + */ + + /** + * Constructs a new DeleteGlossaryResponse. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a DeleteGlossaryResponse. + * @implements IDeleteGlossaryResponse + * @constructor + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryResponse=} [properties] Properties to set + */ + function DeleteGlossaryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlossaryResponse name. + * @member {string} name + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @instance + */ + DeleteGlossaryResponse.prototype.name = ""; + + /** + * DeleteGlossaryResponse submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @instance + */ + DeleteGlossaryResponse.prototype.submitTime = null; + + /** + * DeleteGlossaryResponse endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @instance + */ + DeleteGlossaryResponse.prototype.endTime = null; + + /** + * Creates a new DeleteGlossaryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @static + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryResponse} DeleteGlossaryResponse instance + */ + DeleteGlossaryResponse.create = function create(properties) { + return new DeleteGlossaryResponse(properties); + }; + + /** + * Encodes the specified DeleteGlossaryResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @static + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryResponse} message DeleteGlossaryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteGlossaryResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @static + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryResponse} message DeleteGlossaryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryResponse} DeleteGlossaryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryResponse} DeleteGlossaryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlossaryResponse message. + * @function verify + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlossaryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a DeleteGlossaryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryResponse} DeleteGlossaryResponse + */ + DeleteGlossaryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.DeleteGlossaryResponse) + return object; + var message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryResponse(); + if (object.name != null) + message.name = String(object.name); + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.DeleteGlossaryResponse.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.DeleteGlossaryResponse.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a DeleteGlossaryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @static + * @param {google.cloud.translation.v3beta1.DeleteGlossaryResponse} message DeleteGlossaryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlossaryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.submitTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this DeleteGlossaryResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @instance + * @returns {Object.} JSON object + */ + DeleteGlossaryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteGlossaryResponse; + })(); + + return v3beta1; + })(); + + return translation; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; + + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; + + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; + + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; + + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + case 3: + message.nameField = reader.string(); + break; + case 4: + message.history = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.childType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && message.hasOwnProperty("package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && message.hasOwnProperty("syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && message.hasOwnProperty("extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && message.hasOwnProperty("typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {string} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {string} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && message.hasOwnProperty("inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && message.hasOwnProperty("outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = false; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32(); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = false; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {string} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && message.hasOwnProperty("ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && message.hasOwnProperty("packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && message.hasOwnProperty("lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && message.hasOwnProperty("jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && message.hasOwnProperty("weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32(); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32(); + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1052: + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {string} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {string} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 72295728: + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + case 1051: + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + case 1049: + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {string} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && message.hasOwnProperty("begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && message.hasOwnProperty("type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Any; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Empty; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations#listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && message.hasOwnProperty("metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && message.hasOwnProperty("done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && message.hasOwnProperty("response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.done = reader.bool(); + break; + case 4: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 5: + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.name = reader.string(); + break; + case 1: + message.filter = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && message.hasOwnProperty("timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && message.hasOwnProperty("responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.responseType = reader.string(); + break; + case 2: + message.metadataType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && message.hasOwnProperty("code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && message.hasOwnProperty("message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.int32(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index e244d263390..3fd314080bd 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -20,7 +20,8 @@ "nested": { "TranslationService": { "options": { - "(google.api.default_host)": "translation.googleapis.com" + "(google.api.default_host)": "translate.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-translation" }, "methods": { "TranslateText": { @@ -40,7 +41,8 @@ "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}:detectLanguage", "(google.api.http).body": "*", "(google.api.http).additional_bindings.post": "/v3beta1/{parent=projects/*}:detectLanguage", - "(google.api.http).additional_bindings.body": "*" + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,model,mime_type" } }, "GetSupportedLanguages": { @@ -48,7 +50,8 @@ "responseType": "SupportedLanguages", "options": { "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*}/supportedLanguages", - "(google.api.http).additional_bindings.get": "/v3beta1/{parent=projects/*}/supportedLanguages" + "(google.api.http).additional_bindings.get": "/v3beta1/{parent=projects/*}/supportedLanguages", + "(google.api.method_signature)": "parent,display_language_code,model" } }, "BatchTranslateText": { @@ -56,7 +59,9 @@ "responseType": "google.longrunning.Operation", "options": { "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}:batchTranslateText", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "BatchTranslateResponse", + "(google.longrunning.operation_info).metadata_type": "BatchTranslateMetadata" } }, "CreateGlossary": { @@ -64,28 +69,36 @@ "responseType": "google.longrunning.Operation", "options": { "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}/glossaries", - "(google.api.http).body": "glossary" + "(google.api.http).body": "glossary", + "(google.api.method_signature)": "parent,glossary", + "(google.longrunning.operation_info).response_type": "Glossary", + "(google.longrunning.operation_info).metadata_type": "CreateGlossaryMetadata" } }, "ListGlossaries": { "requestType": "ListGlossariesRequest", "responseType": "ListGlossariesResponse", "options": { - "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*}/glossaries" + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*}/glossaries", + "(google.api.method_signature)": "parent" } }, "GetGlossary": { "requestType": "GetGlossaryRequest", "responseType": "Glossary", "options": { - "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/glossaries/*}" + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/glossaries/*}", + "(google.api.method_signature)": "name" } }, "DeleteGlossary": { "requestType": "DeleteGlossaryRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/glossaries/*}" + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/glossaries/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "DeleteGlossaryResponse", + "(google.longrunning.operation_info).metadata_type": "DeleteGlossaryMetadata" } } } @@ -94,11 +107,17 @@ "fields": { "glossary": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "ignoreCase": { "type": "bool", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -107,31 +126,61 @@ "contents": { "rule": "repeated", "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "mimeType": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "sourceLanguageCode": { "type": "string", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "targetLanguageCode": { "type": "string", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "parent": { "type": "string", - "id": 8 + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } }, "model": { "type": "string", - "id": 6 + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "glossaryConfig": { "type": "TranslateTextGlossaryConfig", - "id": 7 + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -180,11 +229,18 @@ "fields": { "parent": { "type": "string", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } }, "model": { "type": "string", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "content": { "type": "string", @@ -192,7 +248,15 @@ }, "mimeType": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 } } }, @@ -221,15 +285,25 @@ "fields": { "parent": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } }, "displayLanguageCode": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "model": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -266,7 +340,10 @@ "fields": { "inputUri": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -281,7 +358,10 @@ "fields": { "mimeType": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "gcsSource": { "type": "GcsSource", @@ -293,7 +373,10 @@ "fields": { "outputUriPrefix": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -316,35 +399,65 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } }, "sourceLanguageCode": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "targetLanguageCodes": { "rule": "repeated", "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "models": { "keyType": "string", "type": "string", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "inputConfigs": { "rule": "repeated", "type": "InputConfig", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "outputConfig": { "type": "OutputConfig", - "id": 6 + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "glossaries": { "keyType": "string", "type": "TranslateTextGlossaryConfig", - "id": 7 + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -424,6 +537,10 @@ } }, "Glossary": { + "options": { + "(google.api.resource).type": "translate.googleapis.com/Glossary", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/glossaries/{glossary}" + }, "oneofs": { "languages": { "oneof": [ @@ -435,7 +552,10 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "languagePair": { "type": "LanguageCodePair", @@ -451,15 +571,24 @@ }, "entryCount": { "type": "int32", - "id": 6 + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "submitTime": { "type": "google.protobuf.Timestamp", - "id": 7 + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "endTime": { "type": "google.protobuf.Timestamp", - "id": 8 + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -490,11 +619,18 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } }, "glossary": { "type": "Glossary", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -502,7 +638,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "translate.googleapis.com/Glossary" + } } } }, @@ -510,7 +650,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "translate.googleapis.com/Glossary" + } } } }, @@ -518,19 +662,32 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } }, "pageSize": { "type": "int32", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "filter": { "type": "string", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -629,7 +786,7 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "ClientProto", + "java_outer_classname": "ResourceProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -722,6 +879,38 @@ } } }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5 + } + }, "resourceReference": { "type": "google.api.ResourceReference", "id": 1055, @@ -773,22 +962,6 @@ "id": 2 } } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" } } }, diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 4e835c86d71..c7141d7637f 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -17,6 +17,7 @@ API is part of the larger Cloud Machine Learning API family. Samples * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Hybrid Glossaries](#hybrid-glossaries) * [Quickstart](#quickstart) * [Translate](#translate) @@ -85,6 +86,23 @@ node v3beta1/translate_list_codes_beta.js "your_project_id" +### Hybrid Glossaries + +View the [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/hybridGlossaries.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/hybridGlossaries.js,samples/README.md) + +__Usage:__ + + +`node hybridGlossaries.js` + + +----- + + + + ### Quickstart View the [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/quickstart.js). diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js b/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js index 56bb2d839df..b0fbadc02bf 100644 --- a/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js +++ b/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js @@ -59,11 +59,17 @@ const TranslateTextGlossaryConfig = { * text, set to one of the language codes listed in Language Support. * * @property {string} parent - * Required. Location to make a regional or global call. + * Required. Project or location to make a call. Must refer to a caller's + * project. * - * Format: `projects/{project-id}/locations/{location-id}`. + * Format: `projects/{project-id}` or + * `projects/{project-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-id}/locations/global` or + * `projects/{project-id}`. * - * For global calls, use `projects/{project-id}/locations/global`. + * Non-global location is required for requests using AutoML models or + * custom glossaries. * * Models and glossaries must be within the same region (have same * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. @@ -94,6 +100,16 @@ const TranslateTextGlossaryConfig = { * * This object should have the same structure as [TranslateTextGlossaryConfig]{@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} * + * @property {Object.} labels + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * * @typedef TranslateTextRequest * @memberof google.cloud.translation.v3beta1 * @see [google.cloud.translation.v3beta1.TranslateTextRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} @@ -160,11 +176,14 @@ const Translation = { * The request message for language detection. * * @property {string} parent - * Required. Location to make a regional or global call. + * Required. Project or location to make a call. Must refer to a caller's + * project. * - * Format: `projects/{project-id}/locations/{location-id}`. + * Format: `projects/{project-id}/locations/{location-id}` or + * `projects/{project-id}`. * - * For global calls, use `projects/{project-id}/locations/global`. + * For global calls, use `projects/{project-id}/locations/global` or + * `projects/{project-id}`. * * Only models within the same region (has same location-id) can be used. * Otherwise an INVALID_ARGUMENT (400) error is returned. @@ -187,6 +206,16 @@ const Translation = { * Optional. The format of the source text, for example, "text/html", * "text/plain". If left blank, the MIME type defaults to "text/html". * + * @property {Object.} labels + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * * @typedef DetectLanguageRequest * @memberof google.cloud.translation.v3beta1 * @see [google.cloud.translation.v3beta1.DetectLanguageRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} @@ -234,11 +263,16 @@ const DetectLanguageResponse = { * The request message for discovering supported languages. * * @property {string} parent - * Required. Location to make a regional or global call. + * Required. Project or location to make a call. Must refer to a caller's + * project. * - * Format: `projects/{project-id}/locations/{location-id}`. + * Format: `projects/{project-id}` or + * `projects/{project-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-id}/locations/global` or + * `projects/{project-id}`. * - * For global calls, use `projects/{project-id}/locations/global`. + * Non-global location is required for AutoML models. * * Only models within the same region (have same location-id) can be used, * otherwise an INVALID_ARGUMENT (400) error is returned. @@ -371,12 +405,12 @@ const InputConfig = { }; /** - * The Google Cloud Storage location for the output content + * The Google Cloud Storage location for the output content. * * @property {string} outputUriPrefix * Required. There must be no files under 'output_uri_prefix'. - * 'output_uri_prefix' must end with "/", otherwise an INVALID_ARGUMENT (400) - * error is returned.. + * 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an + * INVALID_ARGUMENT (400) error is returned. * * @typedef GcsDestination * @memberof google.cloud.translation.v3beta1 @@ -471,7 +505,7 @@ const OutputConfig = { * The batch translation request. * * @property {string} parent - * Required. Location to make a regional call. + * Required. Location to make a call. Must refer to a caller's project. * * Format: `projects/{project-id}/locations/{location-id}`. * @@ -524,6 +558,16 @@ const OutputConfig = { * Optional. Glossaries to be applied for translation. * It's keyed by target language code. * + * @property {Object.} labels + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * * @typedef BatchTranslateTextRequest * @memberof google.cloud.translation.v3beta1 * @see [google.cloud.translation.v3beta1.BatchTranslateTextRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js index 5f062c384f9..bb5c9585d86 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.js @@ -305,6 +305,21 @@ class TranslationServiceClient { * @param {string} request.targetLanguageCode * Required. The BCP-47 language code to use for translation of the input * text, set to one of the language codes listed in Language Support. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-id}` or + * `projects/{project-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-id}/locations/global` or + * `projects/{project-id}`. + * + * Non-global location is required for requests using AutoML models or + * custom glossaries. + * + * Models and glossaries must be within the same region (have same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. * @param {string} [request.mimeType] * Optional. The format of the source text, for example, "text/html", * "text/plain". If left blank, the MIME type defaults to "text/html". @@ -314,15 +329,6 @@ class TranslationServiceClient { * listed in Language Support. If the source language isn't specified, the API * attempts to identify the source language automatically and returns the * source language within the response. - * @param {string} [request.parent] - * Required. Location to make a regional or global call. - * - * Format: `projects/{project-id}/locations/{location-id}`. - * - * For global calls, use `projects/{project-id}/locations/global`. - * - * Models and glossaries must be within the same region (have same - * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. * @param {string} [request.model] * Optional. The `model` type requested for this translation. * @@ -347,6 +353,15 @@ class TranslationServiceClient { * an INVALID_ARGUMENT (400) error is returned. * * This object should have the same structure as [TranslateTextGlossaryConfig]{@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} + * @param {Object.} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -368,9 +383,11 @@ class TranslationServiceClient { * * const contents = []; * const targetLanguageCode = ''; + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); * const request = { * contents: contents, * targetLanguageCode: targetLanguageCode, + * parent: formattedParent, * }; * client.translateText(request) * .then(responses => { @@ -404,12 +421,15 @@ class TranslationServiceClient { * * @param {Object} request * The request object that will be sent. - * @param {string} [request.parent] - * Required. Location to make a regional or global call. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. * - * Format: `projects/{project-id}/locations/{location-id}`. + * Format: `projects/{project-id}/locations/{location-id}` or + * `projects/{project-id}`. * - * For global calls, use `projects/{project-id}/locations/global`. + * For global calls, use `projects/{project-id}/locations/global` or + * `projects/{project-id}`. * * Only models within the same region (has same location-id) can be used. * Otherwise an INVALID_ARGUMENT (400) error is returned. @@ -428,6 +448,15 @@ class TranslationServiceClient { * @param {string} [request.mimeType] * Optional. The format of the source text, for example, "text/html", * "text/plain". If left blank, the MIME type defaults to "text/html". + * @param {Object.} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -447,8 +476,8 @@ class TranslationServiceClient { * // optional auth parameters. * }); * - * - * client.detectLanguage({}) + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * client.detectLanguage({parent: formattedParent}) * .then(responses => { * const response = responses[0]; * // doThingsWith(response) @@ -480,12 +509,17 @@ class TranslationServiceClient { * * @param {Object} request * The request object that will be sent. - * @param {string} [request.parent] - * Required. Location to make a regional or global call. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. * - * Format: `projects/{project-id}/locations/{location-id}`. + * Format: `projects/{project-id}` or + * `projects/{project-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-id}/locations/global` or + * `projects/{project-id}`. * - * For global calls, use `projects/{project-id}/locations/global`. + * Non-global location is required for AutoML models. * * Only models within the same region (have same location-id) can be used, * otherwise an INVALID_ARGUMENT (400) error is returned. @@ -527,8 +561,8 @@ class TranslationServiceClient { * // optional auth parameters. * }); * - * - * client.getSupportedLanguages({}) + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * client.getSupportedLanguages({parent: formattedParent}) * .then(responses => { * const response = responses[0]; * // doThingsWith(response) @@ -570,6 +604,16 @@ class TranslationServiceClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.parent + * Required. Location to make a call. Must refer to a caller's project. + * + * Format: `projects/{project-id}/locations/{location-id}`. + * + * The `global` location is not supported for batch translation. + * + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. * @param {string} request.sourceLanguageCode * Required. Source language code. * @param {string[]} request.targetLanguageCodes @@ -587,16 +631,6 @@ class TranslationServiceClient { * we don't generate output for duplicate inputs. * * This object should have the same structure as [OutputConfig]{@link google.cloud.translation.v3beta1.OutputConfig} - * @param {string} [request.parent] - * Required. Location to make a regional call. - * - * Format: `projects/{project-id}/locations/{location-id}`. - * - * The `global` location is not supported for batch translation. - * - * Only AutoML Translation models or glossaries within the same region (have - * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - * error is returned. * @param {Object.} [request.models] * Optional. The models to use for translation. Map's key is target language * code. Map's value is model name. Value can be a built-in general model, @@ -617,6 +651,15 @@ class TranslationServiceClient { * @param {Object.} [request.glossaries] * Optional. Glossaries to be applied for translation. * It's keyed by target language code. + * @param {Object.} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -636,11 +679,13 @@ class TranslationServiceClient { * // optional auth parameters. * }); * + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); * const sourceLanguageCode = ''; * const targetLanguageCodes = []; * const inputConfigs = []; * const outputConfig = {}; * const request = { + * parent: formattedParent, * sourceLanguageCode: sourceLanguageCode, * targetLanguageCodes: targetLanguageCodes, * inputConfigs: inputConfigs, @@ -664,11 +709,13 @@ class TranslationServiceClient { * console.error(err); * }); * + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); * const sourceLanguageCode = ''; * const targetLanguageCodes = []; * const inputConfigs = []; * const outputConfig = {}; * const request = { + * parent: formattedParent, * sourceLanguageCode: sourceLanguageCode, * targetLanguageCodes: targetLanguageCodes, * inputConfigs: inputConfigs, @@ -701,11 +748,13 @@ class TranslationServiceClient { * console.error(err); * }); * + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); * const sourceLanguageCode = ''; * const targetLanguageCodes = []; * const inputConfigs = []; * const outputConfig = {}; * const request = { + * parent: formattedParent, * sourceLanguageCode: sourceLanguageCode, * targetLanguageCodes: targetLanguageCodes, * inputConfigs: inputConfigs, @@ -859,7 +908,7 @@ class TranslationServiceClient { * * @param {Object} request * The request object that will be sent. - * @param {string} [request.parent] + * @param {string} request.parent * Required. The name of the project from which to list all of the glossaries. * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API @@ -903,7 +952,9 @@ class TranslationServiceClient { * }); * * // Iterate over all elements. - * client.listGlossaries({}) + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * + * client.listGlossaries({parent: formattedParent}) * .then(responses => { * const resources = responses[0]; * for (const resource of resources) { @@ -915,6 +966,8 @@ class TranslationServiceClient { * }); * * // Or obtain the paged response. + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * * * const options = {autoPaginate: false}; * const callback = responses => { @@ -932,7 +985,7 @@ class TranslationServiceClient { * return client.listGlossaries(nextRequest, options).then(callback); * } * } - * client.listGlossaries({}, options) + * client.listGlossaries({parent: formattedParent}, options) * .then(callback) * .catch(err => { * console.error(err); @@ -971,7 +1024,7 @@ class TranslationServiceClient { * * @param {Object} request * The request object that will be sent. - * @param {string} [request.parent] + * @param {string} request.parent * Required. The name of the project from which to list all of the glossaries. * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API @@ -997,8 +1050,8 @@ class TranslationServiceClient { * // optional auth parameters. * }); * - * - * client.listGlossariesStream({}) + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * client.listGlossariesStream({parent: formattedParent}) * .on('data', element => { * // doThingsWith(element) * }).on('error', err => { diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json index e9f8e606073..21537ac3bb1 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json @@ -57,7 +57,7 @@ }, "DeleteGlossary": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 0fe94328003..68acef630fa 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-09-18T11:32:17.166893Z", + "updateTime": "2019-09-27T11:31:09.304721Z", "sources": [ { "generator": { "name": "artman", - "version": "0.36.3", - "dockerImage": "googleapis/artman@sha256:66ca01f27ef7dc50fbfb7743b67028115a6a8acf43b2d82f9fc826de008adac4" + "version": "0.37.1", + "dockerImage": "googleapis/artman@sha256:6068f67900a3f0bdece596b97bda8fc70406ca0e137a941f4c81d3217c994a80" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4aeb1260230bbf56c9d958ff28dfb3eba019fcd0", - "internalRef": "269598918" + "sha": "cd112d8d255e0099df053643d4bd12c228ef7b1b", + "internalRef": "271468707" } }, { diff --git a/packages/google-cloud-translate/test/gapic-v3beta1.js b/packages/google-cloud-translate/test/gapic-v3beta1.js index 4a93ded58d7..22251b78d88 100644 --- a/packages/google-cloud-translate/test/gapic-v3beta1.js +++ b/packages/google-cloud-translate/test/gapic-v3beta1.js @@ -63,9 +63,11 @@ describe('TranslationServiceClient', () => { // Mock request const contents = []; const targetLanguageCode = 'targetLanguageCode1323228230'; + const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); const request = { contents: contents, targetLanguageCode: targetLanguageCode, + parent: formattedParent, }; // Mock response @@ -93,9 +95,11 @@ describe('TranslationServiceClient', () => { // Mock request const contents = []; const targetLanguageCode = 'targetLanguageCode1323228230'; + const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); const request = { contents: contents, targetLanguageCode: targetLanguageCode, + parent: formattedParent, }; // Mock Grpc layer @@ -122,7 +126,10 @@ describe('TranslationServiceClient', () => { }); // Mock request - const request = {}; + const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + const request = { + parent: formattedParent, + }; // Mock response const expectedResponse = {}; @@ -147,7 +154,10 @@ describe('TranslationServiceClient', () => { }); // Mock request - const request = {}; + const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + const request = { + parent: formattedParent, + }; // Mock Grpc layer client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( @@ -173,7 +183,10 @@ describe('TranslationServiceClient', () => { }); // Mock request - const request = {}; + const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + const request = { + parent: formattedParent, + }; // Mock response const expectedResponse = {}; @@ -198,7 +211,10 @@ describe('TranslationServiceClient', () => { }); // Mock request - const request = {}; + const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + const request = { + parent: formattedParent, + }; // Mock Grpc layer client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( @@ -224,11 +240,13 @@ describe('TranslationServiceClient', () => { }); // Mock request + const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); const sourceLanguageCode = 'sourceLanguageCode1687263568'; const targetLanguageCodes = []; const inputConfigs = []; const outputConfig = {}; const request = { + parent: formattedParent, sourceLanguageCode: sourceLanguageCode, targetLanguageCodes: targetLanguageCodes, inputConfigs: inputConfigs, @@ -273,11 +291,13 @@ describe('TranslationServiceClient', () => { }); // Mock request + const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); const sourceLanguageCode = 'sourceLanguageCode1687263568'; const targetLanguageCodes = []; const inputConfigs = []; const outputConfig = {}; const request = { + parent: formattedParent, sourceLanguageCode: sourceLanguageCode, targetLanguageCodes: targetLanguageCodes, inputConfigs: inputConfigs, @@ -428,7 +448,10 @@ describe('TranslationServiceClient', () => { }); // Mock request - const request = {}; + const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + const request = { + parent: formattedParent, + }; // Mock response const nextPageToken = ''; @@ -463,7 +486,10 @@ describe('TranslationServiceClient', () => { }); // Mock request - const request = {}; + const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + const request = { + parent: formattedParent, + }; // Mock Grpc layer client._innerApiCalls.listGlossaries = mockSimpleGrpcMethod( From ec224d233097da8c2df5d4660a7ed3758e590fb6 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Wed, 2 Oct 2019 01:09:50 -0700 Subject: [PATCH 277/513] fix: use compatible version of google-gax * fix: use compatible version of google-gax * fix: use gax v1.6.3 --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index f2be04272af..7b910f22da5 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -50,7 +50,7 @@ "@google-cloud/promisify": "^1.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^1.0.0", + "google-gax": "^1.6.3", "is": "^3.2.1", "is-html": "^2.0.0", "protobufjs": "^6.8.8" From 6fdecbb71abe6c0a7898fda908493d38c79bdee4 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 3 Oct 2019 15:29:03 -0700 Subject: [PATCH 278/513] chore: update pull request template --- packages/google-cloud-translate/synth.metadata | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 68acef630fa..d95a0bcddb0 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-09-27T11:31:09.304721Z", + "updateTime": "2019-10-01T11:35:00.271857Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "cd112d8d255e0099df053643d4bd12c228ef7b1b", - "internalRef": "271468707" + "sha": "ce3c574d1266026cebea3a893247790bd68191c2", + "internalRef": "272147209" } }, { From 9d803ca3beb79f46d53bcef4f814829b6548ee87 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 8 Oct 2019 17:21:46 -0700 Subject: [PATCH 279/513] chore: update CONTRIBUTING.md and make releaseType node (#341) --- packages/google-cloud-translate/CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/google-cloud-translate/CONTRIBUTING.md b/packages/google-cloud-translate/CONTRIBUTING.md index 78aaa61b269..f6c4cf010e3 100644 --- a/packages/google-cloud-translate/CONTRIBUTING.md +++ b/packages/google-cloud-translate/CONTRIBUTING.md @@ -34,6 +34,7 @@ accept your pull requests. 1. Ensure that your code adheres to the existing style in the code to which you are contributing. 1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. 1. Submit a pull request. ## Running the tests @@ -46,8 +47,17 @@ accept your pull requests. 1. Run the tests: + # Run unit tests. npm test + # Run sample integration tests. + gcloud auth application-default login + npm run samples-test + + # Run all system tests. + gcloud auth application-default login + npm run system-test + 1. Lint (and maybe fix) any changes: npm run fix From 5921c91f6d039b3f87911bc6be51d7ee6eb77dab Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 10 Oct 2019 08:25:14 -0700 Subject: [PATCH 280/513] fix: add filter to method signature --- .../cloud/translate/v3beta1/translation_service.proto | 1 + packages/google-cloud-translate/protos/protos.json | 2 +- packages/google-cloud-translate/synth.metadata | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto index f1fca1857aa..e62a5088382 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto @@ -117,6 +117,7 @@ service TranslationService { get: "/v3beta1/{parent=projects/*/locations/*}/glossaries" }; option (google.api.method_signature) = "parent"; + option (google.api.method_signature) = "parent,filter"; } // Gets a glossary. Returns NOT_FOUND, if the glossary doesn't diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index 3fd314080bd..44bec2d7f21 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -80,7 +80,7 @@ "responseType": "ListGlossariesResponse", "options": { "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*}/glossaries", - "(google.api.method_signature)": "parent" + "(google.api.method_signature)": "parent,filter" } }, "GetGlossary": { diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index d95a0bcddb0..de9a47b1e53 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-10-01T11:35:00.271857Z", + "updateTime": "2019-10-04T11:18:33.519599Z", "sources": [ { "generator": { "name": "artman", - "version": "0.37.1", - "dockerImage": "googleapis/artman@sha256:6068f67900a3f0bdece596b97bda8fc70406ca0e137a941f4c81d3217c994a80" + "version": "0.38.0", + "dockerImage": "googleapis/artman@sha256:0d2f8d429110aeb8d82df6550ef4ede59d40df9062d260a1580fce688b0512bf" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ce3c574d1266026cebea3a893247790bd68191c2", - "internalRef": "272147209" + "sha": "d9576d95b44f64fb0e3da4760adfc4a24fa1faab", + "internalRef": "272741510" } }, { From 60af2066f37649ffcabee2eb52f3d3313d2c0b79 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 12 Oct 2019 10:34:10 -0700 Subject: [PATCH 281/513] chore: release 4.2.0 (#324) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-translate/CHANGELOG.md | 22 ++++++++++++++++++++ packages/google-cloud-translate/package.json | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index d8c928ce503..7f3e50fdcf3 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,28 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [4.2.0](https://www.github.com/googleapis/nodejs-translate/compare/v4.1.3...v4.2.0) (2019-10-10) + + +### Bug Fixes + +* **deps:** update dependency yargs to v14 ([3d6b18d](https://www.github.com/googleapis/nodejs-translate/commit/3d6b18d)) +* **deps:** use the latest extend ([#316](https://www.github.com/googleapis/nodejs-translate/issues/316)) ([f7ca873](https://www.github.com/googleapis/nodejs-translate/commit/f7ca873)) +* **docs:** stop linking reference documents to anchor ([f935f91](https://www.github.com/googleapis/nodejs-translate/commit/f935f91)) +* **samples:** use us-central1 region (not global) ([#322](https://www.github.com/googleapis/nodejs-translate/issues/322)) ([8500423](https://www.github.com/googleapis/nodejs-translate/commit/8500423)) +* add filter to method signature ([f6fb81e](https://www.github.com/googleapis/nodejs-translate/commit/f6fb81e)) +* hybrid glossaries ([#338](https://www.github.com/googleapis/nodejs-translate/issues/338)) ([d37671a](https://www.github.com/googleapis/nodejs-translate/commit/d37671a)) +* hybrid glossary tutorial region tag ([#334](https://www.github.com/googleapis/nodejs-translate/issues/334)) ([d61836d](https://www.github.com/googleapis/nodejs-translate/commit/d61836d)) +* use compatible version of google-gax ([620304e](https://www.github.com/googleapis/nodejs-translate/commit/620304e)) +* use correct version for x-goog-api-client header ([50950c9](https://www.github.com/googleapis/nodejs-translate/commit/50950c9)) + + +### Features + +* add label support ([#331](https://www.github.com/googleapis/nodejs-translate/issues/331)) ([c912f71](https://www.github.com/googleapis/nodejs-translate/commit/c912f71)) +* load protos from JSON, grpc-fallback support ([423c336](https://www.github.com/googleapis/nodejs-translate/commit/423c336)) +* samples for hybrid glossaries tutorial ([#327](https://www.github.com/googleapis/nodejs-translate/issues/327)) ([96ec12f](https://www.github.com/googleapis/nodejs-translate/commit/96ec12f)) + ### [4.1.3](https://www.github.com/googleapis/nodejs-translate/compare/v4.1.2...v4.1.3) (2019-08-05) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7b910f22da5..7a95c8118ca 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "4.1.3", + "version": "4.2.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { From f13dc49eda3ed0fd02c4e199b48a19bbed0a31e2 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 19 Oct 2019 01:41:50 +0300 Subject: [PATCH 282/513] chore(deps): update dependency @google-cloud/storage to v4 (#342) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 08b07603abf..045b2cd4a97 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -19,7 +19,7 @@ "yargs": "^14.0.0" }, "devDependencies": { - "@google-cloud/storage": "^3.2.1", + "@google-cloud/storage": "^4.0.0", "chai": "^4.2.0", "mocha": "^6.0.0", "uuid": "^3.3.2" From d54388eec478f0c28ad11448a3231cbd855050f5 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 21 Oct 2019 13:35:39 -0700 Subject: [PATCH 283/513] chore: clean up eslint config (#344) --- packages/google-cloud-translate/samples/.eslintrc.yml | 2 +- packages/google-cloud-translate/samples/package.json | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/samples/.eslintrc.yml b/packages/google-cloud-translate/samples/.eslintrc.yml index 0aa37ac630e..7e847a0e1eb 100644 --- a/packages/google-cloud-translate/samples/.eslintrc.yml +++ b/packages/google-cloud-translate/samples/.eslintrc.yml @@ -1,4 +1,4 @@ --- rules: no-console: off - node/no-missing-require: off + no-warning-comments: off diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 045b2cd4a97..e4c3a08ad3f 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -4,12 +4,14 @@ "license": "Apache-2.0", "author": "Google Inc.", "repository": "googleapis/nodejs-translate", + "files": [ + "!test/" + ], "engines": { "node": ">=8" }, "scripts": { - "test": "mocha --recursive --timeout 90000", - "test-v3": "mocha ./test/v3beta1/*.js" + "test": "mocha --recursive --timeout 90000" }, "dependencies": { "@google-cloud/automl": "^1.0.0", From b5cb1e31cfa60ef34a84d77e89e39996f8d1da18 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 22 Oct 2019 10:54:55 -0700 Subject: [PATCH 284/513] fix(deps): bump google-gax to 1.7.5 (#345) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7a95c8118ca..c39f39b1c92 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -50,7 +50,7 @@ "@google-cloud/promisify": "^1.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^1.6.3", + "google-gax": "^1.7.5", "is": "^3.2.1", "is-html": "^2.0.0", "protobufjs": "^6.8.8" From b3f6e68857b49ebf3fcffcf9738a7693ed33877c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2019 12:13:21 -0700 Subject: [PATCH 285/513] chore: release 4.2.1 (#346) --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 7f3e50fdcf3..f4414354886 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [4.2.1](https://www.github.com/googleapis/nodejs-translate/compare/v4.2.0...v4.2.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#345](https://www.github.com/googleapis/nodejs-translate/issues/345)) ([2c89fd0](https://www.github.com/googleapis/nodejs-translate/commit/2c89fd090d6557d0387c442eaef59069371e4095)) + ## [4.2.0](https://www.github.com/googleapis/nodejs-translate/compare/v4.1.3...v4.2.0) (2019-10-10) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c39f39b1c92..00e16494a80 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "4.2.0", + "version": "4.2.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index e4c3a08ad3f..e7d46106ef5 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^4.1.3", + "@google-cloud/translate": "^4.2.1", "@google-cloud/vision": "^1.2.0", "yargs": "^14.0.0" }, From 877ccd8ad095b0065ae84f7d7bd60bb6a58b9e44 Mon Sep 17 00:00:00 2001 From: Gus Class Date: Wed, 23 Oct 2019 13:46:01 -0700 Subject: [PATCH 286/513] fix: remove extra brace in snippet (#347) --- packages/google-cloud-translate/samples/quickstart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index 65d00c900c7..95af33d7272 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -35,8 +35,8 @@ async function main( const [translation] = await translate.translate(text, target); console.log(`Text: ${text}`); console.log(`Translation: ${translation}`); + // [END translate_quickstart] } -// [END translate_quickstart] const args = process.argv.slice(2); main(...args).catch(console.error); From 000d30cdd92ce025a80f9714b37817cad5d28933 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 25 Oct 2019 12:46:03 -0700 Subject: [PATCH 287/513] docs: spacing change in README --- packages/google-cloud-translate/README.md | 1 - packages/google-cloud-translate/synth.metadata | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index a7cc11142e3..fd7740ed710 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -76,7 +76,6 @@ npm install @google-cloud/translate const [translation] = await translate.translate(text, target); console.log(`Text: ${text}`); console.log(`Translation: ${translation}`); -} ``` diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index de9a47b1e53..5e006e0ae10 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-10-04T11:18:33.519599Z", + "updateTime": "2019-10-24T11:32:27.284278Z", "sources": [ { "generator": { "name": "artman", - "version": "0.38.0", - "dockerImage": "googleapis/artman@sha256:0d2f8d429110aeb8d82df6550ef4ede59d40df9062d260a1580fce688b0512bf" + "version": "0.40.2", + "dockerImage": "googleapis/artman@sha256:3b8f7d9b4c206843ce08053474f5c64ae4d388ff7d995e68b59fb65edf73eeb9" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d9576d95b44f64fb0e3da4760adfc4a24fa1faab", - "internalRef": "272741510" + "sha": "698b05fe2b05893dfe74a156a5665f879de7fceb", + "internalRef": "276276483" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.5.2" + "version": "2019.10.17" } } ], From a952243c5aa2f911512943b4e130898b7254fce9 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 28 Oct 2019 13:33:52 -0700 Subject: [PATCH 288/513] feat!: v3 is now the default API surface (#355) BREAKING CHANGE: this significantly changes TypeScript types and API surface from the v2 API. Reference samples/ for help making the migration from v2 to v3. --- .../.bots/header-checker-lint.json | 3 + packages/google-cloud-translate/package.json | 4 +- .../translate/v3/translation_service.proto | 926 ++ .../google-cloud-translate/protos/protos.d.ts | 3199 +++++++ .../google-cloud-translate/protos/protos.js | 7724 +++++++++++++++++ .../google-cloud-translate/protos/protos.json | 767 ++ .../samples/package.json | 2 +- .../samples/quickstart.js | 34 +- .../samples/test/quickstart.test.js | 2 +- packages/google-cloud-translate/src/index.ts | 6 +- .../google-cloud-translate/src/v3/index.ts | 19 + .../src/v3/translation_service_client.ts | 692 ++ .../v3/translation_service_client_config.json | 66 + .../v3/translation_service_proto_list.json | 3 + .../system-test/translate.ts | 124 +- .../test/gapic-translation_service-v3.ts | 497 ++ packages/google-cloud-translate/test/index.ts | 2 +- packages/google-cloud-translate/tsconfig.json | 4 +- packages/google-cloud-translate/tslint.json | 5 +- 19 files changed, 13997 insertions(+), 82 deletions(-) create mode 100644 packages/google-cloud-translate/.bots/header-checker-lint.json create mode 100644 packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto create mode 100644 packages/google-cloud-translate/src/v3/index.ts create mode 100644 packages/google-cloud-translate/src/v3/translation_service_client.ts create mode 100644 packages/google-cloud-translate/src/v3/translation_service_client_config.json create mode 100644 packages/google-cloud-translate/src/v3/translation_service_proto_list.json create mode 100644 packages/google-cloud-translate/test/gapic-translation_service-v3.ts diff --git a/packages/google-cloud-translate/.bots/header-checker-lint.json b/packages/google-cloud-translate/.bots/header-checker-lint.json new file mode 100644 index 00000000000..925a9db39b2 --- /dev/null +++ b/packages/google-cloud-translate/.bots/header-checker-lint.json @@ -0,0 +1,3 @@ +{ + "ignoreFiles": ["protos/*"] +} \ No newline at end of file diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 00e16494a80..e065aa55d54 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -33,7 +33,7 @@ "lint": "npm run check && eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha build/system-test --timeout 600000", - "test": "nyc mocha build/test", + "test": "c8 mocha build/test", "check": "gts check", "clean": "gts clean", "compile": "tsc -p . && npm run copy-js", @@ -62,6 +62,7 @@ "@types/node": "^10.5.7", "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", + "c8": "^6.0.0", "codecov": "^3.0.2", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", @@ -73,7 +74,6 @@ "jsdoc-fresh": "^1.0.1", "linkinator": "^1.5.0", "mocha": "^6.1.4", - "nyc": "^14.0.0", "power-assert": "^1.6.0", "prettier": "^1.13.5", "proxyquire": "^2.0.1", diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto new file mode 100644 index 00000000000..ad43831c29b --- /dev/null +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto @@ -0,0 +1,926 @@ +// Copyright 2019 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. +// + +syntax = "proto3"; + +package google.cloud.translation.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Translate.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/translate/v3;translate"; +option java_multiple_files = true; +option java_outer_classname = "TranslationServiceProto"; +option java_package = "com.google.cloud.translate.v3"; +option php_namespace = "Google\\Cloud\\Translate\\V3"; +option ruby_package = "Google::Cloud::Translate::V3"; + +// Proto file for the Cloud Translation API (v3 GA). + +// Provides natural language translation operations. +service TranslationService { + option (google.api.default_host) = "translate.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-translation"; + + // Translates input text and returns translated text. + rpc TranslateText(TranslateTextRequest) returns (TranslateTextResponse) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*}:translateText" + body: "*" + additional_bindings { + post: "/v3/{parent=projects/*}:translateText" + body: "*" + } + }; + option (google.api.method_signature) = + "parent,target_language_code,contents"; + option (google.api.method_signature) = + "parent,model,mime_type,source_language_code,target_language_code,contents"; + } + + // Detects the language of text within a request. + rpc DetectLanguage(DetectLanguageRequest) returns (DetectLanguageResponse) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*}:detectLanguage" + body: "*" + additional_bindings { + post: "/v3/{parent=projects/*}:detectLanguage" + body: "*" + } + }; + option (google.api.method_signature) = "parent,model,mime_type,content"; + } + + // Returns a list of supported languages for translation. + rpc GetSupportedLanguages(GetSupportedLanguagesRequest) + returns (SupportedLanguages) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*}/supportedLanguages" + additional_bindings { get: "/v3/{parent=projects/*}/supportedLanguages" } + }; + option (google.api.method_signature) = "parent,model,display_language_code"; + } + + // Translates a large volume of text in asynchronous batch mode. + // This function provides real-time output as the inputs are being processed. + // If caller cancels a request, the partial results (for an input file, it's + // all or nothing) may still be available on the specified output location. + // + // This call returns immediately and you can + // use google.longrunning.Operation.name to poll the status of the call. + rpc BatchTranslateText(BatchTranslateTextRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*}:batchTranslateText" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "BatchTranslateResponse" + metadata_type: "BatchTranslateMetadata" + }; + } + + // Creates a glossary and returns the long-running operation. Returns + // NOT_FOUND, if the project doesn't exist. + rpc CreateGlossary(CreateGlossaryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*}/glossaries" + body: "glossary" + }; + option (google.api.method_signature) = "parent,glossary"; + option (google.longrunning.operation_info) = { + response_type: "Glossary" + metadata_type: "CreateGlossaryMetadata" + }; + } + + // Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't + // exist. + rpc ListGlossaries(ListGlossariesRequest) returns (ListGlossariesResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*}/glossaries" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + // exist. + rpc GetGlossary(GetGlossaryRequest) returns (Glossary) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/glossaries/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a glossary, or cancels glossary construction + // if the glossary isn't created yet. + // Returns NOT_FOUND, if the glossary doesn't exist. + rpc DeleteGlossary(DeleteGlossaryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/glossaries/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "DeleteGlossaryResponse" + metadata_type: "DeleteGlossaryMetadata" + }; + } +} + +// Configures which glossary should be used for a specific target language, +// and defines options for applying that glossary. +message TranslateTextGlossaryConfig { + // Required. Specifies the glossary used for this translation. Use + // this format: projects/*/locations/*/glossaries/* + string glossary = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Indicates match is case-insensitive. + // Default value is false if missing. + bool ignore_case = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for synchronous translation. +message TranslateTextRequest { + // Required. The content of the input in string format. + // We recommend the total content be less than 30k codepoints. + // Use BatchTranslateText for larger text. + repeated string contents = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The format of the source text, for example, "text/html", + // "text/plain". If left blank, the MIME type defaults to "text/html". + string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code of the input text if + // known, for example, "en-US" or "sr-Latn". Supported language codes are + // listed in Language Support. If the source language isn't specified, the API + // attempts to identify the source language automatically and returns the + // source language within the response. + string source_language_code = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The BCP-47 language code to use for translation of the input + // text, set to one of the language codes listed in Language Support. + string target_language_code = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. Project or location to make a call. Must refer to a caller's + // project. + // + // Format: `projects/{project-number-or-id}` or + // `projects/{project-number-or-id}/locations/{location-id}`. + // + // For global calls, use `projects/{project-number-or-id}/locations/global` or + // `projects/{project-number-or-id}`. + // + // Non-global location is required for requests using AutoML models or + // custom glossaries. + // + // Models and glossaries must be within the same region (have same + // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + string parent = 8 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. The `model` type requested for this translation. + // + // The format depends on model type: + // + // - AutoML Translation models: + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + // + // - General (built-in) models: + // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + // + // + // For global (non-regionalized) requests, use `location-id` `global`. + // For example, + // `projects/{project-number-or-id}/locations/global/models/general/nmt`. + // + // If missing, the system decides which google base model to use. + string model = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Glossary to be applied. The glossary must be + // within the same region (have the same location-id) as the model, otherwise + // an INVALID_ARGUMENT (400) error is returned. + TranslateTextGlossaryConfig glossary_config = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels with user-defined metadata for the request. + // + // Label keys and values can be no longer than 63 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + // + // See https://cloud.google.com/translate/docs/labels for more information. + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +message TranslateTextResponse { + // Text translation responses with no glossary applied. + // This field has the same length as + // [`contents`][google.cloud.translation.v3.TranslateTextRequest.contents]. + repeated Translation translations = 1; + + // Text translation responses if a glossary is provided in the request. + // This can be the same as + // [`translations`][google.cloud.translation.v3.TranslateTextResponse.translations] + // if no terms apply. This field has the same length as + // [`contents`][google.cloud.translation.v3.TranslateTextRequest.contents]. + repeated Translation glossary_translations = 3; +} + +// A single translation response. +message Translation { + // Text translated into the target language. + string translated_text = 1; + + // Only present when `model` is present in the request. + // `model` here is normalized to have project number. + // + // For example: + // If the `model` requested in TranslationTextRequest is + // `projects/{project-id}/locations/{location-id}/models/general/nmt` then + // `model` here would be normalized to + // `projects/{project-number}/locations/{location-id}/models/general/nmt`. + string model = 2; + + // The BCP-47 language code of source text in the initial request, detected + // automatically, if no source language was passed within the initial + // request. If the source language was passed, auto-detection of the language + // does not occur and this field is empty. + string detected_language_code = 4; + + // The `glossary_config` used for this translation. + TranslateTextGlossaryConfig glossary_config = 3; +} + +// The request message for language detection. +message DetectLanguageRequest { + // Required. Project or location to make a call. Must refer to a caller's + // project. + // + // Format: `projects/{project-number-or-id}/locations/{location-id}` or + // `projects/{project-number-or-id}`. + // + // For global calls, use `projects/{project-number-or-id}/locations/global` or + // `projects/{project-number-or-id}`. + // + // Only models within the same region (has same location-id) can be used. + // Otherwise an INVALID_ARGUMENT (400) error is returned. + string parent = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. The language detection model to be used. + // + // Format: + // `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` + // + // Only one language detection model is currently supported: + // `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. + // + // If not specified, the default model is used. + string model = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The source of the document from which to detect the language. + oneof source { + // The content of the input stored as a string. + string content = 1; + } + + // Optional. The format of the source text, for example, "text/html", + // "text/plain". If left blank, the MIME type defaults to "text/html". + string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels with user-defined metadata for the request. + // + // Label keys and values can be no longer than 63 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + // + // See https://cloud.google.com/translate/docs/labels for more information. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for language detection. +message DetectedLanguage { + // The BCP-47 language code of source content in the request, detected + // automatically. + string language_code = 1; + + // The confidence of the detection result for this language. + float confidence = 2; +} + +// The response message for language detection. +message DetectLanguageResponse { + // A list of detected languages sorted by detection confidence in descending + // order. The most probable language first. + repeated DetectedLanguage languages = 1; +} + +// The request message for discovering supported languages. +message GetSupportedLanguagesRequest { + // Required. Project or location to make a call. Must refer to a caller's + // project. + // + // Format: `projects/{project-number-or-id}` or + // `projects/{project-number-or-id}/locations/{location-id}`. + // + // For global calls, use `projects/{project-number-or-id}/locations/global` or + // `projects/{project-number-or-id}`. + // + // Non-global location is required for AutoML models. + // + // Only models within the same region (have same location-id) can be used, + // otherwise an INVALID_ARGUMENT (400) error is returned. + string parent = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. The language to use to return localized, human readable names + // of supported languages. If missing, then display names are not returned + // in a response. + string display_language_code = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Get supported languages of this model. + // + // The format depends on model type: + // + // - AutoML Translation models: + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + // + // - General (built-in) models: + // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + // + // + // Returns languages supported by the specified model. + // If missing, we get supported languages of Google general base (PBMT) model. + string model = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for discovering supported languages. +message SupportedLanguages { + // A list of supported language responses. This list contains an entry + // for each language the Translation API supports. + repeated SupportedLanguage languages = 1; +} + +// A single supported language response corresponds to information related +// to one supported language. +message SupportedLanguage { + // Supported language code, generally consisting of its ISO 639-1 + // identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes + // including language and region identifiers are returned (for example, + // 'zh-TW' and 'zh-CN') + string language_code = 1; + + // Human readable name of the language localized in the display language + // specified in the request. + string display_name = 2; + + // Can be used as source language. + bool support_source = 3; + + // Can be used as target language. + bool support_target = 4; +} + +// The Google Cloud Storage location for the input content. +message GcsSource { + // Required. Source data URI. For example, `gs://my_bucket/my_object`. + string input_uri = 1; +} + +// Input configuration for BatchTranslateText request. +message InputConfig { + // Optional. Can be "text/plain" or "text/html". + // For `.tsv`, "text/html" is used if mime_type is missing. + // For `.html`, this field must be "text/html" or empty. + // For `.txt`, this field must be "text/plain" or empty. + string mime_type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Specify the input. + oneof source { + // Required. Google Cloud Storage location for the source input. + // This can be a single file (for example, + // `gs://translation-test/input.tsv`) or a wildcard (for example, + // `gs://translation-test/*`). If a file extension is `.tsv`, it can + // contain either one or two columns. The first column (optional) is the id + // of the text request. If the first column is missing, we use the row + // number (0-based) from the input file as the ID in the output file. The + // second column is the actual text to be + // translated. We recommend each row be <= 10K Unicode codepoints, + // otherwise an error might be returned. + // Note that the input tsv must be RFC 4180 compliant. + // + // You could use https://github.com/Clever/csvlint to check potential + // formatting errors in your tsv file. + // csvlint --delimiter='\t' your_input_file.tsv + // + // The other supported file extensions are `.txt` or `.html`, which is + // treated as a single large chunk of text. + GcsSource gcs_source = 2; + } +} + +// The Google Cloud Storage location for the output content. +message GcsDestination { + // Required. There must be no files under 'output_uri_prefix'. + // 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an + // INVALID_ARGUMENT (400) error is returned. + string output_uri_prefix = 1; +} + +// Output configuration for BatchTranslateText request. +message OutputConfig { + // Required. The destination of output. + oneof destination { + // Google Cloud Storage destination for output content. + // For every single input file (for example, gs://a/b/c.[extension]), we + // generate at most 2 * n output files. (n is the # of target_language_codes + // in the BatchTranslateTextRequest). + // + // Output files (tsv) generated are compliant with RFC 4180 except that + // record delimiters are '\n' instead of '\r\n'. We don't provide any way to + // change record delimiters. + // + // While the input files are being processed, we write/update an index file + // 'index.csv' under 'output_uri_prefix' (for example, + // gs://translation-test/index.csv) The index file is generated/updated as + // new files are being translated. The format is: + // + // input_file,target_language_code,translations_file,errors_file, + // glossary_translations_file,glossary_errors_file + // + // input_file is one file we matched using gcs_source.input_uri. + // target_language_code is provided in the request. + // translations_file contains the translations. (details provided below) + // errors_file contains the errors during processing of the file. (details + // below). Both translations_file and errors_file could be empty + // strings if we have no content to output. + // glossary_translations_file and glossary_errors_file are always empty + // strings if the input_file is tsv. They could also be empty if we have no + // content to output. + // + // Once a row is present in index.csv, the input/output matching never + // changes. Callers should also expect all the content in input_file are + // processed and ready to be consumed (that is, no partial output file is + // written). + // + // The format of translations_file (for target language code 'trg') is: + // gs://translation_test/a_b_c_'trg'_translations.[extension] + // + // If the input file extension is tsv, the output has the following + // columns: + // Column 1: ID of the request provided in the input, if it's not + // provided in the input, then the input row number is used (0-based). + // Column 2: source sentence. + // Column 3: translation without applying a glossary. Empty string if there + // is an error. + // Column 4 (only present if a glossary is provided in the request): + // translation after applying the glossary. Empty string if there is an + // error applying the glossary. Could be same string as column 3 if there is + // no glossary applied. + // + // If input file extension is a txt or html, the translation is directly + // written to the output file. If glossary is requested, a separate + // glossary_translations_file has format of + // gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] + // + // The format of errors file (for target language code 'trg') is: + // gs://translation_test/a_b_c_'trg'_errors.[extension] + // + // If the input file extension is tsv, errors_file contains the following: + // Column 1: ID of the request provided in the input, if it's not + // provided in the input, then the input row number is used (0-based). + // Column 2: source sentence. + // Column 3: Error detail for the translation. Could be empty. + // Column 4 (only present if a glossary is provided in the request): + // Error when applying the glossary. + // + // If the input file extension is txt or html, glossary_error_file will be + // generated that contains error details. glossary_error_file has format of + // gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] + GcsDestination gcs_destination = 1; + } +} + +// The batch translation request. +message BatchTranslateTextRequest { + // Required. Location to make a call. Must refer to a caller's project. + // + // Format: `projects/{project-number-or-id}/locations/{location-id}`. + // + // The `global` location is not supported for batch translation. + // + // Only AutoML Translation models or glossaries within the same region (have + // the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + // error is returned. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Source language code. + string source_language_code = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specify up to 10 language codes here. + repeated string target_language_codes = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The models to use for translation. Map's key is target language + // code. Map's value is model name. Value can be a built-in general model, + // or an AutoML Translation model. + // + // The value format depends on model type: + // + // - AutoML Translation models: + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + // + // - General (built-in) models: + // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + // + // + // If the map is empty or a specific model is + // not requested for a language pair, then default google model (nmt) is used. + map models = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Input configurations. + // The total number of files matched should be <= 1000. + // The total content size should be <= 100M Unicode codepoints. + // The files must use UTF-8 encoding. + repeated InputConfig input_configs = 5 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Output configuration. + // If 2 input configs match to the same file (that is, same input path), + // we don't generate output for duplicate inputs. + OutputConfig output_config = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Glossaries to be applied for translation. + // It's keyed by target language code. + map glossaries = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels with user-defined metadata for the request. + // + // Label keys and values can be no longer than 63 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + // + // See https://cloud.google.com/translate/docs/labels for more information. + map labels = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// State metadata for the batch translation operation. +message BatchTranslateMetadata { + // State of the job. + enum State { + // Invalid. + STATE_UNSPECIFIED = 0; + + // Request is being processed. + RUNNING = 1; + + // The batch is processed, and at least one item was successfully + // processed. + SUCCEEDED = 2; + + // The batch is done and no item was successfully processed. + FAILED = 3; + + // Request is in the process of being canceled after caller invoked + // longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4; + + // The batch is done after the user has called the + // longrunning.Operations.CancelOperation. Any records processed before the + // cancel command are output as specified in the request. + CANCELLED = 5; + } + + // The state of the operation. + State state = 1; + + // Number of successfully translated characters so far (Unicode codepoints). + int64 translated_characters = 2; + + // Number of characters that have failed to process so far (Unicode + // codepoints). + int64 failed_characters = 3; + + // Total number of characters (Unicode codepoints). + // This is the total number of codepoints from input files times the number of + // target languages and appears here shortly after the call is submitted. + int64 total_characters = 4; + + // Time when the operation was submitted. + google.protobuf.Timestamp submit_time = 5; +} + +// Stored in the +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field returned by BatchTranslateText if at least one sentence is translated +// successfully. +message BatchTranslateResponse { + // Total number of characters (Unicode codepoints). + int64 total_characters = 1; + + // Number of successfully translated characters (Unicode codepoints). + int64 translated_characters = 2; + + // Number of characters that have failed to process (Unicode codepoints). + int64 failed_characters = 3; + + // Time when the operation was submitted. + google.protobuf.Timestamp submit_time = 4; + + // The time when the operation is finished and + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is + // set to true. + google.protobuf.Timestamp end_time = 5; +} + +// Input configuration for glossaries. +message GlossaryInputConfig { + // Required. Specify the input. + oneof source { + // Required. Google Cloud Storage location of glossary data. + // File format is determined based on the filename extension. API returns + // [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file + // formats. Wildcards are not allowed. This must be a single file in one of + // the following formats: + // + // For unidirectional glossaries: + // + // - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. + // The first column is source text. The second column is target text. + // The file must not contain headers. That is, the first row is data, not + // column names. + // + // - TMX (`.tmx`): TMX file with parallel data defining source/target term + // pairs. + // + // For equivalent term sets glossaries: + // + // - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms + // in multiple languages. The format is defined for Google Translation + // Toolkit and documented in [Use a + // glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + GcsSource gcs_source = 1; + } +} + +// Represents a glossary built from user provided data. +message Glossary { + option (google.api.resource) = { + type: "translate.googleapis.com/Glossary" + pattern: "projects/{project}/locations/{location}/glossaries/{glossary}" + }; + + // Used with unidirectional glossaries. + message LanguageCodePair { + // Required. The BCP-47 language code of the input text, for example, + // "en-US". Expected to be an exact match for GlossaryTerm.language_code. + string source_language_code = 1; + + // Required. The BCP-47 language code for translation output, for example, + // "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. + string target_language_code = 2; + } + + // Used with equivalent term set glossaries. + message LanguageCodesSet { + // The BCP-47 language code(s) for terms defined in the glossary. + // All entries are unique. The list contains at least two entries. + // Expected to be an exact match for GlossaryTerm.language_code. + repeated string language_codes = 1; + } + + // Required. The resource name of the glossary. Glossary names have the form + // `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. + string name = 1; + + // Languages supported by the glossary. + oneof languages { + // Used with unidirectional glossaries. + LanguageCodePair language_pair = 3; + + // Used with equivalent term set glossaries. + LanguageCodesSet language_codes_set = 4; + } + + // Required. Provides examples to build the glossary from. + // Total glossary must not exceed 10M Unicode codepoints. + GlossaryInputConfig input_config = 5; + + // Output only. The number of entries defined in the glossary. + int32 entry_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When CreateGlossary was called. + google.protobuf.Timestamp submit_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When the glossary creation was finished. + google.protobuf.Timestamp end_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for CreateGlossary. +message CreateGlossaryRequest { + // Required. The project name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The glossary to create. + Glossary glossary = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GetGlossary. +message GetGlossaryRequest { + // Required. The name of the glossary to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "translate.googleapis.com/Glossary" + } + ]; +} + +// Request message for DeleteGlossary. +message DeleteGlossaryRequest { + // Required. The name of the glossary to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "translate.googleapis.com/Glossary" + } + ]; +} + +// Request message for ListGlossaries. +message ListGlossariesRequest { + // Required. The name of the project from which to list all of the glossaries. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Requested page size. The server may return fewer glossaries than + // requested. If unspecified, the server picks an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + // Typically, this is the value of [ListGlossariesResponse.next_page_token] + // returned from the previous call to `ListGlossaries` method. + // The first page is returned if `page_token`is empty or missing. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter specifying constraints of a list operation. + // Filtering is not supported yet, and the parameter currently has no effect. + // If missing, no filtering is performed. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListGlossaries. +message ListGlossariesResponse { + // The list of glossaries for a project. + repeated Glossary glossaries = 1; + + // A token to retrieve a page of results. Pass this value in the + // [ListGlossariesRequest.page_token] field in the subsequent call to + // `ListGlossaries` method to retrieve the next page of results. + string next_page_token = 2; +} + +// Stored in the +// [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] +// field returned by CreateGlossary. +message CreateGlossaryMetadata { + // Enumerates the possible states that the creation request can be in. + enum State { + // Invalid. + STATE_UNSPECIFIED = 0; + + // Request is being processed. + RUNNING = 1; + + // The glossary was successfully created. + SUCCEEDED = 2; + + // Failed to create the glossary. + FAILED = 3; + + // Request is in the process of being canceled after caller invoked + // longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4; + + // The glossary creation request was successfully canceled. + CANCELLED = 5; + } + + // The name of the glossary that is being created. + string name = 1; + + // The current state of the glossary creation operation. + State state = 2; + + // The time when the operation was submitted to the server. + google.protobuf.Timestamp submit_time = 3; +} + +// Stored in the +// [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] +// field returned by DeleteGlossary. +message DeleteGlossaryMetadata { + // Enumerates the possible states that the creation request can be in. + enum State { + // Invalid. + STATE_UNSPECIFIED = 0; + + // Request is being processed. + RUNNING = 1; + + // The glossary was successfully deleted. + SUCCEEDED = 2; + + // Failed to delete the glossary. + FAILED = 3; + + // Request is in the process of being canceled after caller invoked + // longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4; + + // The glossary deletion request was successfully canceled. + CANCELLED = 5; + } + + // The name of the glossary that is being deleted. + string name = 1; + + // The current state of the glossary deletion operation. + State state = 2; + + // The time when the operation was submitted to the server. + google.protobuf.Timestamp submit_time = 3; +} + +// Stored in the +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field returned by DeleteGlossary. +message DeleteGlossaryResponse { + // The name of the deleted glossary. + string name = 1; + + // The time when the operation was submitted to the server. + google.protobuf.Timestamp submit_time = 2; + + // The time when the glossary deletion is finished and + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is + // set to true. + google.protobuf.Timestamp end_time = 3; +} diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index 979b9314b1c..c9915730c95 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -8,6 +8,3205 @@ export namespace google { /** Namespace translation. */ namespace translation { + /** Namespace v3. */ + namespace v3 { + + /** Represents a TranslationService */ + class TranslationService extends $protobuf.rpc.Service { + + /** + * Constructs a new TranslationService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new TranslationService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): TranslationService; + + /** + * Calls TranslateText. + * @param request TranslateTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TranslateTextResponse + */ + public translateText(request: google.cloud.translation.v3.ITranslateTextRequest, callback: google.cloud.translation.v3.TranslationService.TranslateTextCallback): void; + + /** + * Calls TranslateText. + * @param request TranslateTextRequest message or plain object + * @returns Promise + */ + public translateText(request: google.cloud.translation.v3.ITranslateTextRequest): Promise; + + /** + * Calls DetectLanguage. + * @param request DetectLanguageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DetectLanguageResponse + */ + public detectLanguage(request: google.cloud.translation.v3.IDetectLanguageRequest, callback: google.cloud.translation.v3.TranslationService.DetectLanguageCallback): void; + + /** + * Calls DetectLanguage. + * @param request DetectLanguageRequest message or plain object + * @returns Promise + */ + public detectLanguage(request: google.cloud.translation.v3.IDetectLanguageRequest): Promise; + + /** + * Calls GetSupportedLanguages. + * @param request GetSupportedLanguagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SupportedLanguages + */ + public getSupportedLanguages(request: google.cloud.translation.v3.IGetSupportedLanguagesRequest, callback: google.cloud.translation.v3.TranslationService.GetSupportedLanguagesCallback): void; + + /** + * Calls GetSupportedLanguages. + * @param request GetSupportedLanguagesRequest message or plain object + * @returns Promise + */ + public getSupportedLanguages(request: google.cloud.translation.v3.IGetSupportedLanguagesRequest): Promise; + + /** + * Calls BatchTranslateText. + * @param request BatchTranslateTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchTranslateText(request: google.cloud.translation.v3.IBatchTranslateTextRequest, callback: google.cloud.translation.v3.TranslationService.BatchTranslateTextCallback): void; + + /** + * Calls BatchTranslateText. + * @param request BatchTranslateTextRequest message or plain object + * @returns Promise + */ + public batchTranslateText(request: google.cloud.translation.v3.IBatchTranslateTextRequest): Promise; + + /** + * Calls CreateGlossary. + * @param request CreateGlossaryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGlossary(request: google.cloud.translation.v3.ICreateGlossaryRequest, callback: google.cloud.translation.v3.TranslationService.CreateGlossaryCallback): void; + + /** + * Calls CreateGlossary. + * @param request CreateGlossaryRequest message or plain object + * @returns Promise + */ + public createGlossary(request: google.cloud.translation.v3.ICreateGlossaryRequest): Promise; + + /** + * Calls ListGlossaries. + * @param request ListGlossariesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGlossariesResponse + */ + public listGlossaries(request: google.cloud.translation.v3.IListGlossariesRequest, callback: google.cloud.translation.v3.TranslationService.ListGlossariesCallback): void; + + /** + * Calls ListGlossaries. + * @param request ListGlossariesRequest message or plain object + * @returns Promise + */ + public listGlossaries(request: google.cloud.translation.v3.IListGlossariesRequest): Promise; + + /** + * Calls GetGlossary. + * @param request GetGlossaryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Glossary + */ + public getGlossary(request: google.cloud.translation.v3.IGetGlossaryRequest, callback: google.cloud.translation.v3.TranslationService.GetGlossaryCallback): void; + + /** + * Calls GetGlossary. + * @param request GetGlossaryRequest message or plain object + * @returns Promise + */ + public getGlossary(request: google.cloud.translation.v3.IGetGlossaryRequest): Promise; + + /** + * Calls DeleteGlossary. + * @param request DeleteGlossaryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGlossary(request: google.cloud.translation.v3.IDeleteGlossaryRequest, callback: google.cloud.translation.v3.TranslationService.DeleteGlossaryCallback): void; + + /** + * Calls DeleteGlossary. + * @param request DeleteGlossaryRequest message or plain object + * @returns Promise + */ + public deleteGlossary(request: google.cloud.translation.v3.IDeleteGlossaryRequest): Promise; + } + + namespace TranslationService { + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#translateText}. + * @param error Error, if any + * @param [response] TranslateTextResponse + */ + type TranslateTextCallback = (error: (Error|null), response?: google.cloud.translation.v3.TranslateTextResponse) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#detectLanguage}. + * @param error Error, if any + * @param [response] DetectLanguageResponse + */ + type DetectLanguageCallback = (error: (Error|null), response?: google.cloud.translation.v3.DetectLanguageResponse) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#getSupportedLanguages}. + * @param error Error, if any + * @param [response] SupportedLanguages + */ + type GetSupportedLanguagesCallback = (error: (Error|null), response?: google.cloud.translation.v3.SupportedLanguages) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#batchTranslateText}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchTranslateTextCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#createGlossary}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGlossaryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#listGlossaries}. + * @param error Error, if any + * @param [response] ListGlossariesResponse + */ + type ListGlossariesCallback = (error: (Error|null), response?: google.cloud.translation.v3.ListGlossariesResponse) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#getGlossary}. + * @param error Error, if any + * @param [response] Glossary + */ + type GetGlossaryCallback = (error: (Error|null), response?: google.cloud.translation.v3.Glossary) => void; + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#deleteGlossary}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGlossaryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a TranslateTextGlossaryConfig. */ + interface ITranslateTextGlossaryConfig { + + /** TranslateTextGlossaryConfig glossary */ + glossary?: (string|null); + + /** TranslateTextGlossaryConfig ignoreCase */ + ignoreCase?: (boolean|null); + } + + /** Represents a TranslateTextGlossaryConfig. */ + class TranslateTextGlossaryConfig implements ITranslateTextGlossaryConfig { + + /** + * Constructs a new TranslateTextGlossaryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.ITranslateTextGlossaryConfig); + + /** TranslateTextGlossaryConfig glossary. */ + public glossary: string; + + /** TranslateTextGlossaryConfig ignoreCase. */ + public ignoreCase: boolean; + + /** + * Creates a new TranslateTextGlossaryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslateTextGlossaryConfig instance + */ + public static create(properties?: google.cloud.translation.v3.ITranslateTextGlossaryConfig): google.cloud.translation.v3.TranslateTextGlossaryConfig; + + /** + * Encodes the specified TranslateTextGlossaryConfig message. Does not implicitly {@link google.cloud.translation.v3.TranslateTextGlossaryConfig.verify|verify} messages. + * @param message TranslateTextGlossaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.ITranslateTextGlossaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslateTextGlossaryConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.TranslateTextGlossaryConfig.verify|verify} messages. + * @param message TranslateTextGlossaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.ITranslateTextGlossaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslateTextGlossaryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslateTextGlossaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.TranslateTextGlossaryConfig; + + /** + * Decodes a TranslateTextGlossaryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslateTextGlossaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.TranslateTextGlossaryConfig; + + /** + * Verifies a TranslateTextGlossaryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslateTextGlossaryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslateTextGlossaryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.TranslateTextGlossaryConfig; + + /** + * Creates a plain object from a TranslateTextGlossaryConfig message. Also converts values to other types if specified. + * @param message TranslateTextGlossaryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.TranslateTextGlossaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslateTextGlossaryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TranslateTextRequest. */ + interface ITranslateTextRequest { + + /** TranslateTextRequest contents */ + contents?: (string[]|null); + + /** TranslateTextRequest mimeType */ + mimeType?: (string|null); + + /** TranslateTextRequest sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslateTextRequest targetLanguageCode */ + targetLanguageCode?: (string|null); + + /** TranslateTextRequest parent */ + parent?: (string|null); + + /** TranslateTextRequest model */ + model?: (string|null); + + /** TranslateTextRequest glossaryConfig */ + glossaryConfig?: (google.cloud.translation.v3.ITranslateTextGlossaryConfig|null); + + /** TranslateTextRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a TranslateTextRequest. */ + class TranslateTextRequest implements ITranslateTextRequest { + + /** + * Constructs a new TranslateTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.ITranslateTextRequest); + + /** TranslateTextRequest contents. */ + public contents: string[]; + + /** TranslateTextRequest mimeType. */ + public mimeType: string; + + /** TranslateTextRequest sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslateTextRequest targetLanguageCode. */ + public targetLanguageCode: string; + + /** TranslateTextRequest parent. */ + public parent: string; + + /** TranslateTextRequest model. */ + public model: string; + + /** TranslateTextRequest glossaryConfig. */ + public glossaryConfig?: (google.cloud.translation.v3.ITranslateTextGlossaryConfig|null); + + /** TranslateTextRequest labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new TranslateTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslateTextRequest instance + */ + public static create(properties?: google.cloud.translation.v3.ITranslateTextRequest): google.cloud.translation.v3.TranslateTextRequest; + + /** + * Encodes the specified TranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3.TranslateTextRequest.verify|verify} messages. + * @param message TranslateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.ITranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.TranslateTextRequest.verify|verify} messages. + * @param message TranslateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.ITranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslateTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.TranslateTextRequest; + + /** + * Decodes a TranslateTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.TranslateTextRequest; + + /** + * Verifies a TranslateTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslateTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.TranslateTextRequest; + + /** + * Creates a plain object from a TranslateTextRequest message. Also converts values to other types if specified. + * @param message TranslateTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.TranslateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslateTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TranslateTextResponse. */ + interface ITranslateTextResponse { + + /** TranslateTextResponse translations */ + translations?: (google.cloud.translation.v3.ITranslation[]|null); + + /** TranslateTextResponse glossaryTranslations */ + glossaryTranslations?: (google.cloud.translation.v3.ITranslation[]|null); + } + + /** Represents a TranslateTextResponse. */ + class TranslateTextResponse implements ITranslateTextResponse { + + /** + * Constructs a new TranslateTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.ITranslateTextResponse); + + /** TranslateTextResponse translations. */ + public translations: google.cloud.translation.v3.ITranslation[]; + + /** TranslateTextResponse glossaryTranslations. */ + public glossaryTranslations: google.cloud.translation.v3.ITranslation[]; + + /** + * Creates a new TranslateTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslateTextResponse instance + */ + public static create(properties?: google.cloud.translation.v3.ITranslateTextResponse): google.cloud.translation.v3.TranslateTextResponse; + + /** + * Encodes the specified TranslateTextResponse message. Does not implicitly {@link google.cloud.translation.v3.TranslateTextResponse.verify|verify} messages. + * @param message TranslateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.ITranslateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslateTextResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.TranslateTextResponse.verify|verify} messages. + * @param message TranslateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.ITranslateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslateTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.TranslateTextResponse; + + /** + * Decodes a TranslateTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.TranslateTextResponse; + + /** + * Verifies a TranslateTextResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslateTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslateTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.TranslateTextResponse; + + /** + * Creates a plain object from a TranslateTextResponse message. Also converts values to other types if specified. + * @param message TranslateTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.TranslateTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslateTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Translation. */ + interface ITranslation { + + /** Translation translatedText */ + translatedText?: (string|null); + + /** Translation model */ + model?: (string|null); + + /** Translation detectedLanguageCode */ + detectedLanguageCode?: (string|null); + + /** Translation glossaryConfig */ + glossaryConfig?: (google.cloud.translation.v3.ITranslateTextGlossaryConfig|null); + } + + /** Represents a Translation. */ + class Translation implements ITranslation { + + /** + * Constructs a new Translation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.ITranslation); + + /** Translation translatedText. */ + public translatedText: string; + + /** Translation model. */ + public model: string; + + /** Translation detectedLanguageCode. */ + public detectedLanguageCode: string; + + /** Translation glossaryConfig. */ + public glossaryConfig?: (google.cloud.translation.v3.ITranslateTextGlossaryConfig|null); + + /** + * Creates a new Translation instance using the specified properties. + * @param [properties] Properties to set + * @returns Translation instance + */ + public static create(properties?: google.cloud.translation.v3.ITranslation): google.cloud.translation.v3.Translation; + + /** + * Encodes the specified Translation message. Does not implicitly {@link google.cloud.translation.v3.Translation.verify|verify} messages. + * @param message Translation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.ITranslation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Translation message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Translation.verify|verify} messages. + * @param message Translation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.ITranslation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Translation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Translation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.Translation; + + /** + * Decodes a Translation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Translation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.Translation; + + /** + * Verifies a Translation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Translation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Translation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.Translation; + + /** + * Creates a plain object from a Translation message. Also converts values to other types if specified. + * @param message Translation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.Translation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Translation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectLanguageRequest. */ + interface IDetectLanguageRequest { + + /** DetectLanguageRequest parent */ + parent?: (string|null); + + /** DetectLanguageRequest model */ + model?: (string|null); + + /** DetectLanguageRequest content */ + content?: (string|null); + + /** DetectLanguageRequest mimeType */ + mimeType?: (string|null); + + /** DetectLanguageRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a DetectLanguageRequest. */ + class DetectLanguageRequest implements IDetectLanguageRequest { + + /** + * Constructs a new DetectLanguageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IDetectLanguageRequest); + + /** DetectLanguageRequest parent. */ + public parent: string; + + /** DetectLanguageRequest model. */ + public model: string; + + /** DetectLanguageRequest content. */ + public content: string; + + /** DetectLanguageRequest mimeType. */ + public mimeType: string; + + /** DetectLanguageRequest labels. */ + public labels: { [k: string]: string }; + + /** DetectLanguageRequest source. */ + public source?: "content"; + + /** + * Creates a new DetectLanguageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectLanguageRequest instance + */ + public static create(properties?: google.cloud.translation.v3.IDetectLanguageRequest): google.cloud.translation.v3.DetectLanguageRequest; + + /** + * Encodes the specified DetectLanguageRequest message. Does not implicitly {@link google.cloud.translation.v3.DetectLanguageRequest.verify|verify} messages. + * @param message DetectLanguageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IDetectLanguageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectLanguageRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DetectLanguageRequest.verify|verify} messages. + * @param message DetectLanguageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IDetectLanguageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectLanguageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectLanguageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DetectLanguageRequest; + + /** + * Decodes a DetectLanguageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectLanguageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DetectLanguageRequest; + + /** + * Verifies a DetectLanguageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectLanguageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectLanguageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DetectLanguageRequest; + + /** + * Creates a plain object from a DetectLanguageRequest message. Also converts values to other types if specified. + * @param message DetectLanguageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.DetectLanguageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectLanguageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectedLanguage. */ + interface IDetectedLanguage { + + /** DetectedLanguage languageCode */ + languageCode?: (string|null); + + /** DetectedLanguage confidence */ + confidence?: (number|null); + } + + /** Represents a DetectedLanguage. */ + class DetectedLanguage implements IDetectedLanguage { + + /** + * Constructs a new DetectedLanguage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IDetectedLanguage); + + /** DetectedLanguage languageCode. */ + public languageCode: string; + + /** DetectedLanguage confidence. */ + public confidence: number; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedLanguage instance + */ + public static create(properties?: google.cloud.translation.v3.IDetectedLanguage): google.cloud.translation.v3.DetectedLanguage; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.translation.v3.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DetectedLanguage; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DetectedLanguage; + + /** + * Verifies a DetectedLanguage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedLanguage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DetectedLanguage; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @param message DetectedLanguage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.DetectedLanguage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedLanguage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectLanguageResponse. */ + interface IDetectLanguageResponse { + + /** DetectLanguageResponse languages */ + languages?: (google.cloud.translation.v3.IDetectedLanguage[]|null); + } + + /** Represents a DetectLanguageResponse. */ + class DetectLanguageResponse implements IDetectLanguageResponse { + + /** + * Constructs a new DetectLanguageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IDetectLanguageResponse); + + /** DetectLanguageResponse languages. */ + public languages: google.cloud.translation.v3.IDetectedLanguage[]; + + /** + * Creates a new DetectLanguageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectLanguageResponse instance + */ + public static create(properties?: google.cloud.translation.v3.IDetectLanguageResponse): google.cloud.translation.v3.DetectLanguageResponse; + + /** + * Encodes the specified DetectLanguageResponse message. Does not implicitly {@link google.cloud.translation.v3.DetectLanguageResponse.verify|verify} messages. + * @param message DetectLanguageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IDetectLanguageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectLanguageResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DetectLanguageResponse.verify|verify} messages. + * @param message DetectLanguageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IDetectLanguageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectLanguageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectLanguageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DetectLanguageResponse; + + /** + * Decodes a DetectLanguageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectLanguageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DetectLanguageResponse; + + /** + * Verifies a DetectLanguageResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectLanguageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectLanguageResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DetectLanguageResponse; + + /** + * Creates a plain object from a DetectLanguageResponse message. Also converts values to other types if specified. + * @param message DetectLanguageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.DetectLanguageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectLanguageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetSupportedLanguagesRequest. */ + interface IGetSupportedLanguagesRequest { + + /** GetSupportedLanguagesRequest parent */ + parent?: (string|null); + + /** GetSupportedLanguagesRequest displayLanguageCode */ + displayLanguageCode?: (string|null); + + /** GetSupportedLanguagesRequest model */ + model?: (string|null); + } + + /** Represents a GetSupportedLanguagesRequest. */ + class GetSupportedLanguagesRequest implements IGetSupportedLanguagesRequest { + + /** + * Constructs a new GetSupportedLanguagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IGetSupportedLanguagesRequest); + + /** GetSupportedLanguagesRequest parent. */ + public parent: string; + + /** GetSupportedLanguagesRequest displayLanguageCode. */ + public displayLanguageCode: string; + + /** GetSupportedLanguagesRequest model. */ + public model: string; + + /** + * Creates a new GetSupportedLanguagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSupportedLanguagesRequest instance + */ + public static create(properties?: google.cloud.translation.v3.IGetSupportedLanguagesRequest): google.cloud.translation.v3.GetSupportedLanguagesRequest; + + /** + * Encodes the specified GetSupportedLanguagesRequest message. Does not implicitly {@link google.cloud.translation.v3.GetSupportedLanguagesRequest.verify|verify} messages. + * @param message GetSupportedLanguagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IGetSupportedLanguagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSupportedLanguagesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GetSupportedLanguagesRequest.verify|verify} messages. + * @param message GetSupportedLanguagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IGetSupportedLanguagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSupportedLanguagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSupportedLanguagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.GetSupportedLanguagesRequest; + + /** + * Decodes a GetSupportedLanguagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSupportedLanguagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.GetSupportedLanguagesRequest; + + /** + * Verifies a GetSupportedLanguagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSupportedLanguagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSupportedLanguagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.GetSupportedLanguagesRequest; + + /** + * Creates a plain object from a GetSupportedLanguagesRequest message. Also converts values to other types if specified. + * @param message GetSupportedLanguagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.GetSupportedLanguagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSupportedLanguagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SupportedLanguages. */ + interface ISupportedLanguages { + + /** SupportedLanguages languages */ + languages?: (google.cloud.translation.v3.ISupportedLanguage[]|null); + } + + /** Represents a SupportedLanguages. */ + class SupportedLanguages implements ISupportedLanguages { + + /** + * Constructs a new SupportedLanguages. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.ISupportedLanguages); + + /** SupportedLanguages languages. */ + public languages: google.cloud.translation.v3.ISupportedLanguage[]; + + /** + * Creates a new SupportedLanguages instance using the specified properties. + * @param [properties] Properties to set + * @returns SupportedLanguages instance + */ + public static create(properties?: google.cloud.translation.v3.ISupportedLanguages): google.cloud.translation.v3.SupportedLanguages; + + /** + * Encodes the specified SupportedLanguages message. Does not implicitly {@link google.cloud.translation.v3.SupportedLanguages.verify|verify} messages. + * @param message SupportedLanguages message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.ISupportedLanguages, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupportedLanguages message, length delimited. Does not implicitly {@link google.cloud.translation.v3.SupportedLanguages.verify|verify} messages. + * @param message SupportedLanguages message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.ISupportedLanguages, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupportedLanguages message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupportedLanguages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.SupportedLanguages; + + /** + * Decodes a SupportedLanguages message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupportedLanguages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.SupportedLanguages; + + /** + * Verifies a SupportedLanguages message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SupportedLanguages message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupportedLanguages + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.SupportedLanguages; + + /** + * Creates a plain object from a SupportedLanguages message. Also converts values to other types if specified. + * @param message SupportedLanguages + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.SupportedLanguages, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupportedLanguages to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SupportedLanguage. */ + interface ISupportedLanguage { + + /** SupportedLanguage languageCode */ + languageCode?: (string|null); + + /** SupportedLanguage displayName */ + displayName?: (string|null); + + /** SupportedLanguage supportSource */ + supportSource?: (boolean|null); + + /** SupportedLanguage supportTarget */ + supportTarget?: (boolean|null); + } + + /** Represents a SupportedLanguage. */ + class SupportedLanguage implements ISupportedLanguage { + + /** + * Constructs a new SupportedLanguage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.ISupportedLanguage); + + /** SupportedLanguage languageCode. */ + public languageCode: string; + + /** SupportedLanguage displayName. */ + public displayName: string; + + /** SupportedLanguage supportSource. */ + public supportSource: boolean; + + /** SupportedLanguage supportTarget. */ + public supportTarget: boolean; + + /** + * Creates a new SupportedLanguage instance using the specified properties. + * @param [properties] Properties to set + * @returns SupportedLanguage instance + */ + public static create(properties?: google.cloud.translation.v3.ISupportedLanguage): google.cloud.translation.v3.SupportedLanguage; + + /** + * Encodes the specified SupportedLanguage message. Does not implicitly {@link google.cloud.translation.v3.SupportedLanguage.verify|verify} messages. + * @param message SupportedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.ISupportedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupportedLanguage message, length delimited. Does not implicitly {@link google.cloud.translation.v3.SupportedLanguage.verify|verify} messages. + * @param message SupportedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.ISupportedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupportedLanguage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupportedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.SupportedLanguage; + + /** + * Decodes a SupportedLanguage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupportedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.SupportedLanguage; + + /** + * Verifies a SupportedLanguage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SupportedLanguage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupportedLanguage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.SupportedLanguage; + + /** + * Creates a plain object from a SupportedLanguage message. Also converts values to other types if specified. + * @param message SupportedLanguage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.SupportedLanguage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupportedLanguage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource inputUri */ + inputUri?: (string|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IGcsSource); + + /** GcsSource inputUri. */ + public inputUri: string; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.translation.v3.IGcsSource): google.cloud.translation.v3.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.translation.v3.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.GcsSource; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.GcsSource; + + /** + * Verifies a GcsSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.GcsSource; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InputConfig. */ + interface IInputConfig { + + /** InputConfig mimeType */ + mimeType?: (string|null); + + /** InputConfig gcsSource */ + gcsSource?: (google.cloud.translation.v3.IGcsSource|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IInputConfig); + + /** InputConfig mimeType. */ + public mimeType: string; + + /** InputConfig gcsSource. */ + public gcsSource?: (google.cloud.translation.v3.IGcsSource|null); + + /** InputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.cloud.translation.v3.IInputConfig): google.cloud.translation.v3.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.translation.v3.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.InputConfig; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.InputConfig; + + /** + * Verifies an InputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.InputConfig; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @param message InputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination outputUriPrefix */ + outputUriPrefix?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IGcsDestination); + + /** GcsDestination outputUriPrefix. */ + public outputUriPrefix: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.translation.v3.IGcsDestination): google.cloud.translation.v3.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.translation.v3.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.GcsDestination; + + /** + * Verifies a GcsDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.translation.v3.IGcsDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.translation.v3.IGcsDestination|null); + + /** OutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.translation.v3.IOutputConfig): google.cloud.translation.v3.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.translation.v3.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.OutputConfig; + + /** + * Verifies an OutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchTranslateTextRequest. */ + interface IBatchTranslateTextRequest { + + /** BatchTranslateTextRequest parent */ + parent?: (string|null); + + /** BatchTranslateTextRequest sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** BatchTranslateTextRequest targetLanguageCodes */ + targetLanguageCodes?: (string[]|null); + + /** BatchTranslateTextRequest models */ + models?: ({ [k: string]: string }|null); + + /** BatchTranslateTextRequest inputConfigs */ + inputConfigs?: (google.cloud.translation.v3.IInputConfig[]|null); + + /** BatchTranslateTextRequest outputConfig */ + outputConfig?: (google.cloud.translation.v3.IOutputConfig|null); + + /** BatchTranslateTextRequest glossaries */ + glossaries?: ({ [k: string]: google.cloud.translation.v3.ITranslateTextGlossaryConfig }|null); + + /** BatchTranslateTextRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a BatchTranslateTextRequest. */ + class BatchTranslateTextRequest implements IBatchTranslateTextRequest { + + /** + * Constructs a new BatchTranslateTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IBatchTranslateTextRequest); + + /** BatchTranslateTextRequest parent. */ + public parent: string; + + /** BatchTranslateTextRequest sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** BatchTranslateTextRequest targetLanguageCodes. */ + public targetLanguageCodes: string[]; + + /** BatchTranslateTextRequest models. */ + public models: { [k: string]: string }; + + /** BatchTranslateTextRequest inputConfigs. */ + public inputConfigs: google.cloud.translation.v3.IInputConfig[]; + + /** BatchTranslateTextRequest outputConfig. */ + public outputConfig?: (google.cloud.translation.v3.IOutputConfig|null); + + /** BatchTranslateTextRequest glossaries. */ + public glossaries: { [k: string]: google.cloud.translation.v3.ITranslateTextGlossaryConfig }; + + /** BatchTranslateTextRequest labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new BatchTranslateTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchTranslateTextRequest instance + */ + public static create(properties?: google.cloud.translation.v3.IBatchTranslateTextRequest): google.cloud.translation.v3.BatchTranslateTextRequest; + + /** + * Encodes the specified BatchTranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateTextRequest.verify|verify} messages. + * @param message BatchTranslateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IBatchTranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchTranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateTextRequest.verify|verify} messages. + * @param message BatchTranslateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IBatchTranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchTranslateTextRequest; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchTranslateTextRequest; + + /** + * Verifies a BatchTranslateTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchTranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchTranslateTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchTranslateTextRequest; + + /** + * Creates a plain object from a BatchTranslateTextRequest message. Also converts values to other types if specified. + * @param message BatchTranslateTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.BatchTranslateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchTranslateTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchTranslateMetadata. */ + interface IBatchTranslateMetadata { + + /** BatchTranslateMetadata state */ + state?: (google.cloud.translation.v3.BatchTranslateMetadata.State|null); + + /** BatchTranslateMetadata translatedCharacters */ + translatedCharacters?: (number|Long|null); + + /** BatchTranslateMetadata failedCharacters */ + failedCharacters?: (number|Long|null); + + /** BatchTranslateMetadata totalCharacters */ + totalCharacters?: (number|Long|null); + + /** BatchTranslateMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchTranslateMetadata. */ + class BatchTranslateMetadata implements IBatchTranslateMetadata { + + /** + * Constructs a new BatchTranslateMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IBatchTranslateMetadata); + + /** BatchTranslateMetadata state. */ + public state: google.cloud.translation.v3.BatchTranslateMetadata.State; + + /** BatchTranslateMetadata translatedCharacters. */ + public translatedCharacters: (number|Long); + + /** BatchTranslateMetadata failedCharacters. */ + public failedCharacters: (number|Long); + + /** BatchTranslateMetadata totalCharacters. */ + public totalCharacters: (number|Long); + + /** BatchTranslateMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchTranslateMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchTranslateMetadata instance + */ + public static create(properties?: google.cloud.translation.v3.IBatchTranslateMetadata): google.cloud.translation.v3.BatchTranslateMetadata; + + /** + * Encodes the specified BatchTranslateMetadata message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateMetadata.verify|verify} messages. + * @param message BatchTranslateMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IBatchTranslateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchTranslateMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateMetadata.verify|verify} messages. + * @param message BatchTranslateMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IBatchTranslateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchTranslateMetadata; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchTranslateMetadata; + + /** + * Verifies a BatchTranslateMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchTranslateMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchTranslateMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchTranslateMetadata; + + /** + * Creates a plain object from a BatchTranslateMetadata message. Also converts values to other types if specified. + * @param message BatchTranslateMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.BatchTranslateMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchTranslateMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BatchTranslateMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } + + /** Properties of a BatchTranslateResponse. */ + interface IBatchTranslateResponse { + + /** BatchTranslateResponse totalCharacters */ + totalCharacters?: (number|Long|null); + + /** BatchTranslateResponse translatedCharacters */ + translatedCharacters?: (number|Long|null); + + /** BatchTranslateResponse failedCharacters */ + failedCharacters?: (number|Long|null); + + /** BatchTranslateResponse submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchTranslateResponse endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchTranslateResponse. */ + class BatchTranslateResponse implements IBatchTranslateResponse { + + /** + * Constructs a new BatchTranslateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IBatchTranslateResponse); + + /** BatchTranslateResponse totalCharacters. */ + public totalCharacters: (number|Long); + + /** BatchTranslateResponse translatedCharacters. */ + public translatedCharacters: (number|Long); + + /** BatchTranslateResponse failedCharacters. */ + public failedCharacters: (number|Long); + + /** BatchTranslateResponse submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchTranslateResponse endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchTranslateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchTranslateResponse instance + */ + public static create(properties?: google.cloud.translation.v3.IBatchTranslateResponse): google.cloud.translation.v3.BatchTranslateResponse; + + /** + * Encodes the specified BatchTranslateResponse message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateResponse.verify|verify} messages. + * @param message BatchTranslateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IBatchTranslateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchTranslateResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateResponse.verify|verify} messages. + * @param message BatchTranslateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IBatchTranslateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchTranslateResponse; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchTranslateResponse; + + /** + * Verifies a BatchTranslateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchTranslateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchTranslateResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchTranslateResponse; + + /** + * Creates a plain object from a BatchTranslateResponse message. Also converts values to other types if specified. + * @param message BatchTranslateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.BatchTranslateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchTranslateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GlossaryInputConfig. */ + interface IGlossaryInputConfig { + + /** GlossaryInputConfig gcsSource */ + gcsSource?: (google.cloud.translation.v3.IGcsSource|null); + } + + /** Represents a GlossaryInputConfig. */ + class GlossaryInputConfig implements IGlossaryInputConfig { + + /** + * Constructs a new GlossaryInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IGlossaryInputConfig); + + /** GlossaryInputConfig gcsSource. */ + public gcsSource?: (google.cloud.translation.v3.IGcsSource|null); + + /** GlossaryInputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new GlossaryInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GlossaryInputConfig instance + */ + public static create(properties?: google.cloud.translation.v3.IGlossaryInputConfig): google.cloud.translation.v3.GlossaryInputConfig; + + /** + * Encodes the specified GlossaryInputConfig message. Does not implicitly {@link google.cloud.translation.v3.GlossaryInputConfig.verify|verify} messages. + * @param message GlossaryInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IGlossaryInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GlossaryInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GlossaryInputConfig.verify|verify} messages. + * @param message GlossaryInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IGlossaryInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.GlossaryInputConfig; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.GlossaryInputConfig; + + /** + * Verifies a GlossaryInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GlossaryInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GlossaryInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.GlossaryInputConfig; + + /** + * Creates a plain object from a GlossaryInputConfig message. Also converts values to other types if specified. + * @param message GlossaryInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.GlossaryInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GlossaryInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Glossary. */ + interface IGlossary { + + /** Glossary name */ + name?: (string|null); + + /** Glossary languagePair */ + languagePair?: (google.cloud.translation.v3.Glossary.ILanguageCodePair|null); + + /** Glossary languageCodesSet */ + languageCodesSet?: (google.cloud.translation.v3.Glossary.ILanguageCodesSet|null); + + /** Glossary inputConfig */ + inputConfig?: (google.cloud.translation.v3.IGlossaryInputConfig|null); + + /** Glossary entryCount */ + entryCount?: (number|null); + + /** Glossary submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** Glossary endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Glossary. */ + class Glossary implements IGlossary { + + /** + * Constructs a new Glossary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IGlossary); + + /** Glossary name. */ + public name: string; + + /** Glossary languagePair. */ + public languagePair?: (google.cloud.translation.v3.Glossary.ILanguageCodePair|null); + + /** Glossary languageCodesSet. */ + public languageCodesSet?: (google.cloud.translation.v3.Glossary.ILanguageCodesSet|null); + + /** Glossary inputConfig. */ + public inputConfig?: (google.cloud.translation.v3.IGlossaryInputConfig|null); + + /** Glossary entryCount. */ + public entryCount: number; + + /** Glossary submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** Glossary endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Glossary languages. */ + public languages?: ("languagePair"|"languageCodesSet"); + + /** + * Creates a new Glossary instance using the specified properties. + * @param [properties] Properties to set + * @returns Glossary instance + */ + public static create(properties?: google.cloud.translation.v3.IGlossary): google.cloud.translation.v3.Glossary; + + /** + * Encodes the specified Glossary message. Does not implicitly {@link google.cloud.translation.v3.Glossary.verify|verify} messages. + * @param message Glossary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IGlossary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Glossary message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.verify|verify} messages. + * @param message Glossary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IGlossary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Glossary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.Glossary; + + /** + * Decodes a Glossary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.Glossary; + + /** + * Verifies a Glossary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Glossary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Glossary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.Glossary; + + /** + * Creates a plain object from a Glossary message. Also converts values to other types if specified. + * @param message Glossary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.Glossary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Glossary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Glossary { + + /** Properties of a LanguageCodePair. */ + interface ILanguageCodePair { + + /** LanguageCodePair sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** LanguageCodePair targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a LanguageCodePair. */ + class LanguageCodePair implements ILanguageCodePair { + + /** + * Constructs a new LanguageCodePair. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.Glossary.ILanguageCodePair); + + /** LanguageCodePair sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** LanguageCodePair targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new LanguageCodePair instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageCodePair instance + */ + public static create(properties?: google.cloud.translation.v3.Glossary.ILanguageCodePair): google.cloud.translation.v3.Glossary.LanguageCodePair; + + /** + * Encodes the specified LanguageCodePair message. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodePair.verify|verify} messages. + * @param message LanguageCodePair message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.Glossary.ILanguageCodePair, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageCodePair message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodePair.verify|verify} messages. + * @param message LanguageCodePair message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.Glossary.ILanguageCodePair, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.Glossary.LanguageCodePair; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.Glossary.LanguageCodePair; + + /** + * Verifies a LanguageCodePair message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LanguageCodePair message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageCodePair + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.Glossary.LanguageCodePair; + + /** + * Creates a plain object from a LanguageCodePair message. Also converts values to other types if specified. + * @param message LanguageCodePair + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.Glossary.LanguageCodePair, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageCodePair to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LanguageCodesSet. */ + interface ILanguageCodesSet { + + /** LanguageCodesSet languageCodes */ + languageCodes?: (string[]|null); + } + + /** Represents a LanguageCodesSet. */ + class LanguageCodesSet implements ILanguageCodesSet { + + /** + * Constructs a new LanguageCodesSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.Glossary.ILanguageCodesSet); + + /** LanguageCodesSet languageCodes. */ + public languageCodes: string[]; + + /** + * Creates a new LanguageCodesSet instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageCodesSet instance + */ + public static create(properties?: google.cloud.translation.v3.Glossary.ILanguageCodesSet): google.cloud.translation.v3.Glossary.LanguageCodesSet; + + /** + * Encodes the specified LanguageCodesSet message. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodesSet.verify|verify} messages. + * @param message LanguageCodesSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.Glossary.ILanguageCodesSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageCodesSet message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodesSet.verify|verify} messages. + * @param message LanguageCodesSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.Glossary.ILanguageCodesSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.Glossary.LanguageCodesSet; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.Glossary.LanguageCodesSet; + + /** + * Verifies a LanguageCodesSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LanguageCodesSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageCodesSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.Glossary.LanguageCodesSet; + + /** + * Creates a plain object from a LanguageCodesSet message. Also converts values to other types if specified. + * @param message LanguageCodesSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.Glossary.LanguageCodesSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageCodesSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a CreateGlossaryRequest. */ + interface ICreateGlossaryRequest { + + /** CreateGlossaryRequest parent */ + parent?: (string|null); + + /** CreateGlossaryRequest glossary */ + glossary?: (google.cloud.translation.v3.IGlossary|null); + } + + /** Represents a CreateGlossaryRequest. */ + class CreateGlossaryRequest implements ICreateGlossaryRequest { + + /** + * Constructs a new CreateGlossaryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.ICreateGlossaryRequest); + + /** CreateGlossaryRequest parent. */ + public parent: string; + + /** CreateGlossaryRequest glossary. */ + public glossary?: (google.cloud.translation.v3.IGlossary|null); + + /** + * Creates a new CreateGlossaryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGlossaryRequest instance + */ + public static create(properties?: google.cloud.translation.v3.ICreateGlossaryRequest): google.cloud.translation.v3.CreateGlossaryRequest; + + /** + * Encodes the specified CreateGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryRequest.verify|verify} messages. + * @param message CreateGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.ICreateGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryRequest.verify|verify} messages. + * @param message CreateGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.ICreateGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.CreateGlossaryRequest; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.CreateGlossaryRequest; + + /** + * Verifies a CreateGlossaryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGlossaryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.CreateGlossaryRequest; + + /** + * Creates a plain object from a CreateGlossaryRequest message. Also converts values to other types if specified. + * @param message CreateGlossaryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.CreateGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGlossaryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetGlossaryRequest. */ + interface IGetGlossaryRequest { + + /** GetGlossaryRequest name */ + name?: (string|null); + } + + /** Represents a GetGlossaryRequest. */ + class GetGlossaryRequest implements IGetGlossaryRequest { + + /** + * Constructs a new GetGlossaryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IGetGlossaryRequest); + + /** GetGlossaryRequest name. */ + public name: string; + + /** + * Creates a new GetGlossaryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGlossaryRequest instance + */ + public static create(properties?: google.cloud.translation.v3.IGetGlossaryRequest): google.cloud.translation.v3.GetGlossaryRequest; + + /** + * Encodes the specified GetGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.GetGlossaryRequest.verify|verify} messages. + * @param message GetGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IGetGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GetGlossaryRequest.verify|verify} messages. + * @param message GetGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IGetGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.GetGlossaryRequest; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.GetGlossaryRequest; + + /** + * Verifies a GetGlossaryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGlossaryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.GetGlossaryRequest; + + /** + * Creates a plain object from a GetGlossaryRequest message. Also converts values to other types if specified. + * @param message GetGlossaryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.GetGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGlossaryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteGlossaryRequest. */ + interface IDeleteGlossaryRequest { + + /** DeleteGlossaryRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGlossaryRequest. */ + class DeleteGlossaryRequest implements IDeleteGlossaryRequest { + + /** + * Constructs a new DeleteGlossaryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IDeleteGlossaryRequest); + + /** DeleteGlossaryRequest name. */ + public name: string; + + /** + * Creates a new DeleteGlossaryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlossaryRequest instance + */ + public static create(properties?: google.cloud.translation.v3.IDeleteGlossaryRequest): google.cloud.translation.v3.DeleteGlossaryRequest; + + /** + * Encodes the specified DeleteGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryRequest.verify|verify} messages. + * @param message DeleteGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IDeleteGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryRequest.verify|verify} messages. + * @param message DeleteGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IDeleteGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DeleteGlossaryRequest; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DeleteGlossaryRequest; + + /** + * Verifies a DeleteGlossaryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlossaryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DeleteGlossaryRequest; + + /** + * Creates a plain object from a DeleteGlossaryRequest message. Also converts values to other types if specified. + * @param message DeleteGlossaryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.DeleteGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlossaryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlossariesRequest. */ + interface IListGlossariesRequest { + + /** ListGlossariesRequest parent */ + parent?: (string|null); + + /** ListGlossariesRequest pageSize */ + pageSize?: (number|null); + + /** ListGlossariesRequest pageToken */ + pageToken?: (string|null); + + /** ListGlossariesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListGlossariesRequest. */ + class ListGlossariesRequest implements IListGlossariesRequest { + + /** + * Constructs a new ListGlossariesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IListGlossariesRequest); + + /** ListGlossariesRequest parent. */ + public parent: string; + + /** ListGlossariesRequest pageSize. */ + public pageSize: number; + + /** ListGlossariesRequest pageToken. */ + public pageToken: string; + + /** ListGlossariesRequest filter. */ + public filter: string; + + /** + * Creates a new ListGlossariesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlossariesRequest instance + */ + public static create(properties?: google.cloud.translation.v3.IListGlossariesRequest): google.cloud.translation.v3.ListGlossariesRequest; + + /** + * Encodes the specified ListGlossariesRequest message. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesRequest.verify|verify} messages. + * @param message ListGlossariesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IListGlossariesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlossariesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesRequest.verify|verify} messages. + * @param message ListGlossariesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IListGlossariesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.ListGlossariesRequest; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.ListGlossariesRequest; + + /** + * Verifies a ListGlossariesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlossariesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlossariesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.ListGlossariesRequest; + + /** + * Creates a plain object from a ListGlossariesRequest message. Also converts values to other types if specified. + * @param message ListGlossariesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.ListGlossariesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlossariesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlossariesResponse. */ + interface IListGlossariesResponse { + + /** ListGlossariesResponse glossaries */ + glossaries?: (google.cloud.translation.v3.IGlossary[]|null); + + /** ListGlossariesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListGlossariesResponse. */ + class ListGlossariesResponse implements IListGlossariesResponse { + + /** + * Constructs a new ListGlossariesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IListGlossariesResponse); + + /** ListGlossariesResponse glossaries. */ + public glossaries: google.cloud.translation.v3.IGlossary[]; + + /** ListGlossariesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListGlossariesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlossariesResponse instance + */ + public static create(properties?: google.cloud.translation.v3.IListGlossariesResponse): google.cloud.translation.v3.ListGlossariesResponse; + + /** + * Encodes the specified ListGlossariesResponse message. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesResponse.verify|verify} messages. + * @param message ListGlossariesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IListGlossariesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlossariesResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesResponse.verify|verify} messages. + * @param message ListGlossariesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IListGlossariesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.ListGlossariesResponse; + + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.ListGlossariesResponse; + + /** + * Verifies a ListGlossariesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlossariesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlossariesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.ListGlossariesResponse; + + /** + * Creates a plain object from a ListGlossariesResponse message. Also converts values to other types if specified. + * @param message ListGlossariesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.ListGlossariesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlossariesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateGlossaryMetadata. */ + interface ICreateGlossaryMetadata { + + /** CreateGlossaryMetadata name */ + name?: (string|null); + + /** CreateGlossaryMetadata state */ + state?: (google.cloud.translation.v3.CreateGlossaryMetadata.State|null); + + /** CreateGlossaryMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateGlossaryMetadata. */ + class CreateGlossaryMetadata implements ICreateGlossaryMetadata { + + /** + * Constructs a new CreateGlossaryMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.ICreateGlossaryMetadata); + + /** CreateGlossaryMetadata name. */ + public name: string; + + /** CreateGlossaryMetadata state. */ + public state: google.cloud.translation.v3.CreateGlossaryMetadata.State; + + /** CreateGlossaryMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateGlossaryMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGlossaryMetadata instance + */ + public static create(properties?: google.cloud.translation.v3.ICreateGlossaryMetadata): google.cloud.translation.v3.CreateGlossaryMetadata; + + /** + * Encodes the specified CreateGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryMetadata.verify|verify} messages. + * @param message CreateGlossaryMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.ICreateGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryMetadata.verify|verify} messages. + * @param message CreateGlossaryMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.ICreateGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.CreateGlossaryMetadata; + + /** + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.CreateGlossaryMetadata; + + /** + * Verifies a CreateGlossaryMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGlossaryMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.CreateGlossaryMetadata; + + /** + * Creates a plain object from a CreateGlossaryMetadata message. Also converts values to other types if specified. + * @param message CreateGlossaryMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.CreateGlossaryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGlossaryMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace CreateGlossaryMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } + + /** Properties of a DeleteGlossaryMetadata. */ + interface IDeleteGlossaryMetadata { + + /** DeleteGlossaryMetadata name */ + name?: (string|null); + + /** DeleteGlossaryMetadata state */ + state?: (google.cloud.translation.v3.DeleteGlossaryMetadata.State|null); + + /** DeleteGlossaryMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DeleteGlossaryMetadata. */ + class DeleteGlossaryMetadata implements IDeleteGlossaryMetadata { + + /** + * Constructs a new DeleteGlossaryMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IDeleteGlossaryMetadata); + + /** DeleteGlossaryMetadata name. */ + public name: string; + + /** DeleteGlossaryMetadata state. */ + public state: google.cloud.translation.v3.DeleteGlossaryMetadata.State; + + /** DeleteGlossaryMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DeleteGlossaryMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlossaryMetadata instance + */ + public static create(properties?: google.cloud.translation.v3.IDeleteGlossaryMetadata): google.cloud.translation.v3.DeleteGlossaryMetadata; + + /** + * Encodes the specified DeleteGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryMetadata.verify|verify} messages. + * @param message DeleteGlossaryMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IDeleteGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryMetadata.verify|verify} messages. + * @param message DeleteGlossaryMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IDeleteGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DeleteGlossaryMetadata; + + /** + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DeleteGlossaryMetadata; + + /** + * Verifies a DeleteGlossaryMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlossaryMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DeleteGlossaryMetadata; + + /** + * Creates a plain object from a DeleteGlossaryMetadata message. Also converts values to other types if specified. + * @param message DeleteGlossaryMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.DeleteGlossaryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlossaryMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DeleteGlossaryMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } + + /** Properties of a DeleteGlossaryResponse. */ + interface IDeleteGlossaryResponse { + + /** DeleteGlossaryResponse name */ + name?: (string|null); + + /** DeleteGlossaryResponse submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** DeleteGlossaryResponse endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DeleteGlossaryResponse. */ + class DeleteGlossaryResponse implements IDeleteGlossaryResponse { + + /** + * Constructs a new DeleteGlossaryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IDeleteGlossaryResponse); + + /** DeleteGlossaryResponse name. */ + public name: string; + + /** DeleteGlossaryResponse submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** DeleteGlossaryResponse endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DeleteGlossaryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlossaryResponse instance + */ + public static create(properties?: google.cloud.translation.v3.IDeleteGlossaryResponse): google.cloud.translation.v3.DeleteGlossaryResponse; + + /** + * Encodes the specified DeleteGlossaryResponse message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryResponse.verify|verify} messages. + * @param message DeleteGlossaryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IDeleteGlossaryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlossaryResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryResponse.verify|verify} messages. + * @param message DeleteGlossaryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IDeleteGlossaryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlossaryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DeleteGlossaryResponse; + + /** + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlossaryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DeleteGlossaryResponse; + + /** + * Verifies a DeleteGlossaryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlossaryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlossaryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DeleteGlossaryResponse; + + /** + * Creates a plain object from a DeleteGlossaryResponse message. Also converts values to other types if specified. + * @param message DeleteGlossaryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.DeleteGlossaryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlossaryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + /** Namespace v3beta1. */ namespace v3beta1 { diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index d78ca750b0d..724b91d7d34 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -43,6 +43,7730 @@ */ var translation = {}; + translation.v3 = (function() { + + /** + * Namespace v3. + * @memberof google.cloud.translation + * @namespace + */ + var v3 = {}; + + v3.TranslationService = (function() { + + /** + * Constructs a new TranslationService service. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a TranslationService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function TranslationService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TranslationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TranslationService; + + /** + * Creates new TranslationService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.translation.v3.TranslationService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {TranslationService} RPC service. Useful where requests and/or responses are streamed. + */ + TranslationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#translateText}. + * @memberof google.cloud.translation.v3.TranslationService + * @typedef TranslateTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.translation.v3.TranslateTextResponse} [response] TranslateTextResponse + */ + + /** + * Calls TranslateText. + * @function translateText + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.ITranslateTextRequest} request TranslateTextRequest message or plain object + * @param {google.cloud.translation.v3.TranslationService.TranslateTextCallback} callback Node-style callback called with the error, if any, and TranslateTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.translateText = function translateText(request, callback) { + return this.rpcCall(translateText, $root.google.cloud.translation.v3.TranslateTextRequest, $root.google.cloud.translation.v3.TranslateTextResponse, request, callback); + }, "name", { value: "TranslateText" }); + + /** + * Calls TranslateText. + * @function translateText + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.ITranslateTextRequest} request TranslateTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#detectLanguage}. + * @memberof google.cloud.translation.v3.TranslationService + * @typedef DetectLanguageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.translation.v3.DetectLanguageResponse} [response] DetectLanguageResponse + */ + + /** + * Calls DetectLanguage. + * @function detectLanguage + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IDetectLanguageRequest} request DetectLanguageRequest message or plain object + * @param {google.cloud.translation.v3.TranslationService.DetectLanguageCallback} callback Node-style callback called with the error, if any, and DetectLanguageResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.detectLanguage = function detectLanguage(request, callback) { + return this.rpcCall(detectLanguage, $root.google.cloud.translation.v3.DetectLanguageRequest, $root.google.cloud.translation.v3.DetectLanguageResponse, request, callback); + }, "name", { value: "DetectLanguage" }); + + /** + * Calls DetectLanguage. + * @function detectLanguage + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IDetectLanguageRequest} request DetectLanguageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#getSupportedLanguages}. + * @memberof google.cloud.translation.v3.TranslationService + * @typedef GetSupportedLanguagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.translation.v3.SupportedLanguages} [response] SupportedLanguages + */ + + /** + * Calls GetSupportedLanguages. + * @function getSupportedLanguages + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IGetSupportedLanguagesRequest} request GetSupportedLanguagesRequest message or plain object + * @param {google.cloud.translation.v3.TranslationService.GetSupportedLanguagesCallback} callback Node-style callback called with the error, if any, and SupportedLanguages + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.getSupportedLanguages = function getSupportedLanguages(request, callback) { + return this.rpcCall(getSupportedLanguages, $root.google.cloud.translation.v3.GetSupportedLanguagesRequest, $root.google.cloud.translation.v3.SupportedLanguages, request, callback); + }, "name", { value: "GetSupportedLanguages" }); + + /** + * Calls GetSupportedLanguages. + * @function getSupportedLanguages + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IGetSupportedLanguagesRequest} request GetSupportedLanguagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#batchTranslateText}. + * @memberof google.cloud.translation.v3.TranslationService + * @typedef BatchTranslateTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchTranslateText. + * @function batchTranslateText + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IBatchTranslateTextRequest} request BatchTranslateTextRequest message or plain object + * @param {google.cloud.translation.v3.TranslationService.BatchTranslateTextCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.batchTranslateText = function batchTranslateText(request, callback) { + return this.rpcCall(batchTranslateText, $root.google.cloud.translation.v3.BatchTranslateTextRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchTranslateText" }); + + /** + * Calls BatchTranslateText. + * @function batchTranslateText + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IBatchTranslateTextRequest} request BatchTranslateTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#createGlossary}. + * @memberof google.cloud.translation.v3.TranslationService + * @typedef CreateGlossaryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGlossary. + * @function createGlossary + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.ICreateGlossaryRequest} request CreateGlossaryRequest message or plain object + * @param {google.cloud.translation.v3.TranslationService.CreateGlossaryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.createGlossary = function createGlossary(request, callback) { + return this.rpcCall(createGlossary, $root.google.cloud.translation.v3.CreateGlossaryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGlossary" }); + + /** + * Calls CreateGlossary. + * @function createGlossary + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.ICreateGlossaryRequest} request CreateGlossaryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#listGlossaries}. + * @memberof google.cloud.translation.v3.TranslationService + * @typedef ListGlossariesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.translation.v3.ListGlossariesResponse} [response] ListGlossariesResponse + */ + + /** + * Calls ListGlossaries. + * @function listGlossaries + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IListGlossariesRequest} request ListGlossariesRequest message or plain object + * @param {google.cloud.translation.v3.TranslationService.ListGlossariesCallback} callback Node-style callback called with the error, if any, and ListGlossariesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.listGlossaries = function listGlossaries(request, callback) { + return this.rpcCall(listGlossaries, $root.google.cloud.translation.v3.ListGlossariesRequest, $root.google.cloud.translation.v3.ListGlossariesResponse, request, callback); + }, "name", { value: "ListGlossaries" }); + + /** + * Calls ListGlossaries. + * @function listGlossaries + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IListGlossariesRequest} request ListGlossariesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#getGlossary}. + * @memberof google.cloud.translation.v3.TranslationService + * @typedef GetGlossaryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.translation.v3.Glossary} [response] Glossary + */ + + /** + * Calls GetGlossary. + * @function getGlossary + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IGetGlossaryRequest} request GetGlossaryRequest message or plain object + * @param {google.cloud.translation.v3.TranslationService.GetGlossaryCallback} callback Node-style callback called with the error, if any, and Glossary + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.getGlossary = function getGlossary(request, callback) { + return this.rpcCall(getGlossary, $root.google.cloud.translation.v3.GetGlossaryRequest, $root.google.cloud.translation.v3.Glossary, request, callback); + }, "name", { value: "GetGlossary" }); + + /** + * Calls GetGlossary. + * @function getGlossary + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IGetGlossaryRequest} request GetGlossaryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#deleteGlossary}. + * @memberof google.cloud.translation.v3.TranslationService + * @typedef DeleteGlossaryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGlossary. + * @function deleteGlossary + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IDeleteGlossaryRequest} request DeleteGlossaryRequest message or plain object + * @param {google.cloud.translation.v3.TranslationService.DeleteGlossaryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.deleteGlossary = function deleteGlossary(request, callback) { + return this.rpcCall(deleteGlossary, $root.google.cloud.translation.v3.DeleteGlossaryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGlossary" }); + + /** + * Calls DeleteGlossary. + * @function deleteGlossary + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IDeleteGlossaryRequest} request DeleteGlossaryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TranslationService; + })(); + + v3.TranslateTextGlossaryConfig = (function() { + + /** + * Properties of a TranslateTextGlossaryConfig. + * @memberof google.cloud.translation.v3 + * @interface ITranslateTextGlossaryConfig + * @property {string|null} [glossary] TranslateTextGlossaryConfig glossary + * @property {boolean|null} [ignoreCase] TranslateTextGlossaryConfig ignoreCase + */ + + /** + * Constructs a new TranslateTextGlossaryConfig. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a TranslateTextGlossaryConfig. + * @implements ITranslateTextGlossaryConfig + * @constructor + * @param {google.cloud.translation.v3.ITranslateTextGlossaryConfig=} [properties] Properties to set + */ + function TranslateTextGlossaryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslateTextGlossaryConfig glossary. + * @member {string} glossary + * @memberof google.cloud.translation.v3.TranslateTextGlossaryConfig + * @instance + */ + TranslateTextGlossaryConfig.prototype.glossary = ""; + + /** + * TranslateTextGlossaryConfig ignoreCase. + * @member {boolean} ignoreCase + * @memberof google.cloud.translation.v3.TranslateTextGlossaryConfig + * @instance + */ + TranslateTextGlossaryConfig.prototype.ignoreCase = false; + + /** + * Creates a new TranslateTextGlossaryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.TranslateTextGlossaryConfig + * @static + * @param {google.cloud.translation.v3.ITranslateTextGlossaryConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3.TranslateTextGlossaryConfig} TranslateTextGlossaryConfig instance + */ + TranslateTextGlossaryConfig.create = function create(properties) { + return new TranslateTextGlossaryConfig(properties); + }; + + /** + * Encodes the specified TranslateTextGlossaryConfig message. Does not implicitly {@link google.cloud.translation.v3.TranslateTextGlossaryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.TranslateTextGlossaryConfig + * @static + * @param {google.cloud.translation.v3.ITranslateTextGlossaryConfig} message TranslateTextGlossaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateTextGlossaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.glossary != null && message.hasOwnProperty("glossary")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.glossary); + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignoreCase); + return writer; + }; + + /** + * Encodes the specified TranslateTextGlossaryConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.TranslateTextGlossaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.TranslateTextGlossaryConfig + * @static + * @param {google.cloud.translation.v3.ITranslateTextGlossaryConfig} message TranslateTextGlossaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateTextGlossaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslateTextGlossaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.TranslateTextGlossaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.TranslateTextGlossaryConfig} TranslateTextGlossaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateTextGlossaryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.TranslateTextGlossaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.glossary = reader.string(); + break; + case 2: + message.ignoreCase = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslateTextGlossaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.TranslateTextGlossaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.TranslateTextGlossaryConfig} TranslateTextGlossaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateTextGlossaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslateTextGlossaryConfig message. + * @function verify + * @memberof google.cloud.translation.v3.TranslateTextGlossaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslateTextGlossaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.glossary != null && message.hasOwnProperty("glossary")) + if (!$util.isString(message.glossary)) + return "glossary: string expected"; + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + if (typeof message.ignoreCase !== "boolean") + return "ignoreCase: boolean expected"; + return null; + }; + + /** + * Creates a TranslateTextGlossaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.TranslateTextGlossaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.TranslateTextGlossaryConfig} TranslateTextGlossaryConfig + */ + TranslateTextGlossaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.TranslateTextGlossaryConfig) + return object; + var message = new $root.google.cloud.translation.v3.TranslateTextGlossaryConfig(); + if (object.glossary != null) + message.glossary = String(object.glossary); + if (object.ignoreCase != null) + message.ignoreCase = Boolean(object.ignoreCase); + return message; + }; + + /** + * Creates a plain object from a TranslateTextGlossaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.TranslateTextGlossaryConfig + * @static + * @param {google.cloud.translation.v3.TranslateTextGlossaryConfig} message TranslateTextGlossaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslateTextGlossaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.glossary = ""; + object.ignoreCase = false; + } + if (message.glossary != null && message.hasOwnProperty("glossary")) + object.glossary = message.glossary; + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + object.ignoreCase = message.ignoreCase; + return object; + }; + + /** + * Converts this TranslateTextGlossaryConfig to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.TranslateTextGlossaryConfig + * @instance + * @returns {Object.} JSON object + */ + TranslateTextGlossaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TranslateTextGlossaryConfig; + })(); + + v3.TranslateTextRequest = (function() { + + /** + * Properties of a TranslateTextRequest. + * @memberof google.cloud.translation.v3 + * @interface ITranslateTextRequest + * @property {Array.|null} [contents] TranslateTextRequest contents + * @property {string|null} [mimeType] TranslateTextRequest mimeType + * @property {string|null} [sourceLanguageCode] TranslateTextRequest sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslateTextRequest targetLanguageCode + * @property {string|null} [parent] TranslateTextRequest parent + * @property {string|null} [model] TranslateTextRequest model + * @property {google.cloud.translation.v3.ITranslateTextGlossaryConfig|null} [glossaryConfig] TranslateTextRequest glossaryConfig + * @property {Object.|null} [labels] TranslateTextRequest labels + */ + + /** + * Constructs a new TranslateTextRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a TranslateTextRequest. + * @implements ITranslateTextRequest + * @constructor + * @param {google.cloud.translation.v3.ITranslateTextRequest=} [properties] Properties to set + */ + function TranslateTextRequest(properties) { + this.contents = []; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslateTextRequest contents. + * @member {Array.} contents + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.contents = $util.emptyArray; + + /** + * TranslateTextRequest mimeType. + * @member {string} mimeType + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.mimeType = ""; + + /** + * TranslateTextRequest sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.sourceLanguageCode = ""; + + /** + * TranslateTextRequest targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.targetLanguageCode = ""; + + /** + * TranslateTextRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.parent = ""; + + /** + * TranslateTextRequest model. + * @member {string} model + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.model = ""; + + /** + * TranslateTextRequest glossaryConfig. + * @member {google.cloud.translation.v3.ITranslateTextGlossaryConfig|null|undefined} glossaryConfig + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.glossaryConfig = null; + + /** + * TranslateTextRequest labels. + * @member {Object.} labels + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @instance + */ + TranslateTextRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new TranslateTextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @static + * @param {google.cloud.translation.v3.ITranslateTextRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.TranslateTextRequest} TranslateTextRequest instance + */ + TranslateTextRequest.create = function create(properties) { + return new TranslateTextRequest(properties); + }; + + /** + * Encodes the specified TranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3.TranslateTextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @static + * @param {google.cloud.translation.v3.ITranslateTextRequest} message TranslateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contents != null && message.contents.length) + for (var i = 0; i < message.contents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.contents[i]); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetLanguageCode); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.model); + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.parent); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.TranslateTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @static + * @param {google.cloud.translation.v3.ITranslateTextRequest} message TranslateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslateTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.TranslateTextRequest} TranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.TranslateTextRequest(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push(reader.string()); + break; + case 3: + message.mimeType = reader.string(); + break; + case 4: + message.sourceLanguageCode = reader.string(); + break; + case 5: + message.targetLanguageCode = reader.string(); + break; + case 8: + message.parent = reader.string(); + break; + case 6: + message.model = reader.string(); + break; + case 7: + message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + case 10: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslateTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.TranslateTextRequest} TranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslateTextRequest message. + * @function verify + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslateTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contents != null && message.hasOwnProperty("contents")) { + if (!Array.isArray(message.contents)) + return "contents: array expected"; + for (var i = 0; i < message.contents.length; ++i) + if (!$util.isString(message.contents[i])) + return "contents: string[] expected"; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) { + var error = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.verify(message.glossaryConfig); + if (error) + return "glossaryConfig." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a TranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.TranslateTextRequest} TranslateTextRequest + */ + TranslateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.TranslateTextRequest) + return object; + var message = new $root.google.cloud.translation.v3.TranslateTextRequest(); + if (object.contents) { + if (!Array.isArray(object.contents)) + throw TypeError(".google.cloud.translation.v3.TranslateTextRequest.contents: array expected"); + message.contents = []; + for (var i = 0; i < object.contents.length; ++i) + message.contents[i] = String(object.contents[i]); + } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + if (object.parent != null) + message.parent = String(object.parent); + if (object.model != null) + message.model = String(object.model); + if (object.glossaryConfig != null) { + if (typeof object.glossaryConfig !== "object") + throw TypeError(".google.cloud.translation.v3.TranslateTextRequest.glossaryConfig: object expected"); + message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.fromObject(object.glossaryConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.translation.v3.TranslateTextRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a TranslateTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @static + * @param {google.cloud.translation.v3.TranslateTextRequest} message TranslateTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslateTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contents = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.mimeType = ""; + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + object.model = ""; + object.glossaryConfig = null; + object.parent = ""; + } + if (message.contents && message.contents.length) { + object.contents = []; + for (var j = 0; j < message.contents.length; ++j) + object.contents[j] = message.contents[j]; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + object.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.toObject(message.glossaryConfig, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this TranslateTextRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @instance + * @returns {Object.} JSON object + */ + TranslateTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TranslateTextRequest; + })(); + + v3.TranslateTextResponse = (function() { + + /** + * Properties of a TranslateTextResponse. + * @memberof google.cloud.translation.v3 + * @interface ITranslateTextResponse + * @property {Array.|null} [translations] TranslateTextResponse translations + * @property {Array.|null} [glossaryTranslations] TranslateTextResponse glossaryTranslations + */ + + /** + * Constructs a new TranslateTextResponse. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a TranslateTextResponse. + * @implements ITranslateTextResponse + * @constructor + * @param {google.cloud.translation.v3.ITranslateTextResponse=} [properties] Properties to set + */ + function TranslateTextResponse(properties) { + this.translations = []; + this.glossaryTranslations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslateTextResponse translations. + * @member {Array.} translations + * @memberof google.cloud.translation.v3.TranslateTextResponse + * @instance + */ + TranslateTextResponse.prototype.translations = $util.emptyArray; + + /** + * TranslateTextResponse glossaryTranslations. + * @member {Array.} glossaryTranslations + * @memberof google.cloud.translation.v3.TranslateTextResponse + * @instance + */ + TranslateTextResponse.prototype.glossaryTranslations = $util.emptyArray; + + /** + * Creates a new TranslateTextResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.TranslateTextResponse + * @static + * @param {google.cloud.translation.v3.ITranslateTextResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3.TranslateTextResponse} TranslateTextResponse instance + */ + TranslateTextResponse.create = function create(properties) { + return new TranslateTextResponse(properties); + }; + + /** + * Encodes the specified TranslateTextResponse message. Does not implicitly {@link google.cloud.translation.v3.TranslateTextResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.TranslateTextResponse + * @static + * @param {google.cloud.translation.v3.ITranslateTextResponse} message TranslateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.translations != null && message.translations.length) + for (var i = 0; i < message.translations.length; ++i) + $root.google.cloud.translation.v3.Translation.encode(message.translations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.glossaryTranslations != null && message.glossaryTranslations.length) + for (var i = 0; i < message.glossaryTranslations.length; ++i) + $root.google.cloud.translation.v3.Translation.encode(message.glossaryTranslations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranslateTextResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.TranslateTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.TranslateTextResponse + * @static + * @param {google.cloud.translation.v3.ITranslateTextResponse} message TranslateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslateTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.TranslateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.TranslateTextResponse} TranslateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.TranslateTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.translations && message.translations.length)) + message.translations = []; + message.translations.push($root.google.cloud.translation.v3.Translation.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.glossaryTranslations && message.glossaryTranslations.length)) + message.glossaryTranslations = []; + message.glossaryTranslations.push($root.google.cloud.translation.v3.Translation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslateTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.TranslateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.TranslateTextResponse} TranslateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslateTextResponse message. + * @function verify + * @memberof google.cloud.translation.v3.TranslateTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslateTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.translations != null && message.hasOwnProperty("translations")) { + if (!Array.isArray(message.translations)) + return "translations: array expected"; + for (var i = 0; i < message.translations.length; ++i) { + var error = $root.google.cloud.translation.v3.Translation.verify(message.translations[i]); + if (error) + return "translations." + error; + } + } + if (message.glossaryTranslations != null && message.hasOwnProperty("glossaryTranslations")) { + if (!Array.isArray(message.glossaryTranslations)) + return "glossaryTranslations: array expected"; + for (var i = 0; i < message.glossaryTranslations.length; ++i) { + var error = $root.google.cloud.translation.v3.Translation.verify(message.glossaryTranslations[i]); + if (error) + return "glossaryTranslations." + error; + } + } + return null; + }; + + /** + * Creates a TranslateTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.TranslateTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.TranslateTextResponse} TranslateTextResponse + */ + TranslateTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.TranslateTextResponse) + return object; + var message = new $root.google.cloud.translation.v3.TranslateTextResponse(); + if (object.translations) { + if (!Array.isArray(object.translations)) + throw TypeError(".google.cloud.translation.v3.TranslateTextResponse.translations: array expected"); + message.translations = []; + for (var i = 0; i < object.translations.length; ++i) { + if (typeof object.translations[i] !== "object") + throw TypeError(".google.cloud.translation.v3.TranslateTextResponse.translations: object expected"); + message.translations[i] = $root.google.cloud.translation.v3.Translation.fromObject(object.translations[i]); + } + } + if (object.glossaryTranslations) { + if (!Array.isArray(object.glossaryTranslations)) + throw TypeError(".google.cloud.translation.v3.TranslateTextResponse.glossaryTranslations: array expected"); + message.glossaryTranslations = []; + for (var i = 0; i < object.glossaryTranslations.length; ++i) { + if (typeof object.glossaryTranslations[i] !== "object") + throw TypeError(".google.cloud.translation.v3.TranslateTextResponse.glossaryTranslations: object expected"); + message.glossaryTranslations[i] = $root.google.cloud.translation.v3.Translation.fromObject(object.glossaryTranslations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TranslateTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.TranslateTextResponse + * @static + * @param {google.cloud.translation.v3.TranslateTextResponse} message TranslateTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslateTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.translations = []; + object.glossaryTranslations = []; + } + if (message.translations && message.translations.length) { + object.translations = []; + for (var j = 0; j < message.translations.length; ++j) + object.translations[j] = $root.google.cloud.translation.v3.Translation.toObject(message.translations[j], options); + } + if (message.glossaryTranslations && message.glossaryTranslations.length) { + object.glossaryTranslations = []; + for (var j = 0; j < message.glossaryTranslations.length; ++j) + object.glossaryTranslations[j] = $root.google.cloud.translation.v3.Translation.toObject(message.glossaryTranslations[j], options); + } + return object; + }; + + /** + * Converts this TranslateTextResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.TranslateTextResponse + * @instance + * @returns {Object.} JSON object + */ + TranslateTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TranslateTextResponse; + })(); + + v3.Translation = (function() { + + /** + * Properties of a Translation. + * @memberof google.cloud.translation.v3 + * @interface ITranslation + * @property {string|null} [translatedText] Translation translatedText + * @property {string|null} [model] Translation model + * @property {string|null} [detectedLanguageCode] Translation detectedLanguageCode + * @property {google.cloud.translation.v3.ITranslateTextGlossaryConfig|null} [glossaryConfig] Translation glossaryConfig + */ + + /** + * Constructs a new Translation. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a Translation. + * @implements ITranslation + * @constructor + * @param {google.cloud.translation.v3.ITranslation=} [properties] Properties to set + */ + function Translation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Translation translatedText. + * @member {string} translatedText + * @memberof google.cloud.translation.v3.Translation + * @instance + */ + Translation.prototype.translatedText = ""; + + /** + * Translation model. + * @member {string} model + * @memberof google.cloud.translation.v3.Translation + * @instance + */ + Translation.prototype.model = ""; + + /** + * Translation detectedLanguageCode. + * @member {string} detectedLanguageCode + * @memberof google.cloud.translation.v3.Translation + * @instance + */ + Translation.prototype.detectedLanguageCode = ""; + + /** + * Translation glossaryConfig. + * @member {google.cloud.translation.v3.ITranslateTextGlossaryConfig|null|undefined} glossaryConfig + * @memberof google.cloud.translation.v3.Translation + * @instance + */ + Translation.prototype.glossaryConfig = null; + + /** + * Creates a new Translation instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.Translation + * @static + * @param {google.cloud.translation.v3.ITranslation=} [properties] Properties to set + * @returns {google.cloud.translation.v3.Translation} Translation instance + */ + Translation.create = function create(properties) { + return new Translation(properties); + }; + + /** + * Encodes the specified Translation message. Does not implicitly {@link google.cloud.translation.v3.Translation.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.Translation + * @static + * @param {google.cloud.translation.v3.ITranslation} message Translation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Translation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.translatedText != null && message.hasOwnProperty("translatedText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.translatedText); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.detectedLanguageCode); + return writer; + }; + + /** + * Encodes the specified Translation message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Translation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.Translation + * @static + * @param {google.cloud.translation.v3.ITranslation} message Translation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Translation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Translation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.Translation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.Translation} Translation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Translation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.Translation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.translatedText = reader.string(); + break; + case 2: + message.model = reader.string(); + break; + case 4: + message.detectedLanguageCode = reader.string(); + break; + case 3: + message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Translation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.Translation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.Translation} Translation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Translation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Translation message. + * @function verify + * @memberof google.cloud.translation.v3.Translation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Translation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.translatedText != null && message.hasOwnProperty("translatedText")) + if (!$util.isString(message.translatedText)) + return "translatedText: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + if (!$util.isString(message.detectedLanguageCode)) + return "detectedLanguageCode: string expected"; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) { + var error = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.verify(message.glossaryConfig); + if (error) + return "glossaryConfig." + error; + } + return null; + }; + + /** + * Creates a Translation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.Translation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.Translation} Translation + */ + Translation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.Translation) + return object; + var message = new $root.google.cloud.translation.v3.Translation(); + if (object.translatedText != null) + message.translatedText = String(object.translatedText); + if (object.model != null) + message.model = String(object.model); + if (object.detectedLanguageCode != null) + message.detectedLanguageCode = String(object.detectedLanguageCode); + if (object.glossaryConfig != null) { + if (typeof object.glossaryConfig !== "object") + throw TypeError(".google.cloud.translation.v3.Translation.glossaryConfig: object expected"); + message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.fromObject(object.glossaryConfig); + } + return message; + }; + + /** + * Creates a plain object from a Translation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.Translation + * @static + * @param {google.cloud.translation.v3.Translation} message Translation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Translation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.translatedText = ""; + object.model = ""; + object.glossaryConfig = null; + object.detectedLanguageCode = ""; + } + if (message.translatedText != null && message.hasOwnProperty("translatedText")) + object.translatedText = message.translatedText; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + object.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.toObject(message.glossaryConfig, options); + if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + object.detectedLanguageCode = message.detectedLanguageCode; + return object; + }; + + /** + * Converts this Translation to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.Translation + * @instance + * @returns {Object.} JSON object + */ + Translation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Translation; + })(); + + v3.DetectLanguageRequest = (function() { + + /** + * Properties of a DetectLanguageRequest. + * @memberof google.cloud.translation.v3 + * @interface IDetectLanguageRequest + * @property {string|null} [parent] DetectLanguageRequest parent + * @property {string|null} [model] DetectLanguageRequest model + * @property {string|null} [content] DetectLanguageRequest content + * @property {string|null} [mimeType] DetectLanguageRequest mimeType + * @property {Object.|null} [labels] DetectLanguageRequest labels + */ + + /** + * Constructs a new DetectLanguageRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a DetectLanguageRequest. + * @implements IDetectLanguageRequest + * @constructor + * @param {google.cloud.translation.v3.IDetectLanguageRequest=} [properties] Properties to set + */ + function DetectLanguageRequest(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectLanguageRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @instance + */ + DetectLanguageRequest.prototype.parent = ""; + + /** + * DetectLanguageRequest model. + * @member {string} model + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @instance + */ + DetectLanguageRequest.prototype.model = ""; + + /** + * DetectLanguageRequest content. + * @member {string} content + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @instance + */ + DetectLanguageRequest.prototype.content = ""; + + /** + * DetectLanguageRequest mimeType. + * @member {string} mimeType + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @instance + */ + DetectLanguageRequest.prototype.mimeType = ""; + + /** + * DetectLanguageRequest labels. + * @member {Object.} labels + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @instance + */ + DetectLanguageRequest.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DetectLanguageRequest source. + * @member {"content"|undefined} source + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @instance + */ + Object.defineProperty(DetectLanguageRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["content"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DetectLanguageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @static + * @param {google.cloud.translation.v3.IDetectLanguageRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.DetectLanguageRequest} DetectLanguageRequest instance + */ + DetectLanguageRequest.create = function create(properties) { + return new DetectLanguageRequest(properties); + }; + + /** + * Encodes the specified DetectLanguageRequest message. Does not implicitly {@link google.cloud.translation.v3.DetectLanguageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @static + * @param {google.cloud.translation.v3.IDetectLanguageRequest} message DetectLanguageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectLanguageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.model); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified DetectLanguageRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DetectLanguageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @static + * @param {google.cloud.translation.v3.IDetectLanguageRequest} message DetectLanguageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectLanguageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectLanguageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.DetectLanguageRequest} DetectLanguageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectLanguageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DetectLanguageRequest(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + message.parent = reader.string(); + break; + case 4: + message.model = reader.string(); + break; + case 1: + message.content = reader.string(); + break; + case 3: + message.mimeType = reader.string(); + break; + case 6: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectLanguageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.DetectLanguageRequest} DetectLanguageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectLanguageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectLanguageRequest message. + * @function verify + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectLanguageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.content != null && message.hasOwnProperty("content")) { + properties.source = 1; + if (!$util.isString(message.content)) + return "content: string expected"; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a DetectLanguageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.DetectLanguageRequest} DetectLanguageRequest + */ + DetectLanguageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.DetectLanguageRequest) + return object; + var message = new $root.google.cloud.translation.v3.DetectLanguageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.model != null) + message.model = String(object.model); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.translation.v3.DetectLanguageRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a DetectLanguageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @static + * @param {google.cloud.translation.v3.DetectLanguageRequest} message DetectLanguageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectLanguageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.mimeType = ""; + object.model = ""; + object.parent = ""; + } + if (message.content != null && message.hasOwnProperty("content")) { + object.content = message.content; + if (options.oneofs) + object.source = "content"; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this DetectLanguageRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @instance + * @returns {Object.} JSON object + */ + DetectLanguageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectLanguageRequest; + })(); + + v3.DetectedLanguage = (function() { + + /** + * Properties of a DetectedLanguage. + * @memberof google.cloud.translation.v3 + * @interface IDetectedLanguage + * @property {string|null} [languageCode] DetectedLanguage languageCode + * @property {number|null} [confidence] DetectedLanguage confidence + */ + + /** + * Constructs a new DetectedLanguage. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a DetectedLanguage. + * @implements IDetectedLanguage + * @constructor + * @param {google.cloud.translation.v3.IDetectedLanguage=} [properties] Properties to set + */ + function DetectedLanguage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectedLanguage languageCode. + * @member {string} languageCode + * @memberof google.cloud.translation.v3.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.languageCode = ""; + + /** + * DetectedLanguage confidence. + * @member {number} confidence + * @memberof google.cloud.translation.v3.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.confidence = 0; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.DetectedLanguage + * @static + * @param {google.cloud.translation.v3.IDetectedLanguage=} [properties] Properties to set + * @returns {google.cloud.translation.v3.DetectedLanguage} DetectedLanguage instance + */ + DetectedLanguage.create = function create(properties) { + return new DetectedLanguage(properties); + }; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.translation.v3.DetectedLanguage.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.DetectedLanguage + * @static + * @param {google.cloud.translation.v3.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DetectedLanguage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.DetectedLanguage + * @static + * @param {google.cloud.translation.v3.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DetectedLanguage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.languageCode = reader.string(); + break; + case 2: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedLanguage message. + * @function verify + * @memberof google.cloud.translation.v3.DetectedLanguage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedLanguage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.DetectedLanguage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.DetectedLanguage} DetectedLanguage + */ + DetectedLanguage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.DetectedLanguage) + return object; + var message = new $root.google.cloud.translation.v3.DetectedLanguage(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.DetectedLanguage + * @static + * @param {google.cloud.translation.v3.DetectedLanguage} message DetectedLanguage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedLanguage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.languageCode = ""; + object.confidence = 0; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this DetectedLanguage to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.DetectedLanguage + * @instance + * @returns {Object.} JSON object + */ + DetectedLanguage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectedLanguage; + })(); + + v3.DetectLanguageResponse = (function() { + + /** + * Properties of a DetectLanguageResponse. + * @memberof google.cloud.translation.v3 + * @interface IDetectLanguageResponse + * @property {Array.|null} [languages] DetectLanguageResponse languages + */ + + /** + * Constructs a new DetectLanguageResponse. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a DetectLanguageResponse. + * @implements IDetectLanguageResponse + * @constructor + * @param {google.cloud.translation.v3.IDetectLanguageResponse=} [properties] Properties to set + */ + function DetectLanguageResponse(properties) { + this.languages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectLanguageResponse languages. + * @member {Array.} languages + * @memberof google.cloud.translation.v3.DetectLanguageResponse + * @instance + */ + DetectLanguageResponse.prototype.languages = $util.emptyArray; + + /** + * Creates a new DetectLanguageResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.DetectLanguageResponse + * @static + * @param {google.cloud.translation.v3.IDetectLanguageResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3.DetectLanguageResponse} DetectLanguageResponse instance + */ + DetectLanguageResponse.create = function create(properties) { + return new DetectLanguageResponse(properties); + }; + + /** + * Encodes the specified DetectLanguageResponse message. Does not implicitly {@link google.cloud.translation.v3.DetectLanguageResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.DetectLanguageResponse + * @static + * @param {google.cloud.translation.v3.IDetectLanguageResponse} message DetectLanguageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectLanguageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languages != null && message.languages.length) + for (var i = 0; i < message.languages.length; ++i) + $root.google.cloud.translation.v3.DetectedLanguage.encode(message.languages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DetectLanguageResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DetectLanguageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.DetectLanguageResponse + * @static + * @param {google.cloud.translation.v3.IDetectLanguageResponse} message DetectLanguageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectLanguageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectLanguageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.DetectLanguageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.DetectLanguageResponse} DetectLanguageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectLanguageResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DetectLanguageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.languages && message.languages.length)) + message.languages = []; + message.languages.push($root.google.cloud.translation.v3.DetectedLanguage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectLanguageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.DetectLanguageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.DetectLanguageResponse} DetectLanguageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectLanguageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectLanguageResponse message. + * @function verify + * @memberof google.cloud.translation.v3.DetectLanguageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectLanguageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languages != null && message.hasOwnProperty("languages")) { + if (!Array.isArray(message.languages)) + return "languages: array expected"; + for (var i = 0; i < message.languages.length; ++i) { + var error = $root.google.cloud.translation.v3.DetectedLanguage.verify(message.languages[i]); + if (error) + return "languages." + error; + } + } + return null; + }; + + /** + * Creates a DetectLanguageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.DetectLanguageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.DetectLanguageResponse} DetectLanguageResponse + */ + DetectLanguageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.DetectLanguageResponse) + return object; + var message = new $root.google.cloud.translation.v3.DetectLanguageResponse(); + if (object.languages) { + if (!Array.isArray(object.languages)) + throw TypeError(".google.cloud.translation.v3.DetectLanguageResponse.languages: array expected"); + message.languages = []; + for (var i = 0; i < object.languages.length; ++i) { + if (typeof object.languages[i] !== "object") + throw TypeError(".google.cloud.translation.v3.DetectLanguageResponse.languages: object expected"); + message.languages[i] = $root.google.cloud.translation.v3.DetectedLanguage.fromObject(object.languages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DetectLanguageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.DetectLanguageResponse + * @static + * @param {google.cloud.translation.v3.DetectLanguageResponse} message DetectLanguageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectLanguageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languages = []; + if (message.languages && message.languages.length) { + object.languages = []; + for (var j = 0; j < message.languages.length; ++j) + object.languages[j] = $root.google.cloud.translation.v3.DetectedLanguage.toObject(message.languages[j], options); + } + return object; + }; + + /** + * Converts this DetectLanguageResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.DetectLanguageResponse + * @instance + * @returns {Object.} JSON object + */ + DetectLanguageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectLanguageResponse; + })(); + + v3.GetSupportedLanguagesRequest = (function() { + + /** + * Properties of a GetSupportedLanguagesRequest. + * @memberof google.cloud.translation.v3 + * @interface IGetSupportedLanguagesRequest + * @property {string|null} [parent] GetSupportedLanguagesRequest parent + * @property {string|null} [displayLanguageCode] GetSupportedLanguagesRequest displayLanguageCode + * @property {string|null} [model] GetSupportedLanguagesRequest model + */ + + /** + * Constructs a new GetSupportedLanguagesRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a GetSupportedLanguagesRequest. + * @implements IGetSupportedLanguagesRequest + * @constructor + * @param {google.cloud.translation.v3.IGetSupportedLanguagesRequest=} [properties] Properties to set + */ + function GetSupportedLanguagesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSupportedLanguagesRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @instance + */ + GetSupportedLanguagesRequest.prototype.parent = ""; + + /** + * GetSupportedLanguagesRequest displayLanguageCode. + * @member {string} displayLanguageCode + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @instance + */ + GetSupportedLanguagesRequest.prototype.displayLanguageCode = ""; + + /** + * GetSupportedLanguagesRequest model. + * @member {string} model + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @instance + */ + GetSupportedLanguagesRequest.prototype.model = ""; + + /** + * Creates a new GetSupportedLanguagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @static + * @param {google.cloud.translation.v3.IGetSupportedLanguagesRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.GetSupportedLanguagesRequest} GetSupportedLanguagesRequest instance + */ + GetSupportedLanguagesRequest.create = function create(properties) { + return new GetSupportedLanguagesRequest(properties); + }; + + /** + * Encodes the specified GetSupportedLanguagesRequest message. Does not implicitly {@link google.cloud.translation.v3.GetSupportedLanguagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @static + * @param {google.cloud.translation.v3.IGetSupportedLanguagesRequest} message GetSupportedLanguagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSupportedLanguagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayLanguageCode != null && message.hasOwnProperty("displayLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayLanguageCode); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); + return writer; + }; + + /** + * Encodes the specified GetSupportedLanguagesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GetSupportedLanguagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @static + * @param {google.cloud.translation.v3.IGetSupportedLanguagesRequest} message GetSupportedLanguagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSupportedLanguagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSupportedLanguagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.GetSupportedLanguagesRequest} GetSupportedLanguagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSupportedLanguagesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.GetSupportedLanguagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.parent = reader.string(); + break; + case 1: + message.displayLanguageCode = reader.string(); + break; + case 2: + message.model = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSupportedLanguagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.GetSupportedLanguagesRequest} GetSupportedLanguagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSupportedLanguagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSupportedLanguagesRequest message. + * @function verify + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSupportedLanguagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.displayLanguageCode != null && message.hasOwnProperty("displayLanguageCode")) + if (!$util.isString(message.displayLanguageCode)) + return "displayLanguageCode: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a GetSupportedLanguagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.GetSupportedLanguagesRequest} GetSupportedLanguagesRequest + */ + GetSupportedLanguagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.GetSupportedLanguagesRequest) + return object; + var message = new $root.google.cloud.translation.v3.GetSupportedLanguagesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.displayLanguageCode != null) + message.displayLanguageCode = String(object.displayLanguageCode); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a GetSupportedLanguagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @static + * @param {google.cloud.translation.v3.GetSupportedLanguagesRequest} message GetSupportedLanguagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSupportedLanguagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayLanguageCode = ""; + object.model = ""; + object.parent = ""; + } + if (message.displayLanguageCode != null && message.hasOwnProperty("displayLanguageCode")) + object.displayLanguageCode = message.displayLanguageCode; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this GetSupportedLanguagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @instance + * @returns {Object.} JSON object + */ + GetSupportedLanguagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSupportedLanguagesRequest; + })(); + + v3.SupportedLanguages = (function() { + + /** + * Properties of a SupportedLanguages. + * @memberof google.cloud.translation.v3 + * @interface ISupportedLanguages + * @property {Array.|null} [languages] SupportedLanguages languages + */ + + /** + * Constructs a new SupportedLanguages. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a SupportedLanguages. + * @implements ISupportedLanguages + * @constructor + * @param {google.cloud.translation.v3.ISupportedLanguages=} [properties] Properties to set + */ + function SupportedLanguages(properties) { + this.languages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SupportedLanguages languages. + * @member {Array.} languages + * @memberof google.cloud.translation.v3.SupportedLanguages + * @instance + */ + SupportedLanguages.prototype.languages = $util.emptyArray; + + /** + * Creates a new SupportedLanguages instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.SupportedLanguages + * @static + * @param {google.cloud.translation.v3.ISupportedLanguages=} [properties] Properties to set + * @returns {google.cloud.translation.v3.SupportedLanguages} SupportedLanguages instance + */ + SupportedLanguages.create = function create(properties) { + return new SupportedLanguages(properties); + }; + + /** + * Encodes the specified SupportedLanguages message. Does not implicitly {@link google.cloud.translation.v3.SupportedLanguages.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.SupportedLanguages + * @static + * @param {google.cloud.translation.v3.ISupportedLanguages} message SupportedLanguages message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedLanguages.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languages != null && message.languages.length) + for (var i = 0; i < message.languages.length; ++i) + $root.google.cloud.translation.v3.SupportedLanguage.encode(message.languages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SupportedLanguages message, length delimited. Does not implicitly {@link google.cloud.translation.v3.SupportedLanguages.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.SupportedLanguages + * @static + * @param {google.cloud.translation.v3.ISupportedLanguages} message SupportedLanguages message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedLanguages.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupportedLanguages message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.SupportedLanguages + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.SupportedLanguages} SupportedLanguages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedLanguages.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.SupportedLanguages(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.languages && message.languages.length)) + message.languages = []; + message.languages.push($root.google.cloud.translation.v3.SupportedLanguage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupportedLanguages message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.SupportedLanguages + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.SupportedLanguages} SupportedLanguages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedLanguages.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupportedLanguages message. + * @function verify + * @memberof google.cloud.translation.v3.SupportedLanguages + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupportedLanguages.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languages != null && message.hasOwnProperty("languages")) { + if (!Array.isArray(message.languages)) + return "languages: array expected"; + for (var i = 0; i < message.languages.length; ++i) { + var error = $root.google.cloud.translation.v3.SupportedLanguage.verify(message.languages[i]); + if (error) + return "languages." + error; + } + } + return null; + }; + + /** + * Creates a SupportedLanguages message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.SupportedLanguages + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.SupportedLanguages} SupportedLanguages + */ + SupportedLanguages.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.SupportedLanguages) + return object; + var message = new $root.google.cloud.translation.v3.SupportedLanguages(); + if (object.languages) { + if (!Array.isArray(object.languages)) + throw TypeError(".google.cloud.translation.v3.SupportedLanguages.languages: array expected"); + message.languages = []; + for (var i = 0; i < object.languages.length; ++i) { + if (typeof object.languages[i] !== "object") + throw TypeError(".google.cloud.translation.v3.SupportedLanguages.languages: object expected"); + message.languages[i] = $root.google.cloud.translation.v3.SupportedLanguage.fromObject(object.languages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SupportedLanguages message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.SupportedLanguages + * @static + * @param {google.cloud.translation.v3.SupportedLanguages} message SupportedLanguages + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupportedLanguages.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languages = []; + if (message.languages && message.languages.length) { + object.languages = []; + for (var j = 0; j < message.languages.length; ++j) + object.languages[j] = $root.google.cloud.translation.v3.SupportedLanguage.toObject(message.languages[j], options); + } + return object; + }; + + /** + * Converts this SupportedLanguages to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.SupportedLanguages + * @instance + * @returns {Object.} JSON object + */ + SupportedLanguages.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SupportedLanguages; + })(); + + v3.SupportedLanguage = (function() { + + /** + * Properties of a SupportedLanguage. + * @memberof google.cloud.translation.v3 + * @interface ISupportedLanguage + * @property {string|null} [languageCode] SupportedLanguage languageCode + * @property {string|null} [displayName] SupportedLanguage displayName + * @property {boolean|null} [supportSource] SupportedLanguage supportSource + * @property {boolean|null} [supportTarget] SupportedLanguage supportTarget + */ + + /** + * Constructs a new SupportedLanguage. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a SupportedLanguage. + * @implements ISupportedLanguage + * @constructor + * @param {google.cloud.translation.v3.ISupportedLanguage=} [properties] Properties to set + */ + function SupportedLanguage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SupportedLanguage languageCode. + * @member {string} languageCode + * @memberof google.cloud.translation.v3.SupportedLanguage + * @instance + */ + SupportedLanguage.prototype.languageCode = ""; + + /** + * SupportedLanguage displayName. + * @member {string} displayName + * @memberof google.cloud.translation.v3.SupportedLanguage + * @instance + */ + SupportedLanguage.prototype.displayName = ""; + + /** + * SupportedLanguage supportSource. + * @member {boolean} supportSource + * @memberof google.cloud.translation.v3.SupportedLanguage + * @instance + */ + SupportedLanguage.prototype.supportSource = false; + + /** + * SupportedLanguage supportTarget. + * @member {boolean} supportTarget + * @memberof google.cloud.translation.v3.SupportedLanguage + * @instance + */ + SupportedLanguage.prototype.supportTarget = false; + + /** + * Creates a new SupportedLanguage instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.SupportedLanguage + * @static + * @param {google.cloud.translation.v3.ISupportedLanguage=} [properties] Properties to set + * @returns {google.cloud.translation.v3.SupportedLanguage} SupportedLanguage instance + */ + SupportedLanguage.create = function create(properties) { + return new SupportedLanguage(properties); + }; + + /** + * Encodes the specified SupportedLanguage message. Does not implicitly {@link google.cloud.translation.v3.SupportedLanguage.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.SupportedLanguage + * @static + * @param {google.cloud.translation.v3.ISupportedLanguage} message SupportedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedLanguage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.supportSource != null && message.hasOwnProperty("supportSource")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.supportSource); + if (message.supportTarget != null && message.hasOwnProperty("supportTarget")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.supportTarget); + return writer; + }; + + /** + * Encodes the specified SupportedLanguage message, length delimited. Does not implicitly {@link google.cloud.translation.v3.SupportedLanguage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.SupportedLanguage + * @static + * @param {google.cloud.translation.v3.ISupportedLanguage} message SupportedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedLanguage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupportedLanguage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.SupportedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.SupportedLanguage} SupportedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedLanguage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.SupportedLanguage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.languageCode = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.supportSource = reader.bool(); + break; + case 4: + message.supportTarget = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupportedLanguage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.SupportedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.SupportedLanguage} SupportedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedLanguage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupportedLanguage message. + * @function verify + * @memberof google.cloud.translation.v3.SupportedLanguage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupportedLanguage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.supportSource != null && message.hasOwnProperty("supportSource")) + if (typeof message.supportSource !== "boolean") + return "supportSource: boolean expected"; + if (message.supportTarget != null && message.hasOwnProperty("supportTarget")) + if (typeof message.supportTarget !== "boolean") + return "supportTarget: boolean expected"; + return null; + }; + + /** + * Creates a SupportedLanguage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.SupportedLanguage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.SupportedLanguage} SupportedLanguage + */ + SupportedLanguage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.SupportedLanguage) + return object; + var message = new $root.google.cloud.translation.v3.SupportedLanguage(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.supportSource != null) + message.supportSource = Boolean(object.supportSource); + if (object.supportTarget != null) + message.supportTarget = Boolean(object.supportTarget); + return message; + }; + + /** + * Creates a plain object from a SupportedLanguage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.SupportedLanguage + * @static + * @param {google.cloud.translation.v3.SupportedLanguage} message SupportedLanguage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupportedLanguage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.languageCode = ""; + object.displayName = ""; + object.supportSource = false; + object.supportTarget = false; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.supportSource != null && message.hasOwnProperty("supportSource")) + object.supportSource = message.supportSource; + if (message.supportTarget != null && message.hasOwnProperty("supportTarget")) + object.supportTarget = message.supportTarget; + return object; + }; + + /** + * Converts this SupportedLanguage to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.SupportedLanguage + * @instance + * @returns {Object.} JSON object + */ + SupportedLanguage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SupportedLanguage; + })(); + + v3.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.translation.v3 + * @interface IGcsSource + * @property {string|null} [inputUri] GcsSource inputUri + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.translation.v3.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsSource inputUri. + * @member {string} inputUri + * @memberof google.cloud.translation.v3.GcsSource + * @instance + */ + GcsSource.prototype.inputUri = ""; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.GcsSource + * @static + * @param {google.cloud.translation.v3.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.translation.v3.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.translation.v3.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.GcsSource + * @static + * @param {google.cloud.translation.v3.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.GcsSource + * @static + * @param {google.cloud.translation.v3.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSource message. + * @function verify + * @memberof google.cloud.translation.v3.GcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + return null; + }; + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.GcsSource) + return object; + var message = new $root.google.cloud.translation.v3.GcsSource(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.GcsSource + * @static + * @param {google.cloud.translation.v3.GcsSource} message GcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputUri = ""; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsSource; + })(); + + v3.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.translation.v3 + * @interface IInputConfig + * @property {string|null} [mimeType] InputConfig mimeType + * @property {google.cloud.translation.v3.IGcsSource|null} [gcsSource] InputConfig gcsSource + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.translation.v3 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.translation.v3.IInputConfig=} [properties] Properties to set + */ + function InputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputConfig mimeType. + * @member {string} mimeType + * @memberof google.cloud.translation.v3.InputConfig + * @instance + */ + InputConfig.prototype.mimeType = ""; + + /** + * InputConfig gcsSource. + * @member {google.cloud.translation.v3.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.translation.v3.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.translation.v3.InputConfig + * @instance + */ + Object.defineProperty(InputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.InputConfig + * @static + * @param {google.cloud.translation.v3.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.translation.v3.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.InputConfig + * @static + * @param {google.cloud.translation.v3.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + $root.google.cloud.translation.v3.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.InputConfig + * @static + * @param {google.cloud.translation.v3.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.InputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mimeType = reader.string(); + break; + case 2: + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputConfig message. + * @function verify + * @memberof google.cloud.translation.v3.InputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.translation.v3.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + return null; + }; + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.InputConfig) + return object; + var message = new $root.google.cloud.translation.v3.InputConfig(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.translation.v3.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.InputConfig + * @static + * @param {google.cloud.translation.v3.InputConfig} message InputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mimeType = ""; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.translation.v3.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.InputConfig + * @instance + * @returns {Object.} JSON object + */ + InputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InputConfig; + })(); + + v3.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.translation.v3 + * @interface IGcsDestination + * @property {string|null} [outputUriPrefix] GcsDestination outputUriPrefix + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.translation.v3.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDestination outputUriPrefix. + * @member {string} outputUriPrefix + * @memberof google.cloud.translation.v3.GcsDestination + * @instance + */ + GcsDestination.prototype.outputUriPrefix = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.GcsDestination + * @static + * @param {google.cloud.translation.v3.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.translation.v3.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.translation.v3.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.GcsDestination + * @static + * @param {google.cloud.translation.v3.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.GcsDestination + * @static + * @param {google.cloud.translation.v3.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputUriPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.translation.v3.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + if (!$util.isString(message.outputUriPrefix)) + return "outputUriPrefix: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.GcsDestination) + return object; + var message = new $root.google.cloud.translation.v3.GcsDestination(); + if (object.outputUriPrefix != null) + message.outputUriPrefix = String(object.outputUriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.GcsDestination + * @static + * @param {google.cloud.translation.v3.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUriPrefix = ""; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + object.outputUriPrefix = message.outputUriPrefix; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + v3.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.translation.v3 + * @interface IOutputConfig + * @property {google.cloud.translation.v3.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.translation.v3 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.translation.v3.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.translation.v3.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.translation.v3.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.translation.v3.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.OutputConfig + * @static + * @param {google.cloud.translation.v3.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.translation.v3.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.OutputConfig + * @static + * @param {google.cloud.translation.v3.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.translation.v3.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.OutputConfig + * @static + * @param {google.cloud.translation.v3.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.translation.v3.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.translation.v3.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.OutputConfig) + return object; + var message = new $root.google.cloud.translation.v3.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.translation.v3.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.OutputConfig + * @static + * @param {google.cloud.translation.v3.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputConfig; + })(); + + v3.BatchTranslateTextRequest = (function() { + + /** + * Properties of a BatchTranslateTextRequest. + * @memberof google.cloud.translation.v3 + * @interface IBatchTranslateTextRequest + * @property {string|null} [parent] BatchTranslateTextRequest parent + * @property {string|null} [sourceLanguageCode] BatchTranslateTextRequest sourceLanguageCode + * @property {Array.|null} [targetLanguageCodes] BatchTranslateTextRequest targetLanguageCodes + * @property {Object.|null} [models] BatchTranslateTextRequest models + * @property {Array.|null} [inputConfigs] BatchTranslateTextRequest inputConfigs + * @property {google.cloud.translation.v3.IOutputConfig|null} [outputConfig] BatchTranslateTextRequest outputConfig + * @property {Object.|null} [glossaries] BatchTranslateTextRequest glossaries + * @property {Object.|null} [labels] BatchTranslateTextRequest labels + */ + + /** + * Constructs a new BatchTranslateTextRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a BatchTranslateTextRequest. + * @implements IBatchTranslateTextRequest + * @constructor + * @param {google.cloud.translation.v3.IBatchTranslateTextRequest=} [properties] Properties to set + */ + function BatchTranslateTextRequest(properties) { + this.targetLanguageCodes = []; + this.models = {}; + this.inputConfigs = []; + this.glossaries = {}; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchTranslateTextRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.parent = ""; + + /** + * BatchTranslateTextRequest sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.sourceLanguageCode = ""; + + /** + * BatchTranslateTextRequest targetLanguageCodes. + * @member {Array.} targetLanguageCodes + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.targetLanguageCodes = $util.emptyArray; + + /** + * BatchTranslateTextRequest models. + * @member {Object.} models + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.models = $util.emptyObject; + + /** + * BatchTranslateTextRequest inputConfigs. + * @member {Array.} inputConfigs + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.inputConfigs = $util.emptyArray; + + /** + * BatchTranslateTextRequest outputConfig. + * @member {google.cloud.translation.v3.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.outputConfig = null; + + /** + * BatchTranslateTextRequest glossaries. + * @member {Object.} glossaries + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.glossaries = $util.emptyObject; + + /** + * BatchTranslateTextRequest labels. + * @member {Object.} labels + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new BatchTranslateTextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3.IBatchTranslateTextRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.BatchTranslateTextRequest} BatchTranslateTextRequest instance + */ + BatchTranslateTextRequest.create = function create(properties) { + return new BatchTranslateTextRequest(properties); + }; + + /** + * Encodes the specified BatchTranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateTextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3.IBatchTranslateTextRequest} message BatchTranslateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) + for (var i = 0; i < message.targetLanguageCodes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); + if (message.models != null && message.hasOwnProperty("models")) + for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); + if (message.inputConfigs != null && message.inputConfigs.length) + for (var i = 0; i < message.inputConfigs.length; ++i) + $root.google.cloud.translation.v3.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.translation.v3.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.glossaries != null && message.hasOwnProperty("glossaries")) + for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchTranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3.IBatchTranslateTextRequest} message BatchTranslateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.BatchTranslateTextRequest} BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateTextRequest(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.sourceLanguageCode = reader.string(); + break; + case 3: + if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) + message.targetLanguageCodes = []; + message.targetLanguageCodes.push(reader.string()); + break; + case 4: + reader.skip().pos++; + if (message.models === $util.emptyObject) + message.models = {}; + key = reader.string(); + reader.pos++; + message.models[key] = reader.string(); + break; + case 5: + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.translation.v3.InputConfig.decode(reader, reader.uint32())); + break; + case 6: + message.outputConfig = $root.google.cloud.translation.v3.OutputConfig.decode(reader, reader.uint32()); + break; + case 7: + reader.skip().pos++; + if (message.glossaries === $util.emptyObject) + message.glossaries = {}; + key = reader.string(); + reader.pos++; + message.glossaries[key] = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + case 9: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.BatchTranslateTextRequest} BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchTranslateTextRequest message. + * @function verify + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchTranslateTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCodes != null && message.hasOwnProperty("targetLanguageCodes")) { + if (!Array.isArray(message.targetLanguageCodes)) + return "targetLanguageCodes: array expected"; + for (var i = 0; i < message.targetLanguageCodes.length; ++i) + if (!$util.isString(message.targetLanguageCodes[i])) + return "targetLanguageCodes: string[] expected"; + } + if (message.models != null && message.hasOwnProperty("models")) { + if (!$util.isObject(message.models)) + return "models: object expected"; + var key = Object.keys(message.models); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.models[key[i]])) + return "models: string{k:string} expected"; + } + if (message.inputConfigs != null && message.hasOwnProperty("inputConfigs")) { + if (!Array.isArray(message.inputConfigs)) + return "inputConfigs: array expected"; + for (var i = 0; i < message.inputConfigs.length; ++i) { + var error = $root.google.cloud.translation.v3.InputConfig.verify(message.inputConfigs[i]); + if (error) + return "inputConfigs." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.translation.v3.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.glossaries != null && message.hasOwnProperty("glossaries")) { + if (!$util.isObject(message.glossaries)) + return "glossaries: object expected"; + var key = Object.keys(message.glossaries); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.verify(message.glossaries[key[i]]); + if (error) + return "glossaries." + error; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchTranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.BatchTranslateTextRequest} BatchTranslateTextRequest + */ + BatchTranslateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.BatchTranslateTextRequest) + return object; + var message = new $root.google.cloud.translation.v3.BatchTranslateTextRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCodes) { + if (!Array.isArray(object.targetLanguageCodes)) + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.targetLanguageCodes: array expected"); + message.targetLanguageCodes = []; + for (var i = 0; i < object.targetLanguageCodes.length; ++i) + message.targetLanguageCodes[i] = String(object.targetLanguageCodes[i]); + } + if (object.models) { + if (typeof object.models !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.models: object expected"); + message.models = {}; + for (var keys = Object.keys(object.models), i = 0; i < keys.length; ++i) + message.models[keys[i]] = String(object.models[keys[i]]); + } + if (object.inputConfigs) { + if (!Array.isArray(object.inputConfigs)) + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.inputConfigs: array expected"); + message.inputConfigs = []; + for (var i = 0; i < object.inputConfigs.length; ++i) { + if (typeof object.inputConfigs[i] !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.inputConfigs: object expected"); + message.inputConfigs[i] = $root.google.cloud.translation.v3.InputConfig.fromObject(object.inputConfigs[i]); + } + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.translation.v3.OutputConfig.fromObject(object.outputConfig); + } + if (object.glossaries) { + if (typeof object.glossaries !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.glossaries: object expected"); + message.glossaries = {}; + for (var keys = Object.keys(object.glossaries), i = 0; i < keys.length; ++i) { + if (typeof object.glossaries[keys[i]] !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.glossaries: object expected"); + message.glossaries[keys[i]] = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.fromObject(object.glossaries[keys[i]]); + } + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchTranslateTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3.BatchTranslateTextRequest} message BatchTranslateTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchTranslateTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targetLanguageCodes = []; + object.inputConfigs = []; + } + if (options.objects || options.defaults) { + object.models = {}; + object.glossaries = {}; + object.labels = {}; + } + if (options.defaults) { + object.parent = ""; + object.sourceLanguageCode = ""; + object.outputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCodes && message.targetLanguageCodes.length) { + object.targetLanguageCodes = []; + for (var j = 0; j < message.targetLanguageCodes.length; ++j) + object.targetLanguageCodes[j] = message.targetLanguageCodes[j]; + } + var keys2; + if (message.models && (keys2 = Object.keys(message.models)).length) { + object.models = {}; + for (var j = 0; j < keys2.length; ++j) + object.models[keys2[j]] = message.models[keys2[j]]; + } + if (message.inputConfigs && message.inputConfigs.length) { + object.inputConfigs = []; + for (var j = 0; j < message.inputConfigs.length; ++j) + object.inputConfigs[j] = $root.google.cloud.translation.v3.InputConfig.toObject(message.inputConfigs[j], options); + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.translation.v3.OutputConfig.toObject(message.outputConfig, options); + if (message.glossaries && (keys2 = Object.keys(message.glossaries)).length) { + object.glossaries = {}; + for (var j = 0; j < keys2.length; ++j) + object.glossaries[keys2[j]] = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.toObject(message.glossaries[keys2[j]], options); + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchTranslateTextRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + * @returns {Object.} JSON object + */ + BatchTranslateTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchTranslateTextRequest; + })(); + + v3.BatchTranslateMetadata = (function() { + + /** + * Properties of a BatchTranslateMetadata. + * @memberof google.cloud.translation.v3 + * @interface IBatchTranslateMetadata + * @property {google.cloud.translation.v3.BatchTranslateMetadata.State|null} [state] BatchTranslateMetadata state + * @property {number|Long|null} [translatedCharacters] BatchTranslateMetadata translatedCharacters + * @property {number|Long|null} [failedCharacters] BatchTranslateMetadata failedCharacters + * @property {number|Long|null} [totalCharacters] BatchTranslateMetadata totalCharacters + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateMetadata submitTime + */ + + /** + * Constructs a new BatchTranslateMetadata. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a BatchTranslateMetadata. + * @implements IBatchTranslateMetadata + * @constructor + * @param {google.cloud.translation.v3.IBatchTranslateMetadata=} [properties] Properties to set + */ + function BatchTranslateMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchTranslateMetadata state. + * @member {google.cloud.translation.v3.BatchTranslateMetadata.State} state + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.state = 0; + + /** + * BatchTranslateMetadata translatedCharacters. + * @member {number|Long} translatedCharacters + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateMetadata failedCharacters. + * @member {number|Long} failedCharacters + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateMetadata totalCharacters. + * @member {number|Long} totalCharacters + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.submitTime = null; + + /** + * Creates a new BatchTranslateMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3.IBatchTranslateMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3.BatchTranslateMetadata} BatchTranslateMetadata instance + */ + BatchTranslateMetadata.create = function create(properties) { + return new BatchTranslateMetadata(properties); + }; + + /** + * Encodes the specified BatchTranslateMetadata message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3.IBatchTranslateMetadata} message BatchTranslateMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalCharacters); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchTranslateMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3.IBatchTranslateMetadata} message BatchTranslateMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.BatchTranslateMetadata} BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.translatedCharacters = reader.int64(); + break; + case 3: + message.failedCharacters = reader.int64(); + break; + case 4: + message.totalCharacters = reader.int64(); + break; + case 5: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.BatchTranslateMetadata} BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchTranslateMetadata message. + * @function verify + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchTranslateMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) + return "translatedCharacters: integer|Long expected"; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) + return "failedCharacters: integer|Long expected"; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) + return "totalCharacters: integer|Long expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + return null; + }; + + /** + * Creates a BatchTranslateMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.BatchTranslateMetadata} BatchTranslateMetadata + */ + BatchTranslateMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.BatchTranslateMetadata) + return object; + var message = new $root.google.cloud.translation.v3.BatchTranslateMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.translatedCharacters != null) + if ($util.Long) + (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; + else if (typeof object.translatedCharacters === "string") + message.translatedCharacters = parseInt(object.translatedCharacters, 10); + else if (typeof object.translatedCharacters === "number") + message.translatedCharacters = object.translatedCharacters; + else if (typeof object.translatedCharacters === "object") + message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); + if (object.failedCharacters != null) + if ($util.Long) + (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; + else if (typeof object.failedCharacters === "string") + message.failedCharacters = parseInt(object.failedCharacters, 10); + else if (typeof object.failedCharacters === "number") + message.failedCharacters = object.failedCharacters; + else if (typeof object.failedCharacters === "object") + message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); + if (object.totalCharacters != null) + if ($util.Long) + (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; + else if (typeof object.totalCharacters === "string") + message.totalCharacters = parseInt(object.totalCharacters, 10); + else if (typeof object.totalCharacters === "number") + message.totalCharacters = object.totalCharacters; + else if (typeof object.totalCharacters === "object") + message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchTranslateMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3.BatchTranslateMetadata} message BatchTranslateMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchTranslateMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCharacters = options.longs === String ? "0" : 0; + object.submitTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3.BatchTranslateMetadata.State[message.state] : message.state; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (typeof message.translatedCharacters === "number") + object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; + else + object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (typeof message.failedCharacters === "number") + object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; + else + object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (typeof message.totalCharacters === "number") + object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; + else + object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + return object; + }; + + /** + * Converts this BatchTranslateMetadata to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchTranslateMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.translation.v3.BatchTranslateMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + BatchTranslateMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return BatchTranslateMetadata; + })(); + + v3.BatchTranslateResponse = (function() { + + /** + * Properties of a BatchTranslateResponse. + * @memberof google.cloud.translation.v3 + * @interface IBatchTranslateResponse + * @property {number|Long|null} [totalCharacters] BatchTranslateResponse totalCharacters + * @property {number|Long|null} [translatedCharacters] BatchTranslateResponse translatedCharacters + * @property {number|Long|null} [failedCharacters] BatchTranslateResponse failedCharacters + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateResponse submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] BatchTranslateResponse endTime + */ + + /** + * Constructs a new BatchTranslateResponse. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a BatchTranslateResponse. + * @implements IBatchTranslateResponse + * @constructor + * @param {google.cloud.translation.v3.IBatchTranslateResponse=} [properties] Properties to set + */ + function BatchTranslateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchTranslateResponse totalCharacters. + * @member {number|Long} totalCharacters + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateResponse translatedCharacters. + * @member {number|Long} translatedCharacters + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateResponse failedCharacters. + * @member {number|Long} failedCharacters + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateResponse submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.submitTime = null; + + /** + * BatchTranslateResponse endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.endTime = null; + + /** + * Creates a new BatchTranslateResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3.IBatchTranslateResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3.BatchTranslateResponse} BatchTranslateResponse instance + */ + BatchTranslateResponse.create = function create(properties) { + return new BatchTranslateResponse(properties); + }; + + /** + * Encodes the specified BatchTranslateResponse message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3.IBatchTranslateResponse} message BatchTranslateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalCharacters); + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchTranslateResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3.IBatchTranslateResponse} message BatchTranslateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.BatchTranslateResponse} BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalCharacters = reader.int64(); + break; + case 2: + message.translatedCharacters = reader.int64(); + break; + case 3: + message.failedCharacters = reader.int64(); + break; + case 4: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.BatchTranslateResponse} BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchTranslateResponse message. + * @function verify + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchTranslateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) + return "totalCharacters: integer|Long expected"; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) + return "translatedCharacters: integer|Long expected"; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) + return "failedCharacters: integer|Long expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a BatchTranslateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.BatchTranslateResponse} BatchTranslateResponse + */ + BatchTranslateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.BatchTranslateResponse) + return object; + var message = new $root.google.cloud.translation.v3.BatchTranslateResponse(); + if (object.totalCharacters != null) + if ($util.Long) + (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; + else if (typeof object.totalCharacters === "string") + message.totalCharacters = parseInt(object.totalCharacters, 10); + else if (typeof object.totalCharacters === "number") + message.totalCharacters = object.totalCharacters; + else if (typeof object.totalCharacters === "object") + message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); + if (object.translatedCharacters != null) + if ($util.Long) + (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; + else if (typeof object.translatedCharacters === "string") + message.translatedCharacters = parseInt(object.translatedCharacters, 10); + else if (typeof object.translatedCharacters === "number") + message.translatedCharacters = object.translatedCharacters; + else if (typeof object.translatedCharacters === "object") + message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); + if (object.failedCharacters != null) + if ($util.Long) + (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; + else if (typeof object.failedCharacters === "string") + message.failedCharacters = parseInt(object.failedCharacters, 10); + else if (typeof object.failedCharacters === "number") + message.failedCharacters = object.failedCharacters; + else if (typeof object.failedCharacters === "object") + message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateResponse.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateResponse.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchTranslateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3.BatchTranslateResponse} message BatchTranslateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchTranslateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCharacters = options.longs === String ? "0" : 0; + object.submitTime = null; + object.endTime = null; + } + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (typeof message.totalCharacters === "number") + object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; + else + object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (typeof message.translatedCharacters === "number") + object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; + else + object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (typeof message.failedCharacters === "number") + object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; + else + object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this BatchTranslateResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @instance + * @returns {Object.} JSON object + */ + BatchTranslateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchTranslateResponse; + })(); + + v3.GlossaryInputConfig = (function() { + + /** + * Properties of a GlossaryInputConfig. + * @memberof google.cloud.translation.v3 + * @interface IGlossaryInputConfig + * @property {google.cloud.translation.v3.IGcsSource|null} [gcsSource] GlossaryInputConfig gcsSource + */ + + /** + * Constructs a new GlossaryInputConfig. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a GlossaryInputConfig. + * @implements IGlossaryInputConfig + * @constructor + * @param {google.cloud.translation.v3.IGlossaryInputConfig=} [properties] Properties to set + */ + function GlossaryInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GlossaryInputConfig gcsSource. + * @member {google.cloud.translation.v3.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @instance + */ + GlossaryInputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GlossaryInputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @instance + */ + Object.defineProperty(GlossaryInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GlossaryInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3.IGlossaryInputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3.GlossaryInputConfig} GlossaryInputConfig instance + */ + GlossaryInputConfig.create = function create(properties) { + return new GlossaryInputConfig(properties); + }; + + /** + * Encodes the specified GlossaryInputConfig message. Does not implicitly {@link google.cloud.translation.v3.GlossaryInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3.IGlossaryInputConfig} message GlossaryInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlossaryInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + $root.google.cloud.translation.v3.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GlossaryInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GlossaryInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3.IGlossaryInputConfig} message GlossaryInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlossaryInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.GlossaryInputConfig} GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlossaryInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.GlossaryInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.GlossaryInputConfig} GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlossaryInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GlossaryInputConfig message. + * @function verify + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GlossaryInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.translation.v3.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + return null; + }; + + /** + * Creates a GlossaryInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.GlossaryInputConfig} GlossaryInputConfig + */ + GlossaryInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.GlossaryInputConfig) + return object; + var message = new $root.google.cloud.translation.v3.GlossaryInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.translation.v3.GlossaryInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from a GlossaryInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3.GlossaryInputConfig} message GlossaryInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GlossaryInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.translation.v3.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this GlossaryInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @instance + * @returns {Object.} JSON object + */ + GlossaryInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GlossaryInputConfig; + })(); + + v3.Glossary = (function() { + + /** + * Properties of a Glossary. + * @memberof google.cloud.translation.v3 + * @interface IGlossary + * @property {string|null} [name] Glossary name + * @property {google.cloud.translation.v3.Glossary.ILanguageCodePair|null} [languagePair] Glossary languagePair + * @property {google.cloud.translation.v3.Glossary.ILanguageCodesSet|null} [languageCodesSet] Glossary languageCodesSet + * @property {google.cloud.translation.v3.IGlossaryInputConfig|null} [inputConfig] Glossary inputConfig + * @property {number|null} [entryCount] Glossary entryCount + * @property {google.protobuf.ITimestamp|null} [submitTime] Glossary submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] Glossary endTime + */ + + /** + * Constructs a new Glossary. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a Glossary. + * @implements IGlossary + * @constructor + * @param {google.cloud.translation.v3.IGlossary=} [properties] Properties to set + */ + function Glossary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Glossary name. + * @member {string} name + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.name = ""; + + /** + * Glossary languagePair. + * @member {google.cloud.translation.v3.Glossary.ILanguageCodePair|null|undefined} languagePair + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.languagePair = null; + + /** + * Glossary languageCodesSet. + * @member {google.cloud.translation.v3.Glossary.ILanguageCodesSet|null|undefined} languageCodesSet + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.languageCodesSet = null; + + /** + * Glossary inputConfig. + * @member {google.cloud.translation.v3.IGlossaryInputConfig|null|undefined} inputConfig + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.inputConfig = null; + + /** + * Glossary entryCount. + * @member {number} entryCount + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.entryCount = 0; + + /** + * Glossary submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.submitTime = null; + + /** + * Glossary endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.endTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Glossary languages. + * @member {"languagePair"|"languageCodesSet"|undefined} languages + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Object.defineProperty(Glossary.prototype, "languages", { + get: $util.oneOfGetter($oneOfFields = ["languagePair", "languageCodesSet"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Glossary instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {google.cloud.translation.v3.IGlossary=} [properties] Properties to set + * @returns {google.cloud.translation.v3.Glossary} Glossary instance + */ + Glossary.create = function create(properties) { + return new Glossary(properties); + }; + + /** + * Encodes the specified Glossary message. Does not implicitly {@link google.cloud.translation.v3.Glossary.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {google.cloud.translation.v3.IGlossary} message Glossary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Glossary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.languagePair != null && message.hasOwnProperty("languagePair")) + $root.google.cloud.translation.v3.Glossary.LanguageCodePair.encode(message.languagePair, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) + $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.encode(message.languageCodesSet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.translation.v3.GlossaryInputConfig.encode(message.inputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.entryCount); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Glossary message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {google.cloud.translation.v3.IGlossary} message Glossary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Glossary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Glossary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.Glossary} Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Glossary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.Glossary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.languagePair = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.decode(reader, reader.uint32()); + break; + case 4: + message.languageCodesSet = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.decode(reader, reader.uint32()); + break; + case 5: + message.inputConfig = $root.google.cloud.translation.v3.GlossaryInputConfig.decode(reader, reader.uint32()); + break; + case 6: + message.entryCount = reader.int32(); + break; + case 7: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Glossary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.Glossary} Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Glossary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Glossary message. + * @function verify + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Glossary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languagePair != null && message.hasOwnProperty("languagePair")) { + properties.languages = 1; + { + var error = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.verify(message.languagePair); + if (error) + return "languagePair." + error; + } + } + if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) { + if (properties.languages === 1) + return "languages: multiple values"; + properties.languages = 1; + { + var error = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.verify(message.languageCodesSet); + if (error) + return "languageCodesSet." + error; + } + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.translation.v3.GlossaryInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + if (!$util.isInteger(message.entryCount)) + return "entryCount: integer expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a Glossary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.Glossary} Glossary + */ + Glossary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.Glossary) + return object; + var message = new $root.google.cloud.translation.v3.Glossary(); + if (object.name != null) + message.name = String(object.name); + if (object.languagePair != null) { + if (typeof object.languagePair !== "object") + throw TypeError(".google.cloud.translation.v3.Glossary.languagePair: object expected"); + message.languagePair = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.fromObject(object.languagePair); + } + if (object.languageCodesSet != null) { + if (typeof object.languageCodesSet !== "object") + throw TypeError(".google.cloud.translation.v3.Glossary.languageCodesSet: object expected"); + message.languageCodesSet = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.fromObject(object.languageCodesSet); + } + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.translation.v3.Glossary.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.translation.v3.GlossaryInputConfig.fromObject(object.inputConfig); + } + if (object.entryCount != null) + message.entryCount = object.entryCount | 0; + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3.Glossary.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3.Glossary.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a Glossary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {google.cloud.translation.v3.Glossary} message Glossary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Glossary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputConfig = null; + object.entryCount = 0; + object.submitTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languagePair != null && message.hasOwnProperty("languagePair")) { + object.languagePair = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.toObject(message.languagePair, options); + if (options.oneofs) + object.languages = "languagePair"; + } + if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) { + object.languageCodesSet = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.toObject(message.languageCodesSet, options); + if (options.oneofs) + object.languages = "languageCodesSet"; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.translation.v3.GlossaryInputConfig.toObject(message.inputConfig, options); + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + object.entryCount = message.entryCount; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this Glossary to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.Glossary + * @instance + * @returns {Object.} JSON object + */ + Glossary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Glossary.LanguageCodePair = (function() { + + /** + * Properties of a LanguageCodePair. + * @memberof google.cloud.translation.v3.Glossary + * @interface ILanguageCodePair + * @property {string|null} [sourceLanguageCode] LanguageCodePair sourceLanguageCode + * @property {string|null} [targetLanguageCode] LanguageCodePair targetLanguageCode + */ + + /** + * Constructs a new LanguageCodePair. + * @memberof google.cloud.translation.v3.Glossary + * @classdesc Represents a LanguageCodePair. + * @implements ILanguageCodePair + * @constructor + * @param {google.cloud.translation.v3.Glossary.ILanguageCodePair=} [properties] Properties to set + */ + function LanguageCodePair(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageCodePair sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @instance + */ + LanguageCodePair.prototype.sourceLanguageCode = ""; + + /** + * LanguageCodePair targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @instance + */ + LanguageCodePair.prototype.targetLanguageCode = ""; + + /** + * Creates a new LanguageCodePair instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3.Glossary.ILanguageCodePair=} [properties] Properties to set + * @returns {google.cloud.translation.v3.Glossary.LanguageCodePair} LanguageCodePair instance + */ + LanguageCodePair.create = function create(properties) { + return new LanguageCodePair(properties); + }; + + /** + * Encodes the specified LanguageCodePair message. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodePair.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3.Glossary.ILanguageCodePair} message LanguageCodePair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodePair.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified LanguageCodePair message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodePair.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3.Glossary.ILanguageCodePair} message LanguageCodePair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodePair.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.Glossary.LanguageCodePair} LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodePair.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.Glossary.LanguageCodePair(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourceLanguageCode = reader.string(); + break; + case 2: + message.targetLanguageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.Glossary.LanguageCodePair} LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodePair.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageCodePair message. + * @function verify + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageCodePair.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a LanguageCodePair message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.Glossary.LanguageCodePair} LanguageCodePair + */ + LanguageCodePair.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.Glossary.LanguageCodePair) + return object; + var message = new $root.google.cloud.translation.v3.Glossary.LanguageCodePair(); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a LanguageCodePair message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3.Glossary.LanguageCodePair} message LanguageCodePair + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageCodePair.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this LanguageCodePair to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @instance + * @returns {Object.} JSON object + */ + LanguageCodePair.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LanguageCodePair; + })(); + + Glossary.LanguageCodesSet = (function() { + + /** + * Properties of a LanguageCodesSet. + * @memberof google.cloud.translation.v3.Glossary + * @interface ILanguageCodesSet + * @property {Array.|null} [languageCodes] LanguageCodesSet languageCodes + */ + + /** + * Constructs a new LanguageCodesSet. + * @memberof google.cloud.translation.v3.Glossary + * @classdesc Represents a LanguageCodesSet. + * @implements ILanguageCodesSet + * @constructor + * @param {google.cloud.translation.v3.Glossary.ILanguageCodesSet=} [properties] Properties to set + */ + function LanguageCodesSet(properties) { + this.languageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageCodesSet languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @instance + */ + LanguageCodesSet.prototype.languageCodes = $util.emptyArray; + + /** + * Creates a new LanguageCodesSet instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3.Glossary.ILanguageCodesSet=} [properties] Properties to set + * @returns {google.cloud.translation.v3.Glossary.LanguageCodesSet} LanguageCodesSet instance + */ + LanguageCodesSet.create = function create(properties) { + return new LanguageCodesSet(properties); + }; + + /** + * Encodes the specified LanguageCodesSet message. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodesSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3.Glossary.ILanguageCodesSet} message LanguageCodesSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodesSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCodes[i]); + return writer; + }; + + /** + * Encodes the specified LanguageCodesSet message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodesSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3.Glossary.ILanguageCodesSet} message LanguageCodesSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodesSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.Glossary.LanguageCodesSet} LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodesSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.Glossary.LanguageCodesSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.Glossary.LanguageCodesSet} LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodesSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageCodesSet message. + * @function verify + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageCodesSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + return null; + }; + + /** + * Creates a LanguageCodesSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.Glossary.LanguageCodesSet} LanguageCodesSet + */ + LanguageCodesSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.Glossary.LanguageCodesSet) + return object; + var message = new $root.google.cloud.translation.v3.Glossary.LanguageCodesSet(); + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.translation.v3.Glossary.LanguageCodesSet.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + return message; + }; + + /** + * Creates a plain object from a LanguageCodesSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3.Glossary.LanguageCodesSet} message LanguageCodesSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageCodesSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageCodes = []; + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + return object; + }; + + /** + * Converts this LanguageCodesSet to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @instance + * @returns {Object.} JSON object + */ + LanguageCodesSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LanguageCodesSet; + })(); + + return Glossary; + })(); + + v3.CreateGlossaryRequest = (function() { + + /** + * Properties of a CreateGlossaryRequest. + * @memberof google.cloud.translation.v3 + * @interface ICreateGlossaryRequest + * @property {string|null} [parent] CreateGlossaryRequest parent + * @property {google.cloud.translation.v3.IGlossary|null} [glossary] CreateGlossaryRequest glossary + */ + + /** + * Constructs a new CreateGlossaryRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a CreateGlossaryRequest. + * @implements ICreateGlossaryRequest + * @constructor + * @param {google.cloud.translation.v3.ICreateGlossaryRequest=} [properties] Properties to set + */ + function CreateGlossaryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGlossaryRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @instance + */ + CreateGlossaryRequest.prototype.parent = ""; + + /** + * CreateGlossaryRequest glossary. + * @member {google.cloud.translation.v3.IGlossary|null|undefined} glossary + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @instance + */ + CreateGlossaryRequest.prototype.glossary = null; + + /** + * Creates a new CreateGlossaryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3.ICreateGlossaryRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.CreateGlossaryRequest} CreateGlossaryRequest instance + */ + CreateGlossaryRequest.create = function create(properties) { + return new CreateGlossaryRequest(properties); + }; + + /** + * Encodes the specified CreateGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3.ICreateGlossaryRequest} message CreateGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGlossaryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.glossary != null && message.hasOwnProperty("glossary")) + $root.google.cloud.translation.v3.Glossary.encode(message.glossary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3.ICreateGlossaryRequest} message CreateGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.CreateGlossaryRequest} CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGlossaryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.CreateGlossaryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.glossary = $root.google.cloud.translation.v3.Glossary.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.CreateGlossaryRequest} CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGlossaryRequest message. + * @function verify + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGlossaryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.glossary != null && message.hasOwnProperty("glossary")) { + var error = $root.google.cloud.translation.v3.Glossary.verify(message.glossary); + if (error) + return "glossary." + error; + } + return null; + }; + + /** + * Creates a CreateGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.CreateGlossaryRequest} CreateGlossaryRequest + */ + CreateGlossaryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.CreateGlossaryRequest) + return object; + var message = new $root.google.cloud.translation.v3.CreateGlossaryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.glossary != null) { + if (typeof object.glossary !== "object") + throw TypeError(".google.cloud.translation.v3.CreateGlossaryRequest.glossary: object expected"); + message.glossary = $root.google.cloud.translation.v3.Glossary.fromObject(object.glossary); + } + return message; + }; + + /** + * Creates a plain object from a CreateGlossaryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3.CreateGlossaryRequest} message CreateGlossaryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGlossaryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.glossary = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.glossary != null && message.hasOwnProperty("glossary")) + object.glossary = $root.google.cloud.translation.v3.Glossary.toObject(message.glossary, options); + return object; + }; + + /** + * Converts this CreateGlossaryRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGlossaryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateGlossaryRequest; + })(); + + v3.GetGlossaryRequest = (function() { + + /** + * Properties of a GetGlossaryRequest. + * @memberof google.cloud.translation.v3 + * @interface IGetGlossaryRequest + * @property {string|null} [name] GetGlossaryRequest name + */ + + /** + * Constructs a new GetGlossaryRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a GetGlossaryRequest. + * @implements IGetGlossaryRequest + * @constructor + * @param {google.cloud.translation.v3.IGetGlossaryRequest=} [properties] Properties to set + */ + function GetGlossaryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGlossaryRequest name. + * @member {string} name + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @instance + */ + GetGlossaryRequest.prototype.name = ""; + + /** + * Creates a new GetGlossaryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3.IGetGlossaryRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.GetGlossaryRequest} GetGlossaryRequest instance + */ + GetGlossaryRequest.create = function create(properties) { + return new GetGlossaryRequest(properties); + }; + + /** + * Encodes the specified GetGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.GetGlossaryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3.IGetGlossaryRequest} message GetGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlossaryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GetGlossaryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3.IGetGlossaryRequest} message GetGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.GetGlossaryRequest} GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlossaryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.GetGlossaryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.GetGlossaryRequest} GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGlossaryRequest message. + * @function verify + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGlossaryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.GetGlossaryRequest} GetGlossaryRequest + */ + GetGlossaryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.GetGlossaryRequest) + return object; + var message = new $root.google.cloud.translation.v3.GetGlossaryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGlossaryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3.GetGlossaryRequest} message GetGlossaryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGlossaryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetGlossaryRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @instance + * @returns {Object.} JSON object + */ + GetGlossaryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGlossaryRequest; + })(); + + v3.DeleteGlossaryRequest = (function() { + + /** + * Properties of a DeleteGlossaryRequest. + * @memberof google.cloud.translation.v3 + * @interface IDeleteGlossaryRequest + * @property {string|null} [name] DeleteGlossaryRequest name + */ + + /** + * Constructs a new DeleteGlossaryRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a DeleteGlossaryRequest. + * @implements IDeleteGlossaryRequest + * @constructor + * @param {google.cloud.translation.v3.IDeleteGlossaryRequest=} [properties] Properties to set + */ + function DeleteGlossaryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlossaryRequest name. + * @member {string} name + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @instance + */ + DeleteGlossaryRequest.prototype.name = ""; + + /** + * Creates a new DeleteGlossaryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3.IDeleteGlossaryRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.DeleteGlossaryRequest} DeleteGlossaryRequest instance + */ + DeleteGlossaryRequest.create = function create(properties) { + return new DeleteGlossaryRequest(properties); + }; + + /** + * Encodes the specified DeleteGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3.IDeleteGlossaryRequest} message DeleteGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3.IDeleteGlossaryRequest} message DeleteGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.DeleteGlossaryRequest} DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DeleteGlossaryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.DeleteGlossaryRequest} DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlossaryRequest message. + * @function verify + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlossaryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.DeleteGlossaryRequest} DeleteGlossaryRequest + */ + DeleteGlossaryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.DeleteGlossaryRequest) + return object; + var message = new $root.google.cloud.translation.v3.DeleteGlossaryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGlossaryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3.DeleteGlossaryRequest} message DeleteGlossaryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlossaryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteGlossaryRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGlossaryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteGlossaryRequest; + })(); + + v3.ListGlossariesRequest = (function() { + + /** + * Properties of a ListGlossariesRequest. + * @memberof google.cloud.translation.v3 + * @interface IListGlossariesRequest + * @property {string|null} [parent] ListGlossariesRequest parent + * @property {number|null} [pageSize] ListGlossariesRequest pageSize + * @property {string|null} [pageToken] ListGlossariesRequest pageToken + * @property {string|null} [filter] ListGlossariesRequest filter + */ + + /** + * Constructs a new ListGlossariesRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a ListGlossariesRequest. + * @implements IListGlossariesRequest + * @constructor + * @param {google.cloud.translation.v3.IListGlossariesRequest=} [properties] Properties to set + */ + function ListGlossariesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGlossariesRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.parent = ""; + + /** + * ListGlossariesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.pageSize = 0; + + /** + * ListGlossariesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.pageToken = ""; + + /** + * ListGlossariesRequest filter. + * @member {string} filter + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.filter = ""; + + /** + * Creates a new ListGlossariesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3.IListGlossariesRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.ListGlossariesRequest} ListGlossariesRequest instance + */ + ListGlossariesRequest.create = function create(properties) { + return new ListGlossariesRequest(properties); + }; + + /** + * Encodes the specified ListGlossariesRequest message. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3.IListGlossariesRequest} message ListGlossariesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListGlossariesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3.IListGlossariesRequest} message ListGlossariesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.ListGlossariesRequest} ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.ListGlossariesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.ListGlossariesRequest} ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlossariesRequest message. + * @function verify + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlossariesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListGlossariesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.ListGlossariesRequest} ListGlossariesRequest + */ + ListGlossariesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.ListGlossariesRequest) + return object; + var message = new $root.google.cloud.translation.v3.ListGlossariesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListGlossariesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3.ListGlossariesRequest} message ListGlossariesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlossariesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListGlossariesRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @instance + * @returns {Object.} JSON object + */ + ListGlossariesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListGlossariesRequest; + })(); + + v3.ListGlossariesResponse = (function() { + + /** + * Properties of a ListGlossariesResponse. + * @memberof google.cloud.translation.v3 + * @interface IListGlossariesResponse + * @property {Array.|null} [glossaries] ListGlossariesResponse glossaries + * @property {string|null} [nextPageToken] ListGlossariesResponse nextPageToken + */ + + /** + * Constructs a new ListGlossariesResponse. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a ListGlossariesResponse. + * @implements IListGlossariesResponse + * @constructor + * @param {google.cloud.translation.v3.IListGlossariesResponse=} [properties] Properties to set + */ + function ListGlossariesResponse(properties) { + this.glossaries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGlossariesResponse glossaries. + * @member {Array.} glossaries + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @instance + */ + ListGlossariesResponse.prototype.glossaries = $util.emptyArray; + + /** + * ListGlossariesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @instance + */ + ListGlossariesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListGlossariesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3.IListGlossariesResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3.ListGlossariesResponse} ListGlossariesResponse instance + */ + ListGlossariesResponse.create = function create(properties) { + return new ListGlossariesResponse(properties); + }; + + /** + * Encodes the specified ListGlossariesResponse message. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3.IListGlossariesResponse} message ListGlossariesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.glossaries != null && message.glossaries.length) + for (var i = 0; i < message.glossaries.length; ++i) + $root.google.cloud.translation.v3.Glossary.encode(message.glossaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListGlossariesResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3.IListGlossariesResponse} message ListGlossariesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.ListGlossariesResponse} ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.ListGlossariesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.glossaries && message.glossaries.length)) + message.glossaries = []; + message.glossaries.push($root.google.cloud.translation.v3.Glossary.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.ListGlossariesResponse} ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlossariesResponse message. + * @function verify + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlossariesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.glossaries != null && message.hasOwnProperty("glossaries")) { + if (!Array.isArray(message.glossaries)) + return "glossaries: array expected"; + for (var i = 0; i < message.glossaries.length; ++i) { + var error = $root.google.cloud.translation.v3.Glossary.verify(message.glossaries[i]); + if (error) + return "glossaries." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListGlossariesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.ListGlossariesResponse} ListGlossariesResponse + */ + ListGlossariesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.ListGlossariesResponse) + return object; + var message = new $root.google.cloud.translation.v3.ListGlossariesResponse(); + if (object.glossaries) { + if (!Array.isArray(object.glossaries)) + throw TypeError(".google.cloud.translation.v3.ListGlossariesResponse.glossaries: array expected"); + message.glossaries = []; + for (var i = 0; i < object.glossaries.length; ++i) { + if (typeof object.glossaries[i] !== "object") + throw TypeError(".google.cloud.translation.v3.ListGlossariesResponse.glossaries: object expected"); + message.glossaries[i] = $root.google.cloud.translation.v3.Glossary.fromObject(object.glossaries[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListGlossariesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3.ListGlossariesResponse} message ListGlossariesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlossariesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.glossaries = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.glossaries && message.glossaries.length) { + object.glossaries = []; + for (var j = 0; j < message.glossaries.length; ++j) + object.glossaries[j] = $root.google.cloud.translation.v3.Glossary.toObject(message.glossaries[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListGlossariesResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @instance + * @returns {Object.} JSON object + */ + ListGlossariesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListGlossariesResponse; + })(); + + v3.CreateGlossaryMetadata = (function() { + + /** + * Properties of a CreateGlossaryMetadata. + * @memberof google.cloud.translation.v3 + * @interface ICreateGlossaryMetadata + * @property {string|null} [name] CreateGlossaryMetadata name + * @property {google.cloud.translation.v3.CreateGlossaryMetadata.State|null} [state] CreateGlossaryMetadata state + * @property {google.protobuf.ITimestamp|null} [submitTime] CreateGlossaryMetadata submitTime + */ + + /** + * Constructs a new CreateGlossaryMetadata. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a CreateGlossaryMetadata. + * @implements ICreateGlossaryMetadata + * @constructor + * @param {google.cloud.translation.v3.ICreateGlossaryMetadata=} [properties] Properties to set + */ + function CreateGlossaryMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGlossaryMetadata name. + * @member {string} name + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @instance + */ + CreateGlossaryMetadata.prototype.name = ""; + + /** + * CreateGlossaryMetadata state. + * @member {google.cloud.translation.v3.CreateGlossaryMetadata.State} state + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @instance + */ + CreateGlossaryMetadata.prototype.state = 0; + + /** + * CreateGlossaryMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @instance + */ + CreateGlossaryMetadata.prototype.submitTime = null; + + /** + * Creates a new CreateGlossaryMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @static + * @param {google.cloud.translation.v3.ICreateGlossaryMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3.CreateGlossaryMetadata} CreateGlossaryMetadata instance + */ + CreateGlossaryMetadata.create = function create(properties) { + return new CreateGlossaryMetadata(properties); + }; + + /** + * Encodes the specified CreateGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @static + * @param {google.cloud.translation.v3.ICreateGlossaryMetadata} message CreateGlossaryMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGlossaryMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @static + * @param {google.cloud.translation.v3.ICreateGlossaryMetadata} message CreateGlossaryMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGlossaryMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.CreateGlossaryMetadata} CreateGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGlossaryMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.CreateGlossaryMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.CreateGlossaryMetadata} CreateGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGlossaryMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGlossaryMetadata message. + * @function verify + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGlossaryMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + return null; + }; + + /** + * Creates a CreateGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.CreateGlossaryMetadata} CreateGlossaryMetadata + */ + CreateGlossaryMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.CreateGlossaryMetadata) + return object; + var message = new $root.google.cloud.translation.v3.CreateGlossaryMetadata(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3.CreateGlossaryMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateGlossaryMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @static + * @param {google.cloud.translation.v3.CreateGlossaryMetadata} message CreateGlossaryMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGlossaryMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.submitTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3.CreateGlossaryMetadata.State[message.state] : message.state; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + return object; + }; + + /** + * Converts this CreateGlossaryMetadata to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateGlossaryMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.translation.v3.CreateGlossaryMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + CreateGlossaryMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return CreateGlossaryMetadata; + })(); + + v3.DeleteGlossaryMetadata = (function() { + + /** + * Properties of a DeleteGlossaryMetadata. + * @memberof google.cloud.translation.v3 + * @interface IDeleteGlossaryMetadata + * @property {string|null} [name] DeleteGlossaryMetadata name + * @property {google.cloud.translation.v3.DeleteGlossaryMetadata.State|null} [state] DeleteGlossaryMetadata state + * @property {google.protobuf.ITimestamp|null} [submitTime] DeleteGlossaryMetadata submitTime + */ + + /** + * Constructs a new DeleteGlossaryMetadata. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a DeleteGlossaryMetadata. + * @implements IDeleteGlossaryMetadata + * @constructor + * @param {google.cloud.translation.v3.IDeleteGlossaryMetadata=} [properties] Properties to set + */ + function DeleteGlossaryMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlossaryMetadata name. + * @member {string} name + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @instance + */ + DeleteGlossaryMetadata.prototype.name = ""; + + /** + * DeleteGlossaryMetadata state. + * @member {google.cloud.translation.v3.DeleteGlossaryMetadata.State} state + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @instance + */ + DeleteGlossaryMetadata.prototype.state = 0; + + /** + * DeleteGlossaryMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @instance + */ + DeleteGlossaryMetadata.prototype.submitTime = null; + + /** + * Creates a new DeleteGlossaryMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @static + * @param {google.cloud.translation.v3.IDeleteGlossaryMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3.DeleteGlossaryMetadata} DeleteGlossaryMetadata instance + */ + DeleteGlossaryMetadata.create = function create(properties) { + return new DeleteGlossaryMetadata(properties); + }; + + /** + * Encodes the specified DeleteGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @static + * @param {google.cloud.translation.v3.IDeleteGlossaryMetadata} message DeleteGlossaryMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @static + * @param {google.cloud.translation.v3.IDeleteGlossaryMetadata} message DeleteGlossaryMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.DeleteGlossaryMetadata} DeleteGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DeleteGlossaryMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.DeleteGlossaryMetadata} DeleteGlossaryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlossaryMetadata message. + * @function verify + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlossaryMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + return null; + }; + + /** + * Creates a DeleteGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.DeleteGlossaryMetadata} DeleteGlossaryMetadata + */ + DeleteGlossaryMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.DeleteGlossaryMetadata) + return object; + var message = new $root.google.cloud.translation.v3.DeleteGlossaryMetadata(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3.DeleteGlossaryMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + return message; + }; + + /** + * Creates a plain object from a DeleteGlossaryMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @static + * @param {google.cloud.translation.v3.DeleteGlossaryMetadata} message DeleteGlossaryMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlossaryMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.submitTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3.DeleteGlossaryMetadata.State[message.state] : message.state; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + return object; + }; + + /** + * Converts this DeleteGlossaryMetadata to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteGlossaryMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.translation.v3.DeleteGlossaryMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + DeleteGlossaryMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return DeleteGlossaryMetadata; + })(); + + v3.DeleteGlossaryResponse = (function() { + + /** + * Properties of a DeleteGlossaryResponse. + * @memberof google.cloud.translation.v3 + * @interface IDeleteGlossaryResponse + * @property {string|null} [name] DeleteGlossaryResponse name + * @property {google.protobuf.ITimestamp|null} [submitTime] DeleteGlossaryResponse submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] DeleteGlossaryResponse endTime + */ + + /** + * Constructs a new DeleteGlossaryResponse. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a DeleteGlossaryResponse. + * @implements IDeleteGlossaryResponse + * @constructor + * @param {google.cloud.translation.v3.IDeleteGlossaryResponse=} [properties] Properties to set + */ + function DeleteGlossaryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlossaryResponse name. + * @member {string} name + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @instance + */ + DeleteGlossaryResponse.prototype.name = ""; + + /** + * DeleteGlossaryResponse submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @instance + */ + DeleteGlossaryResponse.prototype.submitTime = null; + + /** + * DeleteGlossaryResponse endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @instance + */ + DeleteGlossaryResponse.prototype.endTime = null; + + /** + * Creates a new DeleteGlossaryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @static + * @param {google.cloud.translation.v3.IDeleteGlossaryResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3.DeleteGlossaryResponse} DeleteGlossaryResponse instance + */ + DeleteGlossaryResponse.create = function create(properties) { + return new DeleteGlossaryResponse(properties); + }; + + /** + * Encodes the specified DeleteGlossaryResponse message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @static + * @param {google.cloud.translation.v3.IDeleteGlossaryResponse} message DeleteGlossaryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteGlossaryResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @static + * @param {google.cloud.translation.v3.IDeleteGlossaryResponse} message DeleteGlossaryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.DeleteGlossaryResponse} DeleteGlossaryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DeleteGlossaryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.DeleteGlossaryResponse} DeleteGlossaryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlossaryResponse message. + * @function verify + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlossaryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a DeleteGlossaryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.DeleteGlossaryResponse} DeleteGlossaryResponse + */ + DeleteGlossaryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.DeleteGlossaryResponse) + return object; + var message = new $root.google.cloud.translation.v3.DeleteGlossaryResponse(); + if (object.name != null) + message.name = String(object.name); + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3.DeleteGlossaryResponse.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3.DeleteGlossaryResponse.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a DeleteGlossaryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @static + * @param {google.cloud.translation.v3.DeleteGlossaryResponse} message DeleteGlossaryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlossaryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.submitTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this DeleteGlossaryResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @instance + * @returns {Object.} JSON object + */ + DeleteGlossaryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteGlossaryResponse; + })(); + + return v3; + })(); + translation.v3beta1 = (function() { /** diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index 44bec2d7f21..38a285d9036 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -6,6 +6,773 @@ "nested": { "translation": { "nested": { + "v3": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Translate.V3", + "go_package": "google.golang.org/genproto/googleapis/cloud/translate/v3;translate", + "java_multiple_files": true, + "java_outer_classname": "TranslationServiceProto", + "java_package": "com.google.cloud.translate.v3", + "php_namespace": "Google\\Cloud\\Translate\\V3", + "ruby_package": "Google::Cloud::Translate::V3" + }, + "nested": { + "TranslationService": { + "options": { + "(google.api.default_host)": "translate.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-translation" + }, + "methods": { + "TranslateText": { + "requestType": "TranslateTextRequest", + "responseType": "TranslateTextResponse", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*}:translateText", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v3/{parent=projects/*}:translateText", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,model,mime_type,source_language_code,target_language_code,contents" + } + }, + "DetectLanguage": { + "requestType": "DetectLanguageRequest", + "responseType": "DetectLanguageResponse", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*}:detectLanguage", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v3/{parent=projects/*}:detectLanguage", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,model,mime_type,content" + } + }, + "GetSupportedLanguages": { + "requestType": "GetSupportedLanguagesRequest", + "responseType": "SupportedLanguages", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*}/supportedLanguages", + "(google.api.http).additional_bindings.get": "/v3/{parent=projects/*}/supportedLanguages", + "(google.api.method_signature)": "parent,model,display_language_code" + } + }, + "BatchTranslateText": { + "requestType": "BatchTranslateTextRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*}:batchTranslateText", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "BatchTranslateResponse", + "(google.longrunning.operation_info).metadata_type": "BatchTranslateMetadata" + } + }, + "CreateGlossary": { + "requestType": "CreateGlossaryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*}/glossaries", + "(google.api.http).body": "glossary", + "(google.api.method_signature)": "parent,glossary", + "(google.longrunning.operation_info).response_type": "Glossary", + "(google.longrunning.operation_info).metadata_type": "CreateGlossaryMetadata" + } + }, + "ListGlossaries": { + "requestType": "ListGlossariesRequest", + "responseType": "ListGlossariesResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*}/glossaries", + "(google.api.method_signature)": "parent" + } + }, + "GetGlossary": { + "requestType": "GetGlossaryRequest", + "responseType": "Glossary", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/locations/*/glossaries/*}", + "(google.api.method_signature)": "name" + } + }, + "DeleteGlossary": { + "requestType": "DeleteGlossaryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/locations/*/glossaries/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "DeleteGlossaryResponse", + "(google.longrunning.operation_info).metadata_type": "DeleteGlossaryMetadata" + } + } + } + }, + "TranslateTextGlossaryConfig": { + "fields": { + "glossary": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreCase": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TranslateTextRequest": { + "fields": { + "contents": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mimeType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sourceLanguageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "targetLanguageCode": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parent": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "model": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "glossaryConfig": { + "type": "TranslateTextGlossaryConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TranslateTextResponse": { + "fields": { + "translations": { + "rule": "repeated", + "type": "Translation", + "id": 1 + }, + "glossaryTranslations": { + "rule": "repeated", + "type": "Translation", + "id": 3 + } + } + }, + "Translation": { + "fields": { + "translatedText": { + "type": "string", + "id": 1 + }, + "model": { + "type": "string", + "id": 2 + }, + "detectedLanguageCode": { + "type": "string", + "id": 4 + }, + "glossaryConfig": { + "type": "TranslateTextGlossaryConfig", + "id": 3 + } + } + }, + "DetectLanguageRequest": { + "oneofs": { + "source": { + "oneof": [ + "content" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "model": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "content": { + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DetectedLanguage": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "DetectLanguageResponse": { + "fields": { + "languages": { + "rule": "repeated", + "type": "DetectedLanguage", + "id": 1 + } + } + }, + "GetSupportedLanguagesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "displayLanguageCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "model": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SupportedLanguages": { + "fields": { + "languages": { + "rule": "repeated", + "type": "SupportedLanguage", + "id": 1 + } + } + }, + "SupportedLanguage": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "supportSource": { + "type": "bool", + "id": 3 + }, + "supportTarget": { + "type": "bool", + "id": 4 + } + } + }, + "GcsSource": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + } + } + }, + "InputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "mimeType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcsSource": { + "type": "GcsSource", + "id": 2 + } + } + }, + "GcsDestination": { + "fields": { + "outputUriPrefix": { + "type": "string", + "id": 1 + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + } + } + }, + "BatchTranslateTextRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "sourceLanguageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "models": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputConfigs": { + "rule": "repeated", + "type": "InputConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "OutputConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "glossaries": { + "keyType": "string", + "type": "TranslateTextGlossaryConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchTranslateMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "translatedCharacters": { + "type": "int64", + "id": 2 + }, + "failedCharacters": { + "type": "int64", + "id": 3 + }, + "totalCharacters": { + "type": "int64", + "id": 4 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "SUCCEEDED": 2, + "FAILED": 3, + "CANCELLING": 4, + "CANCELLED": 5 + } + } + } + }, + "BatchTranslateResponse": { + "fields": { + "totalCharacters": { + "type": "int64", + "id": 1 + }, + "translatedCharacters": { + "type": "int64", + "id": 2 + }, + "failedCharacters": { + "type": "int64", + "id": 3 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "GlossaryInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + } + } + }, + "Glossary": { + "options": { + "(google.api.resource).type": "translate.googleapis.com/Glossary", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/glossaries/{glossary}" + }, + "oneofs": { + "languages": { + "oneof": [ + "languagePair", + "languageCodesSet" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "languagePair": { + "type": "LanguageCodePair", + "id": 3 + }, + "languageCodesSet": { + "type": "LanguageCodesSet", + "id": 4 + }, + "inputConfig": { + "type": "GlossaryInputConfig", + "id": 5 + }, + "entryCount": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LanguageCodePair": { + "fields": { + "sourceLanguageCode": { + "type": "string", + "id": 1 + }, + "targetLanguageCode": { + "type": "string", + "id": 2 + } + } + }, + "LanguageCodesSet": { + "fields": { + "languageCodes": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "CreateGlossaryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "glossary": { + "type": "Glossary", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetGlossaryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "translate.googleapis.com/Glossary" + } + } + } + }, + "DeleteGlossaryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "translate.googleapis.com/Glossary" + } + } + } + }, + "ListGlossariesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListGlossariesResponse": { + "fields": { + "glossaries": { + "rule": "repeated", + "type": "Glossary", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateGlossaryMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "state": { + "type": "State", + "id": 2 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "SUCCEEDED": 2, + "FAILED": 3, + "CANCELLING": 4, + "CANCELLED": 5 + } + } + } + }, + "DeleteGlossaryMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "state": { + "type": "State", + "id": 2 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "SUCCEEDED": 2, + "FAILED": 3, + "CANCELLING": 4, + "CANCELLED": 5 + } + } + } + }, + "DeleteGlossaryResponse": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + } + } + }, "v3beta1": { "options": { "cc_enable_arenas": true, diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index e7d46106ef5..1de8f46676a 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -11,7 +11,7 @@ "node": ">=8" }, "scripts": { - "test": "mocha --recursive --timeout 90000" + "test": "mocha --recursive --timeout 150000" }, "dependencies": { "@google-cloud/automl": "^1.0.0", diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index 95af33d7272..2423f4dd53d 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -1,5 +1,5 @@ /** - * Copyright 2017, Google, Inc. + * Copyright 2017 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 @@ -15,28 +15,36 @@ 'use strict'; -async function main( +function main( projectId = 'YOUR_PROJECT_ID' // Your GCP Project Id ) { // [START translate_quickstart] + /** + * TODO(developer): Uncomment the following line before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + // Imports the Google Cloud client library - const {Translate} = require('@google-cloud/translate'); + const {Translate} = require('@google-cloud/translate').v2; // Instantiates a client const translate = new Translate({projectId}); - // The text to translate - const text = 'Hello, world!'; + async function quickStart() { + // The text to translate + const text = 'Hello, world!'; + + // The target language + const target = 'ru'; - // The target language - const target = 'ru'; + // Translates some text into Russian + const [translation] = await translate.translate(text, target); + console.log(`Text: ${text}`); + console.log(`Translation: ${translation}`); + } - // Translates some text into Russian - const [translation] = await translate.translate(text, target); - console.log(`Text: ${text}`); - console.log(`Translation: ${translation}`); + quickStart(); // [END translate_quickstart] } -const args = process.argv.slice(2); -main(...args).catch(console.error); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/test/quickstart.test.js b/packages/google-cloud-translate/samples/test/quickstart.test.js index 36efd92428a..5b75ed58326 100644 --- a/packages/google-cloud-translate/samples/test/quickstart.test.js +++ b/packages/google-cloud-translate/samples/test/quickstart.test.js @@ -1,5 +1,5 @@ /** - * Copyright 2017, Google, Inc. + * Copyright 2017 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 diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 879116bfd8b..7a6c4b12fbf 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -30,6 +30,7 @@ * @namespace google.protobuf */ const v3beta1 = require('./v3beta1'); +import * as v2 from './v2'; /** * The `@google-cloud/translate` package has the following named exports: @@ -73,11 +74,12 @@ const v3beta1 = require('./v3beta1'); * const {TranslationServiceClient} = * require('@google-cloud/translate').v3beta1; */ -export * from './v2'; +import * as v3 from './v3'; +export * from './v3'; /** * @type {object} * @property {constructor} TranslationServiceClient * Reference to {@link v3beta1.TranslationServiceClient} */ -export {v3beta1}; +export {v2, v3beta1, v3}; diff --git a/packages/google-cloud-translate/src/v3/index.ts b/packages/google-cloud-translate/src/v3/index.ts new file mode 100644 index 00000000000..07f3c18ec18 --- /dev/null +++ b/packages/google-cloud-translate/src/v3/index.ts @@ -0,0 +1,19 @@ +// Copyright 2019 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {TranslationServiceClient} from './translation_service_client'; diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts new file mode 100644 index 00000000000..3cb89bbaddf --- /dev/null +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -0,0 +1,692 @@ +// Copyright 2019 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import * as path from 'path'; + +import * as packageJson from '../../package.json'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './translation_service_client_config.json'; + +const version = packageJson.version; + +export interface ClientOptions extends gax.GrpcClientOptions, + gax.GoogleAuthOptions { + libName?: string; + libVersion?: string; + clientConfig?: gax.ClientConfig; + fallback?: boolean; + apiEndpoint?: string; + port?: number; + servicePath?: string; + sslCreds?: object; +} + +interface Descriptors { + page: {[name: string]: gax.PageDescriptor}; + stream: {[name: string]: gax.StreamDescriptor}; + longrunning: {[name: string]: gax.LongrunningDescriptor}; +} + +export interface Callback< + ResponseObject, NextRequestObject, RawResponseObject> { + (err: Error|null|undefined, value?: ResponseObject|null, + nextRequest?: NextRequestObject, rawResponse?: RawResponseObject): void; +} + +export interface Operation extends gax.Operation { + promise(): Promise< + [ResultType, MetadataType, protosTypes.google.longrunning.IOperation]>; +} + + +export interface PaginationCallback< + RequestObject, ResponseObject, ResponseType> { + (err: Error|null, values?: ResponseType[], nextPageRequest?: RequestObject, + rawResponse?: ResponseObject): void; +} + +export interface PaginationResponse< + RequestObject, ResponseObject, ResponseType> { + values?: ResponseType[]; + nextPageRequest?: RequestObject; + rawResponse?: ResponseObject; +} + +export class TranslationServiceClient { + /* + Provides natural language translation operations. + */ + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + auth: gax.GoogleAuth; + + /** + * Construct an instance of TranslationServiceClient. + * + * @@param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @@param {object} [options.credentials] - Credentials object. + * @@param {string} [options.credentials.client_email] + * @@param {string} [options.credentials.private_key] + * @@param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @@param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @@param {number} [options.port] - The port on which to connect to + * the remote host. + * @@param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@@link + * https://developers.google.com/identity/protocols/application-default-credentials + * Application Default Credentials}, your project ID will be detected + * automatically. + * @@param {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @@param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof TranslationServiceClient; + const servicePath = opts && opts.servicePath ? + opts.servicePath : + ((opts && opts.apiEndpoint) ? opts.apiEndpoint : + staticMembers.servicePath); + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = (typeof window !== 'undefined'); + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof TranslationServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = (gaxGrpc.auth as gax.GoogleAuth); + + // Determine the client header string. + const clientHeader = [ + `gl-node/${process.version}`, `grpc/${gaxGrpc.grpcVersion}`, + `gax/${gaxModule.version}`, `gapic/${version}`, + `gl-web/${gaxModule.version}` + ]; + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = + path.join(__dirname, '..', '..', 'protos', 'protos.json'); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this._descriptors.page = { + listGlossaries: new gaxModule.PageDescriptor( + 'pageToken', 'nextPageToken', 'glossaries') + }; + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const protoFilesRoot = opts.fallback ? + gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) : + gaxModule.protobuf.loadSync(nodejsProtoPath); + + const operationsClient = + gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined + }) + .operationsClient(opts); + const batchTranslateTextResponse = + protoFilesRoot.lookup('BatchTranslateResponse') as gax.protobuf.Type; + const batchTranslateTextMetadata = + protoFilesRoot.lookup('BatchTranslateMetadata') as gax.protobuf.Type; + const createGlossaryResponse = + protoFilesRoot.lookup('Glossary') as gax.protobuf.Type; + const createGlossaryMetadata = + protoFilesRoot.lookup('CreateGlossaryMetadata') as gax.protobuf.Type; + const deleteGlossaryResponse = + protoFilesRoot.lookup('DeleteGlossaryResponse') as gax.protobuf.Type; + const deleteGlossaryMetadata = + protoFilesRoot.lookup('DeleteGlossaryMetadata') as gax.protobuf.Type; + + this._descriptors.longrunning = { + batchTranslateText: new gaxModule.LongrunningDescriptor( + operationsClient, + batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), + batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata)), + createGlossary: new gaxModule.LongrunningDescriptor( + operationsClient, + createGlossaryResponse.decode.bind(createGlossaryResponse), + createGlossaryMetadata.decode.bind(createGlossaryMetadata)), + deleteGlossary: new gaxModule.LongrunningDescriptor( + operationsClient, + deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), + deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata)) + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.translation.v3.TranslationService', + gapicConfig as gax.ClientConfig, opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this._innerApiCalls = {}; + + // Put together the "service stub" for + // google.showcase.v1alpha2.Echo. + const translationServiceStub = + gaxGrpc.createStub( + opts.fallback ? + // @ts-ignore Do not check types for loaded protos + protos.lookupService( + 'google.cloud.translation.v3.TranslationService') : + // @ts-ignore Do not check types for loaded protos + protos.google.cloud.translation.v3.TranslationService, + opts as gax.ClientStubOptions) as Promise<{[method: string]: Function}>; + + const translationServiceStubMethods = [ + 'translateText', 'detectLanguage', 'getSupportedLanguages', + 'batchTranslateText', 'createGlossary', 'listGlossaries', 'getGlossary', + 'deleteGlossary' + ]; + + for (const methodName of translationServiceStubMethods) { + const innerCallPromise = translationServiceStub.then( + (stub: {[method: string]: Function}) => (...args: Array<{}>) => { + return stub[methodName].apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + this._innerApiCalls[methodName] = gax.createApiCall( + innerCallPromise, defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName]); + } + } + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'translate.googleapis.com'; + } + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'translate.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-translation' + ]; + } + + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId(): Promise; + getProjectId(callback: Callback): void; + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /* + Translates input text and returns translated text. + */ + translateText( + request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest, + options?: gax.CallOptions): + Promise<[ + protosTypes.google.cloud.translation.v3.ITranslateTextResponse, + protosTypes.google.cloud.translation.v3.ITranslateTextRequest|undefined, + {}|undefined + ]>; + translateText( + request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3.ITranslateTextResponse, + protosTypes.google.cloud.translation.v3.ITranslateTextRequest| + undefined, + {}|undefined>): void; + translateText( + request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest, + optionsOrCallback?: gax.CallOptions|Callback< + protosTypes.google.cloud.translation.v3.ITranslateTextResponse, + protosTypes.google.cloud.translation.v3.ITranslateTextRequest| + undefined, + {}|undefined>, + callback?: Callback< + protosTypes.google.cloud.translation.v3.ITranslateTextResponse, + protosTypes.google.cloud.translation.v3.ITranslateTextRequest| + undefined, + {}|undefined>): + Promise<[ + protosTypes.google.cloud.translation.v3.ITranslateTextResponse, + protosTypes.google.cloud.translation.v3.ITranslateTextRequest|undefined, + {}|undefined + ]>|void { + request = request || {}; + let options = optionsOrCallback; + if (typeof options === 'function' && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + return this._innerApiCalls.translateText(request, options, callback); + } + /* + Detects the language of text within a request. + */ + detectLanguage( + request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest, + options?: gax.CallOptions): + Promise<[ + protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, + protosTypes.google.cloud.translation.v3.IDetectLanguageRequest| + undefined, + {}|undefined + ]>; + detectLanguage( + request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, + protosTypes.google.cloud.translation.v3.IDetectLanguageRequest| + undefined, + {}|undefined>): void; + detectLanguage( + request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest, + optionsOrCallback?: gax.CallOptions|Callback< + protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, + protosTypes.google.cloud.translation.v3.IDetectLanguageRequest| + undefined, + {}|undefined>, + callback?: Callback< + protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, + protosTypes.google.cloud.translation.v3.IDetectLanguageRequest| + undefined, + {}|undefined>): + Promise<[ + protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, + protosTypes.google.cloud.translation.v3.IDetectLanguageRequest| + undefined, + {}|undefined + ]>|void { + request = request || {}; + let options = optionsOrCallback; + if (typeof options === 'function' && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + return this._innerApiCalls.detectLanguage(request, options, callback); + } + /* + Returns a list of supported languages for translation. + */ + getSupportedLanguages( + request: + protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + options?: gax.CallOptions): + Promise<[ + protosTypes.google.cloud.translation.v3.ISupportedLanguages, + protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest| + undefined, + {}|undefined + ]>; + getSupportedLanguages( + request: + protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3.ISupportedLanguages, + protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest| + undefined, + {}|undefined>): void; + getSupportedLanguages( + request: + protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + optionsOrCallback?: gax.CallOptions|Callback< + protosTypes.google.cloud.translation.v3.ISupportedLanguages, + protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest| + undefined, + {}|undefined>, + callback?: Callback< + protosTypes.google.cloud.translation.v3.ISupportedLanguages, + protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest| + undefined, + {}|undefined>): + Promise<[ + protosTypes.google.cloud.translation.v3.ISupportedLanguages, + protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest| + undefined, + {}|undefined + ]>|void { + request = request || {}; + let options = optionsOrCallback; + if (typeof options === 'function' && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + return this._innerApiCalls.getSupportedLanguages( + request, options, callback); + } + /* + Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + exist. + */ + getGlossary( + request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest, + options?: gax.CallOptions): + Promise<[ + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.IGetGlossaryRequest|undefined, + {}|undefined + ]>; + getGlossary( + request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.IGetGlossaryRequest|undefined, + {}|undefined>): void; + getGlossary( + request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest, + optionsOrCallback?: gax.CallOptions|Callback< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.IGetGlossaryRequest|undefined, + {}|undefined>, + callback?: Callback< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.IGetGlossaryRequest|undefined, + {}|undefined>): + Promise<[ + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.IGetGlossaryRequest|undefined, + {}|undefined + ]>|void { + request = request || {}; + let options = optionsOrCallback; + if (typeof options === 'function' && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + return this._innerApiCalls.getGlossary(request, options, callback); + } + + /* + Translates a large volume of text in asynchronous batch mode. + This function provides real-time output as the inputs are being processed. + If caller cancels a request, the partial results (for an input file, it's + all or nothing) may still be available on the specified output location. + + This call returns immediately and you can + use google.longrunning.Operation.name to poll the status of the call. + */ + batchTranslateText( + request: + protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest, + options?: gax.CallOptions): + Promise<[ + Operation< + protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchTranslateText( + request: + protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + Operation< + protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined>): + void; + batchTranslateText( + request: + protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest, + optionsOrCallback?: gax.CallOptions|Callback< + Operation< + protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined>, + callback?: Callback< + Operation< + protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined>): + Promise<[ + Operation< + protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options = optionsOrCallback; + if (typeof options === 'function' && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + return this._innerApiCalls.batchTranslateText(request, options, callback); + } + /* + Creates a glossary and returns the long-running operation. Returns + NOT_FOUND, if the project doesn't exist. + */ + createGlossary( + request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest, + options?: gax.CallOptions): + Promise<[ + Operation< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createGlossary( + request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + Operation< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined>): + void; + createGlossary( + request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest, + optionsOrCallback?: gax.CallOptions|Callback< + Operation< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined>, + callback?: Callback< + Operation< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined>): + Promise<[ + Operation< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options = optionsOrCallback; + if (typeof options === 'function' && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + return this._innerApiCalls.createGlossary(request, options, callback); + } + /* + Deletes a glossary, or cancels glossary construction + if the glossary isn't created yet. + Returns NOT_FOUND, if the glossary doesn't exist. + */ + deleteGlossary( + request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest, + options?: gax.CallOptions): + Promise<[ + Operation< + protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteGlossary( + request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + Operation< + protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined>): + void; + deleteGlossary( + request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest, + optionsOrCallback?: gax.CallOptions|Callback< + Operation< + protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined>, + callback?: Callback< + Operation< + protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined>): + Promise<[ + Operation< + protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata>, + protosTypes.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options = optionsOrCallback; + if (typeof options === 'function' && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + return this._innerApiCalls.deleteGlossary(request, options, callback); + } + /* + Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't + exist. + */ + listGlossaries( + request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, + options?: gax.CallOptions): + Promise<[ + protosTypes.google.cloud.translation.v3.IGlossary[], + protosTypes.google.cloud.translation.v3.IListGlossariesRequest|null, + protosTypes.google.cloud.translation.v3.IListGlossariesResponse + ]>; + listGlossaries( + request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3.IGlossary[], + protosTypes.google.cloud.translation.v3.IListGlossariesRequest|null, + protosTypes.google.cloud.translation.v3.IListGlossariesResponse>): + void; + listGlossaries( + request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, + optionsOrCallback?: gax.CallOptions|Callback< + protosTypes.google.cloud.translation.v3.IGlossary[], + protosTypes.google.cloud.translation.v3.IListGlossariesRequest|null, + protosTypes.google.cloud.translation.v3.IListGlossariesResponse>, + callback?: Callback< + protosTypes.google.cloud.translation.v3.IGlossary[], + protosTypes.google.cloud.translation.v3.IListGlossariesRequest|null, + protosTypes.google.cloud.translation.v3.IListGlossariesResponse>): + Promise<[ + protosTypes.google.cloud.translation.v3.IGlossary[], + protosTypes.google.cloud.translation.v3.IListGlossariesRequest|null, + protosTypes.google.cloud.translation.v3.IListGlossariesResponse + ]>|void { + request = request || {}; + let options = optionsOrCallback; + if (typeof options === 'function' && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + return this._innerApiCalls.listGlossaries(request, options, callback); + } +} diff --git a/packages/google-cloud-translate/src/v3/translation_service_client_config.json b/packages/google-cloud-translate/src/v3/translation_service_client_config.json new file mode 100644 index 00000000000..fda9369d83f --- /dev/null +++ b/packages/google-cloud-translate/src/v3/translation_service_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.translation.v3.TranslationService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "TranslateText": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DetectLanguage": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSupportedLanguages": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchTranslateText": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateGlossary": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListGlossaries": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetGlossary": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteGlossary": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-translate/src/v3/translation_service_proto_list.json b/packages/google-cloud-translate/src/v3/translation_service_proto_list.json new file mode 100644 index 00000000000..21e41c10464 --- /dev/null +++ b/packages/google-cloud-translate/src/v3/translation_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/translate/v3/translation_service.proto" +] diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 41e67e0f19d..9bf021526d7 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -15,41 +15,48 @@ */ import * as assert from 'assert'; -import {Translate} from '../src'; +import {TranslationServiceClient} from '../src'; const API_KEY = process.env.TRANSLATE_API_KEY; describe('translate', () => { - let translate = new Translate(); + const translate = new TranslationServiceClient(); describe('detecting language from input', () => { const INPUT = [ { - input: 'Hello!', + content: 'Hello!', expectedLanguage: 'en', }, { - input: '¡Hola!', + content: '¡Hola!', expectedLanguage: 'es', }, ]; it('should detect a langauge', async () => { - const input = INPUT.map(x => x.input); - const [results] = await translate.detect(input); - assert.strictEqual(results[0].language, INPUT[0].expectedLanguage); - assert.strictEqual(results[1].language, INPUT[1].expectedLanguage); + const projectId = await translate.getProjectId(); + for (const input of INPUT) { + const [result] = await translate.detectLanguage({ + content: input.content, + parent: `projects/${projectId}`, + }); + assert.strictEqual( + result.languages![0].languageCode, + input.expectedLanguage + ); + } }); }); describe('translations', () => { const INPUT = [ { - input: 'Hello!', + content: 'Hello!', expectedTranslation: 'Hola', }, { - input: 'How are you today?', + content: 'How are you today?', expectedTranslation: 'Cómo estás hoy', }, ]; @@ -62,33 +69,32 @@ describe('translate', () => { } it('should translate input', async () => { - const input = INPUT.map(x => x.input); - let [results] = await translate.translate(input, 'es'); - results = results.map(removeSymbols); - assert.strictEqual(results[0], INPUT[0].expectedTranslation); - assert.strictEqual(results[1], INPUT[1].expectedTranslation); - }); - - it('should translate input with from and to options', async () => { - const input = INPUT.map(x => x.input); - const opts = { - from: 'en', - to: 'es', - }; - let [results] = await translate.translate(input, opts); - results = results.map(removeSymbols); - assert.strictEqual(results[0], INPUT[0].expectedTranslation); - assert.strictEqual(results[1], INPUT[1].expectedTranslation); + const projectId = await translate.getProjectId(); + const [results] = await translate.translateText({ + contents: INPUT.map(intput => intput.content), + sourceLanguageCode: 'en', + targetLanguageCode: 'es', + parent: `projects/${projectId}`, + }); + const translations = results.translations!.map(translation => + removeSymbols(translation.translatedText as string) + ); + assert.strictEqual(translations[0], INPUT[0].expectedTranslation); + assert.strictEqual(translations[1], INPUT[1].expectedTranslation); }); it('should autodetect HTML', async () => { - const input = '' + INPUT[0].input + ''; - const opts = { - from: 'en', - to: 'es', - }; - const [results] = await translate.translate(input, opts); - const translation = results.split(/<\/*body>/g)[1].trim(); + const input = '' + INPUT[0].content + ''; + const projectId = await translate.getProjectId(); + const [results] = await translate.translateText({ + contents: [input], + sourceLanguageCode: 'en', + targetLanguageCode: 'es', + parent: `projects/${projectId}`, + }); + const translation = (results.translations![0].translatedText as string) + .split(/<\/*body>/g)[1] + .trim(); assert.strictEqual( removeSymbols(translation), INPUT[0].expectedTranslation @@ -98,38 +104,36 @@ describe('translate', () => { describe('supported languages', () => { it('should get a list of supported languages', async () => { - const [languages] = await translate.getLanguages(); - const englishResult = languages.filter(l => l.code === 'en')[0]; + const projectId = await translate.getProjectId(); + const [result] = await translate.getSupportedLanguages({ + parent: `projects/${projectId}`, + }); + const englishResult = result.languages!.filter( + l => l.languageCode === 'en' + )[0]; assert.deepStrictEqual(englishResult, { - code: 'en', - name: 'English', + languageCode: 'en', + displayName: '', + supportSource: true, + supportTarget: true, }); }); - it('should accept a target language', async () => { - const [languages] = await translate.getLanguages('es'); - const englishResult = languages.filter(language => { - return language.code === 'en'; - })[0]; + it('should accept displayLanguageCode, and show appropriate displayName', async () => { + const projectId = await translate.getProjectId(); + const [result] = await translate.getSupportedLanguages({ + parent: `projects/${projectId}`, + displayLanguageCode: 'es', + }); + const englishResult = result.languages!.filter( + l => l.languageCode === 'en' + )[0]; assert.deepStrictEqual(englishResult, { - code: 'en', - name: 'inglés', + languageCode: 'en', + displayName: 'inglés', + supportSource: true, + supportTarget: true, }); }); }); - - describe('authentication', () => { - beforeEach(() => { - if (!API_KEY) { - throw new Error( - 'The `TRANSLATE_API_KEY` environment variable is required!' - ); - } - translate = new Translate({key: API_KEY}); - }); - - it('should use an API key to authenticate', done => { - translate.getLanguages(done); - }); - }); }); diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts new file mode 100644 index 00000000000..98c05937708 --- /dev/null +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts @@ -0,0 +1,497 @@ +// Copyright 2019 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const assert = require('assert'); +const translationServiceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + code: number; + constructor(n: number) { + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): {}; +} + +export class Operation { + constructor() {} + promise() {} +} + +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('TranslationServiceClient', () => { + it('has servicePath', () => { + const servicePath = + translationServiceModule.v3.TranslationServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + translationServiceModule.v3.TranslationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = translationServiceModule.v3.TranslationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new translationServiceModule.v3.TranslationServiceClient(); + assert(client); + }); + it('should create a client with gRPC option', () => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + fallback: true, + }); + assert(client); + }); + describe('translateText', () => { + it('invokes translateText without error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.translateText = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.translateText(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes translateText with error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.translateText = mockSimpleGrpcMethod( + request, + null, + error + ); + client.translateText(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('detectLanguage', () => { + it('invokes detectLanguage without error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.detectLanguage(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes detectLanguage with error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( + request, + null, + error + ); + client.detectLanguage(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getSupportedLanguages', () => { + it('invokes getSupportedLanguages without error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getSupportedLanguages(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getSupportedLanguages with error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getSupportedLanguages(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getGlossary', () => { + it('invokes getGlossary without error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGlossary = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getGlossary(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getGlossary with error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGlossary = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getGlossary(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('batchTranslateText', () => { + it('invokes batchTranslateText without error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.batchTranslateText = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .batchTranslateText(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes batchTranslateText with error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.batchTranslateText = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .batchTranslateText(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('createGlossary', () => { + it('invokes createGlossary without error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createGlossary = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .createGlossary(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes createGlossary with error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createGlossary = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .createGlossary(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('deleteGlossary', () => { + it('invokes deleteGlossary without error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteGlossary = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .deleteGlossary(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes deleteGlossary with error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteGlossary = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .deleteGlossary(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('listGlossaries', () => { + it('invokes listGlossaries without error', done => { + const client = new translationServiceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listGlossaries = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listGlossaries(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); +}); diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index 2b4141ac0fd..25f2652caa4 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -68,7 +68,7 @@ describe('Translate v2', () => { }; // tslint:disable-next-line variable-name - let Translate: typeof orig.Translate; + let Translate: typeof orig.v2.Translate; // tslint:disable-next-line no-any let translate: any; diff --git a/packages/google-cloud-translate/tsconfig.json b/packages/google-cloud-translate/tsconfig.json index b10ee498aef..32d9ad48a12 100644 --- a/packages/google-cloud-translate/tsconfig.json +++ b/packages/google-cloud-translate/tsconfig.json @@ -1,8 +1,10 @@ { "extends": "./node_modules/gts/tsconfig-google.json", "compilerOptions": { + "lib": ["es2016", "dom"], "rootDir": ".", - "outDir": "build" + "outDir": "build", + "resolveJsonModule": true }, "include": [ "src/*.ts", diff --git a/packages/google-cloud-translate/tslint.json b/packages/google-cloud-translate/tslint.json index 617dc975bae..b3bfaf59207 100644 --- a/packages/google-cloud-translate/tslint.json +++ b/packages/google-cloud-translate/tslint.json @@ -1,3 +1,6 @@ { - "extends": "gts/tslint.json" + "extends": "gts/tslint.json", + "rules": { + "ban-ts-ignore": false + } } From 9c1f1bec607daa18a06ef5bfcde444e9f77a1179 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2019 14:34:48 -0700 Subject: [PATCH 289/513] chore: release 5.0.0 (#360) --- packages/google-cloud-translate/CHANGELOG.md | 16 ++++++++++++++++ packages/google-cloud-translate/package.json | 2 +- .../google-cloud-translate/samples/package.json | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index f4414354886..67dc75abba8 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,22 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [5.0.0](https://www.github.com/googleapis/nodejs-translate/compare/v4.2.1...v5.0.0) (2019-10-28) + + +### ⚠ BREAKING CHANGES + +* this significantly changes TypeScript types and API surface from the v2 API. Reference samples/ for help making the migration from v2 to v3. + +### Features + +* v3 is now the default API surface ([#355](https://www.github.com/googleapis/nodejs-translate/issues/355)) ([91169b4](https://www.github.com/googleapis/nodejs-translate/commit/91169b4b141289a6890e1da1ba04765fbfdfd617)) + + +### Bug Fixes + +* remove extra brace in snippet ([#347](https://www.github.com/googleapis/nodejs-translate/issues/347)) ([6c1e95b](https://www.github.com/googleapis/nodejs-translate/commit/6c1e95bd99ec84c48e73b85203562b5f1cfa46d9)) + ### [4.2.1](https://www.github.com/googleapis/nodejs-translate/compare/v4.2.0...v4.2.1) (2019-10-22) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index e065aa55d54..229e1e42df4 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "4.2.1", + "version": "5.0.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 1de8f46676a..8cd00b25472 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^4.2.1", + "@google-cloud/translate": "^5.0.0", "@google-cloud/vision": "^1.2.0", "yargs": "^14.0.0" }, From a5dbb2f6f997d2cbad1ebc49f7eaf38d70df5fa6 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 28 Oct 2019 15:30:34 -0700 Subject: [PATCH 290/513] fix: package.json in build/ caused bad publish (#361) --- .../src/v3/translation_service_client.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 3cb89bbaddf..6607ff1bec9 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -19,11 +19,10 @@ import * as gax from 'google-gax'; import * as path from 'path'; -import * as packageJson from '../../package.json'; import * as protosTypes from '../../protos/protos'; import * as gapicConfig from './translation_service_client_config.json'; -const version = packageJson.version; +const version = require('../../../package.json').version; export interface ClientOptions extends gax.GrpcClientOptions, gax.GoogleAuthOptions { From 4051c60f94e57c52010d7099de24718f1bd06bf4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2019 16:25:19 -0700 Subject: [PATCH 291/513] chore: release 5.0.1 (#362) --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 67dc75abba8..a8c06f212d1 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [5.0.1](https://www.github.com/googleapis/nodejs-translate/compare/v5.0.0...v5.0.1) (2019-10-28) + + +### Bug Fixes + +* package.json in build/ caused bad publish ([#361](https://www.github.com/googleapis/nodejs-translate/issues/361)) ([e9c8955](https://www.github.com/googleapis/nodejs-translate/commit/e9c8955f68d18562cab50b8d0500dd62005887f8)) + ## [5.0.0](https://www.github.com/googleapis/nodejs-translate/compare/v4.2.1...v5.0.0) (2019-10-28) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 229e1e42df4..1c0f6dc846c 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "5.0.0", + "version": "5.0.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 8cd00b25472..82ab9ac0c94 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^5.0.0", + "@google-cloud/translate": "^5.0.1", "@google-cloud/vision": "^1.2.0", "yargs": "^14.0.0" }, From 61c94c34f52496dabac36d055bf3639144b769cd Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 8 Nov 2019 06:43:00 +0200 Subject: [PATCH 292/513] chore(deps): update dependency typescript to ~3.7.0 (#374) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 1c0f6dc846c..304de64dc0b 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -78,6 +78,6 @@ "prettier": "^1.13.5", "proxyquire": "^2.0.1", "source-map-support": "^0.5.6", - "typescript": "~3.6.0" + "typescript": "~3.7.0" } } From 184c8bb902848754a7b7247bd3bfecfd1796a62f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2019 20:58:07 -0800 Subject: [PATCH 293/513] chore: release 5.0.2 (#368) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index a8c06f212d1..891e378bb85 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [5.0.2](https://www.github.com/googleapis/nodejs-translate/compare/v5.0.1...v5.0.2) (2019-11-08) + + +### Bug Fixes + +* region tag ([#367](https://www.github.com/googleapis/nodejs-translate/issues/367)) ([13e75d2](https://www.github.com/googleapis/nodejs-translate/commit/13e75d2680e3c4f09e07b19cce650a91b212603f)) + ### [5.0.1](https://www.github.com/googleapis/nodejs-translate/compare/v5.0.0...v5.0.1) (2019-10-28) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 304de64dc0b..0d97dbb76ec 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "5.0.1", + "version": "5.0.2", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 82ab9ac0c94..524f49c2b8f 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^5.0.1", + "@google-cloud/translate": "^5.0.2", "@google-cloud/vision": "^1.2.0", "yargs": "^14.0.0" }, From e7e8d0074a2d35248f79628409d1d3143d80504a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 8 Nov 2019 10:59:04 -0800 Subject: [PATCH 294/513] docs: update samples in the readme (#378) --- packages/google-cloud-translate/.nycrc | 1 - packages/google-cloud-translate/README.md | 27 +++++++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/google-cloud-translate/.nycrc b/packages/google-cloud-translate/.nycrc index 23e322204ec..367688844eb 100644 --- a/packages/google-cloud-translate/.nycrc +++ b/packages/google-cloud-translate/.nycrc @@ -10,7 +10,6 @@ "**/docs", "**/samples", "**/scripts", - "**/src/**/v*/**/*.js", "**/protos", "**/test", ".jsdoc.js", diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index fd7740ed710..b1b6940e2ba 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -60,22 +60,31 @@ npm install @google-cloud/translate ### Using the client library ```javascript + /** + * TODO(developer): Uncomment the following line before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + // Imports the Google Cloud client library - const {Translate} = require('@google-cloud/translate'); + const {Translate} = require('@google-cloud/translate').v2; // Instantiates a client const translate = new Translate({projectId}); - // The text to translate - const text = 'Hello, world!'; + async function quickStart() { + // The text to translate + const text = 'Hello, world!'; + + // The target language + const target = 'ru'; - // The target language - const target = 'ru'; + // Translates some text into Russian + const [translation] = await translate.translate(text, target); + console.log(`Text: ${text}`); + console.log(`Translation: ${translation}`); + } - // Translates some text into Russian - const [translation] = await translate.translate(text, target); - console.log(`Text: ${text}`); - console.log(`Translation: ${translation}`); + quickStart(); ``` From 4d8b6474ed0f206a94e5cd3cd6472aaf0099cb44 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 14 Nov 2019 15:00:14 -0800 Subject: [PATCH 295/513] fix(docs): snippets are now replaced in jsdoc comments (#381) --- packages/google-cloud-translate/.jsdoc.js | 3 ++- packages/google-cloud-translate/package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index 64ae6681f8e..119851e1525 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -26,7 +26,8 @@ module.exports = { destination: './docs/' }, plugins: [ - 'plugins/markdown' + 'plugins/markdown', + 'jsdoc-region-tag' ], source: { excludePattern: '(^|\\/|\\\\)[._]', diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 0d97dbb76ec..b85a1137961 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -72,6 +72,7 @@ "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", + "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^6.1.4", "power-assert": "^1.6.0", From 39ae87ac04c1705436f593874a1af784aaa25884 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 19 Nov 2019 14:06:32 -0800 Subject: [PATCH 296/513] fix: get autosynth working again (#387) --- packages/google-cloud-translate/package.json | 1 + .../google-cloud-translate/src/v2/index.ts | 322 ++-- .../src/v3/translation_service_client.ts | 1465 ++++++++++++----- .../google-cloud-translate/synth.metadata | 20 +- packages/google-cloud-translate/synth.py | 20 +- .../system-test/.eslintrc.yml | 5 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 26 + .../system-test/install.ts | 50 + .../test/gapic-translation_service-v3.ts | 114 +- packages/google-cloud-translate/tsconfig.json | 9 +- packages/google-cloud-translate/tslint.json | 5 +- .../google-cloud-translate/webpack.config.js | 32 +- 13 files changed, 1430 insertions(+), 666 deletions(-) create mode 100644 packages/google-cloud-translate/system-test/.eslintrc.yml create mode 100644 packages/google-cloud-translate/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-translate/system-test/install.ts diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index b85a1137961..98e5facce7a 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -75,6 +75,7 @@ "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^6.1.4", + "pack-n-play": "^1.0.0-2", "power-assert": "^1.6.0", "prettier": "^1.13.5", "proxyquire": "^2.0.1", diff --git a/packages/google-cloud-translate/src/v2/index.ts b/packages/google-cloud-translate/src/v2/index.ts index 169f9bc55cb..35ecf7dc8d9 100644 --- a/packages/google-cloud-translate/src/v2/index.ts +++ b/packages/google-cloud-translate/src/v2/index.ts @@ -20,7 +20,10 @@ import {GoogleAuthOptions} from 'google-auth-library'; import * as is from 'is'; const isHtml = require('is-html'); -import {DecorateRequestOptions, BodyResponseCallback} from '@google-cloud/common/build/src/util'; +import { + DecorateRequestOptions, + BodyResponseCallback, +} from '@google-cloud/common/build/src/util'; const PKG = require('../../../package.json'); @@ -31,8 +34,8 @@ export interface TranslateRequest { to?: string; } -export interface TranslateCallback { - (err: Error|null, translations?: T|null, apiResponse?: Metadata): void; +export interface TranslateCallback { + (err: Error | null, translations?: T | null, apiResponse?: Metadata): void; } export interface DetectResult { @@ -41,8 +44,8 @@ export interface DetectResult { input: string; } -export interface DetectCallback { - (err: Error|null, results?: T|null, apiResponse?: Metadata): void; +export interface DetectCallback { + (err: Error | null, results?: T | null, apiResponse?: Metadata): void; } export interface LanguageResult { @@ -51,8 +54,11 @@ export interface LanguageResult { } export interface GetLanguagesCallback { - (err: Error|null, results?: LanguageResult[]|null, - apiResponse?: Metadata): void; + ( + err: Error | null, + results?: LanguageResult[] | null, + apiResponse?: Metadata + ): void; } export interface TranslateConfig extends GoogleAuthOptions { @@ -151,26 +157,26 @@ export class Translate extends Service { detect(input: string[]): Promise<[DetectResult[], Metadata]>; detect(input: string, callback: DetectCallback): void; detect(input: string[], callback: DetectCallback): void; -/** - * @typedef {object} DetectResult - * @memberof v2 - * @property {string} 0.language The language code matched from the input. - * @property {number} [0.confidence] A float 0 - 1. The higher the number, the - * higher the confidence in language detection. Note, this is not always - * returned from the API. - * @property {object} 1 The full API response. - */ -/** - * @callback DetectCallback - * @memberof v2 - * @param {?Error} err Request error, if any. - * @param {object|object[]} results The detection results. - * @param {string} results.language The language code matched from the input. - * @param {number} [results.confidence] A float 0 - 1. The higher the number, the - * higher the confidence in language detection. Note, this is not always - * returned from the API. - * @param {object} apiResponse The full API response. - */ + /** + * @typedef {object} DetectResult + * @memberof v2 + * @property {string} 0.language The language code matched from the input. + * @property {number} [0.confidence] A float 0 - 1. The higher the number, the + * higher the confidence in language detection. Note, this is not always + * returned from the API. + * @property {object} 1 The full API response. + */ + /** + * @callback DetectCallback + * @memberof v2 + * @param {?Error} err Request error, if any. + * @param {object|object[]} results The detection results. + * @param {string} results.language The language code matched from the input. + * @param {number} [results.confidence] A float 0 - 1. The higher the number, the + * higher the confidence in language detection. Note, this is not always + * returned from the API. + * @param {object} apiResponse The full API response. + */ /** * Detect the language used in a string or multiple strings. * @@ -235,69 +241,73 @@ export class Translate extends Service { * Here's a full example: */ detect( - input: string|string[], - callback?: DetectCallback| - DetectCallback): void|Promise<[DetectResult, Metadata]>| - Promise<[DetectResult[], Metadata]> { + input: string | string[], + callback?: DetectCallback | DetectCallback + ): + | void + | Promise<[DetectResult, Metadata]> + | Promise<[DetectResult[], Metadata]> { const inputIsArray = Array.isArray(input); input = arrify(input); this.request( - { - method: 'POST', - uri: '/detect', - json: { - q: input, - }, + { + method: 'POST', + uri: '/detect', + json: { + q: input, }, - (err, resp) => { - if (err) { - (callback as Function)(err, null, resp); - return; + }, + (err, resp) => { + if (err) { + (callback as Function)(err, null, resp); + return; + } + + let results = resp.data.detections.map( + (detection: Array<{}>, index: number) => { + const result = extend({}, detection[0], { + input: input[index], + }); + + // Deprecated. + // tslint:disable-next-line no-any + delete (result as any).isReliable; + + return result; } + ); - let results = resp.data.detections.map( - (detection: Array<{}>, index: number) => { - const result = extend({}, detection[0], { - input: input[index], - }); - - // Deprecated. - // tslint:disable-next-line no-any - delete (result as any).isReliable; + if (input.length === 1 && !inputIsArray) { + results = results[0]; + } - return result; - }); - - if (input.length === 1 && !inputIsArray) { - results = results[0]; - } - - (callback as Function)(null, results, resp); - }); + (callback as Function)(null, results, resp); + } + ); } getLanguages(target?: string): Promise<[LanguageResult[], Metadata]>; getLanguages(target: string, callback: GetLanguagesCallback): void; getLanguages(callback: GetLanguagesCallback): void; -/** - * @typedef {object} LanguageResult - * @memberof v2 - * @property {string} code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) - * language code. - * @property {string} name The language name. This can be translated into your - * preferred language with the `target` option. - */ -/** - * @callback GetLanguagesCallback - * @memberof v2 - * @param {?Error} err Request error, if any. - * @param {object[]} results The languages supported by the API. - * @param {string} results.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) - * language code. - * @param {string} results.name The language name. This can be translated into your - * preferred language with the `target` option. - * @param {object} apiResponse The full API response. - */ + /** + * @typedef {object} LanguageResult + * @memberof v2 + * @property {string} code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * language code. + * @property {string} name The language name. This can be translated into your + * preferred language with the `target` option. + */ + /** + * @callback GetLanguagesCallback + * @memberof v2 + * @param {?Error} err Request error, if any. + * @param {object[]} results The languages supported by the API. + * @param {string} results.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * language code. + * @param {string} results.name The language name. This can be translated into your + * preferred language with the `target` option. + * @param {object} apiResponse The full API response. + */ /** * Get an array of all supported languages. * @@ -317,9 +327,9 @@ export class Translate extends Service { * Gets the language names in a language other than English: */ getLanguages( - targetOrCallback?: string|GetLanguagesCallback, - callback?: GetLanguagesCallback): - void|Promise<[LanguageResult[], Metadata]> { + targetOrCallback?: string | GetLanguagesCallback, + callback?: GetLanguagesCallback + ): void | Promise<[LanguageResult[], Metadata]> { let target: string; if (is.fn(targetOrCallback)) { callback = targetOrCallback as GetLanguagesCallback; @@ -345,57 +355,72 @@ export class Translate extends Service { } const languages = resp.data.languages.map( - (language: {language: string, name: string}) => { - return { - code: language.language, - name: language.name, - }; - }); + (language: {language: string; name: string}) => { + return { + code: language.language, + name: language.name, + }; + } + ); callback!(null, languages, resp); }); } - translate(input: string, options: TranslateRequest): - Promise<[string, Metadata]>; - translate(input: string[], options: TranslateRequest): - Promise<[string[], Metadata]>; + translate( + input: string, + options: TranslateRequest + ): Promise<[string, Metadata]>; + translate( + input: string[], + options: TranslateRequest + ): Promise<[string[], Metadata]>; translate(input: string, to: string): Promise<[string, Metadata]>; translate(input: string[], to: string): Promise<[string[], Metadata]>; translate( - input: string, options: TranslateRequest, - callback: TranslateCallback): void; - translate(input: string, to: string, callback: TranslateCallback): - void; + input: string, + options: TranslateRequest, + callback: TranslateCallback + ): void; translate( - input: string[], options: TranslateRequest, - callback: TranslateCallback): void; - translate(input: string[], to: string, callback: TranslateCallback): - void; -/** - * Translate request options. - * - * @typedef {object} TranslateRequest - * @memberof v2 - * @property {string} [format] Set the text's format as `html` or `text`. - * If not provided, we will try to auto-detect if the text given is HTML. - * If not, we set the format as `text`. - * @property {string} [from] The ISO 639-1 language code the source input - * is written in. - * @property {string} [model] Set the model type requested for this - * translation. Please refer to the upstream documentation for possible - * values. - * @property {string} to The ISO 639-1 language code to translate the - * input to. - */ -/** - * @callback TranslateCallback - * @memberof v2 - * @param {?Error} err Request error, if any. - * @param {object|object[]} translations If a single string input was given, a - * single translation is given. Otherwise, it is an array of translations. - * @param {object} apiResponse The full API response. - */ + input: string, + to: string, + callback: TranslateCallback + ): void; + translate( + input: string[], + options: TranslateRequest, + callback: TranslateCallback + ): void; + translate( + input: string[], + to: string, + callback: TranslateCallback + ): void; + /** + * Translate request options. + * + * @typedef {object} TranslateRequest + * @memberof v2 + * @property {string} [format] Set the text's format as `html` or `text`. + * If not provided, we will try to auto-detect if the text given is HTML. + * If not, we set the format as `text`. + * @property {string} [from] The ISO 639-1 language code the source input + * is written in. + * @property {string} [model] Set the model type requested for this + * translation. Please refer to the upstream documentation for possible + * values. + * @property {string} to The ISO 639-1 language code to translate the + * input to. + */ + /** + * @callback TranslateCallback + * @memberof v2 + * @param {?Error} err Request error, if any. + * @param {object|object[]} translations If a single string input was given, a + * single translation is given. Otherwise, it is an array of translations. + * @param {object} apiResponse The full API response. + */ /** * Translate a string or multiple strings into another language. * @@ -472,9 +497,10 @@ export class Translate extends Service { * Translation using the premium model: */ translate( - inputs: string|string[], optionsOrTo: string|TranslateRequest, - callback?: TranslateCallback|TranslateCallback): - void|Promise<[string, Metadata]>|Promise<[string[], Metadata]> { + inputs: string | string[], + optionsOrTo: string | TranslateRequest, + callback?: TranslateCallback | TranslateCallback + ): void | Promise<[string, Metadata]> | Promise<[string[], Metadata]> { const inputIsArray = Array.isArray(inputs); const input = arrify(inputs); let options: TranslateRequest = {}; @@ -508,30 +534,33 @@ export class Translate extends Service { if (!body.target) { throw new Error( - 'A target language is required to perform a translation.'); + 'A target language is required to perform a translation.' + ); } this.request( - { - method: 'POST', - uri: '', - json: body, - }, - (err, resp) => { - if (err) { - (callback as Function)(err, null, resp); - return; - } + { + method: 'POST', + uri: '', + json: body, + }, + (err, resp) => { + if (err) { + (callback as Function)(err, null, resp); + return; + } - let translations = resp.data.translations.map( - (x: {translatedText: string}) => x.translatedText); + let translations = resp.data.translations.map( + (x: {translatedText: string}) => x.translatedText + ); - if (body.q.length === 1 && !inputIsArray) { - translations = translations[0]; - } + if (body.q.length === 1 && !inputIsArray) { + translations = translations[0]; + } - (callback as Function)(err, translations, resp); - }); + (callback as Function)(err, translations, resp); + } + ); } /** @@ -545,7 +574,10 @@ export class Translate extends Service { * @param {object} reqOpts - Request options that are passed to `request`. * @param {function} callback - The callback function passed to `request`. */ - request(reqOpts: DecorateRequestOptions, callback: BodyResponseCallback): void { + request( + reqOpts: DecorateRequestOptions, + callback: BodyResponseCallback + ): void { if (!this.key) { super.request(reqOpts, callback!); return; diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 6607ff1bec9..07b4cb78415 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -17,101 +17,74 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; import * as path from 'path'; +import {Transform} from 'stream'; import * as protosTypes from '../../protos/protos'; import * as gapicConfig from './translation_service_client_config.json'; const version = require('../../../package.json').version; -export interface ClientOptions extends gax.GrpcClientOptions, - gax.GoogleAuthOptions { - libName?: string; - libVersion?: string; - clientConfig?: gax.ClientConfig; - fallback?: boolean; - apiEndpoint?: string; - port?: number; - servicePath?: string; - sslCreds?: object; -} - -interface Descriptors { - page: {[name: string]: gax.PageDescriptor}; - stream: {[name: string]: gax.StreamDescriptor}; - longrunning: {[name: string]: gax.LongrunningDescriptor}; -} - -export interface Callback< - ResponseObject, NextRequestObject, RawResponseObject> { - (err: Error|null|undefined, value?: ResponseObject|null, - nextRequest?: NextRequestObject, rawResponse?: RawResponseObject): void; -} - -export interface Operation extends gax.Operation { - promise(): Promise< - [ResultType, MetadataType, protosTypes.google.longrunning.IOperation]>; -} - - -export interface PaginationCallback< - RequestObject, ResponseObject, ResponseType> { - (err: Error|null, values?: ResponseType[], nextPageRequest?: RequestObject, - rawResponse?: ResponseObject): void; -} - -export interface PaginationResponse< - RequestObject, ResponseObject, ResponseType> { - values?: ResponseType[]; - nextPageRequest?: RequestObject; - rawResponse?: ResponseObject; -} - +/** + * Provides natural language translation operations. + * @class + * @memberof v3 + */ export class TranslationServiceClient { - /* - Provides natural language translation operations. - */ private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _translationServiceStub: Promise<{[name: string]: Function}>; private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; auth: gax.GoogleAuth; /** * Construct an instance of TranslationServiceClient. * - * @@param {object} [options] - The configuration object. See the subsequent + * @param {object} [options] - The configuration object. See the subsequent * parameters for more details. - * @@param {object} [options.credentials] - Credentials object. - * @@param {string} [options.credentials.client_email] - * @@param {string} [options.credentials.private_key] - * @@param {string} [options.email] - Account email address. Required when + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when * using a .pem or .p12 keyFilename. - * @@param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or * .p12 key downloaded from the Google Developers Console. If you provide * a path to a JSON file, the projectId option below is not necessary. * NOTE: .pem and .p12 require you to specify options.email as well. - * @@param {number} [options.port] - The port on which to connect to + * @param {number} [options.port] - The port on which to connect to * the remote host. - * @@param {string} [options.projectId] - The project ID from the Google + * @param {string} [options.projectId] - The project ID from the Google * Developer's Console, e.g. 'grape-spaceship-123'. We will also check * the environment variable GCLOUD_PROJECT for your project ID. If your * app is running in an environment which supports - * {@@link - * https://developers.google.com/identity/protocols/application-default-credentials - * Application Default Credentials}, your project ID will be detected - * automatically. - * @@param {function} [options.promise] - Custom promise module to use instead + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {function} [options.promise] - Custom promise module to use instead * of native Promises. - * @@param {string} [options.apiEndpoint] - The domain name of the + * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ constructor(opts?: ClientOptions) { // Ensure that options include the service address and port. const staticMembers = this.constructor as typeof TranslationServiceClient; - const servicePath = opts && opts.servicePath ? - opts.servicePath : - ((opts && opts.apiEndpoint) ? opts.apiEndpoint : - staticMembers.servicePath); + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; const port = opts && opts.port ? opts.port : staticMembers.port; if (!opts) { @@ -121,7 +94,7 @@ export class TranslationServiceClient { opts.port = opts.port || port; opts.clientConfig = opts.clientConfig || {}; - const isBrowser = (typeof window !== 'undefined'); + const isBrowser = typeof window !== 'undefined'; if (isBrowser) { opts.fallback = true; } @@ -136,14 +109,18 @@ export class TranslationServiceClient { const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. - this.auth = (gaxGrpc.auth as gax.GoogleAuth); + this.auth = gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.version}`, `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gaxModule.version}`, `gapic/${version}`, - `gl-web/${gaxModule.version}` - ]; + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } @@ -151,65 +128,94 @@ export class TranslationServiceClient { // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. - const nodejsProtoPath = - path.join(__dirname, '..', '..', 'protos', 'protos.json'); + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath); + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + glossaryPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/glossaries/{glossary}' + ), + }; // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { listGlossaries: new gaxModule.PageDescriptor( - 'pageToken', 'nextPageToken', 'glossaries') + 'pageToken', + 'nextPageToken', + 'glossaries' + ), }; + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - const protoFilesRoot = opts.fallback ? - gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) : - gaxModule.protobuf.loadSync(nodejsProtoPath); - - const operationsClient = - gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined - }) - .operationsClient(opts); - const batchTranslateTextResponse = - protoFilesRoot.lookup('BatchTranslateResponse') as gax.protobuf.Type; - const batchTranslateTextMetadata = - protoFilesRoot.lookup('BatchTranslateMetadata') as gax.protobuf.Type; - const createGlossaryResponse = - protoFilesRoot.lookup('Glossary') as gax.protobuf.Type; - const createGlossaryMetadata = - protoFilesRoot.lookup('CreateGlossaryMetadata') as gax.protobuf.Type; - const deleteGlossaryResponse = - protoFilesRoot.lookup('DeleteGlossaryResponse') as gax.protobuf.Type; - const deleteGlossaryMetadata = - protoFilesRoot.lookup('DeleteGlossaryMetadata') as gax.protobuf.Type; + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + + const operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const batchTranslateTextResponse = protoFilesRoot.lookup( + '.google.cloud.translation.v3.BatchTranslateResponse' + ) as gax.protobuf.Type; + const batchTranslateTextMetadata = protoFilesRoot.lookup( + '.google.cloud.translation.v3.BatchTranslateMetadata' + ) as gax.protobuf.Type; + const createGlossaryResponse = protoFilesRoot.lookup( + '.google.cloud.translation.v3.Glossary' + ) as gax.protobuf.Type; + const createGlossaryMetadata = protoFilesRoot.lookup( + '.google.cloud.translation.v3.CreateGlossaryMetadata' + ) as gax.protobuf.Type; + const deleteGlossaryResponse = protoFilesRoot.lookup( + '.google.cloud.translation.v3.DeleteGlossaryResponse' + ) as gax.protobuf.Type; + const deleteGlossaryMetadata = protoFilesRoot.lookup( + '.google.cloud.translation.v3.DeleteGlossaryMetadata' + ) as gax.protobuf.Type; this._descriptors.longrunning = { batchTranslateText: new gaxModule.LongrunningDescriptor( - operationsClient, - batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), - batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata)), + operationsClient, + batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), + batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) + ), createGlossary: new gaxModule.LongrunningDescriptor( - operationsClient, - createGlossaryResponse.decode.bind(createGlossaryResponse), - createGlossaryMetadata.decode.bind(createGlossaryMetadata)), + operationsClient, + createGlossaryResponse.decode.bind(createGlossaryResponse), + createGlossaryMetadata.decode.bind(createGlossaryMetadata) + ), deleteGlossary: new gaxModule.LongrunningDescriptor( - operationsClient, - deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), - deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata)) + operationsClient, + deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), + deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata) + ), }; // Put together the default options sent with requests. const defaults = gaxGrpc.constructSettings( - 'google.cloud.translation.v3.TranslationService', - gapicConfig as gax.ClientConfig, opts.clientConfig || {}, - {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.translation.v3.TranslationService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code @@ -217,45 +223,68 @@ export class TranslationServiceClient { this._innerApiCalls = {}; // Put together the "service stub" for - // google.showcase.v1alpha2.Echo. - const translationServiceStub = - gaxGrpc.createStub( - opts.fallback ? - // @ts-ignore Do not check types for loaded protos - protos.lookupService( - 'google.cloud.translation.v3.TranslationService') : - // @ts-ignore Do not check types for loaded protos - protos.google.cloud.translation.v3.TranslationService, - opts as gax.ClientStubOptions) as Promise<{[method: string]: Function}>; + // google.cloud.translation.v3.TranslationService. + this._translationServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.translation.v3.TranslationService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.translation.v3.TranslationService, + opts + ) as Promise<{[method: string]: Function}>; + // Iterate over each of the methods that the service provides + // and create an API call method for each. const translationServiceStubMethods = [ - 'translateText', 'detectLanguage', 'getSupportedLanguages', - 'batchTranslateText', 'createGlossary', 'listGlossaries', 'getGlossary', - 'deleteGlossary' + 'translateText', + 'detectLanguage', + 'getSupportedLanguages', + 'batchTranslateText', + 'createGlossary', + 'listGlossaries', + 'getGlossary', + 'deleteGlossary', ]; for (const methodName of translationServiceStubMethods) { - const innerCallPromise = translationServiceStub.then( - (stub: {[method: string]: Function}) => (...args: Array<{}>) => { - return stub[methodName].apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - this._innerApiCalls[methodName] = gax.createApiCall( - innerCallPromise, defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName]); + const innerCallPromise = this._translationServiceStub.then( + stub => (...args: Array<{}>) => { + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return apiCall(argument, callOptions, callback); + }; } } + /** * The DNS address for this API service. */ static get servicePath() { return 'translate.googleapis.com'; } + /** * The DNS address for this API service - same as servicePath(), * exists for compatibility reasons. @@ -278,19 +307,20 @@ export class TranslationServiceClient { static get scopes() { return [ 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-translation' + 'https://www.googleapis.com/auth/cloud-translation', ]; } + getProjectId(): Promise; + getProjectId(callback: Callback): void; /** * Return the project ID used by this class. * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId(): Promise; - getProjectId(callback: Callback): void; - getProjectId(callback?: Callback): - Promise|void { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -301,391 +331,932 @@ export class TranslationServiceClient { // ------------------- // -- Service calls -- // ------------------- - /* - Translates input text and returns translated text. - */ translateText( - request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest, - options?: gax.CallOptions): - Promise<[ - protosTypes.google.cloud.translation.v3.ITranslateTextResponse, - protosTypes.google.cloud.translation.v3.ITranslateTextRequest|undefined, - {}|undefined - ]>; + request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.translation.v3.ITranslateTextResponse, + protosTypes.google.cloud.translation.v3.ITranslateTextRequest | undefined, + {} | undefined + ] + >; translateText( - request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest, - options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.translation.v3.ITranslateTextResponse, - protosTypes.google.cloud.translation.v3.ITranslateTextRequest| - undefined, - {}|undefined>): void; + request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3.ITranslateTextResponse, + protosTypes.google.cloud.translation.v3.ITranslateTextRequest | undefined, + {} | undefined + > + ): void; + /** + * Translates input text and returns translated text. + * + * @param {Object} request + * The request object that will be sent. + * @param {string[]} request.contents + * Required. The content of the input in string format. + * We recommend the total content be less than 30k codepoints. + * Use BatchTranslateText for larger text. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + * @param {string} [request.sourceLanguageCode] + * Optional. The BCP-47 language code of the input text if + * known, for example, "en-US" or "sr-Latn". Supported language codes are + * listed in Language Support. If the source language isn't specified, the API + * attempts to identify the source language automatically and returns the + * source language within the response. + * @param {string} request.targetLanguageCode + * Required. The BCP-47 language code to use for translation of the input + * text, set to one of the language codes listed in Language Support. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * + * Non-global location is required for requests using AutoML models or + * custom glossaries. + * + * Models and glossaries must be within the same region (have same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.model] + * Optional. The `model` type requested for this translation. + * + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * + * + * For global (non-regionalized) requests, use `location-id` `global`. + * For example, + * `projects/{project-number-or-id}/locations/global/models/general/nmt`. + * + * If missing, the system decides which google base model to use. + * @param {google.cloud.translation.v3.TranslateTextGlossaryConfig} [request.glossaryConfig] + * Optional. Glossary to be applied. The glossary must be + * within the same region (have the same location-id) as the model, otherwise + * an INVALID_ARGUMENT (400) error is returned. + * @param {number} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3.TranslateTextResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ translateText( - request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protosTypes.google.cloud.translation.v3.ITranslateTextResponse, - protosTypes.google.cloud.translation.v3.ITranslateTextRequest| - undefined, - {}|undefined>, - callback?: Callback< + request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protosTypes.google.cloud.translation.v3.ITranslateTextResponse, - protosTypes.google.cloud.translation.v3.ITranslateTextRequest| - undefined, - {}|undefined>): - Promise<[ - protosTypes.google.cloud.translation.v3.ITranslateTextResponse, - protosTypes.google.cloud.translation.v3.ITranslateTextRequest|undefined, - {}|undefined - ]>|void { + | protosTypes.google.cloud.translation.v3.ITranslateTextRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.translation.v3.ITranslateTextResponse, + protosTypes.google.cloud.translation.v3.ITranslateTextRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.translation.v3.ITranslateTextResponse, + protosTypes.google.cloud.translation.v3.ITranslateTextRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; - let options = optionsOrCallback; - if (typeof options === 'function' && callback === undefined) { - callback = options; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); return this._innerApiCalls.translateText(request, options, callback); } - /* - Detects the language of text within a request. - */ detectLanguage( - request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest, - options?: gax.CallOptions): - Promise<[ - protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, - protosTypes.google.cloud.translation.v3.IDetectLanguageRequest| - undefined, - {}|undefined - ]>; + request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, + ( + | protosTypes.google.cloud.translation.v3.IDetectLanguageRequest + | undefined + ), + {} | undefined + ] + >; detectLanguage( - request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest, - options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, - protosTypes.google.cloud.translation.v3.IDetectLanguageRequest| - undefined, - {}|undefined>): void; + request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, + | protosTypes.google.cloud.translation.v3.IDetectLanguageRequest + | undefined, + {} | undefined + > + ): void; + /** + * Detects the language of text within a request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-number-or-id}/locations/{location-id}` or + * `projects/{project-number-or-id}`. + * + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * + * Only models within the same region (has same location-id) can be used. + * Otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.model] + * Optional. The language detection model to be used. + * + * Format: + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` + * + * Only one language detection model is currently supported: + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. + * + * If not specified, the default model is used. + * @param {string} request.content + * The content of the input stored as a string. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + * @param {number} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3.DetectLanguageResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ detectLanguage( - request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest, - optionsOrCallback?: gax.CallOptions|Callback< + request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, - protosTypes.google.cloud.translation.v3.IDetectLanguageRequest| - undefined, - {}|undefined>, - callback?: Callback< - protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, - protosTypes.google.cloud.translation.v3.IDetectLanguageRequest| - undefined, - {}|undefined>): - Promise<[ - protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, - protosTypes.google.cloud.translation.v3.IDetectLanguageRequest| - undefined, - {}|undefined - ]>|void { + | protosTypes.google.cloud.translation.v3.IDetectLanguageRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, + | protosTypes.google.cloud.translation.v3.IDetectLanguageRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, + ( + | protosTypes.google.cloud.translation.v3.IDetectLanguageRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; - let options = optionsOrCallback; - if (typeof options === 'function' && callback === undefined) { - callback = options; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); return this._innerApiCalls.detectLanguage(request, options, callback); } - /* - Returns a list of supported languages for translation. - */ getSupportedLanguages( - request: - protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - options?: gax.CallOptions): - Promise<[ - protosTypes.google.cloud.translation.v3.ISupportedLanguages, - protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest| - undefined, - {}|undefined - ]>; + request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.translation.v3.ISupportedLanguages, + ( + | protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | undefined + ), + {} | undefined + ] + >; getSupportedLanguages( - request: - protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.translation.v3.ISupportedLanguages, - protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest| - undefined, - {}|undefined>): void; + request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3.ISupportedLanguages, + | protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | undefined, + {} | undefined + > + ): void; + /** + * Returns a list of supported languages for translation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * + * Non-global location is required for AutoML models. + * + * Only models within the same region (have same location-id) can be used, + * otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.displayLanguageCode] + * Optional. The language to use to return localized, human readable names + * of supported languages. If missing, then display names are not returned + * in a response. + * @param {string} [request.model] + * Optional. Get supported languages of this model. + * + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * + * + * Returns languages supported by the specified model. + * If missing, we get supported languages of Google general base (PBMT) model. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3.SupportedLanguages}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getSupportedLanguages( - request: - protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protosTypes.google.cloud.translation.v3.ISupportedLanguages, - protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest| - undefined, - {}|undefined>, - callback?: Callback< + request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protosTypes.google.cloud.translation.v3.ISupportedLanguages, - protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest| - undefined, - {}|undefined>): - Promise<[ - protosTypes.google.cloud.translation.v3.ISupportedLanguages, - protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest| - undefined, - {}|undefined - ]>|void { + | protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.translation.v3.ISupportedLanguages, + | protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.translation.v3.ISupportedLanguages, + ( + | protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; - let options = optionsOrCallback; - if (typeof options === 'function' && callback === undefined) { - callback = options; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); return this._innerApiCalls.getSupportedLanguages( - request, options, callback); + request, + options, + callback + ); } - /* - Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - exist. - */ getGlossary( - request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest, - options?: gax.CallOptions): - Promise<[ - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.IGetGlossaryRequest|undefined, - {}|undefined - ]>; + request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.IGetGlossaryRequest | undefined, + {} | undefined + ] + >; getGlossary( - request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.IGetGlossaryRequest|undefined, - {}|undefined>): void; + request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.IGetGlossaryRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3.Glossary}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getGlossary( - request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.IGetGlossaryRequest|undefined, - {}|undefined>, - callback?: Callback< + request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.IGetGlossaryRequest|undefined, - {}|undefined>): - Promise<[ - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.IGetGlossaryRequest|undefined, - {}|undefined - ]>|void { + | protosTypes.google.cloud.translation.v3.IGetGlossaryRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.IGetGlossaryRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.IGetGlossaryRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; - let options = optionsOrCallback; - if (typeof options === 'function' && callback === undefined) { - callback = options; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); return this._innerApiCalls.getGlossary(request, options, callback); } - /* - Translates a large volume of text in asynchronous batch mode. - This function provides real-time output as the inputs are being processed. - If caller cancels a request, the partial results (for an input file, it's - all or nothing) may still be available on the specified output location. - - This call returns immediately and you can - use google.longrunning.Operation.name to poll the status of the call. - */ batchTranslateText( - request: - protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest, - options?: gax.CallOptions): - Promise<[ - Operation< - protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; batchTranslateText( - request: - protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest, - options: gax.CallOptions, - callback: Callback< - Operation< - protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined>): - void; + request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Translates a large volume of text in asynchronous batch mode. + * This function provides real-time output as the inputs are being processed. + * If caller cancels a request, the partial results (for an input file, it's + * all or nothing) may still be available on the specified output location. + * + * This call returns immediately and you can + * use google.longrunning.Operation.name to poll the status of the call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Location to make a call. Must refer to a caller's project. + * + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * + * The `global` location is not supported for batch translation. + * + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. + * @param {string} request.sourceLanguageCode + * Required. Source language code. + * @param {string[]} request.targetLanguageCodes + * Required. Specify up to 10 language codes here. + * @param {number} [request.models] + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is model name. Value can be a built-in general model, + * or an AutoML Translation model. + * + * The value format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * + * + * If the map is empty or a specific model is + * not requested for a language pair, then default google model (nmt) is used. + * @param {number} request.inputConfigs + * Required. Input configurations. + * The total number of files matched should be <= 1000. + * The total content size should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + * @param {google.cloud.translation.v3.OutputConfig} request.outputConfig + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + * @param {number} [request.glossaries] + * Optional. Glossaries to be applied for translation. + * It's keyed by target language code. + * @param {number} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ batchTranslateText( - request: - protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest, - optionsOrCallback?: gax.CallOptions|Callback< - Operation< - protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined>, - callback?: Callback< - Operation< - protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined>): - Promise<[ - Operation< + request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; - let options = optionsOrCallback; - if (typeof options === 'function' && callback === undefined) { - callback = options; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); return this._innerApiCalls.batchTranslateText(request, options, callback); } - /* - Creates a glossary and returns the long-running operation. Returns - NOT_FOUND, if the project doesn't exist. - */ createGlossary( - request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest, - options?: gax.CallOptions): - Promise<[ - Operation< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; createGlossary( - request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - Operation< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined>): - void; + request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Creates a glossary and returns the long-running operation. Returns + * NOT_FOUND, if the project doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project name. + * @param {google.cloud.translation.v3.Glossary} request.glossary + * Required. The glossary to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createGlossary( - request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest, - optionsOrCallback?: gax.CallOptions|Callback< - Operation< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined>, - callback?: Callback< - Operation< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined>): - Promise<[ - Operation< + request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.translation.v3.IGlossary, + protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; - let options = optionsOrCallback; - if (typeof options === 'function' && callback === undefined) { - callback = options; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); return this._innerApiCalls.createGlossary(request, options, callback); } - /* - Deletes a glossary, or cancels glossary construction - if the glossary isn't created yet. - Returns NOT_FOUND, if the glossary doesn't exist. - */ deleteGlossary( - request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest, - options?: gax.CallOptions): - Promise<[ - Operation< - protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; deleteGlossary( - request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - Operation< - protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined>): - void; + request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Deletes a glossary, or cancels glossary construction + * if the glossary isn't created yet. + * Returns NOT_FOUND, if the glossary doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ deleteGlossary( - request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest, - optionsOrCallback?: gax.CallOptions|Callback< - Operation< - protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined>, - callback?: Callback< - Operation< - protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined>): - Promise<[ - Operation< + request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata>, - protosTypes.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; - let options = optionsOrCallback; - if (typeof options === 'function' && callback === undefined) { - callback = options; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); return this._innerApiCalls.deleteGlossary(request, options, callback); } - /* - Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - exist. - */ listGlossaries( - request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, - options?: gax.CallOptions): - Promise<[ - protosTypes.google.cloud.translation.v3.IGlossary[], - protosTypes.google.cloud.translation.v3.IListGlossariesRequest|null, - protosTypes.google.cloud.translation.v3.IListGlossariesResponse - ]>; + request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.translation.v3.IGlossary[], + protosTypes.google.cloud.translation.v3.IListGlossariesRequest | null, + protosTypes.google.cloud.translation.v3.IListGlossariesResponse + ] + >; listGlossaries( - request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, - options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.translation.v3.IGlossary[], - protosTypes.google.cloud.translation.v3.IListGlossariesRequest|null, - protosTypes.google.cloud.translation.v3.IListGlossariesResponse>): - void; + request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3.IGlossary[], + protosTypes.google.cloud.translation.v3.IListGlossariesRequest | null, + protosTypes.google.cloud.translation.v3.IListGlossariesResponse + > + ): void; + /** + * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListGlossariesResponse]{@link google.cloud.translation.v3.ListGlossariesResponse}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [ListGlossariesResponse]{@link google.cloud.translation.v3.ListGlossariesResponse} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListGlossariesResponse]{@link google.cloud.translation.v3.ListGlossariesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ listGlossaries( - request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protosTypes.google.cloud.translation.v3.IGlossary[], - protosTypes.google.cloud.translation.v3.IListGlossariesRequest|null, - protosTypes.google.cloud.translation.v3.IListGlossariesResponse>, - callback?: Callback< + request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protosTypes.google.cloud.translation.v3.IGlossary[], - protosTypes.google.cloud.translation.v3.IListGlossariesRequest|null, - protosTypes.google.cloud.translation.v3.IListGlossariesResponse>): - Promise<[ - protosTypes.google.cloud.translation.v3.IGlossary[], - protosTypes.google.cloud.translation.v3.IListGlossariesRequest|null, - protosTypes.google.cloud.translation.v3.IListGlossariesResponse - ]>|void { + protosTypes.google.cloud.translation.v3.IListGlossariesRequest | null, + protosTypes.google.cloud.translation.v3.IListGlossariesResponse + >, + callback?: Callback< + protosTypes.google.cloud.translation.v3.IGlossary[], + protosTypes.google.cloud.translation.v3.IListGlossariesRequest | null, + protosTypes.google.cloud.translation.v3.IListGlossariesResponse + > + ): Promise< + [ + protosTypes.google.cloud.translation.v3.IGlossary[], + protosTypes.google.cloud.translation.v3.IListGlossariesRequest | null, + protosTypes.google.cloud.translation.v3.IListGlossariesResponse + ] + > | void { request = request || {}; - let options = optionsOrCallback; - if (typeof options === 'function' && callback === undefined) { - callback = options; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); return this._innerApiCalls.listGlossaries(request, options, callback); } + + /** + * Equivalent to {@link listGlossaries}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGlossaries} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3.Glossary} on 'data' event. + */ + listGlossariesStream( + request?: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listGlossaries.createStream( + this._innerApiCalls.listGlossaries as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + glossaryPath(project: string, location: string, glossary: string) { + return this._pathTemplates.glossaryPathTemplate.render({ + project, + location, + glossary, + }); + } + matchProjectFromGlossaryName(glossaryName: string) { + return this._pathTemplates.glossaryPathTemplate.match(glossaryName).project; + } + matchLocationFromGlossaryName(glossaryName: string) { + return this._pathTemplates.glossaryPathTemplate.match(glossaryName) + .location; + } + matchGlossaryFromGlossaryName(glossaryName: string) { + return this._pathTemplates.glossaryPathTemplate.match(glossaryName) + .glossary; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this._translationServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } } diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 5e006e0ae10..5d3b33b70be 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,12 @@ { - "updateTime": "2019-10-24T11:32:27.284278Z", + "updateTime": "2019-11-19T19:14:34.278318Z", "sources": [ - { - "generator": { - "name": "artman", - "version": "0.40.2", - "dockerImage": "googleapis/artman@sha256:3b8f7d9b4c206843ce08053474f5c64ae4d388ff7d995e68b59fb65edf73eeb9" - } - }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "698b05fe2b05893dfe74a156a5665f879de7fceb", - "internalRef": "276276483" + "sha": "5af83f47b9656261cafcf88b0b3334521ab266b3", + "internalRef": "281334391" } }, { @@ -29,10 +22,9 @@ "client": { "source": "googleapis", "apiName": "translate", - "apiVersion": "v3beta1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/translate/artman_translate_v3beta1.yaml" + "apiVersion": "v3", + "language": "typescript", + "generator": "gapic-generator-typescript" } } ] diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py index ef762fb6e71..d447aba8beb 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/synth.py @@ -20,15 +20,18 @@ import subprocess # Run the gapic generator -gapic = gcp.GAPICGenerator() -versions = ['v3beta1'] +gapic = gcp.GAPICMicrogenerator() +versions = ['v3'] for version in versions: - library = gapic.node_library('translate', version) - s.copy(library, excludes=['src/index.js', 'src/browser.js', 'README.md', 'package.json']) -# note: no browser.js support until we fully support TypeScript + library = gapic.typescript_library( + 'translate', + generator_args={ + "grpc-service-config": "google/cloud/translate/v3/translate_grpc_service_config.json" + }, + version=version) +s.copy(library, excludes=['README.md', 'package.json', 'src/index.ts']) # Update path discovery due to build/ dir and TypeScript conversion. -s.replace("src/v3beta1/translation_service_client.js", "../../package.json", "../../../package.json") s.replace("test/gapic-*.js", "../../package.json", "../../../package.json") # [START fix-dead-link] @@ -41,10 +44,13 @@ 'toISOString)') # [END fix-dead-link] +s.replace("system-test/fixtures/sample/src/index.js", "'translation'", "'@google-cloud/translate'") +s.replace("system-test/fixtures/sample/src/index.ts", "'translation'", "'@google-cloud/translate'") + logging.basicConfig(level=logging.DEBUG) common_templates = gcp.CommonTemplates() templates = common_templates.node_library(source_location='build/src') -s.copy(templates) +s.copy(templates, excludes=[]) # Node.js specific cleanup subprocess.run(["npm", "install"]) diff --git a/packages/google-cloud-translate/system-test/.eslintrc.yml b/packages/google-cloud-translate/system-test/.eslintrc.yml new file mode 100644 index 00000000000..f9605165c0f --- /dev/null +++ b/packages/google-cloud-translate/system-test/.eslintrc.yml @@ -0,0 +1,5 @@ +--- +env: + mocha: true +rules: + no-console: off diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..3c0ba06fc4a --- /dev/null +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2019 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const translation = require('@google-cloud/translate'); + +function main() { + const translationServiceClient = new translation.TranslationServiceClient(); + console.log('translationServiceClient was created!'); +} + +main(); diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..96dcfd2b847 --- /dev/null +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,26 @@ +// Copyright 2019 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {TranslationServiceClient} from '@google-cloud/translate'; + +function main() { + const translationServiceClient = new TranslationServiceClient(); + console.log("translationServiceClient was created!"); +} + +main(); diff --git a/packages/google-cloud-translate/system-test/install.ts b/packages/google-cloud-translate/system-test/install.ts new file mode 100644 index 00000000000..2736aee84f7 --- /dev/null +++ b/packages/google-cloud-translate/system-test/install.ts @@ -0,0 +1,50 @@ +// Copyright 2019 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; + +describe('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); + + it('should have correct type signature for javascript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); +}); diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts index 98c05937708..530c57b3d9e 100644 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts @@ -16,21 +16,24 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -'use strict'; - -const assert = require('assert'); -const translationServiceModule = require('../src'); +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +const translationserviceModule = require('../src'); const FAKE_STATUS_CODE = 1; class FakeError { + name: string; + message: string; code: number; constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; this.code = n; } } const error = new FakeError(FAKE_STATUS_CODE); export interface Callback { - (err: FakeError | null, response?: {} | null): {}; + (err: FakeError | null, response?: {} | null): void; } export class Operation { @@ -78,37 +81,37 @@ function mockLongRunningGrpcMethod( describe('TranslationServiceClient', () => { it('has servicePath', () => { const servicePath = - translationServiceModule.v3.TranslationServiceClient.servicePath; + translationserviceModule.v3.TranslationServiceClient.servicePath; assert(servicePath); }); it('has apiEndpoint', () => { const apiEndpoint = - translationServiceModule.v3.TranslationServiceClient.apiEndpoint; + translationserviceModule.v3.TranslationServiceClient.apiEndpoint; assert(apiEndpoint); }); it('has port', () => { - const port = translationServiceModule.v3.TranslationServiceClient.port; + const port = translationserviceModule.v3.TranslationServiceClient.port; assert(port); assert(typeof port === 'number'); }); it('should create a client with no option', () => { - const client = new translationServiceModule.v3.TranslationServiceClient(); + const client = new translationserviceModule.v3.TranslationServiceClient(); assert(client); }); it('should create a client with gRPC option', () => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ fallback: true, }); assert(client); }); describe('translateText', () => { it('invokes translateText without error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -125,12 +128,12 @@ describe('TranslationServiceClient', () => { }); it('invokes translateText with error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -149,12 +152,12 @@ describe('TranslationServiceClient', () => { }); describe('detectLanguage', () => { it('invokes detectLanguage without error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -171,12 +174,12 @@ describe('TranslationServiceClient', () => { }); it('invokes detectLanguage with error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -195,12 +198,12 @@ describe('TranslationServiceClient', () => { }); describe('getSupportedLanguages', () => { it('invokes getSupportedLanguages without error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -217,12 +220,12 @@ describe('TranslationServiceClient', () => { }); it('invokes getSupportedLanguages with error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -241,12 +244,12 @@ describe('TranslationServiceClient', () => { }); describe('getGlossary', () => { it('invokes getGlossary without error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -263,12 +266,12 @@ describe('TranslationServiceClient', () => { }); it('invokes getGlossary with error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -287,12 +290,12 @@ describe('TranslationServiceClient', () => { }); describe('batchTranslateText', () => { it('invokes batchTranslateText without error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -316,12 +319,12 @@ describe('TranslationServiceClient', () => { }); it('invokes batchTranslateText with error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -348,12 +351,12 @@ describe('TranslationServiceClient', () => { }); describe('createGlossary', () => { it('invokes createGlossary without error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -377,12 +380,12 @@ describe('TranslationServiceClient', () => { }); it('invokes createGlossary with error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -409,12 +412,12 @@ describe('TranslationServiceClient', () => { }); describe('deleteGlossary', () => { it('invokes deleteGlossary without error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -438,12 +441,12 @@ describe('TranslationServiceClient', () => { }); it('invokes deleteGlossary with error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest = {}; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -470,12 +473,12 @@ describe('TranslationServiceClient', () => { }); describe('listGlossaries', () => { it('invokes listGlossaries without error', done => { - const client = new translationServiceModule.v3.TranslationServiceClient({ + const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const request = {}; + const request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest = {}; // Mock response const expectedResponse = {}; // Mock Grpc layer @@ -494,4 +497,35 @@ describe('TranslationServiceClient', () => { }); }); }); + describe('listGlossariesStream', () => { + it('invokes listGlossariesStream without error', done => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listGlossaries = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listGlossariesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); }); diff --git a/packages/google-cloud-translate/tsconfig.json b/packages/google-cloud-translate/tsconfig.json index 32d9ad48a12..613d35597b5 100644 --- a/packages/google-cloud-translate/tsconfig.json +++ b/packages/google-cloud-translate/tsconfig.json @@ -1,14 +1,19 @@ { "extends": "./node_modules/gts/tsconfig-google.json", "compilerOptions": { - "lib": ["es2016", "dom"], "rootDir": ".", "outDir": "build", - "resolveJsonModule": true + "resolveJsonModule": true, + "lib": [ + "es2016", + "dom" + ] }, "include": [ "src/*.ts", + "src/**/*.ts", "test/*.ts", + "test/**/*.ts", "system-test/*.ts" ] } diff --git a/packages/google-cloud-translate/tslint.json b/packages/google-cloud-translate/tslint.json index b3bfaf59207..617dc975bae 100644 --- a/packages/google-cloud-translate/tslint.json +++ b/packages/google-cloud-translate/tslint.json @@ -1,6 +1,3 @@ { - "extends": "gts/tslint.json", - "rules": { - "ban-ts-ignore": false - } + "extends": "gts/tslint.json" } diff --git a/packages/google-cloud-translate/webpack.config.js b/packages/google-cloud-translate/webpack.config.js index 7eeb99c5e5b..83505312e83 100644 --- a/packages/google-cloud-translate/webpack.config.js +++ b/packages/google-cloud-translate/webpack.config.js @@ -12,11 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +const path = require('path'); + module.exports = { - entry: './src/browser.js', + entry: './src/index.ts', output: { - library: 'translate', - filename: './translate.js', + library: 'TranslationService', + filename: './translation-service.js', }, node: { child_process: 'empty', @@ -24,20 +26,36 @@ module.exports = { crypto: 'empty', }, resolve: { - extensions: ['.js', '.json'], + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], }, module: { rules: [ { - test: /node_modules[\\/]retry-request[\\/]/, + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, use: 'null-loader', }, { - test: /node_modules[\\/]https-proxy-agent[\\/]/, + test: /node_modules[\\/]https-proxy-agent/, use: 'null-loader', }, { - test: /node_modules[\\/]gtoken[\\/]/, + test: /node_modules[\\/]gtoken/, use: 'null-loader', }, ], From a74837dc5a574c0d6f8338c23c7af1261840ac4f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 20 Nov 2019 19:50:14 +0100 Subject: [PATCH 297/513] fix(deps): update dependency yargs to v15 (#386) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 524f49c2b8f..3fb133a0100 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -18,7 +18,7 @@ "@google-cloud/text-to-speech": "^1.1.4", "@google-cloud/translate": "^5.0.2", "@google-cloud/vision": "^1.2.0", - "yargs": "^14.0.0" + "yargs": "^15.0.0" }, "devDependencies": { "@google-cloud/storage": "^4.0.0", From d0af49766ce24a17cab0d0d25455010160461510 Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Wed, 20 Nov 2019 13:55:00 -0800 Subject: [PATCH 298/513] chore: update synth.py to pass package name --- packages/google-cloud-translate/synth.metadata | 6 +++--- packages/google-cloud-translate/synth.py | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 5d3b33b70be..6d535140d16 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2019-11-19T19:14:34.278318Z", + "updateTime": "2019-11-20T20:59:24.452560Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5af83f47b9656261cafcf88b0b3334521ab266b3", - "internalRef": "281334391" + "sha": "16543773103e2619d2b5f52456264de5bb9be104", + "internalRef": "281423227" } }, { diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py index d447aba8beb..9fef1c0f882 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/synth.py @@ -26,7 +26,8 @@ library = gapic.typescript_library( 'translate', generator_args={ - "grpc-service-config": "google/cloud/translate/v3/translate_grpc_service_config.json" + "grpc-service-config": "google/cloud/translate/v3/translate_grpc_service_config.json", + "package-name":"@google-cloud/translate" }, version=version) s.copy(library, excludes=['README.md', 'package.json', 'src/index.ts']) @@ -44,9 +45,6 @@ 'toISOString)') # [END fix-dead-link] -s.replace("system-test/fixtures/sample/src/index.js", "'translation'", "'@google-cloud/translate'") -s.replace("system-test/fixtures/sample/src/index.ts", "'translation'", "'@google-cloud/translate'") - logging.basicConfig(level=logging.DEBUG) common_templates = gcp.CommonTemplates() templates = common_templates.node_library(source_location='build/src') From af13f041ead5920dbda05a779c48ccb6bbf19517 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 21 Nov 2019 23:27:08 -0800 Subject: [PATCH 299/513] feat: convert v3beta1 to TypeScript (#389) * feat: convert v3beta1 to TypeScript * fix: gts fix * fix: no npx --- packages/google-cloud-translate/package.json | 9 +- .../google/cloud/common_resources.proto | 68 + .../google-cloud-translate/protos/protos.d.ts | 30 + .../google-cloud-translate/protos/protos.js | 104 +- .../google-cloud-translate/protos/protos.json | 14 + packages/google-cloud-translate/src/index.ts | 67 +- .../src/v3/translation_service_client.ts | 73 + .../v3beta1/doc_translation_service.js | 931 ----------- .../doc/google/longrunning/doc_operations.js | 63 - .../v3beta1/doc/google/protobuf/doc_any.js | 137 -- .../doc/google/protobuf/doc_timestamp.js | 117 -- .../src/v3beta1/doc/google/rpc/doc_status.js | 95 -- .../src/v3beta1/{index.js => index.ts} | 10 +- ...lient.js => translation_service_client.ts} | 1470 +++++++++-------- .../translation_service_client_config.json | 24 +- .../google-cloud-translate/synth.metadata | 15 +- packages/google-cloud-translate/synth.py | 27 +- .../system-test/.eslintrc.yml | 3 +- .../system-test/fixtures/sample/src/index.js | 1 - .../system-test/fixtures/sample/src/index.ts | 1 - .../test/gapic-translation_service-v3beta1.ts | 565 +++++++ .../test/gapic-v3beta1.js | 709 -------- 22 files changed, 1672 insertions(+), 2861 deletions(-) create mode 100644 packages/google-cloud-translate/protos/google/cloud/common_resources.proto delete mode 100644 packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js delete mode 100644 packages/google-cloud-translate/src/v3beta1/doc/google/longrunning/doc_operations.js delete mode 100644 packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js delete mode 100644 packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js delete mode 100644 packages/google-cloud-translate/src/v3beta1/doc/google/rpc/doc_status.js rename packages/google-cloud-translate/src/v3beta1/{index.js => index.ts} (68%) rename packages/google-cloud-translate/src/v3beta1/{translation_service_client.js => translation_service_client.ts} (50%) create mode 100644 packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts delete mode 100644 packages/google-cloud-translate/test/gapic-v3beta1.js diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 98e5facce7a..ce6c5a6fd80 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -30,14 +30,11 @@ "scripts": { "docs": "jsdoc -c .jsdoc.js", "predocs": "npm run compile", - "lint": "npm run check && eslint '**/*.js'", + "lint": "gts check && eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha build/system-test --timeout 600000", "test": "c8 mocha build/test", - "check": "gts check", - "clean": "gts clean", - "compile": "tsc -p . && npm run copy-js", - "copy-js": "cp -r src/v3beta1 build/src/ && cp -r protos build/ && cp test/*.js build/test", + "compile": "tsc -p . && cp -r protos build/", "fix": "gts fix && eslint --fix '**/*.js'", "prepare": "npm run compile", "pretest": "npm run compile", @@ -50,7 +47,7 @@ "@google-cloud/promisify": "^1.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^1.7.5", + "google-gax": "^1.11.1", "is": "^3.2.1", "is-html": "^2.0.0", "protobufjs": "^6.8.8" diff --git a/packages/google-cloud-translate/protos/google/cloud/common_resources.proto b/packages/google-cloud-translate/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..5d795bff1b8 --- /dev/null +++ b/packages/google-cloud-translate/protos/google/cloud/common_resources.proto @@ -0,0 +1,68 @@ +// Copyright 2019 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. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +message Project { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" + }; + + string name = 1; +} + +message Organization { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" + }; + + string name = 1; +} + +message Folder { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" + }; + + string name = 1; +} + +message BillingAccount { + option (google.api.resource) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" + }; + + string name = 1; +} + +message Location { + option (google.api.resource) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" + }; + + string name = 1; +} diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index c9915730c95..1ae026a4f64 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -1,3 +1,18 @@ +// Copyright 2019 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. + +import * as Long from "long"; import * as $protobuf from "protobufjs"; /** Namespace google. */ export namespace google { @@ -6774,6 +6789,12 @@ export namespace google { /** ResourceDescriptor history */ history?: (google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); } /** Represents a ResourceDescriptor. */ @@ -6797,6 +6818,12 @@ export namespace google { /** ResourceDescriptor history. */ public history: google.api.ResourceDescriptor.History; + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + /** * Creates a new ResourceDescriptor instance using the specified properties. * @param [properties] Properties to set @@ -8533,6 +8560,9 @@ export namespace google { /** FileOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); } /** Represents a FileOptions. */ diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index 724b91d7d34..3bf1543a509 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -1,3 +1,17 @@ +// Copyright 2019 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. + /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ (function(global, factory) { /* global define, require, module */ @@ -16442,6 +16456,8 @@ * @property {Array.|null} [pattern] ResourceDescriptor pattern * @property {string|null} [nameField] ResourceDescriptor nameField * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular */ /** @@ -16492,6 +16508,22 @@ */ ResourceDescriptor.prototype.history = 0; + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + /** * Creates a new ResourceDescriptor instance using the specified properties. * @function create @@ -16525,6 +16557,10 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); if (message.history != null && message.hasOwnProperty("history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; @@ -16573,6 +16609,12 @@ case 4: message.history = reader.int32(); break; + case 5: + message.plural = reader.string(); + break; + case 6: + message.singular = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -16630,6 +16672,12 @@ case 2: break; } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; return null; }; @@ -16670,6 +16718,10 @@ message.history = 2; break; } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); return message; }; @@ -16692,6 +16744,8 @@ object.type = ""; object.nameField = ""; object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; } if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; @@ -16704,6 +16758,10 @@ object.nameField = message.nameField; if (message.history != null && message.hasOwnProperty("history")) object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; return object; }; @@ -21118,6 +21176,7 @@ * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace * @property {string|null} [rubyPackage] FileOptions rubyPackage * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition */ /** @@ -21130,6 +21189,7 @@ */ function FileOptions(properties) { this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21304,6 +21364,14 @@ */ FileOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + /** * Creates a new FileOptions instance using the specified properties. * @function create @@ -21371,6 +21439,9 @@ if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -21470,6 +21541,11 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; + case 1053: + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -21580,6 +21656,15 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } return null; }; @@ -21657,6 +21742,16 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } return message; }; @@ -21673,8 +21768,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } if (options.defaults) { object.javaPackage = ""; object.javaOuterClassname = ""; @@ -21742,6 +21839,11 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } return object; }; diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index 38a285d9036..f4f8d5076a9 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -1683,6 +1683,12 @@ "id": 1055, "extend": "google.protobuf.FieldOptions" }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, "resource": { "type": "google.api.ResourceDescriptor", "id": 1053, @@ -1706,6 +1712,14 @@ "history": { "type": "History", "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 } }, "nested": { diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 7a6c4b12fbf..af42f24bb15 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -14,54 +14,34 @@ * limitations under the License. */ -/** - * @namespace v2 - */ -/** - * @namespace google.cloud.translation.v3beta1 - */ -/** - * @namespace google.longrunning - */ -/** - * @namespace google.rpc - */ -/** - * @namespace google.protobuf - */ -const v3beta1 = require('./v3beta1'); import * as v2 from './v2'; /** * The `@google-cloud/translate` package has the following named exports: * - * - `{@link Translate}` class - constructor for v2 of the Translation API. - * See {@link Translate} and {@link ClientConfig} for client methods and - * configuration options. Provides TypeScript types out-of-the-box. + * - `{@link TranslationServiceClient}` class - constructor for v3 of the Translation API. + * See {@link v3.TranslationServiceClient} for client methods. + * - `v3` - client for the v3 backend service version. It exports: + * - `TranslationServiceClient` - Reference to {@link v3.TranslationServiceClient} * - `v3beta1` - client for the v3beta1 backend service version. It exports: - * - `TranslationServiceClient` - Reference to {@link - * v3beta1.TranslationServiceClient} - * + * - `TranslationServiceClient` - Reference to {@link v3beta1.TranslationServiceClient} + * - `v2` - client for the v2 backend service version. It exports: + * - `Translate` - Reference to {@link v2.Translate} * * @module {constructor} @google-cloud/translate * @alias nodejs-translate * - * @example Install the v2 client library with npm: npm install --save - * @google-cloud/translate + * @example Install the v3 client library with npm: + * npm install --save @google-cloud/translate * - * @example Import the v2 client library: - * const {Translate} = require('@google-cloud/translate'); + * @example Import the v3 client library: + * const {TranslationServiceClient} = require('@google-cloud/translate'); * - * @example Create a v2 client that uses Create a v3 client that uses Application Default Credentials - * (ADC): const client = new Translate(); - * - * @example Create a v2 client with explicit credentials: const client - * = new Translate({ projectId: 'your-project-id', keyFilename: - * '/path/to/keyfile.json', - * }); + * (ADC): + * const client = new TranslationServiceClient(); * * @example include:samples/quickstart.js * region_tag:translate_quickstart @@ -74,12 +54,17 @@ import * as v2 from './v2'; * const {TranslationServiceClient} = * require('@google-cloud/translate').v3beta1; */ +import * as v3beta1 from './v3beta1'; import * as v3 from './v3'; export * from './v3'; -/** - * @type {object} - * @property {constructor} TranslationServiceClient - * Reference to {@link v3beta1.TranslationServiceClient} - */ -export {v2, v3beta1, v3}; +const TranslationServiceClient = v3.TranslationServiceClient; +export {TranslationServiceClient, v2, v3beta1, v3}; +// For compatibility with JavaScript libraries we need to provide this default export: +// tslint:disable-next-line no-default-export +export default { + v2, + v3beta1, + v3, + TranslationServiceClient, +}; diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 07b4cb78415..cfc517bfefb 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -143,6 +143,9 @@ export class TranslationServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { + locationPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), glossaryPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/glossaries/{glossary}' ), @@ -1226,6 +1229,52 @@ export class TranslationServiceClient { // -------------------- // -- Path templates -- // -------------------- + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this._pathTemplates.locationPathTemplate.render({ + project, + location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this._pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this._pathTemplates.locationPathTemplate.match(locationName) + .location; + } + + /** + * Return a fully-qualified glossary resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} glossary + * @returns {string} Resource name string. + */ glossaryPath(project: string, location: string, glossary: string) { return this._pathTemplates.glossaryPathTemplate.render({ project, @@ -1233,13 +1282,37 @@ export class TranslationServiceClient { glossary, }); } + + /** + * Parse the project from Glossary resource. + * + * @param {string} glossaryName + * A fully-qualified path representing Glossary resource. + * @returns {string} A string representing the project. + */ matchProjectFromGlossaryName(glossaryName: string) { return this._pathTemplates.glossaryPathTemplate.match(glossaryName).project; } + + /** + * Parse the location from Glossary resource. + * + * @param {string} glossaryName + * A fully-qualified path representing Glossary resource. + * @returns {string} A string representing the location. + */ matchLocationFromGlossaryName(glossaryName: string) { return this._pathTemplates.glossaryPathTemplate.match(glossaryName) .location; } + + /** + * Parse the glossary from Glossary resource. + * + * @param {string} glossaryName + * A fully-qualified path representing Glossary resource. + * @returns {string} A string representing the glossary. + */ matchGlossaryFromGlossaryName(glossaryName: string) { return this._pathTemplates.glossaryPathTemplate.match(glossaryName) .glossary; diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js b/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js deleted file mode 100644 index b0fbadc02bf..00000000000 --- a/packages/google-cloud-translate/src/v3beta1/doc/google/cloud/translation/v3beta1/doc_translation_service.js +++ /dev/null @@ -1,931 +0,0 @@ -// Copyright 2019 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 -// -// https://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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Configures which glossary should be used for a specific target language, - * and defines options for applying that glossary. - * - * @property {string} glossary - * Required. Specifies the glossary used for this translation. Use - * this format: projects/* /locations/* /glossaries/* - * - * @property {boolean} ignoreCase - * Optional. Indicates match is case-insensitive. - * Default value is false if missing. - * - * @typedef TranslateTextGlossaryConfig - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.TranslateTextGlossaryConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const TranslateTextGlossaryConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for synchronous translation. - * - * @property {string[]} contents - * Required. The content of the input in string format. - * We recommend the total content be less than 30k codepoints. - * Use BatchTranslateText for larger text. - * - * @property {string} mimeType - * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type defaults to "text/html". - * - * @property {string} sourceLanguageCode - * Optional. The BCP-47 language code of the input text if - * known, for example, "en-US" or "sr-Latn". Supported language codes are - * listed in Language Support. If the source language isn't specified, the API - * attempts to identify the source language automatically and returns the - * source language within the response. - * - * @property {string} targetLanguageCode - * Required. The BCP-47 language code to use for translation of the input - * text, set to one of the language codes listed in Language Support. - * - * @property {string} parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-id}` or - * `projects/{project-id}/locations/{location-id}`. - * - * For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. - * - * Non-global location is required for requests using AutoML models or - * custom glossaries. - * - * Models and glossaries must be within the same region (have same - * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - * - * @property {string} model - * Optional. The `model` type requested for this translation. - * - * The format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` - * - * - * For global (non-regionalized) requests, use `location-id` `global`. - * For example, - * `projects/{project-id}/locations/global/models/general/nmt`. - * - * If missing, the system decides which google base model to use. - * - * @property {Object} glossaryConfig - * Optional. Glossary to be applied. The glossary must be - * within the same region (have the same location-id) as the model, otherwise - * an INVALID_ARGUMENT (400) error is returned. - * - * This object should have the same structure as [TranslateTextGlossaryConfig]{@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} - * - * @property {Object.} labels - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * - * @typedef TranslateTextRequest - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.TranslateTextRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const TranslateTextRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * @property {Object[]} translations - * Text translation responses with no glossary applied. - * This field has the same length as - * `contents`. - * - * This object should have the same structure as [Translation]{@link google.cloud.translation.v3beta1.Translation} - * - * @property {Object[]} glossaryTranslations - * Text translation responses if a glossary is provided in the request. - * This can be the same as - * `translations` if no terms apply. - * This field has the same length as - * `contents`. - * - * This object should have the same structure as [Translation]{@link google.cloud.translation.v3beta1.Translation} - * - * @typedef TranslateTextResponse - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.TranslateTextResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const TranslateTextResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A single translation response. - * - * @property {string} translatedText - * Text translated into the target language. - * - * @property {string} model - * Only present when `model` is present in the request. - * This is same as `model` provided in the request. - * - * @property {string} detectedLanguageCode - * The BCP-47 language code of source text in the initial request, detected - * automatically, if no source language was passed within the initial - * request. If the source language was passed, auto-detection of the language - * does not occur and this field is empty. - * - * @property {Object} glossaryConfig - * The `glossary_config` used for this translation. - * - * This object should have the same structure as [TranslateTextGlossaryConfig]{@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} - * - * @typedef Translation - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.Translation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const Translation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for language detection. - * - * @property {string} parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-id}/locations/{location-id}` or - * `projects/{project-id}`. - * - * For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. - * - * Only models within the same region (has same location-id) can be used. - * Otherwise an INVALID_ARGUMENT (400) error is returned. - * - * @property {string} model - * Optional. The language detection model to be used. - * - * Format: - * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` - * - * Only one language detection model is currently supported: - * `projects/{project-id}/locations/{location-id}/models/language-detection/default`. - * - * If not specified, the default model is used. - * - * @property {string} content - * The content of the input stored as a string. - * - * @property {string} mimeType - * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type defaults to "text/html". - * - * @property {Object.} labels - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * - * @typedef DetectLanguageRequest - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.DetectLanguageRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const DetectLanguageRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The response message for language detection. - * - * @property {string} languageCode - * The BCP-47 language code of source content in the request, detected - * automatically. - * - * @property {number} confidence - * The confidence of the detection result for this language. - * - * @typedef DetectedLanguage - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.DetectedLanguage definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const DetectedLanguage = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The response message for language detection. - * - * @property {Object[]} languages - * A list of detected languages sorted by detection confidence in descending - * order. The most probable language first. - * - * This object should have the same structure as [DetectedLanguage]{@link google.cloud.translation.v3beta1.DetectedLanguage} - * - * @typedef DetectLanguageResponse - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.DetectLanguageResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const DetectLanguageResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for discovering supported languages. - * - * @property {string} parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-id}` or - * `projects/{project-id}/locations/{location-id}`. - * - * For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. - * - * Non-global location is required for AutoML models. - * - * Only models within the same region (have same location-id) can be used, - * otherwise an INVALID_ARGUMENT (400) error is returned. - * - * @property {string} displayLanguageCode - * Optional. The language to use to return localized, human readable names - * of supported languages. If missing, then display names are not returned - * in a response. - * - * @property {string} model - * Optional. Get supported languages of this model. - * - * The format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` - * - * - * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. - * - * @typedef GetSupportedLanguagesRequest - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.GetSupportedLanguagesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const GetSupportedLanguagesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The response message for discovering supported languages. - * - * @property {Object[]} languages - * A list of supported language responses. This list contains an entry - * for each language the Translation API supports. - * - * This object should have the same structure as [SupportedLanguage]{@link google.cloud.translation.v3beta1.SupportedLanguage} - * - * @typedef SupportedLanguages - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.SupportedLanguages definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const SupportedLanguages = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A single supported language response corresponds to information related - * to one supported language. - * - * @property {string} languageCode - * Supported language code, generally consisting of its ISO 639-1 - * identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes - * including language and region identifiers are returned (for example, - * 'zh-TW' and 'zh-CN') - * - * @property {string} displayName - * Human readable name of the language localized in the display language - * specified in the request. - * - * @property {boolean} supportSource - * Can be used as source language. - * - * @property {boolean} supportTarget - * Can be used as target language. - * - * @typedef SupportedLanguage - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.SupportedLanguage definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const SupportedLanguage = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The Google Cloud Storage location for the input content. - * - * @property {string} inputUri - * Required. Source data URI. For example, `gs://my_bucket/my_object`. - * - * @typedef GcsSource - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.GcsSource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const GcsSource = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Input configuration for BatchTranslateText request. - * - * @property {string} mimeType - * Optional. Can be "text/plain" or "text/html". - * For `.tsv`, "text/html" is used if mime_type is missing. - * For `.html`, this field must be "text/html" or empty. - * For `.txt`, this field must be "text/plain" or empty. - * - * @property {Object} gcsSource - * Required. Google Cloud Storage location for the source input. - * This can be a single file (for example, - * `gs://translation-test/input.tsv`) or a wildcard (for example, - * `gs://translation-test/*`). If a file extension is `.tsv`, it can - * contain either one or two columns. The first column (optional) is the id - * of the text request. If the first column is missing, we use the row - * number (0-based) from the input file as the ID in the output file. The - * second column is the actual text to be - * translated. We recommend each row be <= 10K Unicode codepoints, - * otherwise an error might be returned. - * Note that the input tsv must be RFC 4180 compliant. - * - * You could use https://github.com/Clever/csvlint to check potential - * formatting errors in your tsv file. - * csvlint --delimiter='\t' your_input_file.tsv - * - * The other supported file extensions are `.txt` or `.html`, which is - * treated as a single large chunk of text. - * - * This object should have the same structure as [GcsSource]{@link google.cloud.translation.v3beta1.GcsSource} - * - * @typedef InputConfig - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.InputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const InputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The Google Cloud Storage location for the output content. - * - * @property {string} outputUriPrefix - * Required. There must be no files under 'output_uri_prefix'. - * 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an - * INVALID_ARGUMENT (400) error is returned. - * - * @typedef GcsDestination - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const GcsDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Output configuration for BatchTranslateText request. - * - * @property {Object} gcsDestination - * Google Cloud Storage destination for output content. - * For every single input file (for example, gs://a/b/c.[extension]), we - * generate at most 2 * n output files. (n is the # of target_language_codes - * in the BatchTranslateTextRequest). - * - * Output files (tsv) generated are compliant with RFC 4180 except that - * record delimiters are '\n' instead of '\r\n'. We don't provide any way to - * change record delimiters. - * - * While the input files are being processed, we write/update an index file - * 'index.csv' under 'output_uri_prefix' (for example, - * gs://translation-test/index.csv) The index file is generated/updated as - * new files are being translated. The format is: - * - * input_file,target_language_code,translations_file,errors_file, - * glossary_translations_file,glossary_errors_file - * - * input_file is one file we matched using gcs_source.input_uri. - * target_language_code is provided in the request. - * translations_file contains the translations. (details provided below) - * errors_file contains the errors during processing of the file. (details - * below). Both translations_file and errors_file could be empty - * strings if we have no content to output. - * glossary_translations_file and glossary_errors_file are always empty - * strings if the input_file is tsv. They could also be empty if we have no - * content to output. - * - * Once a row is present in index.csv, the input/output matching never - * changes. Callers should also expect all the content in input_file are - * processed and ready to be consumed (that is, no partial output file is - * written). - * - * The format of translations_file (for target language code 'trg') is: - * gs://translation_test/a_b_c_'trg'_translations.[extension] - * - * If the input file extension is tsv, the output has the following - * columns: - * Column 1: ID of the request provided in the input, if it's not - * provided in the input, then the input row number is used (0-based). - * Column 2: source sentence. - * Column 3: translation without applying a glossary. Empty string if there - * is an error. - * Column 4 (only present if a glossary is provided in the request): - * translation after applying the glossary. Empty string if there is an - * error applying the glossary. Could be same string as column 3 if there is - * no glossary applied. - * - * If input file extension is a txt or html, the translation is directly - * written to the output file. If glossary is requested, a separate - * glossary_translations_file has format of - * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] - * - * The format of errors file (for target language code 'trg') is: - * gs://translation_test/a_b_c_'trg'_errors.[extension] - * - * If the input file extension is tsv, errors_file contains the following: - * Column 1: ID of the request provided in the input, if it's not - * provided in the input, then the input row number is used (0-based). - * Column 2: source sentence. - * Column 3: Error detail for the translation. Could be empty. - * Column 4 (only present if a glossary is provided in the request): - * Error when applying the glossary. - * - * If the input file extension is txt or html, glossary_error_file will be - * generated that contains error details. glossary_error_file has format of - * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] - * - * This object should have the same structure as [GcsDestination]{@link google.cloud.translation.v3beta1.GcsDestination} - * - * @typedef OutputConfig - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const OutputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The batch translation request. - * - * @property {string} parent - * Required. Location to make a call. Must refer to a caller's project. - * - * Format: `projects/{project-id}/locations/{location-id}`. - * - * The `global` location is not supported for batch translation. - * - * Only AutoML Translation models or glossaries within the same region (have - * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - * error is returned. - * - * @property {string} sourceLanguageCode - * Required. Source language code. - * - * @property {string[]} targetLanguageCodes - * Required. Specify up to 10 language codes here. - * - * @property {Object.} models - * Optional. The models to use for translation. Map's key is target language - * code. Map's value is model name. Value can be a built-in general model, - * or an AutoML Translation model. - * - * The value format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` - * - * - * If the map is empty or a specific model is - * not requested for a language pair, then default google model (nmt) is used. - * - * @property {Object[]} inputConfigs - * Required. Input configurations. - * The total number of files matched should be <= 1000. - * The total content size should be <= 100M Unicode codepoints. - * The files must use UTF-8 encoding. - * - * This object should have the same structure as [InputConfig]{@link google.cloud.translation.v3beta1.InputConfig} - * - * @property {Object} outputConfig - * Required. Output configuration. - * If 2 input configs match to the same file (that is, same input path), - * we don't generate output for duplicate inputs. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.translation.v3beta1.OutputConfig} - * - * @property {Object.} glossaries - * Optional. Glossaries to be applied for translation. - * It's keyed by target language code. - * - * @property {Object.} labels - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * - * @typedef BatchTranslateTextRequest - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.BatchTranslateTextRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const BatchTranslateTextRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * State metadata for the batch translation operation. - * - * @property {number} state - * The state of the operation. - * - * The number should be among the values of [State]{@link google.cloud.translation.v3beta1.State} - * - * @property {number} translatedCharacters - * Number of successfully translated characters so far (Unicode codepoints). - * - * @property {number} failedCharacters - * Number of characters that have failed to process so far (Unicode - * codepoints). - * - * @property {number} totalCharacters - * Total number of characters (Unicode codepoints). - * This is the total number of codepoints from input files times the number of - * target languages and appears here shortly after the call is submitted. - * - * @property {Object} submitTime - * Time when the operation was submitted. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef BatchTranslateMetadata - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.BatchTranslateMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const BatchTranslateMetadata = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Stored in the google.longrunning.Operation.response field returned by - * BatchTranslateText if at least one sentence is translated successfully. - * - * @property {number} totalCharacters - * Total number of characters (Unicode codepoints). - * - * @property {number} translatedCharacters - * Number of successfully translated characters (Unicode codepoints). - * - * @property {number} failedCharacters - * Number of characters that have failed to process (Unicode codepoints). - * - * @property {Object} submitTime - * Time when the operation was submitted. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} endTime - * The time when the operation is finished and - * google.longrunning.Operation.done is set to true. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef BatchTranslateResponse - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.BatchTranslateResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const BatchTranslateResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Input configuration for glossaries. - * - * @property {Object} gcsSource - * Required. Google Cloud Storage location of glossary data. - * File format is determined based on the filename extension. API returns - * [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file - * formats. Wildcards are not allowed. This must be a single file in one of - * the following formats: - * - * For unidirectional glossaries: - * - * - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. - * The first column is source text. The second column is target text. - * The file must not contain headers. That is, the first row is data, not - * column names. - * - * - TMX (`.tmx`): TMX file with parallel data defining source/target term - * pairs. - * - * For equivalent term sets glossaries: - * - * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). - * - * This object should have the same structure as [GcsSource]{@link google.cloud.translation.v3beta1.GcsSource} - * - * @typedef GlossaryInputConfig - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.GlossaryInputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const GlossaryInputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Represents a glossary built from user provided data. - * - * @property {string} name - * Required. The resource name of the glossary. Glossary names have the form - * `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`. - * - * @property {Object} languagePair - * Used with unidirectional glossaries. - * - * This object should have the same structure as [LanguageCodePair]{@link google.cloud.translation.v3beta1.LanguageCodePair} - * - * @property {Object} languageCodesSet - * Used with equivalent term set glossaries. - * - * This object should have the same structure as [LanguageCodesSet]{@link google.cloud.translation.v3beta1.LanguageCodesSet} - * - * @property {Object} inputConfig - * Required. Provides examples to build the glossary from. - * Total glossary must not exceed 10M Unicode codepoints. - * - * This object should have the same structure as [GlossaryInputConfig]{@link google.cloud.translation.v3beta1.GlossaryInputConfig} - * - * @property {number} entryCount - * Output only. The number of entries defined in the glossary. - * - * @property {Object} submitTime - * Output only. When CreateGlossary was called. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} endTime - * Output only. When the glossary creation was finished. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef Glossary - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.Glossary definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const Glossary = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Used with unidirectional glossaries. - * - * @property {string} sourceLanguageCode - * Required. The BCP-47 language code of the input text, for example, - * "en-US". Expected to be an exact match for GlossaryTerm.language_code. - * - * @property {string} targetLanguageCode - * Required. The BCP-47 language code for translation output, for example, - * "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. - * - * @typedef LanguageCodePair - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.Glossary.LanguageCodePair definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ - LanguageCodePair: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Used with equivalent term set glossaries. - * - * @property {string[]} languageCodes - * The BCP-47 language code(s) for terms defined in the glossary. - * All entries are unique. The list contains at least two entries. - * Expected to be an exact match for GlossaryTerm.language_code. - * - * @typedef LanguageCodesSet - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.Glossary.LanguageCodesSet definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ - LanguageCodesSet: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Request message for CreateGlossary. - * - * @property {string} parent - * Required. The project name. - * - * @property {Object} glossary - * Required. The glossary to create. - * - * This object should have the same structure as [Glossary]{@link google.cloud.translation.v3beta1.Glossary} - * - * @typedef CreateGlossaryRequest - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.CreateGlossaryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const CreateGlossaryRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for GetGlossary. - * - * @property {string} name - * Required. The name of the glossary to retrieve. - * - * @typedef GetGlossaryRequest - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.GetGlossaryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const GetGlossaryRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for DeleteGlossary. - * - * @property {string} name - * Required. The name of the glossary to delete. - * - * @typedef DeleteGlossaryRequest - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.DeleteGlossaryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const DeleteGlossaryRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for ListGlossaries. - * - * @property {string} parent - * Required. The name of the project from which to list all of the glossaries. - * - * @property {number} pageSize - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * - * @property {string} pageToken - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * - * @property {string} filter - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * - * @typedef ListGlossariesRequest - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.ListGlossariesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const ListGlossariesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for ListGlossaries. - * - * @property {Object[]} glossaries - * The list of glossaries for a project. - * - * This object should have the same structure as [Glossary]{@link google.cloud.translation.v3beta1.Glossary} - * - * @property {string} nextPageToken - * A token to retrieve a page of results. Pass this value in the - * [ListGlossariesRequest.page_token] field in the subsequent call to - * `ListGlossaries` method to retrieve the next page of results. - * - * @typedef ListGlossariesResponse - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.ListGlossariesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const ListGlossariesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Stored in the google.longrunning.Operation.metadata field returned by - * CreateGlossary. - * - * @property {string} name - * The name of the glossary that is being created. - * - * @property {number} state - * The current state of the glossary creation operation. - * - * The number should be among the values of [State]{@link google.cloud.translation.v3beta1.State} - * - * @property {Object} submitTime - * The time when the operation was submitted to the server. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef CreateGlossaryMetadata - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.CreateGlossaryMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const CreateGlossaryMetadata = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Stored in the google.longrunning.Operation.metadata field returned by - * DeleteGlossary. - * - * @property {string} name - * The name of the glossary that is being deleted. - * - * @property {number} state - * The current state of the glossary deletion operation. - * - * The number should be among the values of [State]{@link google.cloud.translation.v3beta1.State} - * - * @property {Object} submitTime - * The time when the operation was submitted to the server. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef DeleteGlossaryMetadata - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.DeleteGlossaryMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const DeleteGlossaryMetadata = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Stored in the google.longrunning.Operation.response field returned by - * DeleteGlossary. - * - * @property {string} name - * The name of the deleted glossary. - * - * @property {Object} submitTime - * The time when the operation was submitted to the server. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} endTime - * The time when the glossary deletion is finished and - * google.longrunning.Operation.done is set to true. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef DeleteGlossaryResponse - * @memberof google.cloud.translation.v3beta1 - * @see [google.cloud.translation.v3beta1.DeleteGlossaryResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/translate/v3beta1/translation_service.proto} - */ -const DeleteGlossaryResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-translate/src/v3beta1/doc/google/longrunning/doc_operations.js deleted file mode 100644 index 4719aebdc91..00000000000 --- a/packages/google-cloud-translate/src/v3beta1/doc/google/longrunning/doc_operations.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2019 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 -// -// https://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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * This resource represents a long-running operation that is the result of a - * network API call. - * - * @property {string} name - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the - * `name` should have the format of `operations/some/unique/name`. - * - * @property {Object} metadata - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. - * Some services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @property {boolean} done - * If the value is `false`, it means the operation is still in progress. - * If `true`, the operation is completed, and either `error` or `response` is - * available. - * - * @property {Object} error - * The error result of the operation in case of failure or cancellation. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @property {Object} response - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` - * is the original method name. For example, if the original method name - * is `TakeSnapshot()`, the inferred response type is - * `TakeSnapshotResponse`. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Operation - * @memberof google.longrunning - * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const Operation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js deleted file mode 100644 index cdd2fc80e49..00000000000 --- a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_any.js +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2019 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 -// -// https://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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * # JSON - * - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message google.protobuf.Duration): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - * - * @property {string} typeUrl - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a google.protobuf.Type - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * - * @property {Buffer} value - * Must be a valid serialized protocol buffer of the above specified type. - * - * @typedef Any - * @memberof google.protobuf - * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} - */ -const Any = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index c457acc0c7d..00000000000 --- a/packages/google-cloud-translate/src/v3beta1/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2019 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 -// -// https://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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-translate/src/v3beta1/doc/google/rpc/doc_status.js deleted file mode 100644 index 432ab6bb928..00000000000 --- a/packages/google-cloud-translate/src/v3beta1/doc/google/rpc/doc_status.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2019 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 -// -// https://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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - * - Simple to use and understand for most users - * - Flexible enough to meet unexpected needs - * - * # Overview - * - * The `Status` message contains three pieces of data: error code, error - * message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes - * if needed. The error message should be a developer-facing English message - * that helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. - * - * # Language mapping - * - * The `Status` message is the logical representation of the error model, but it - * is not necessarily the actual wire format. When the `Status` message is - * exposed in different client libraries and different wire protocols, it can be - * mapped differently. For example, it will likely be mapped to some exceptions - * in Java, but more likely mapped to some error codes in C. - * - * # Other uses - * - * The error model and the `Status` message can be used in a variety of - * environments, either with or without APIs, to provide a - * consistent developer experience across different environments. - * - * Example uses of this error model include: - * - * - Partial errors. If a service needs to return partial errors to the client, - * it may embed the `Status` in the normal response to indicate the partial - * errors. - * - * - Workflow errors. A typical workflow has multiple steps. Each step may - * have a `Status` message for error reporting. - * - * - Batch operations. If a client uses batch request and batch response, the - * `Status` message should be used directly inside batch response, one for - * each error sub-response. - * - * - Asynchronous operations. If an API call embeds asynchronous operation - * results in its response, the status of those operations should be - * represented directly using the `Status` message. - * - * - Logging. If some API errors are stored in logs, the message `Status` could - * be used directly after any stripping needed for security/privacy reasons. - * - * @property {number} code - * The status code, which should be an enum value of - * google.rpc.Code. - * - * @property {string} message - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized - * by the client. - * - * @property {Object[]} details - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Status - * @memberof google.rpc - * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} - */ -const Status = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-translate/src/v3beta1/index.js b/packages/google-cloud-translate/src/v3beta1/index.ts similarity index 68% rename from packages/google-cloud-translate/src/v3beta1/index.js rename to packages/google-cloud-translate/src/v3beta1/index.ts index 2ee97b83a41..07f3c18ec18 100644 --- a/packages/google-cloud-translate/src/v3beta1/index.js +++ b/packages/google-cloud-translate/src/v3beta1/index.ts @@ -11,9 +11,9 @@ // 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; - -const TranslationServiceClient = require('./translation_service_client'); - -module.exports.TranslationServiceClient = TranslationServiceClient; +export {TranslationServiceClient} from './translation_service_client'; diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts similarity index 50% rename from packages/google-cloud-translate/src/v3beta1/translation_service_client.js rename to packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index bb5c9585d86..04455605067 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.js +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -11,22 +11,43 @@ // 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; +import * as gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; -const gapicConfig = require('./translation_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './translation_service_client_config.json'; -const VERSION = require('../../../package.json').version; +const version = require('../../../package.json').version; /** - * Provides natural language translation operations. - * + * Provides natural language translation operations. * @class * @memberof v3beta1 */ -class TranslationServiceClient { +export class TranslationServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _translationServiceStub: Promise<{[name: string]: Function}>; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + /** * Construct an instance of TranslationServiceClient. * @@ -54,58 +75,55 @@ class TranslationServiceClient { * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof TranslationServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. - opts.scopes = this.constructor.scopes; + opts.scopes = (this.constructor as typeof TranslationServiceClient).scopes; const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; + this.auth = gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = []; - + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); } - clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } - // Load the applicable protos. // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. @@ -125,12 +143,12 @@ class TranslationServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - glossaryPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/glossaries/{glossary}' - ), locationPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), + glossaryPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/glossaries/{glossary}' + ), }; // Some of the methods on this service return "paged" results, @@ -144,50 +162,51 @@ class TranslationServiceClient { ), }; - const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gaxModule.lro({ - auth: gaxGrpc.auth, - grpc: gaxGrpc.grpc, - }).operationsClient(opts); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + const operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); const batchTranslateTextResponse = protoFilesRoot.lookup( - 'google.cloud.translation.v3beta1.BatchTranslateResponse' - ); + '.google.cloud.translation.v3beta1.BatchTranslateResponse' + ) as gax.protobuf.Type; const batchTranslateTextMetadata = protoFilesRoot.lookup( - 'google.cloud.translation.v3beta1.BatchTranslateMetadata' - ); + '.google.cloud.translation.v3beta1.BatchTranslateMetadata' + ) as gax.protobuf.Type; const createGlossaryResponse = protoFilesRoot.lookup( - 'google.cloud.translation.v3beta1.Glossary' - ); + '.google.cloud.translation.v3beta1.Glossary' + ) as gax.protobuf.Type; const createGlossaryMetadata = protoFilesRoot.lookup( - 'google.cloud.translation.v3beta1.CreateGlossaryMetadata' - ); + '.google.cloud.translation.v3beta1.CreateGlossaryMetadata' + ) as gax.protobuf.Type; const deleteGlossaryResponse = protoFilesRoot.lookup( - 'google.cloud.translation.v3beta1.DeleteGlossaryResponse' - ); + '.google.cloud.translation.v3beta1.DeleteGlossaryResponse' + ) as gax.protobuf.Type; const deleteGlossaryMetadata = protoFilesRoot.lookup( - 'google.cloud.translation.v3beta1.DeleteGlossaryMetadata' - ); + '.google.cloud.translation.v3beta1.DeleteGlossaryMetadata' + ) as gax.protobuf.Type; this._descriptors.longrunning = { batchTranslateText: new gaxModule.LongrunningDescriptor( - this.operationsClient, + operationsClient, batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) ), createGlossary: new gaxModule.LongrunningDescriptor( - this.operationsClient, + operationsClient, createGlossaryResponse.decode.bind(createGlossaryResponse), createGlossaryMetadata.decode.bind(createGlossaryMetadata) ), deleteGlossary: new gaxModule.LongrunningDescriptor( - this.operationsClient, + operationsClient, deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata) ), @@ -196,8 +215,8 @@ class TranslationServiceClient { // Put together the default options sent with requests. const defaults = gaxGrpc.constructSettings( 'google.cloud.translation.v3beta1.TranslationService', - gapicConfig, - opts.clientConfig, + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')} ); @@ -208,14 +227,15 @@ class TranslationServiceClient { // Put together the "service stub" for // google.cloud.translation.v3beta1.TranslationService. - const translationServiceStub = gaxGrpc.createStub( + this._translationServiceStub = gaxGrpc.createStub( opts.fallback - ? protos.lookupService( + ? (protos as protobuf.Root).lookupService( 'google.cloud.translation.v3beta1.TranslationService' ) - : protos.google.cloud.translation.v3beta1.TranslationService, + : // tslint:disable-next-line no-any + (protos as any).google.cloud.translation.v3beta1.TranslationService, opts - ); + ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides // and create an API call method for each. @@ -229,21 +249,35 @@ class TranslationServiceClient { 'getGlossary', 'deleteGlossary', ]; + for (const methodName of translationServiceStubMethods) { - const innerCallPromise = translationServiceStub.then( - stub => (...args) => { + const innerCallPromise = this._translationServiceStub.then( + stub => (...args: Array<{}>) => { return stub[methodName].apply(stub, args); }, - err => () => { + (err: Error | null | undefined) => () => { throw err; } ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( + + const apiCall = gaxModule.createApiCall( innerCallPromise, defaults[methodName], this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return apiCall(argument, callOptions, callback); + }; } } @@ -280,19 +314,49 @@ class TranslationServiceClient { ]; } + getProjectId(): Promise; + getProjectId(callback: Callback): void; /** * Return the project ID used by this class. * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId(callback) { - return this.auth.getProjectId(callback); + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); } // ------------------- // -- Service calls -- // ------------------- - + translateText( + request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.translation.v3beta1.ITranslateTextResponse, + ( + | protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest + | undefined + ), + {} | undefined + ] + >; + translateText( + request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3beta1.ITranslateTextResponse, + | protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest + | undefined, + {} | undefined + > + ): void; /** * Translates input text and returns translated text. * @@ -302,6 +366,15 @@ class TranslationServiceClient { * Required. The content of the input in string format. * We recommend the total content be less than 30k codepoints. * Use BatchTranslateText for larger text. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + * @param {string} [request.sourceLanguageCode] + * Optional. The BCP-47 language code of the input text if + * known, for example, "en-US" or "sr-Latn". Supported language codes are + * listed in Language Support. If the source language isn't specified, the API + * attempts to identify the source language automatically and returns the + * source language within the response. * @param {string} request.targetLanguageCode * Required. The BCP-47 language code to use for translation of the input * text, set to one of the language codes listed in Language Support. @@ -320,15 +393,6 @@ class TranslationServiceClient { * * Models and glossaries must be within the same region (have same * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.mimeType] - * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {string} [request.sourceLanguageCode] - * Optional. The BCP-47 language code of the input text if - * known, for example, "en-US" or "sr-Latn". Supported language codes are - * listed in Language Support. If the source language isn't specified, the API - * attempts to identify the source language automatically and returns the - * source language within the response. * @param {string} [request.model] * Optional. The `model` type requested for this translation. * @@ -347,13 +411,11 @@ class TranslationServiceClient { * `projects/{project-id}/locations/global/models/general/nmt`. * * If missing, the system decides which google base model to use. - * @param {Object} [request.glossaryConfig] + * @param {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} [request.glossaryConfig] * Optional. Glossary to be applied. The glossary must be * within the same region (have the same location-id) as the model, otherwise * an INVALID_ARGUMENT (400) error is returned. - * - * This object should have the same structure as [TranslateTextGlossaryConfig]{@link google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} - * @param {Object.} [request.labels] + * @param {number} [request.labels] * Optional. The labels with user-defined metadata for the request. * * Label keys and values can be no longer than 63 characters @@ -362,60 +424,79 @@ class TranslationServiceClient { * Label values are optional. Label keys must start with a letter. * * See https://cloud.google.com/translate/docs/labels for more information. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3beta1.TranslateTextResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3beta1.TranslateTextResponse}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const translate = require('@google-cloud/translate'); - * - * const client = new translate.v3beta1.TranslationServiceClient({ - * // optional auth parameters. - * }); - * - * const contents = []; - * const targetLanguageCode = ''; - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * const request = { - * contents: contents, - * targetLanguageCode: targetLanguageCode, - * parent: formattedParent, - * }; - * client.translateText(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); */ - translateText(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + translateText( + request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.translation.v3beta1.ITranslateTextResponse, + | protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.translation.v3beta1.ITranslateTextResponse, + | protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.translation.v3beta1.ITranslateTextResponse, + ( + | protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent, + parent: request.parent || '', }); - return this._innerApiCalls.translateText(request, options, callback); } - + detectLanguage( + request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.translation.v3beta1.IDetectLanguageResponse, + ( + | protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest + | undefined + ), + {} | undefined + ] + >; + detectLanguage( + request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3beta1.IDetectLanguageResponse, + | protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest + | undefined, + {} | undefined + > + ): void; /** * Detects the language of text within a request. * @@ -443,12 +524,12 @@ class TranslationServiceClient { * `projects/{project-id}/locations/{location-id}/models/language-detection/default`. * * If not specified, the default model is used. - * @param {string} [request.content] + * @param {string} request.content * The content of the input stored as a string. * @param {string} [request.mimeType] * Optional. The format of the source text, for example, "text/html", * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {Object.} [request.labels] + * @param {number} request.labels * Optional. The labels with user-defined metadata for the request. * * Label keys and values can be no longer than 63 characters @@ -457,53 +538,79 @@ class TranslationServiceClient { * Label values are optional. Label keys must start with a letter. * * See https://cloud.google.com/translate/docs/labels for more information. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3beta1.DetectLanguageResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3beta1.DetectLanguageResponse}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const translate = require('@google-cloud/translate'); - * - * const client = new translate.v3beta1.TranslationServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * client.detectLanguage({parent: formattedParent}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); */ - detectLanguage(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + detectLanguage( + request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.translation.v3beta1.IDetectLanguageResponse, + | protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.translation.v3beta1.IDetectLanguageResponse, + | protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.translation.v3beta1.IDetectLanguageResponse, + ( + | protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent, + parent: request.parent || '', }); - return this._innerApiCalls.detectLanguage(request, options, callback); } - + getSupportedLanguages( + request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.translation.v3beta1.ISupportedLanguages, + ( + | protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | undefined + ), + {} | undefined + ] + >; + getSupportedLanguages( + request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3beta1.ISupportedLanguages, + | protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | undefined, + {} | undefined + > + ): void; /** * Returns a list of supported languages for translation. * @@ -542,57 +649,167 @@ class TranslationServiceClient { * * Returns languages supported by the specified model. * If missing, we get supported languages of Google general base (PBMT) model. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [SupportedLanguages]{@link google.cloud.translation.v3beta1.SupportedLanguages}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3beta1.SupportedLanguages}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const translate = require('@google-cloud/translate'); - * - * const client = new translate.v3beta1.TranslationServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * client.getSupportedLanguages({parent: formattedParent}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); */ - getSupportedLanguages(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + getSupportedLanguages( + request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.translation.v3beta1.ISupportedLanguages, + | protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.translation.v3beta1.ISupportedLanguages, + | protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.translation.v3beta1.ISupportedLanguages, + ( + | protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent, + parent: request.parent || '', }); - return this._innerApiCalls.getSupportedLanguages( request, options, callback ); } + getGlossary( + request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.translation.v3beta1.IGlossary, + ( + | protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest + | undefined + ), + {} | undefined + ] + >; + getGlossary( + request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3beta1.IGlossary, + | protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getGlossary( + request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.translation.v3beta1.IGlossary, + | protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.translation.v3beta1.IGlossary, + | protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.translation.v3beta1.IGlossary, + ( + | protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getGlossary(request, options, callback); + } + batchTranslateText( + request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchTranslateText( + request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; /** * Translates a large volume of text in asynchronous batch mode. * This function provides real-time output as the inputs are being processed. @@ -618,20 +835,7 @@ class TranslationServiceClient { * Required. Source language code. * @param {string[]} request.targetLanguageCodes * Required. Specify up to 10 language codes here. - * @param {Object[]} request.inputConfigs - * Required. Input configurations. - * The total number of files matched should be <= 1000. - * The total content size should be <= 100M Unicode codepoints. - * The files must use UTF-8 encoding. - * - * This object should have the same structure as [InputConfig]{@link google.cloud.translation.v3beta1.InputConfig} - * @param {Object} request.outputConfig - * Required. Output configuration. - * If 2 input configs match to the same file (that is, same input path), - * we don't generate output for duplicate inputs. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.translation.v3beta1.OutputConfig} - * @param {Object.} [request.models] + * @param {number} [request.models] * Optional. The models to use for translation. Map's key is target language * code. Map's value is model name. Value can be a built-in general model, * or an AutoML Translation model. @@ -648,10 +852,19 @@ class TranslationServiceClient { * * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. - * @param {Object.} [request.glossaries] + * @param {number} request.inputConfigs + * Required. Input configurations. + * The total number of files matched should be <= 1000. + * The total content size should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + * @param {google.cloud.translation.v3beta1.OutputConfig} request.outputConfig + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + * @param {number} [request.glossaries] * Optional. Glossaries to be applied for translation. * It's keyed by target language code. - * @param {Object.} [request.labels] + * @param {number} [request.labels] * Optional. The labels with user-defined metadata for the request. * * Label keys and values can be no longer than 63 characters @@ -660,130 +873,85 @@ class TranslationServiceClient { * Label values are optional. Label keys must start with a letter. * * See https://cloud.google.com/translate/docs/labels for more information. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const translate = require('@google-cloud/translate'); - * - * const client = new translate.v3beta1.TranslationServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * const sourceLanguageCode = ''; - * const targetLanguageCodes = []; - * const inputConfigs = []; - * const outputConfig = {}; - * const request = { - * parent: formattedParent, - * sourceLanguageCode: sourceLanguageCode, - * targetLanguageCodes: targetLanguageCodes, - * inputConfigs: inputConfigs, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the promise pattern. - * client.batchTranslateText(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * const sourceLanguageCode = ''; - * const targetLanguageCodes = []; - * const inputConfigs = []; - * const outputConfig = {}; - * const request = { - * parent: formattedParent, - * sourceLanguageCode: sourceLanguageCode, - * targetLanguageCodes: targetLanguageCodes, - * inputConfigs: inputConfigs, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.batchTranslateText(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * const sourceLanguageCode = ''; - * const targetLanguageCodes = []; - * const inputConfigs = []; - * const outputConfig = {}; - * const request = { - * parent: formattedParent, - * sourceLanguageCode: sourceLanguageCode, - * targetLanguageCodes: targetLanguageCodes, - * inputConfigs: inputConfigs, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.batchTranslateText(request); - * - * const [response] = await operation.promise(); */ - batchTranslateText(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + batchTranslateText( + request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protosTypes.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent, + parent: request.parent || '', }); - return this._innerApiCalls.batchTranslateText(request, options, callback); } - + createGlossary( + request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.translation.v3beta1.IGlossary, + protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createGlossary( + request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.translation.v3beta1.IGlossary, + protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; /** * Creates a glossary and returns the long-running operation. Returns * NOT_FOUND, if the project doesn't exist. @@ -792,116 +960,169 @@ class TranslationServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. The project name. - * @param {Object} request.glossary + * @param {google.cloud.translation.v3beta1.Glossary} request.glossary * Required. The glossary to create. - * - * This object should have the same structure as [Glossary]{@link google.cloud.translation.v3beta1.Glossary} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const translate = require('@google-cloud/translate'); - * - * const client = new translate.v3beta1.TranslationServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * const glossary = {}; - * const request = { - * parent: formattedParent, - * glossary: glossary, - * }; - * - * // Handle the operation using the promise pattern. - * client.createGlossary(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * const glossary = {}; - * const request = { - * parent: formattedParent, - * glossary: glossary, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.createGlossary(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * const glossary = {}; - * const request = { - * parent: formattedParent, - * glossary: glossary, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.createGlossary(request); - * - * const [response] = await operation.promise(); */ - createGlossary(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + createGlossary( + request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.translation.v3beta1.IGlossary, + protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.translation.v3beta1.IGlossary, + protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.translation.v3beta1.IGlossary, + protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent, + parent: request.parent || '', }); - return this._innerApiCalls.createGlossary(request, options, callback); } - + deleteGlossary( + request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteGlossary( + request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Deletes a glossary, or cancels glossary construction + * if the glossary isn't created yet. + * Returns NOT_FOUND, if the glossary doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteGlossary( + request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteGlossary(request, options, callback); + } + listGlossaries( + request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.translation.v3beta1.IGlossary[], + protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest | null, + protosTypes.google.cloud.translation.v3beta1.IListGlossariesResponse + ] + >; + listGlossaries( + request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.translation.v3beta1.IGlossary[], + protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest | null, + protosTypes.google.cloud.translation.v3beta1.IListGlossariesResponse + > + ): void; /** * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't * exist. @@ -911,101 +1132,67 @@ class TranslationServiceClient { * @param {string} request.parent * Required. The name of the project from which to list all of the glossaries. * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. * @param {string} [request.filter] * Optional. Filter specifying constraints of a list operation. * Filtering is not supported yet, and the parameter currently has no effect. * If missing, no filtering is performed. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. + * The first element of the array is an object representing [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. * * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary} in a single response. + * The first element is Array of [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse} in a single response. * The second element is the next request object if the response * indicates the next page exists, or null. The third element is * an object representing [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. * * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const translate = require('@google-cloud/translate'); - * - * const client = new translate.v3beta1.TranslationServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * - * client.listGlossaries({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listGlossaries(nextRequest, options).then(callback); - * } - * } - * client.listGlossaries({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); */ - listGlossaries(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + listGlossaries( + request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.translation.v3beta1.IGlossary[], + protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest | null, + protosTypes.google.cloud.translation.v3beta1.IListGlossariesResponse + >, + callback?: Callback< + protosTypes.google.cloud.translation.v3beta1.IGlossary[], + protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest | null, + protosTypes.google.cloud.translation.v3beta1.IListGlossariesResponse + > + ): Promise< + [ + protosTypes.google.cloud.translation.v3beta1.IGlossary[], + protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest | null, + protosTypes.google.cloud.translation.v3beta1.IListGlossariesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent, + parent: request.parent || '', }); - return this._innerApiCalls.listGlossaries(request, options, callback); } @@ -1027,293 +1214,138 @@ class TranslationServiceClient { * @param {string} request.parent * Required. The name of the project from which to list all of the glossaries. * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. * @param {string} [request.filter] * Optional. Filter specifying constraints of a list operation. * Filtering is not supported yet, and the parameter currently has no effect. * If missing, no filtering is performed. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary} on 'data' event. - * - * @example - * - * const translate = require('@google-cloud/translate'); - * - * const client = new translate.v3beta1.TranslationServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * client.listGlossariesStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); */ - listGlossariesStream(request, options) { - options = options || {}; - + listGlossariesStream( + request?: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); return this._descriptors.page.listGlossaries.createStream( - this._innerApiCalls.listGlossaries, + this._innerApiCalls.listGlossaries as gax.GaxCall, request, - options + callSettings ); } + // -------------------- + // -- Path templates -- + // -------------------- /** - * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to retrieve. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const translate = require('@google-cloud/translate'); - * - * const client = new translate.v3beta1.TranslationServiceClient({ - * // optional auth parameters. - * }); + * Return a fully-qualified location resource name string. * - * const formattedName = client.glossaryPath('[PROJECT]', '[LOCATION]', '[GLOSSARY]'); - * client.getGlossary({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. */ - getGlossary(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, + locationPath(project: string, location: string) { + return this._pathTemplates.locationPathTemplate.render({ + project, + location, }); - - return this._innerApiCalls.getGlossary(request, options, callback); } /** - * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. + * Parse the project from Location resource. * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to delete. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const translate = require('@google-cloud/translate'); - * - * const client = new translate.v3beta1.TranslationServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.glossaryPath('[PROJECT]', '[LOCATION]', '[GLOSSARY]'); - * - * // Handle the operation using the promise pattern. - * client.deleteGlossary({name: formattedName}) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedName = client.glossaryPath('[PROJECT]', '[LOCATION]', '[GLOSSARY]'); - * - * // Handle the operation using the event emitter pattern. - * client.deleteGlossary({name: formattedName}) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedName = client.glossaryPath('[PROJECT]', '[LOCATION]', '[GLOSSARY]'); - * - * // Handle the operation using the await pattern. - * const [operation] = await client.deleteGlossary({name: formattedName}); - * - * const [response] = await operation.promise(); + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. */ - deleteGlossary(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteGlossary(request, options, callback); + matchProjectFromLocationName(locationName: string) { + return this._pathTemplates.locationPathTemplate.match(locationName).project; } - // -------------------- - // -- Path templates -- - // -------------------- - /** - * Return a fully-qualified glossary resource name string. + * Parse the location from Location resource. * - * @param {String} project - * @param {String} location - * @param {String} glossary - * @returns {String} + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. */ - glossaryPath(project, location, glossary) { - return this._pathTemplates.glossaryPathTemplate.render({ - project: project, - location: location, - glossary: glossary, - }); + matchLocationFromLocationName(locationName: string) { + return this._pathTemplates.locationPathTemplate.match(locationName) + .location; } /** - * Return a fully-qualified location resource name string. + * Return a fully-qualified glossary resource name string. * - * @param {String} project - * @param {String} location - * @returns {String} + * @param {string} project + * @param {string} location + * @param {string} glossary + * @returns {string} Resource name string. */ - locationPath(project, location) { - return this._pathTemplates.locationPathTemplate.render({ - project: project, - location: location, + glossaryPath(project: string, location: string, glossary: string) { + return this._pathTemplates.glossaryPathTemplate.render({ + project, + location, + glossary, }); } /** - * Parse the glossaryName from a glossary resource. + * Parse the project from Glossary resource. * - * @param {String} glossaryName - * A fully-qualified path representing a glossary resources. - * @returns {String} - A string representing the project. + * @param {string} glossaryName + * A fully-qualified path representing Glossary resource. + * @returns {string} A string representing the project. */ - matchProjectFromGlossaryName(glossaryName) { + matchProjectFromGlossaryName(glossaryName: string) { return this._pathTemplates.glossaryPathTemplate.match(glossaryName).project; } /** - * Parse the glossaryName from a glossary resource. + * Parse the location from Glossary resource. * - * @param {String} glossaryName - * A fully-qualified path representing a glossary resources. - * @returns {String} - A string representing the location. + * @param {string} glossaryName + * A fully-qualified path representing Glossary resource. + * @returns {string} A string representing the location. */ - matchLocationFromGlossaryName(glossaryName) { + matchLocationFromGlossaryName(glossaryName: string) { return this._pathTemplates.glossaryPathTemplate.match(glossaryName) .location; } /** - * Parse the glossaryName from a glossary resource. + * Parse the glossary from Glossary resource. * - * @param {String} glossaryName - * A fully-qualified path representing a glossary resources. - * @returns {String} - A string representing the glossary. + * @param {string} glossaryName + * A fully-qualified path representing Glossary resource. + * @returns {string} A string representing the glossary. */ - matchGlossaryFromGlossaryName(glossaryName) { + matchGlossaryFromGlossaryName(glossaryName: string) { return this._pathTemplates.glossaryPathTemplate.match(glossaryName) .glossary; } /** - * Parse the locationName from a location resource. - * - * @param {String} locationName - * A fully-qualified path representing a location resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromLocationName(locationName) { - return this._pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the locationName from a location resource. + * Terminate the GRPC channel and close the client. * - * @param {String} locationName - * A fully-qualified path representing a location resources. - * @returns {String} - A string representing the location. + * The client will no longer be usable and all future behavior is undefined. */ - matchLocationFromLocationName(locationName) { - return this._pathTemplates.locationPathTemplate.match(locationName) - .location; + close(): Promise { + if (!this._terminated) { + return this._translationServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); } } - -module.exports = TranslationServiceClient; diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json index 21537ac3bb1..db6fab77c0a 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json @@ -2,11 +2,11 @@ "interfaces": { "google.cloud.translation.v3beta1.TranslationService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { @@ -14,50 +14,50 @@ "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, + "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 20000, "total_timeout_millis": 600000 } }, "methods": { "TranslateText": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DetectLanguage": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetSupportedLanguages": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "BatchTranslateText": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateGlossary": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "ListGlossaries": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetGlossary": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "DeleteGlossary": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "timeout_millis": 600000, + "retry_codes_name": "idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 6d535140d16..3a1dd3507da 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2019-11-20T20:59:24.452560Z", + "updateTime": "2019-11-21T07:10:28.256353Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "16543773103e2619d2b5f52456264de5bb9be104", - "internalRef": "281423227" + "sha": "5bc0fecee454f857cec042fb99fe2d22e1bff5bc", + "internalRef": "281635572" } }, { @@ -18,6 +18,15 @@ } ], "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "translate", + "apiVersion": "v3beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + }, { "client": { "source": "googleapis", diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py index 9fef1c0f882..8d6160bcc43 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/synth.py @@ -21,29 +21,19 @@ # Run the gapic generator gapic = gcp.GAPICMicrogenerator() -versions = ['v3'] +versions = ['v3beta1', 'v3'] +name = 'translate' for version in versions: library = gapic.typescript_library( - 'translate', + name, + proto_path=f"google/cloud/{name}/{version}", generator_args={ - "grpc-service-config": "google/cloud/translate/v3/translate_grpc_service_config.json", - "package-name":"@google-cloud/translate" + "grpc-service-config": f"google/cloud/{name}/{version}/{name}_grpc_service_config.json", + "package-name": f"@google-cloud/{name}" }, + extra_proto_files=['google/cloud/common_resources.proto'], version=version) -s.copy(library, excludes=['README.md', 'package.json', 'src/index.ts']) - -# Update path discovery due to build/ dir and TypeScript conversion. -s.replace("test/gapic-*.js", "../../package.json", "../../../package.json") - -# [START fix-dead-link] -s.replace('**/doc/google/protobuf/doc_timestamp.js', - 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', - r"https://\1)") - -s.replace('**/doc/google/protobuf/doc_timestamp.js', - 'toISOString\]', - 'toISOString)') -# [END fix-dead-link] + s.copy(library, excludes=['README.md', 'package.json', 'src/index.ts']) logging.basicConfig(level=logging.DEBUG) common_templates = gcp.CommonTemplates() @@ -53,3 +43,4 @@ # Node.js specific cleanup subprocess.run(["npm", "install"]) subprocess.run(["npm", "run", "fix"]) +subprocess.run(["npx", "compileProtos", "src"]) diff --git a/packages/google-cloud-translate/system-test/.eslintrc.yml b/packages/google-cloud-translate/system-test/.eslintrc.yml index f9605165c0f..dc5d9b0171b 100644 --- a/packages/google-cloud-translate/system-test/.eslintrc.yml +++ b/packages/google-cloud-translate/system-test/.eslintrc.yml @@ -1,5 +1,4 @@ --- env: mocha: true -rules: - no-console: off + diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js index 3c0ba06fc4a..4a53d1c41ee 100644 --- a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js @@ -21,7 +21,6 @@ const translation = require('@google-cloud/translate'); function main() { const translationServiceClient = new translation.TranslationServiceClient(); - console.log('translationServiceClient was created!'); } main(); diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts index 96dcfd2b847..299f64d2334 100644 --- a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts @@ -20,7 +20,6 @@ import {TranslationServiceClient} from '@google-cloud/translate'; function main() { const translationServiceClient = new TranslationServiceClient(); - console.log("translationServiceClient was created!"); } main(); diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts new file mode 100644 index 00000000000..5aed0f075d2 --- /dev/null +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts @@ -0,0 +1,565 @@ +// Copyright 2019 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +const translationserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} + +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('TranslationServiceClient', () => { + it('has servicePath', () => { + const servicePath = + translationserviceModule.v3beta1.TranslationServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + translationserviceModule.v3beta1.TranslationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = translationserviceModule.v3beta1.TranslationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient(); + assert(client); + }); + it('should create a client with gRPC option', () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + describe('translateText', () => { + it('invokes translateText without error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.translateText = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.translateText(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes translateText with error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.translateText = mockSimpleGrpcMethod( + request, + null, + error + ); + client.translateText(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('detectLanguage', () => { + it('invokes detectLanguage without error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.detectLanguage(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes detectLanguage with error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( + request, + null, + error + ); + client.detectLanguage(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getSupportedLanguages', () => { + it('invokes getSupportedLanguages without error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getSupportedLanguages(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getSupportedLanguages with error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getSupportedLanguages(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getGlossary', () => { + it('invokes getGlossary without error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGlossary = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getGlossary(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getGlossary with error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGlossary = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getGlossary(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('batchTranslateText', () => { + it('invokes batchTranslateText without error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.batchTranslateText = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .batchTranslateText(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes batchTranslateText with error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.batchTranslateText = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .batchTranslateText(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('createGlossary', () => { + it('invokes createGlossary without error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createGlossary = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .createGlossary(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes createGlossary with error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createGlossary = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .createGlossary(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('deleteGlossary', () => { + it('invokes deleteGlossary without error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteGlossary = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .deleteGlossary(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes deleteGlossary with error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteGlossary = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .deleteGlossary(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('listGlossaries', () => { + it('invokes listGlossaries without error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listGlossaries = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listGlossaries(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listGlossariesStream', () => { + it('invokes listGlossariesStream without error', done => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listGlossaries = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listGlossariesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); +}); diff --git a/packages/google-cloud-translate/test/gapic-v3beta1.js b/packages/google-cloud-translate/test/gapic-v3beta1.js deleted file mode 100644 index 22251b78d88..00000000000 --- a/packages/google-cloud-translate/test/gapic-v3beta1.js +++ /dev/null @@ -1,709 +0,0 @@ -// Copyright 2019 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 -// -// https://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. - -'use strict'; - -const assert = require('assert'); - -const translateModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; - -describe('TranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = - translateModule.v3beta1.TranslationServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - translateModule.v3beta1.TranslationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = translateModule.v3beta1.TranslationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new translateModule.v3beta1.TranslationServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - fallback: true, - }); - assert(client); - }); - - describe('translateText', () => { - it('invokes translateText without error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const contents = []; - const targetLanguageCode = 'targetLanguageCode1323228230'; - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const request = { - contents: contents, - targetLanguageCode: targetLanguageCode, - parent: formattedParent, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.translateText = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.translateText(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes translateText with error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const contents = []; - const targetLanguageCode = 'targetLanguageCode1323228230'; - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const request = { - contents: contents, - targetLanguageCode: targetLanguageCode, - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.translateText = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.translateText(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('detectLanguage', () => { - it('invokes detectLanguage without error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.detectLanguage(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes detectLanguage with error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.detectLanguage(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getSupportedLanguages', () => { - it('invokes getSupportedLanguages without error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getSupportedLanguages(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getSupportedLanguages with error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getSupportedLanguages(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('batchTranslateText', function() { - it('invokes batchTranslateText without error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const sourceLanguageCode = 'sourceLanguageCode1687263568'; - const targetLanguageCodes = []; - const inputConfigs = []; - const outputConfig = {}; - const request = { - parent: formattedParent, - sourceLanguageCode: sourceLanguageCode, - targetLanguageCodes: targetLanguageCodes, - inputConfigs: inputConfigs, - outputConfig: outputConfig, - }; - - // Mock response - const totalCharacters = 1368640955; - const translatedCharacters = 1337326221; - const failedCharacters = 1723028396; - const expectedResponse = { - totalCharacters: totalCharacters, - translatedCharacters: translatedCharacters, - failedCharacters: failedCharacters, - }; - - // Mock Grpc layer - client._innerApiCalls.batchTranslateText = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .batchTranslateText(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes batchTranslateText with error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const sourceLanguageCode = 'sourceLanguageCode1687263568'; - const targetLanguageCodes = []; - const inputConfigs = []; - const outputConfig = {}; - const request = { - parent: formattedParent, - sourceLanguageCode: sourceLanguageCode, - targetLanguageCodes: targetLanguageCodes, - inputConfigs: inputConfigs, - outputConfig: outputConfig, - }; - - // Mock Grpc layer - client._innerApiCalls.batchTranslateText = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .batchTranslateText(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.batchTranslateText - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.batchTranslateText - .metadataDecoder instanceof Function - ); - }); - }); - - describe('createGlossary', function() { - it('invokes createGlossary without error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const glossary = {}; - const request = { - parent: formattedParent, - glossary: glossary, - }; - - // Mock response - const name = 'name3373707'; - const entryCount = 811131134; - const expectedResponse = { - name: name, - entryCount: entryCount, - }; - - // Mock Grpc layer - client._innerApiCalls.createGlossary = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .createGlossary(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes createGlossary with error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const glossary = {}; - const request = { - parent: formattedParent, - glossary: glossary, - }; - - // Mock Grpc layer - client._innerApiCalls.createGlossary = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .createGlossary(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.createGlossary - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.createGlossary - .metadataDecoder instanceof Function - ); - }); - }); - - describe('listGlossaries', () => { - it('invokes listGlossaries without error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const glossariesElement = {}; - const glossaries = [glossariesElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - glossaries: glossaries, - }; - - // Mock Grpc layer - client._innerApiCalls.listGlossaries = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.glossaries); - }; - - client.listGlossaries(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.glossaries); - done(); - }); - }); - - it('invokes listGlossaries with error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listGlossaries = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listGlossaries(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getGlossary', () => { - it('invokes getGlossary without error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.glossaryPath( - '[PROJECT]', - '[LOCATION]', - '[GLOSSARY]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const entryCount = 811131134; - const expectedResponse = { - name: name2, - entryCount: entryCount, - }; - - // Mock Grpc layer - client._innerApiCalls.getGlossary = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getGlossary(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getGlossary with error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.glossaryPath( - '[PROJECT]', - '[LOCATION]', - '[GLOSSARY]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getGlossary = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getGlossary(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteGlossary', function() { - it('invokes deleteGlossary without error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.glossaryPath( - '[PROJECT]', - '[LOCATION]', - '[GLOSSARY]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteGlossary = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .deleteGlossary(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes deleteGlossary with error', done => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.glossaryPath( - '[PROJECT]', - '[LOCATION]', - '[GLOSSARY]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteGlossary = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .deleteGlossary(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new translateModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.deleteGlossary - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.deleteGlossary - .metadataDecoder instanceof Function - ); - }); - }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} - -function mockLongRunningGrpcMethod(expectedRequest, response, error) { - return request => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise: function() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} From 9dbad43cda3567b60390930a82f55ccbeeec5742 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2019 23:51:03 -0800 Subject: [PATCH 300/513] chore: release 5.1.0 (#391) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-translate/CHANGELOG.md | 14 ++++++++++++++ packages/google-cloud-translate/package.json | 2 +- .../google-cloud-translate/samples/package.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 891e378bb85..c3f0cfa3f68 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,20 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [5.1.0](https://www.github.com/googleapis/nodejs-translate/compare/v5.0.2...v5.1.0) (2019-11-22) + + +### Features + +* convert v3beta1 to TypeScript ([#389](https://www.github.com/googleapis/nodejs-translate/issues/389)) ([0a88c63](https://www.github.com/googleapis/nodejs-translate/commit/0a88c63a1cb0564958f8b2f9d9d11d504284a229)) + + +### Bug Fixes + +* get autosynth working again ([#387](https://www.github.com/googleapis/nodejs-translate/issues/387)) ([c226e58](https://www.github.com/googleapis/nodejs-translate/commit/c226e5811f898ad424a6bf85af197559bf668b25)) +* **deps:** update dependency yargs to v15 ([#386](https://www.github.com/googleapis/nodejs-translate/issues/386)) ([e87a80f](https://www.github.com/googleapis/nodejs-translate/commit/e87a80f201588b779728dd29c5dae96fb7055dbf)) +* **docs:** snippets are now replaced in jsdoc comments ([#381](https://www.github.com/googleapis/nodejs-translate/issues/381)) ([b14f7d4](https://www.github.com/googleapis/nodejs-translate/commit/b14f7d42b961400dfe9dec7bc3fff3a7688c0baa)) + ### [5.0.2](https://www.github.com/googleapis/nodejs-translate/compare/v5.0.1...v5.0.2) (2019-11-08) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index ce6c5a6fd80..6fcc5e174fd 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "5.0.2", + "version": "5.1.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 3fb133a0100..4a3a4709346 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^5.0.2", + "@google-cloud/translate": "^5.1.0", "@google-cloud/vision": "^1.2.0", "yargs": "^15.0.0" }, From 867536e116c4cbc087e937b041bbda2af03e858c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 23 Nov 2019 10:37:33 -0800 Subject: [PATCH 301/513] chore: changes in test and webpack.config.js --- packages/google-cloud-translate/synth.metadata | 6 +++--- .../test/gapic-translation_service-v3.ts | 5 ++--- .../test/gapic-translation_service-v3beta1.ts | 5 ++--- packages/google-cloud-translate/webpack.config.js | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 3a1dd3507da..cbeff7834bd 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2019-11-21T07:10:28.256353Z", + "updateTime": "2019-11-23T12:30:07.706829Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5bc0fecee454f857cec042fb99fe2d22e1bff5bc", - "internalRef": "281635572" + "sha": "777b580a046c4fa84a35e1d00658b71964120bb0", + "internalRef": "282068850" } }, { diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts index 530c57b3d9e..e5dfc4e3af8 100644 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts @@ -40,7 +40,6 @@ export class Operation { constructor() {} promise() {} } - function mockSimpleGrpcMethod( expectedRequest: {}, response: {} | null, @@ -78,7 +77,7 @@ function mockLongRunningGrpcMethod( return Promise.resolve([mockOperation]); }; } -describe('TranslationServiceClient', () => { +describe('v3.TranslationServiceClient', () => { it('has servicePath', () => { const servicePath = translationserviceModule.v3.TranslationServiceClient.servicePath; @@ -98,7 +97,7 @@ describe('TranslationServiceClient', () => { const client = new translationserviceModule.v3.TranslationServiceClient(); assert(client); }); - it('should create a client with gRPC option', () => { + it('should create a client with gRPC fallback', () => { const client = new translationserviceModule.v3.TranslationServiceClient({ fallback: true, }); diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts index 5aed0f075d2..132a9e86b44 100644 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts @@ -40,7 +40,6 @@ export class Operation { constructor() {} promise() {} } - function mockSimpleGrpcMethod( expectedRequest: {}, response: {} | null, @@ -78,7 +77,7 @@ function mockLongRunningGrpcMethod( return Promise.resolve([mockOperation]); }; } -describe('TranslationServiceClient', () => { +describe('v3beta1.TranslationServiceClient', () => { it('has servicePath', () => { const servicePath = translationserviceModule.v3beta1.TranslationServiceClient.servicePath; @@ -98,7 +97,7 @@ describe('TranslationServiceClient', () => { const client = new translationserviceModule.v3beta1.TranslationServiceClient(); assert(client); }); - it('should create a client with gRPC option', () => { + it('should create a client with gRPC fallback', () => { const client = new translationserviceModule.v3beta1.TranslationServiceClient( { fallback: true, diff --git a/packages/google-cloud-translate/webpack.config.js b/packages/google-cloud-translate/webpack.config.js index 83505312e83..a2bfa96a714 100644 --- a/packages/google-cloud-translate/webpack.config.js +++ b/packages/google-cloud-translate/webpack.config.js @@ -51,7 +51,7 @@ module.exports = { use: 'null-loader', }, { - test: /node_modules[\\/]https-proxy-agent/, + test: /node_modules[\\/]https?-proxy-agent/, use: 'null-loader', }, { From abcbeefbc69e2807cded0331e1e2dc10520ca9c6 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 25 Nov 2019 08:56:22 -0800 Subject: [PATCH 302/513] chore: update license headers (#394) --- .../samples/quickstart.js | 27 +++++++++---------- .../samples/test/quickstart.test.js | 27 +++++++++---------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/packages/google-cloud-translate/samples/quickstart.js b/packages/google-cloud-translate/samples/quickstart.js index 2423f4dd53d..57bc3254c20 100644 --- a/packages/google-cloud-translate/samples/quickstart.js +++ b/packages/google-cloud-translate/samples/quickstart.js @@ -1,17 +1,16 @@ -/** - * Copyright 2017 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. - */ +// Copyright 2017 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. 'use strict'; diff --git a/packages/google-cloud-translate/samples/test/quickstart.test.js b/packages/google-cloud-translate/samples/test/quickstart.test.js index 5b75ed58326..fec6f136e7b 100644 --- a/packages/google-cloud-translate/samples/test/quickstart.test.js +++ b/packages/google-cloud-translate/samples/test/quickstart.test.js @@ -1,17 +1,16 @@ -/** - * Copyright 2017 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. - */ +// Copyright 2017 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. 'use strict'; From be67e1f419a11ea2a5e98d4b60d498e184bca5de Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 5 Dec 2019 10:46:50 -0800 Subject: [PATCH 303/513] fix(deps): pin TypeScript below 3.7.0 --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 6fcc5e174fd..7eb1935dfd0 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -77,6 +77,6 @@ "prettier": "^1.13.5", "proxyquire": "^2.0.1", "source-map-support": "^0.5.6", - "typescript": "~3.7.0" + "typescript": "3.6.4" } } From 6b965dfa63c404a3e88f90ce9ce12c49fb08b52e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2019 15:38:30 -0800 Subject: [PATCH 304/513] chore: release 5.1.1 (#399) --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index c3f0cfa3f68..834061b54e8 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [5.1.1](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.0...v5.1.1) (2019-12-05) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([53f3cff](https://www.github.com/googleapis/nodejs-translate/commit/53f3cff821869347a8d34f3b0561d3b8158d171d)) + ## [5.1.0](https://www.github.com/googleapis/nodejs-translate/compare/v5.0.2...v5.1.0) (2019-11-22) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7eb1935dfd0..7f2197e768b 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "5.1.0", + "version": "5.1.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 4a3a4709346..a8e4b7cd4a6 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^5.1.0", + "@google-cloud/translate": "^5.1.1", "@google-cloud/vision": "^1.2.0", "yargs": "^15.0.0" }, From 3317c18d0b8d9a7b2208db5dc18ae379fde2739e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 6 Dec 2019 11:40:02 -0800 Subject: [PATCH 305/513] docs: correction to labels type in jsdoc --- .../src/v3/translation_service_client.ts | 12 ++++++------ .../src/v3beta1/translation_service_client.ts | 12 ++++++------ packages/google-cloud-translate/synth.metadata | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index cfc517bfefb..55e5a8cc536 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -411,7 +411,7 @@ export class TranslationServiceClient { * Optional. Glossary to be applied. The glossary must be * within the same region (have the same location-id) as the model, otherwise * an INVALID_ARGUMENT (400) error is returned. - * @param {number} [request.labels] + * @param {number[]} [request.labels] * Optional. The labels with user-defined metadata for the request. * * Label keys and values can be no longer than 63 characters @@ -521,7 +521,7 @@ export class TranslationServiceClient { * @param {string} [request.mimeType] * Optional. The format of the source text, for example, "text/html", * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {number} [request.labels] + * @param {number[]} [request.labels] * Optional. The labels with user-defined metadata for the request. * * Label keys and values can be no longer than 63 characters @@ -819,7 +819,7 @@ export class TranslationServiceClient { * Required. Source language code. * @param {string[]} request.targetLanguageCodes * Required. Specify up to 10 language codes here. - * @param {number} [request.models] + * @param {number[]} [request.models] * Optional. The models to use for translation. Map's key is target language * code. Map's value is model name. Value can be a built-in general model, * or an AutoML Translation model. @@ -836,7 +836,7 @@ export class TranslationServiceClient { * * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. - * @param {number} request.inputConfigs + * @param {number[]} request.inputConfigs * Required. Input configurations. * The total number of files matched should be <= 1000. * The total content size should be <= 100M Unicode codepoints. @@ -845,10 +845,10 @@ export class TranslationServiceClient { * Required. Output configuration. * If 2 input configs match to the same file (that is, same input path), * we don't generate output for duplicate inputs. - * @param {number} [request.glossaries] + * @param {number[]} [request.glossaries] * Optional. Glossaries to be applied for translation. * It's keyed by target language code. - * @param {number} [request.labels] + * @param {number[]} [request.labels] * Optional. The labels with user-defined metadata for the request. * * Label keys and values can be no longer than 63 characters diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 04455605067..07652be2fb3 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -415,7 +415,7 @@ export class TranslationServiceClient { * Optional. Glossary to be applied. The glossary must be * within the same region (have the same location-id) as the model, otherwise * an INVALID_ARGUMENT (400) error is returned. - * @param {number} [request.labels] + * @param {number[]} [request.labels] * Optional. The labels with user-defined metadata for the request. * * Label keys and values can be no longer than 63 characters @@ -529,7 +529,7 @@ export class TranslationServiceClient { * @param {string} [request.mimeType] * Optional. The format of the source text, for example, "text/html", * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {number} request.labels + * @param {number[]} request.labels * Optional. The labels with user-defined metadata for the request. * * Label keys and values can be no longer than 63 characters @@ -835,7 +835,7 @@ export class TranslationServiceClient { * Required. Source language code. * @param {string[]} request.targetLanguageCodes * Required. Specify up to 10 language codes here. - * @param {number} [request.models] + * @param {number[]} [request.models] * Optional. The models to use for translation. Map's key is target language * code. Map's value is model name. Value can be a built-in general model, * or an AutoML Translation model. @@ -852,7 +852,7 @@ export class TranslationServiceClient { * * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. - * @param {number} request.inputConfigs + * @param {number[]} request.inputConfigs * Required. Input configurations. * The total number of files matched should be <= 1000. * The total content size should be <= 100M Unicode codepoints. @@ -861,10 +861,10 @@ export class TranslationServiceClient { * Required. Output configuration. * If 2 input configs match to the same file (that is, same input path), * we don't generate output for duplicate inputs. - * @param {number} [request.glossaries] + * @param {number[]} [request.glossaries] * Optional. Glossaries to be applied for translation. * It's keyed by target language code. - * @param {number} [request.labels] + * @param {number[]} [request.labels] * Optional. The labels with user-defined metadata for the request. * * Label keys and values can be no longer than 63 characters diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index cbeff7834bd..0749ccbcbc1 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2019-11-23T12:30:07.706829Z", + "updateTime": "2019-12-06T12:26:00.969948Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "777b580a046c4fa84a35e1d00658b71964120bb0", - "internalRef": "282068850" + "sha": "b10e4547017ca529ac8d183e839f3c272e1c13de", + "internalRef": "284059574" } }, { From 82c873a6a33024e30b3eb5b69570088d03ce4689 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 11 Dec 2019 11:46:21 -0800 Subject: [PATCH 306/513] fix: make operationsClient and service stub public --- .../google/cloud/common_resources.proto | 56 +++++++------------ .../src/v3/translation_service_client.ts | 17 +++--- .../src/v3beta1/translation_service_client.ts | 17 +++--- .../google-cloud-translate/synth.metadata | 6 +- 4 files changed, 41 insertions(+), 55 deletions(-) diff --git a/packages/google-cloud-translate/protos/google/cloud/common_resources.proto b/packages/google-cloud-translate/protos/google/cloud/common_resources.proto index 5d795bff1b8..56c9f800d5e 100644 --- a/packages/google-cloud-translate/protos/google/cloud/common_resources.proto +++ b/packages/google-cloud-translate/protos/google/cloud/common_resources.proto @@ -22,47 +22,31 @@ package google.cloud; import "google/api/resource.proto"; -message Project { - option (google.api.resource) = { - type: "cloudresourcemanager.googleapis.com/Project" - pattern: "projects/{project}" - }; +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; - string name = 1; -} -message Organization { - option (google.api.resource) = { - type: "cloudresourcemanager.googleapis.com/Organization" - pattern: "organizations/{organization}" - }; +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; - string name = 1; -} -message Folder { - option (google.api.resource) = { - type: "cloudresourcemanager.googleapis.com/Folder" - pattern: "folders/{folder}" - }; +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; - string name = 1; -} -message BillingAccount { - option (google.api.resource) = { - type: "cloudbilling.googleapis.com/BillingAccount" - pattern: "billingAccounts/{billing_account}" - }; +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; - string name = 1; -} +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; -message Location { - option (google.api.resource) = { - type: "locations.googleapis.com/Location" - pattern: "projects/{project}/locations/{location}" - }; - - string name = 1; -} diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 55e5a8cc536..1116c87c05b 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -42,11 +42,12 @@ const version = require('../../../package.json').version; */ export class TranslationServiceClient { private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; - private _translationServiceStub: Promise<{[name: string]: Function}>; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + translationServiceStub: Promise<{[name: string]: Function}>; /** * Construct an instance of TranslationServiceClient. @@ -169,7 +170,7 @@ export class TranslationServiceClient { ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) : gaxModule.protobuf.loadSync(nodejsProtoPath); - const operationsClient = gaxModule + this.operationsClient = gaxModule .lro({ auth: this.auth, grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, @@ -196,17 +197,17 @@ export class TranslationServiceClient { this._descriptors.longrunning = { batchTranslateText: new gaxModule.LongrunningDescriptor( - operationsClient, + this.operationsClient, batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) ), createGlossary: new gaxModule.LongrunningDescriptor( - operationsClient, + this.operationsClient, createGlossaryResponse.decode.bind(createGlossaryResponse), createGlossaryMetadata.decode.bind(createGlossaryMetadata) ), deleteGlossary: new gaxModule.LongrunningDescriptor( - operationsClient, + this.operationsClient, deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata) ), @@ -227,7 +228,7 @@ export class TranslationServiceClient { // Put together the "service stub" for // google.cloud.translation.v3.TranslationService. - this._translationServiceStub = gaxGrpc.createStub( + this.translationServiceStub = gaxGrpc.createStub( opts.fallback ? (protos as protobuf.Root).lookupService( 'google.cloud.translation.v3.TranslationService' @@ -251,7 +252,7 @@ export class TranslationServiceClient { ]; for (const methodName of translationServiceStubMethods) { - const innerCallPromise = this._translationServiceStub.then( + const innerCallPromise = this.translationServiceStub.then( stub => (...args: Array<{}>) => { return stub[methodName].apply(stub, args); }, @@ -1325,7 +1326,7 @@ export class TranslationServiceClient { */ close(): Promise { if (!this._terminated) { - return this._translationServiceStub.then(stub => { + return this.translationServiceStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 07652be2fb3..112eb56910d 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -42,11 +42,12 @@ const version = require('../../../package.json').version; */ export class TranslationServiceClient { private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; - private _translationServiceStub: Promise<{[name: string]: Function}>; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + translationServiceStub: Promise<{[name: string]: Function}>; /** * Construct an instance of TranslationServiceClient. @@ -169,7 +170,7 @@ export class TranslationServiceClient { ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) : gaxModule.protobuf.loadSync(nodejsProtoPath); - const operationsClient = gaxModule + this.operationsClient = gaxModule .lro({ auth: this.auth, grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, @@ -196,17 +197,17 @@ export class TranslationServiceClient { this._descriptors.longrunning = { batchTranslateText: new gaxModule.LongrunningDescriptor( - operationsClient, + this.operationsClient, batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) ), createGlossary: new gaxModule.LongrunningDescriptor( - operationsClient, + this.operationsClient, createGlossaryResponse.decode.bind(createGlossaryResponse), createGlossaryMetadata.decode.bind(createGlossaryMetadata) ), deleteGlossary: new gaxModule.LongrunningDescriptor( - operationsClient, + this.operationsClient, deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata) ), @@ -227,7 +228,7 @@ export class TranslationServiceClient { // Put together the "service stub" for // google.cloud.translation.v3beta1.TranslationService. - this._translationServiceStub = gaxGrpc.createStub( + this.translationServiceStub = gaxGrpc.createStub( opts.fallback ? (protos as protobuf.Root).lookupService( 'google.cloud.translation.v3beta1.TranslationService' @@ -251,7 +252,7 @@ export class TranslationServiceClient { ]; for (const methodName of translationServiceStubMethods) { - const innerCallPromise = this._translationServiceStub.then( + const innerCallPromise = this.translationServiceStub.then( stub => (...args: Array<{}>) => { return stub[methodName].apply(stub, args); }, @@ -1341,7 +1342,7 @@ export class TranslationServiceClient { */ close(): Promise { if (!this._terminated) { - return this._translationServiceStub.then(stub => { + return this.translationServiceStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 0749ccbcbc1..81e4e83e55f 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2019-12-06T12:26:00.969948Z", + "updateTime": "2019-12-11T12:27:20.173934Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b10e4547017ca529ac8d183e839f3c272e1c13de", - "internalRef": "284059574" + "sha": "e47fdd266542386e5e7346697f90476e96dc7ee8", + "internalRef": "284822593" } }, { From dbe941c6d1d0c2a3b3096a55775c2e063f94b196 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2019 12:02:13 -0800 Subject: [PATCH 307/513] chore: release 5.1.2 (#407) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 834061b54e8..7dfdf2c4d0e 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [5.1.2](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.1...v5.1.2) (2019-12-11) + + +### Bug Fixes + +* make operationsClient and service stub public ([7ac1252](https://www.github.com/googleapis/nodejs-translate/commit/7ac12522ef96d6a37c15ca7847e6e872316c8a9d)) + ### [5.1.1](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.0...v5.1.1) (2019-12-05) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7f2197e768b..5eafa4bfa7f 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "5.1.1", + "version": "5.1.2", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index a8e4b7cd4a6..a104e2b2588 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^5.1.1", + "@google-cloud/translate": "^5.1.2", "@google-cloud/vision": "^1.2.0", "yargs": "^15.0.0" }, From b74914e8258c1f112deead9c9170075350689674 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 12 Dec 2019 17:31:06 -0500 Subject: [PATCH 308/513] test: adds integration test for x-goog-user-project header (#404) --- packages/google-cloud-translate/package.json | 2 + .../system-test/translate.ts | 80 +++++++++++++++++++ 2 files changed, 82 insertions(+) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 5eafa4bfa7f..ecae425b73e 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -65,7 +65,9 @@ "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^10.0.0", "eslint-plugin-prettier": "^3.0.0", + "google-auth-library": "^5.7.0", "gts": "^1.0.0", + "http2spy": "^1.1.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 9bf021526d7..2fe7af060f3 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -17,6 +17,7 @@ import * as assert from 'assert'; import {TranslationServiceClient} from '../src'; +const http2spy = require('http2spy'); const API_KEY = process.env.TRANSLATE_API_KEY; describe('translate', () => { @@ -135,5 +136,84 @@ describe('translate', () => { supportTarget: true, }); }); + + it('should populate x-goog-user-project header, and succeed if valid project', async () => { + const {GoogleAuth} = require('google-auth-library'); + const auth = new GoogleAuth({ + credentials: Object.assign( + require(process.env.GOOGLE_APPLICATION_CREDENTIALS || ''), + { + quota_project_id: process.env.GCLOUD_PROJECT, + } + ), + }); + const {TranslationServiceClient} = http2spy.require( + require.resolve('../src') + ); + const translate = new TranslationServiceClient({ + auth, + }); + + // We run the same test as "list of supported languages", but with an + // alternate "quota_project_id" set; Given that GCLOUD_PROJECT + // references a valid project, we expect success: + const projectId = await translate.getProjectId(); + // This should not hrow an exception: + await translate.getSupportedLanguages({ + parent: `projects/${projectId}`, + }); + // Ensure we actually populated the header: + assert.strictEqual( + process.env.GCLOUD_PROJECT, + http2spy.requests[http2spy.requests.length - 1][ + 'x-goog-user-project' + ][0] + ); + }); + + it('should populate x-goog-user-project header, and fail if invalid project', async () => { + const {GoogleAuth} = require('google-auth-library'); + const auth = new GoogleAuth({ + credentials: Object.assign( + require(process.env.GOOGLE_APPLICATION_CREDENTIALS || ''), + { + quota_project_id: 'my-fake-billing-project', + } + ), + }); + const {TranslationServiceClient} = http2spy.require( + require.resolve('../src') + ); + const translate = new TranslationServiceClient({ + auth, + }); + + // We set a quota project "my-fake-billing-project" that does not exist, + // this should result in an error. + let err: Error | null = null; + try { + const projectId = await translate.getProjectId(); + const [result] = await translate.getSupportedLanguages({ + parent: `projects/${projectId}`, + }); + } catch (_err) { + err = _err; + } + assert(err); + assert( + err!.message.includes( + // make sure the error included our fake project name, we shouldn't + // be too specific about the error incase it changes upstream. + 'my-fake-billing-project' + ), + err!.message + ); + assert.strictEqual( + 'my-fake-billing-project', + http2spy.requests[http2spy.requests.length - 1][ + 'x-goog-user-project' + ][0] + ); + }); }); }); From ae8f701ce84e17929502fb9d928b7398cdf90b52 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 13 Dec 2019 11:05:35 -0800 Subject: [PATCH 309/513] docs: updated jsdoc comments for generated methods --- .../src/v3/translation_service_client.ts | 15 +- .../src/v3beta1/translation_service_client.ts | 15 +- .../google-cloud-translate/synth.metadata | 2693 ++++++++++++++++- 3 files changed, 2710 insertions(+), 13 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 1116c87c05b..1ce373d4c6e 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -1131,13 +1131,18 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListGlossariesResponse]{@link google.cloud.translation.v3.ListGlossariesResponse}. + * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3.Glossary}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. * * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [ListGlossariesResponse]{@link google.cloud.translation.v3.ListGlossariesResponse} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListGlossariesResponse]{@link google.cloud.translation.v3.ListGlossariesResponse}. + * The first element is Array of [Glossary]{@link google.cloud.translation.v3.Glossary} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGlossariesRequest]{@link google.cloud.translation.v3.ListGlossariesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGlossariesResponse]{@link google.cloud.translation.v3.ListGlossariesResponse}. * * The promise has a method named "cancel" which cancels the ongoing API call. */ diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 112eb56910d..a187e17bc3d 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -1147,13 +1147,18 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. + * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. * * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. + * The first element is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGlossariesRequest]{@link google.cloud.translation.v3beta1.ListGlossariesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. * * The promise has a method named "cancel" which cancels the ongoing API call. */ diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 81e4e83e55f..cf91c38471c 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2019-12-11T12:27:20.173934Z", + "updateTime": "2019-12-13T12:27:17.330029Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e47fdd266542386e5e7346697f90476e96dc7ee8", - "internalRef": "284822593" + "sha": "2085a0d3c76180ee843cf2ecef2b94ca5266be31", + "internalRef": "285233245" } }, { @@ -36,5 +36,2692 @@ "generator": "gapic-generator-typescript" } } + ], + "newFiles": [ + { + "path": "tslint.json" + }, + { + "path": "codecov.yaml" + }, + { + "path": "tsconfig.json" + }, + { + "path": "CONTRIBUTING.md" + }, + { + "path": "renovate.json" + }, + { + "path": ".prettierrc" + }, + { + "path": "linkinator.config.json" + }, + { + "path": ".clang-format" + }, + { + "path": ".repo-metadata.json" + }, + { + "path": ".readme-partials.yml" + }, + { + "path": "CODE_OF_CONDUCT.md" + }, + { + "path": ".eslintrc.yml" + }, + { + "path": "synth.metadata" + }, + { + "path": ".nycrc" + }, + { + "path": "LICENSE" + }, + { + "path": "CHANGELOG.md" + }, + { + "path": "synth.py" + }, + { + "path": ".eslintignore" + }, + { + "path": ".jsdoc.js" + }, + { + "path": ".prettierignore" + }, + { + "path": "webpack.config.js" + }, + { + "path": "package.json" + }, + { + "path": "README.md" + }, + { + "path": ".gitignore" + }, + { + "path": "package-lock.json" + }, + { + "path": ".git/HEAD" + }, + { + "path": ".git/description" + }, + { + "path": ".git/shallow" + }, + { + "path": ".git/config" + }, + { + "path": ".git/index" + }, + { + "path": ".git/packed-refs" + }, + { + "path": ".git/logs/HEAD" + }, + { + "path": ".git/logs/refs/remotes/origin/HEAD" + }, + { + "path": ".git/logs/refs/heads/autosynth" + }, + { + "path": ".git/logs/refs/heads/master" + }, + { + "path": ".git/info/exclude" + }, + { + "path": ".git/hooks/pre-applypatch.sample" + }, + { + "path": ".git/hooks/commit-msg.sample" + }, + { + "path": ".git/hooks/pre-push.sample" + }, + { + "path": ".git/hooks/post-update.sample" + }, + { + "path": ".git/hooks/update.sample" + }, + { + "path": ".git/hooks/pre-commit.sample" + }, + { + "path": ".git/hooks/pre-rebase.sample" + }, + { + "path": ".git/hooks/prepare-commit-msg.sample" + }, + { + "path": ".git/hooks/applypatch-msg.sample" + }, + { + "path": ".git/hooks/pre-receive.sample" + }, + { + "path": ".git/hooks/fsmonitor-watchman.sample" + }, + { + "path": ".git/refs/remotes/origin/HEAD" + }, + { + "path": ".git/refs/heads/autosynth" + }, + { + "path": ".git/refs/heads/master" + }, + { + "path": ".git/objects/pack/pack-aeb825b05c07e0ff972d78bcc4e8c18a679f6e57.idx" + }, + { + "path": ".git/objects/pack/pack-aeb825b05c07e0ff972d78bcc4e8c18a679f6e57.pack" + }, + { + "path": "protos/protos.json" + }, + { + "path": "protos/protos.js" + }, + { + "path": "protos/protos.d.ts" + }, + { + "path": "protos/google/cloud/common_resources.proto" + }, + { + "path": "protos/google/cloud/translate/v3/translation_service.proto" + }, + { + "path": "protos/google/cloud/translate/v3beta1/translation_service.proto" + }, + { + "path": ".bots/header-checker-lint.json" + }, + { + "path": "node_modules/eslint-plugin-node/package.json" + }, + { + "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" + }, + { + "path": "node_modules/is-callable/package.json" + }, + { + "path": "node_modules/natural-compare/package.json" + }, + { + "path": "node_modules/indent-string/package.json" + }, + { + "path": "node_modules/ansi-colors/package.json" + }, + { + "path": "node_modules/uglify-js/package.json" + }, + { + "path": "node_modules/mimic-fn/package.json" + }, + { + "path": "node_modules/path-is-absolute/package.json" + }, + { + "path": "node_modules/yargs/package.json" + }, + { + "path": "node_modules/yargs/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/yargs/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/yargs/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/yargs/node_modules/find-up/package.json" + }, + { + "path": "node_modules/is-ci/package.json" + }, + { + "path": "node_modules/esrecurse/package.json" + }, + { + "path": "node_modules/array-find/package.json" + }, + { + "path": "node_modules/asynckit/package.json" + }, + { + "path": "node_modules/string.prototype.trimleft/package.json" + }, + { + "path": "node_modules/once/package.json" + }, + { + "path": "node_modules/http-proxy-agent/package.json" + }, + { + "path": "node_modules/http-proxy-agent/node_modules/ms/package.json" + }, + { + "path": "node_modules/http-proxy-agent/node_modules/debug/package.json" + }, + { + "path": "node_modules/p-locate/package.json" + }, + { + "path": "node_modules/typedarray-to-buffer/index.js" + }, + { + "path": "node_modules/typedarray-to-buffer/LICENSE" + }, + { + "path": "node_modules/typedarray-to-buffer/.travis.yml" + }, + { + "path": "node_modules/typedarray-to-buffer/package.json" + }, + { + "path": "node_modules/typedarray-to-buffer/README.md" + }, + { + "path": "node_modules/typedarray-to-buffer/.airtap.yml" + }, + { + "path": "node_modules/typedarray-to-buffer/test/basic.js" + }, + { + "path": "node_modules/progress/package.json" + }, + { + "path": "node_modules/camelcase-keys/package.json" + }, + { + "path": "node_modules/camelcase-keys/node_modules/camelcase/package.json" + }, + { + "path": "node_modules/is-html/package.json" + }, + { + "path": "node_modules/regexpp/package.json" + }, + { + "path": "node_modules/url-parse-lax/package.json" + }, + { + "path": "node_modules/markdown-it/package.json" + }, + { + "path": "node_modules/deep-is/package.json" + }, + { + "path": "node_modules/statuses/package.json" + }, + { + "path": "node_modules/eventemitter3/package.json" + }, + { + "path": "node_modules/stringifier/package.json" + }, + { + "path": "node_modules/trim-newlines/package.json" + }, + { + "path": "node_modules/v8-compile-cache/package.json" + }, + { + "path": "node_modules/got/package.json" + }, + { + "path": "node_modules/got/node_modules/get-stream/package.json" + }, + { + "path": "node_modules/ci-info/package.json" + }, + { + "path": "node_modules/error-ex/package.json" + }, + { + "path": "node_modules/object.getownpropertydescriptors/package.json" + }, + { + "path": "node_modules/escodegen/package.json" + }, + { + "path": "node_modules/escodegen/node_modules/esprima/package.json" + }, + { + "path": "node_modules/callsites/package.json" + }, + { + "path": "node_modules/dot-prop/package.json" + }, + { + "path": "node_modules/stream-shift/package.json" + }, + { + "path": "node_modules/wordwrap/package.json" + }, + { + "path": "node_modules/is-date-object/package.json" + }, + { + "path": "node_modules/long/package.json" + }, + { + "path": "node_modules/functional-red-black-tree/package.json" + }, + { + "path": "node_modules/graceful-fs/package.json" + }, + { + "path": "node_modules/is-regex/package.json" + }, + { + "path": "node_modules/lodash.at/package.json" + }, + { + "path": "node_modules/locate-path/package.json" + }, + { + "path": "node_modules/onetime/package.json" + }, + { + "path": "node_modules/decompress-response/package.json" + }, + { + "path": "node_modules/css-what/package.json" + }, + { + "path": "node_modules/toidentifier/package.json" + }, + { + "path": "node_modules/google-p12-pem/package.json" + }, + { + "path": "node_modules/ee-first/package.json" + }, + { + "path": "node_modules/es-abstract/package.json" + }, + { + "path": "node_modules/execa/package.json" + }, + { + "path": "node_modules/execa/node_modules/shebang-command/package.json" + }, + { + "path": "node_modules/execa/node_modules/which/package.json" + }, + { + "path": "node_modules/execa/node_modules/is-stream/package.json" + }, + { + "path": "node_modules/execa/node_modules/shebang-regex/package.json" + }, + { + "path": "node_modules/execa/node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/execa/node_modules/lru-cache/package.json" + }, + { + "path": "node_modules/execa/node_modules/yallist/package.json" + }, + { + "path": "node_modules/globals/package.json" + }, + { + "path": "node_modules/color-convert/package.json" + }, + { + "path": "node_modules/duplexer3/package.json" + }, + { + "path": "node_modules/esutils/package.json" + }, + { + "path": "node_modules/es6-map/package.json" + }, + { + "path": "node_modules/js2xmlparser/package.json" + }, + { + "path": "node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/cli-width/package.json" + }, + { + "path": "node_modules/escape-string-regexp/package.json" + }, + { + "path": "node_modules/registry-url/package.json" + }, + { + "path": "node_modules/os-tmpdir/package.json" + }, + { + "path": "node_modules/object.assign/package.json" + }, + { + "path": "node_modules/mdurl/package.json" + }, + { + "path": "node_modules/minimist/package.json" + }, + { + "path": "node_modules/mute-stream/package.json" + }, + { + "path": "node_modules/p-try/package.json" + }, + { + "path": "node_modules/gts/package.json" + }, + { + "path": "node_modules/gts/node_modules/color-convert/package.json" + }, + { + "path": "node_modules/gts/node_modules/has-flag/package.json" + }, + { + "path": "node_modules/gts/node_modules/color-name/package.json" + }, + { + "path": "node_modules/gts/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/gts/node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/gts/node_modules/chalk/package.json" + }, + { + "path": "node_modules/gcp-metadata/package.json" + }, + { + "path": "node_modules/urlgrey/package.json" + }, + { + "path": "node_modules/builtin-modules/package.json" + }, + { + "path": "node_modules/is-typedarray/package.json" + }, + { + "path": "node_modules/loud-rejection/package.json" + }, + { + "path": "node_modules/object-keys/package.json" + }, + { + "path": "node_modules/requizzle/package.json" + }, + { + "path": "node_modules/end-of-stream/package.json" + }, + { + "path": "node_modules/spdx-correct/package.json" + }, + { + "path": "node_modules/parse5/package.json" + }, + { + "path": "node_modules/domhandler/package.json" + }, + { + "path": "node_modules/ini/package.json" + }, + { + "path": "node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/decamelize-keys/package.json" + }, + { + "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" + }, + { + "path": "node_modules/map-obj/package.json" + }, + { + "path": "node_modules/get-stream/package.json" + }, + { + "path": "node_modules/chardet/package.json" + }, + { + "path": "node_modules/write-file-atomic/package.json" + }, + { + "path": "node_modules/flat/package.json" + }, + { + "path": "node_modules/balanced-match/package.json" + }, + { + "path": "node_modules/esquery/package.json" + }, + { + "path": "node_modules/set-blocking/package.json" + }, + { + "path": "node_modules/configstore/package.json" + }, + { + "path": "node_modules/configstore/node_modules/write-file-atomic/package.json" + }, + { + "path": "node_modules/configstore/node_modules/pify/package.json" + }, + { + "path": "node_modules/configstore/node_modules/make-dir/package.json" + }, + { + "path": "node_modules/dom-serializer/package.json" + }, + { + "path": "node_modules/process-nextick-args/package.json" + }, + { + "path": "node_modules/defer-to-connect/package.json" + }, + { + "path": "node_modules/c8/package.json" + }, + { + "path": "node_modules/klaw/package.json" + }, + { + "path": "node_modules/latest-version/package.json" + }, + { + "path": "node_modules/istanbul-lib-report/package.json" + }, + { + "path": "node_modules/eastasianwidth/package.json" + }, + { + "path": "node_modules/mimic-response/package.json" + }, + { + "path": "node_modules/rimraf/package.json" + }, + { + "path": "node_modules/camelcase/package.json" + }, + { + "path": "node_modules/domutils/package.json" + }, + { + "path": "node_modules/file-entry-cache/package.json" + }, + { + "path": "node_modules/lowercase-keys/package.json" + }, + { + "path": "node_modules/acorn-jsx/package.json" + }, + { + "path": "node_modules/run-async/package.json" + }, + { + "path": "node_modules/markdown-it-anchor/package.json" + }, + { + "path": "node_modules/power-assert-renderer-comparison/package.json" + }, + { + "path": "node_modules/uri-js/package.json" + }, + { + "path": "node_modules/commander/package.json" + }, + { + "path": "node_modules/ms/package.json" + }, + { + "path": "node_modules/power-assert-renderer-base/package.json" + }, + { + "path": "node_modules/teeny-request/package.json" + }, + { + "path": "node_modules/boolbase/package.json" + }, + { + "path": "node_modules/object-is/package.json" + }, + { + "path": "node_modules/ent/package.json" + }, + { + "path": "node_modules/inflight/package.json" + }, + { + "path": "node_modules/on-finished/package.json" + }, + { + "path": "node_modules/wide-align/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/string-width/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/v8-to-istanbul/package.json" + }, + { + "path": "node_modules/v8-to-istanbul/node_modules/source-map/package.json" + }, + { + "path": "node_modules/decamelize/package.json" + }, + { + "path": "node_modules/handlebars/package.json" + }, + { + "path": "node_modules/json-parse-better-errors/package.json" + }, + { + "path": "node_modules/es6-symbol/package.json" + }, + { + "path": "node_modules/load-json-file/package.json" + }, + { + "path": "node_modules/load-json-file/node_modules/pify/package.json" + }, + { + "path": "node_modules/call-signature/package.json" + }, + { + "path": "node_modules/optimist/package.json" + }, + { + "path": "node_modules/http-errors/package.json" + }, + { + "path": "node_modules/escape-html/package.json" + }, + { + "path": "node_modules/safer-buffer/package.json" + }, + { + "path": "node_modules/yargs-unparser/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/form-data/package.json" + }, + { + "path": "node_modules/has-flag/package.json" + }, + { + "path": "node_modules/string.prototype.trimright/package.json" + }, + { + "path": "node_modules/read-pkg-up/package.json" + }, + { + "path": "node_modules/read-pkg-up/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/read-pkg-up/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/read-pkg-up/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/read-pkg-up/node_modules/find-up/package.json" + }, + { + "path": "node_modules/jsdoc-region-tag/package.json" + }, + { + "path": "node_modules/shebang-command/package.json" + }, + { + "path": "node_modules/path-exists/package.json" + }, + { + "path": "node_modules/power-assert-renderer-file/package.json" + }, + { + "path": "node_modules/es6-promisify/package.json" + }, + { + "path": "node_modules/tsutils/package.json" + }, + { + "path": "node_modules/underscore/package.json" + }, + { + "path": "node_modules/eslint/package.json" + }, + { + "path": "node_modules/eslint/node_modules/shebang-command/package.json" + }, + { + "path": "node_modules/eslint/node_modules/which/package.json" + }, + { + "path": "node_modules/eslint/node_modules/debug/package.json" + }, + { + "path": "node_modules/eslint/node_modules/shebang-regex/package.json" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/index.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/README.md" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" + }, + { + "path": "node_modules/eslint/node_modules/path-key/package.json" + }, + { + "path": "node_modules/test-exclude/package.json" + }, + { + "path": "node_modules/serve-static/package.json" + }, + { + "path": "node_modules/@babel/parser/package.json" + }, + { + "path": "node_modules/@babel/highlight/package.json" + }, + { + "path": "node_modules/@babel/code-frame/package.json" + }, + { + "path": "node_modules/es6-iterator/package.json" + }, + { + "path": "node_modules/deep-extend/package.json" + }, + { + "path": "node_modules/strip-json-comments/package.json" + }, + { + "path": "node_modules/type-fest/package.json" + }, + { + "path": "node_modules/he/package.json" + }, + { + "path": "node_modules/power-assert-formatter/package.json" + }, + { + "path": "node_modules/json-bigint/package.json" + }, + { + "path": "node_modules/prepend-http/package.json" + }, + { + "path": "node_modules/extend/package.json" + }, + { + "path": "node_modules/argv/package.json" + }, + { + "path": "node_modules/color-name/package.json" + }, + { + "path": "node_modules/diff/package.json" + }, + { + "path": "node_modules/hosted-git-info/package.json" + }, + { + "path": "node_modules/require-main-filename/package.json" + }, + { + "path": "node_modules/node-fetch/package.json" + }, + { + "path": "node_modules/finalhandler/package.json" + }, + { + "path": "node_modules/finalhandler/node_modules/ms/package.json" + }, + { + "path": "node_modules/finalhandler/node_modules/debug/package.json" + }, + { + "path": "node_modules/js-tokens/package.json" + }, + { + "path": "node_modules/fast-deep-equal/package.json" + }, + { + "path": "node_modules/linkinator/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/color-convert/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/has-flag/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/color-name/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/chalk/package.json" + }, + { + "path": "node_modules/jsdoc/package.json" + }, + { + "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" + }, + { + "path": "node_modules/which/package.json" + }, + { + "path": "node_modules/lodash.camelcase/package.json" + }, + { + "path": "node_modules/prelude-ls/package.json" + }, + { + "path": "node_modules/type-name/package.json" + }, + { + "path": "node_modules/is-extglob/package.json" + }, + { + "path": "node_modules/imurmurhash/package.json" + }, + { + "path": "node_modules/amdefine/package.json" + }, + { + "path": "node_modules/supports-color/package.json" + }, + { + "path": "node_modules/escope/package.json" + }, + { + "path": "node_modules/eslint-plugin-prettier/package.json" + }, + { + "path": "node_modules/normalize-package-data/package.json" + }, + { + "path": "node_modules/normalize-package-data/node_modules/semver/package.json" + }, + { + "path": "node_modules/punycode/package.json" + }, + { + "path": "node_modules/istanbul-reports/package.json" + }, + { + "path": "node_modules/eslint-utils/package.json" + }, + { + "path": "node_modules/string-width/package.json" + }, + { + "path": "node_modules/p-cancelable/package.json" + }, + { + "path": "node_modules/npm-bundled/package.json" + }, + { + "path": "node_modules/iconv-lite/package.json" + }, + { + "path": "node_modules/istanbul-lib-coverage/package.json" + }, + { + "path": "node_modules/spdx-license-ids/package.json" + }, + { + "path": "node_modules/through/package.json" + }, + { + "path": "node_modules/pseudomap/package.json" + }, + { + "path": "node_modules/npm-normalize-package-bin/package.json" + }, + { + "path": "node_modules/codecov/package.json" + }, + { + "path": "node_modules/codecov/node_modules/teeny-request/package.json" + }, + { + "path": "node_modules/codecov/node_modules/https-proxy-agent/package.json" + }, + { + "path": "node_modules/semver/package.json" + }, + { + "path": "node_modules/read-pkg/package.json" + }, + { + "path": "node_modules/arrify/package.json" + }, + { + "path": "node_modules/gtoken/package.json" + }, + { + "path": "node_modules/power-assert-renderer-assertion/package.json" + }, + { + "path": "node_modules/prettier-linter-helpers/package.json" + }, + { + "path": "node_modules/jsdoc-fresh/package.json" + }, + { + "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" + }, + { + "path": "node_modules/@protobufjs/fetch/package.json" + }, + { + "path": "node_modules/@protobufjs/utf8/package.json" + }, + { + "path": "node_modules/@protobufjs/aspromise/package.json" + }, + { + "path": "node_modules/@protobufjs/path/package.json" + }, + { + "path": "node_modules/@protobufjs/float/package.json" + }, + { + "path": "node_modules/@protobufjs/eventemitter/package.json" + }, + { + "path": "node_modules/@protobufjs/codegen/package.json" + }, + { + "path": "node_modules/@protobufjs/inquire/package.json" + }, + { + "path": "node_modules/@protobufjs/base64/package.json" + }, + { + "path": "node_modules/@protobufjs/pool/package.json" + }, + { + "path": "node_modules/safe-buffer/package.json" + }, + { + "path": "node_modules/import-fresh/package.json" + }, + { + "path": "node_modules/js-yaml/package.json" + }, + { + "path": "node_modules/foreground-child/package.json" + }, + { + "path": "node_modules/external-editor/package.json" + }, + { + "path": "node_modules/abort-controller/package.json" + }, + { + "path": "node_modules/google-auth-library/package.json" + }, + { + "path": "node_modules/catharsis/package.json" + }, + { + "path": "node_modules/wrap-ansi/package.json" + }, + { + "path": "node_modules/mocha/package.json" + }, + { + "path": "node_modules/mocha/node_modules/yargs/package.json" + }, + { + "path": "node_modules/mocha/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/mocha/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/mocha/node_modules/ms/package.json" + }, + { + "path": "node_modules/mocha/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" + }, + { + "path": "node_modules/mocha/node_modules/diff/package.json" + }, + { + "path": "node_modules/mocha/node_modules/which/package.json" + }, + { + "path": "node_modules/mocha/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/mocha/node_modules/find-up/package.json" + }, + { + "path": "node_modules/mocha/node_modules/glob/package.json" + }, + { + "path": "node_modules/mocha/node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/empower/package.json" + }, + { + "path": "node_modules/http2spy/package.json" + }, + { + "path": "node_modules/agent-base/package.json" + }, + { + "path": "node_modules/fast-diff/package.json" + }, + { + "path": "node_modules/flat-cache/package.json" + }, + { + "path": "node_modules/flat-cache/node_modules/rimraf/package.json" + }, + { + "path": "node_modules/htmlparser2/package.json" + }, + { + "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" + }, + { + "path": "node_modules/npm-run-path/package.json" + }, + { + "path": "node_modules/npm-run-path/node_modules/path-key/package.json" + }, + { + "path": "node_modules/rxjs/package.json" + }, + { + "path": "node_modules/fs.realpath/package.json" + }, + { + "path": "node_modules/source-map-support/package.json" + }, + { + "path": "node_modules/fs-minipass/package.json" + }, + { + "path": "node_modules/parse-json/package.json" + }, + { + "path": "node_modules/debug/package.json" + }, + { + "path": "node_modules/multi-stage-sourcemap/package.json" + }, + { + "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" + }, + { + "path": "node_modules/type/package.json" + }, + { + "path": "node_modules/isarray/package.json" + }, + { + "path": "node_modules/widest-line/package.json" + }, + { + "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/widest-line/node_modules/string-width/package.json" + }, + { + "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/event-emitter/package.json" + }, + { + "path": "node_modules/power-assert/package.json" + }, + { + "path": "node_modules/@google-cloud/common/package.json" + }, + { + "path": "node_modules/@google-cloud/promisify/package.json" + }, + { + "path": "node_modules/@google-cloud/projectify/package.json" + }, + { + "path": "node_modules/has-yarn/package.json" + }, + { + "path": "node_modules/base64-js/package.json" + }, + { + "path": "node_modules/restore-cursor/package.json" + }, + { + "path": "node_modules/es6-promise/package.json" + }, + { + "path": "node_modules/mime-types/package.json" + }, + { + "path": "node_modules/clone-response/package.json" + }, + { + "path": "node_modules/tslint/package.json" + }, + { + "path": "node_modules/tslint/node_modules/semver/package.json" + }, + { + "path": "node_modules/crypto-random-string/package.json" + }, + { + "path": "node_modules/es5-ext/package.json" + }, + { + "path": "node_modules/is-stream/package.json" + }, + { + "path": "node_modules/shebang-regex/package.json" + }, + { + "path": "node_modules/jsonexport/package.json" + }, + { + "path": "node_modules/fast-json-stable-stringify/package.json" + }, + { + "path": "node_modules/espurify/package.json" + }, + { + "path": "node_modules/fresh/package.json" + }, + { + "path": "node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/type-check/package.json" + }, + { + "path": "node_modules/tmp/package.json" + }, + { + "path": "node_modules/inherits/package.json" + }, + { + "path": "node_modules/find-up/package.json" + }, + { + "path": "node_modules/is-symbol/package.json" + }, + { + "path": "node_modules/traverse/package.json" + }, + { + "path": "node_modules/es6-set/package.json" + }, + { + "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" + }, + { + "path": "node_modules/furi/package.json" + }, + { + "path": "node_modules/gaxios/package.json" + }, + { + "path": "node_modules/pump/package.json" + }, + { + "path": "node_modules/log-symbols/package.json" + }, + { + "path": "node_modules/doctrine/package.json" + }, + { + "path": "node_modules/es6-weak-map/package.json" + }, + { + "path": "node_modules/delayed-stream/package.json" + }, + { + "path": "node_modules/d/package.json" + }, + { + "path": "node_modules/@types/tough-cookie/package.json" + }, + { + "path": "node_modules/@types/long/package.json" + }, + { + "path": "node_modules/@types/extend/package.json" + }, + { + "path": "node_modules/@types/color-name/package.json" + }, + { + "path": "node_modules/@types/istanbul-lib-coverage/package.json" + }, + { + "path": "node_modules/@types/mocha/package.json" + }, + { + "path": "node_modules/@types/node/package.json" + }, + { + "path": "node_modules/@types/is-windows/package.json" + }, + { + "path": "node_modules/@types/caseless/package.json" + }, + { + "path": "node_modules/@types/request/package.json" + }, + { + "path": "node_modules/@types/is/package.json" + }, + { + "path": "node_modules/@types/proxyquire/package.json" + }, + { + "path": "node_modules/strip-indent/package.json" + }, + { + "path": "node_modules/empower-core/package.json" + }, + { + "path": "node_modules/empower-assert/package.json" + }, + { + "path": "node_modules/keyv/package.json" + }, + { + "path": "node_modules/brace-expansion/package.json" + }, + { + "path": "node_modules/eslint-scope/package.json" + }, + { + "path": "node_modules/update-notifier/package.json" + }, + { + "path": "node_modules/inquirer/package.json" + }, + { + "path": "node_modules/inquirer/node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/inquirer/node_modules/string-width/package.json" + }, + { + "path": "node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/inquirer/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/slice-ansi/package.json" + }, + { + "path": "node_modules/path-is-inside/package.json" + }, + { + "path": "node_modules/is-path-inside/package.json" + }, + { + "path": "node_modules/which-module/package.json" + }, + { + "path": "node_modules/sprintf-js/package.json" + }, + { + "path": "node_modules/power-assert-context-formatter/package.json" + }, + { + "path": "node_modules/word-wrap/package.json" + }, + { + "path": "node_modules/normalize-url/package.json" + }, + { + "path": "node_modules/term-size/package.json" + }, + { + "path": "node_modules/mkdirp/package.json" + }, + { + "path": "node_modules/mkdirp/node_modules/minimist/package.json" + }, + { + "path": "node_modules/setprototypeof/package.json" + }, + { + "path": "node_modules/entities/package.json" + }, + { + "path": "node_modules/send/package.json" + }, + { + "path": "node_modules/send/node_modules/ms/package.json" + }, + { + "path": "node_modules/send/node_modules/debug/package.json" + }, + { + "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" + }, + { + "path": "node_modules/send/node_modules/mime/package.json" + }, + { + "path": "node_modules/eslint-visitor-keys/package.json" + }, + { + "path": "node_modules/intelli-espower-loader/package.json" + }, + { + "path": "node_modules/taffydb/package.json" + }, + { + "path": "node_modules/espree/package.json" + }, + { + "path": "node_modules/readable-stream/package.json" + }, + { + "path": "node_modules/minipass/package.json" + }, + { + "path": "node_modules/minipass/node_modules/yallist/package.json" + }, + { + "path": "node_modules/parseurl/package.json" + }, + { + "path": "node_modules/spdx-expression-parse/package.json" + }, + { + "path": "node_modules/google-gax/package.json" + }, + { + "path": "node_modules/astral-regex/package.json" + }, + { + "path": "node_modules/regexp.prototype.flags/package.json" + }, + { + "path": "node_modules/mime-db/package.json" + }, + { + "path": "node_modules/p-timeout/package.json" + }, + { + "path": "node_modules/boxen/package.json" + }, + { + "path": "node_modules/boxen/node_modules/type-fest/package.json" + }, + { + "path": "node_modules/tar/package.json" + }, + { + "path": "node_modules/tar/node_modules/yallist/package.json" + }, + { + "path": "node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/glob-parent/package.json" + }, + { + "path": "node_modules/json-schema-traverse/package.json" + }, + { + "path": "node_modules/lodash/package.json" + }, + { + "path": "node_modules/server-destroy/package.json" + }, + { + "path": "node_modules/cheerio/package.json" + }, + { + "path": "node_modules/growl/package.json" + }, + { + "path": "node_modules/http-cache-semantics/package.json" + }, + { + "path": "node_modules/levn/package.json" + }, + { + "path": "node_modules/resolve-from/package.json" + }, + { + "path": "node_modules/protobufjs/package.json" + }, + { + "path": "node_modules/protobufjs/cli/package.json" + }, + { + "path": "node_modules/protobufjs/cli/package-lock.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" + }, + { + "path": "node_modules/walkdir/package.json" + }, + { + "path": "node_modules/browser-stdout/package.json" + }, + { + "path": "node_modules/@bcoe/v8-coverage/package.json" + }, + { + "path": "node_modules/strip-bom/package.json" + }, + { + "path": "node_modules/html-tags/package.json" + }, + { + "path": "node_modules/eslint-plugin-es/package.json" + }, + { + "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" + }, + { + "path": "node_modules/esprima/package.json" + }, + { + "path": "node_modules/cli-cursor/package.json" + }, + { + "path": "node_modules/meow/package.json" + }, + { + "path": "node_modules/meow/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/meow/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/meow/node_modules/p-try/package.json" + }, + { + "path": "node_modules/meow/node_modules/camelcase/package.json" + }, + { + "path": "node_modules/meow/node_modules/read-pkg-up/package.json" + }, + { + "path": "node_modules/meow/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/meow/node_modules/find-up/package.json" + }, + { + "path": "node_modules/meow/node_modules/p-limit/package.json" + }, + { + "path": "node_modules/meow/node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/jws/package.json" + }, + { + "path": "node_modules/core-js/package.json" + }, + { + "path": "node_modules/to-readable-stream/package.json" + }, + { + "path": "node_modules/json-buffer/package.json" + }, + { + "path": "node_modules/espower-source/package.json" + }, + { + "path": "node_modules/espower-source/node_modules/acorn/package.json" + }, + { + "path": "node_modules/is-npm/package.json" + }, + { + "path": "node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/path-parse/package.json" + }, + { + "path": "node_modules/lru-cache/package.json" + }, + { + "path": "node_modules/glob/package.json" + }, + { + "path": "node_modules/pify/package.json" + }, + { + "path": "node_modules/object-inspect/package.json" + }, + { + "path": "node_modules/universal-deep-strict-equal/package.json" + }, + { + "path": "node_modules/espower-location-detector/package.json" + }, + { + "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" + }, + { + "path": "node_modules/wrappy/package.json" + }, + { + "path": "node_modules/is-url/package.json" + }, + { + "path": "node_modules/escallmatch/package.json" + }, + { + "path": "node_modules/escallmatch/node_modules/esprima/package.json" + }, + { + "path": "node_modules/string_decoder/package.json" + }, + { + "path": "node_modules/is-windows/package.json" + }, + { + "path": "node_modules/ansi-escapes/package.json" + }, + { + "path": "node_modules/argparse/package.json" + }, + { + "path": "node_modules/minimatch/package.json" + }, + { + "path": "node_modules/encodeurl/package.json" + }, + { + "path": "node_modules/define-properties/package.json" + }, + { + "path": "node_modules/require-directory/package.json" + }, + { + "path": "node_modules/p-limit/package.json" + }, + { + "path": "node_modules/bignumber.js/package.json" + }, + { + "path": "node_modules/make-dir/package.json" + }, + { + "path": "node_modules/make-dir/node_modules/semver/package.json" + }, + { + "path": "node_modules/source-map/package.json" + }, + { + "path": "node_modules/uc.micro/package.json" + }, + { + "path": "node_modules/eslint-config-prettier/package.json" + }, + { + "path": "node_modules/path-key/package.json" + }, + { + "path": "node_modules/validate-npm-package-license/package.json" + }, + { + "path": "node_modules/node-environment-flags/package.json" + }, + { + "path": "node_modules/node-environment-flags/node_modules/semver/package.json" + }, + { + "path": "node_modules/minimist-options/package.json" + }, + { + "path": "node_modules/minimist-options/node_modules/arrify/package.json" + }, + { + "path": "node_modules/signal-exit/package.json" + }, + { + "path": "node_modules/mime/package.json" + }, + { + "path": "node_modules/spdx-exceptions/package.json" + }, + { + "path": "node_modules/acorn/package.json" + }, + { + "path": "node_modules/ecdsa-sig-formatter/package.json" + }, + { + "path": "node_modules/p-queue/package.json" + }, + { + "path": "node_modules/linkify-it/package.json" + }, + { + "path": "node_modules/depd/package.json" + }, + { + "path": "node_modules/chalk/package.json" + }, + { + "path": "node_modules/chalk/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/has-symbols/package.json" + }, + { + "path": "node_modules/typescript/package.json" + }, + { + "path": "node_modules/domelementtype/package.json" + }, + { + "path": "node_modules/ignore/package.json" + }, + { + "path": "node_modules/xtend/package.json" + }, + { + "path": "node_modules/function-bind/package.json" + }, + { + "path": "node_modules/duplexify/package.json" + }, + { + "path": "node_modules/fill-keys/package.json" + }, + { + "path": "node_modules/nth-check/package.json" + }, + { + "path": "node_modules/stubs/package.json" + }, + { + "path": "node_modules/ansi-align/package.json" + }, + { + "path": "node_modules/fast-text-encoding/package.json" + }, + { + "path": "node_modules/stream-events/package.json" + }, + { + "path": "node_modules/indexof/package.json" + }, + { + "path": "node_modules/ajv/package.json" + }, + { + "path": "node_modules/util-deprecate/package.json" + }, + { + "path": "node_modules/xmlcreate/package.json" + }, + { + "path": "node_modules/is-stream-ended/package.json" + }, + { + "path": "node_modules/is-plain-obj/package.json" + }, + { + "path": "node_modules/espower-loader/package.json" + }, + { + "path": "node_modules/espower-loader/node_modules/source-map-support/package.json" + }, + { + "path": "node_modules/espower-loader/node_modules/source-map/package.json" + }, + { + "path": "node_modules/strip-eof/package.json" + }, + { + "path": "node_modules/currently-unhandled/package.json" + }, + { + "path": "node_modules/merge-estraverse-visitors/package.json" + }, + { + "path": "node_modules/module-not-found-error/package.json" + }, + { + "path": "node_modules/cliui/package.json" + }, + { + "path": "node_modules/acorn-es7-plugin/package.json" + }, + { + "path": "node_modules/figures/package.json" + }, + { + "path": "node_modules/chownr/package.json" + }, + { + "path": "node_modules/@szmarczak/http-timer/package.json" + }, + { + "path": "node_modules/redent/package.json" + }, + { + "path": "node_modules/ignore-walk/package.json" + }, + { + "path": "node_modules/buffer-equal-constant-time/package.json" + }, + { + "path": "node_modules/rc/package.json" + }, + { + "path": "node_modules/rc/node_modules/minimist/package.json" + }, + { + "path": "node_modules/rc/node_modules/strip-json-comments/package.json" + }, + { + "path": "node_modules/power-assert-context-reducer-ast/package.json" + }, + { + "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" + }, + { + "path": "node_modules/buffer-from/package.json" + }, + { + "path": "node_modules/is-glob/package.json" + }, + { + "path": "node_modules/array-find-index/package.json" + }, + { + "path": "node_modules/semver-diff/package.json" + }, + { + "path": "node_modules/semver-diff/node_modules/semver/package.json" + }, + { + "path": "node_modules/power-assert-context-traversal/package.json" + }, + { + "path": "node_modules/y18n/package.json" + }, + { + "path": "node_modules/is-installed-globally/package.json" + }, + { + "path": "node_modules/p-finally/package.json" + }, + { + "path": "node_modules/write/package.json" + }, + { + "path": "node_modules/power-assert-renderer-diagram/package.json" + }, + { + "path": "node_modules/@sindresorhus/is/package.json" + }, + { + "path": "node_modules/combined-stream/package.json" + }, + { + "path": "node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/fast-levenshtein/package.json" + }, + { + "path": "node_modules/isexe/package.json" + }, + { + "path": "node_modules/ncp/package.json" + }, + { + "path": "node_modules/parent-module/package.json" + }, + { + "path": "node_modules/cacheable-request/package.json" + }, + { + "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" + }, + { + "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" + }, + { + "path": "node_modules/prettier/package.json" + }, + { + "path": "node_modules/cli-boxes/package.json" + }, + { + "path": "node_modules/tslint-config-prettier/package.json" + }, + { + "path": "node_modules/merge-descriptors/package.json" + }, + { + "path": "node_modules/get-stdin/package.json" + }, + { + "path": "node_modules/is-arrayish/package.json" + }, + { + "path": "node_modules/https-proxy-agent/package.json" + }, + { + "path": "node_modules/pack-n-play/package.json" + }, + { + "path": "node_modules/pack-n-play/node_modules/tmp/package.json" + }, + { + "path": "node_modules/pack-n-play/node_modules/tmp/node_modules/rimraf/package.json" + }, + { + "path": "node_modules/convert-source-map/package.json" + }, + { + "path": "node_modules/is-object/package.json" + }, + { + "path": "node_modules/unpipe/package.json" + }, + { + "path": "node_modules/path-type/package.json" + }, + { + "path": "node_modules/path-type/node_modules/pify/package.json" + }, + { + "path": "node_modules/unique-string/package.json" + }, + { + "path": "node_modules/package-json/package.json" + }, + { + "path": "node_modules/range-parser/package.json" + }, + { + "path": "node_modules/lodash.has/package.json" + }, + { + "path": "node_modules/array-filter/package.json" + }, + { + "path": "node_modules/concat-map/package.json" + }, + { + "path": "node_modules/yallist/package.json" + }, + { + "path": "node_modules/etag/package.json" + }, + { + "path": "node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/ext/package.json" + }, + { + "path": "node_modules/ext/node_modules/type/package.json" + }, + { + "path": "node_modules/@grpc/grpc-js/package.json" + }, + { + "path": "node_modules/@grpc/proto-loader/package.json" + }, + { + "path": "node_modules/text-table/package.json" + }, + { + "path": "node_modules/retry-request/package.json" + }, + { + "path": "node_modules/retry-request/node_modules/debug/package.json" + }, + { + "path": "node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/minizlib/package.json" + }, + { + "path": "node_modules/minizlib/node_modules/yallist/package.json" + }, + { + "path": "node_modules/import-lazy/package.json" + }, + { + "path": "node_modules/resolve/package.json" + }, + { + "path": "node_modules/core-util-is/package.json" + }, + { + "path": "node_modules/power-assert-util-string-width/package.json" + }, + { + "path": "node_modules/tslib/package.json" + }, + { + "path": "node_modules/through2/package.json" + }, + { + "path": "node_modules/call-matcher/package.json" + }, + { + "path": "node_modules/node-forge/package.json" + }, + { + "path": "node_modules/next-tick/package.json" + }, + { + "path": "node_modules/is/package.json" + }, + { + "path": "node_modules/global-dirs/package.json" + }, + { + "path": "node_modules/is-arguments/package.json" + }, + { + "path": "node_modules/flatted/package.json" + }, + { + "path": "node_modules/quick-lru/package.json" + }, + { + "path": "node_modules/proxyquire/package.json" + }, + { + "path": "node_modules/npm-packlist/package.json" + }, + { + "path": "node_modules/has/package.json" + }, + { + "path": "node_modules/deep-equal/package.json" + }, + { + "path": "node_modules/marked/package.json" + }, + { + "path": "node_modules/optionator/package.json" + }, + { + "path": "node_modules/jwa/package.json" + }, + { + "path": "node_modules/estraverse/package.json" + }, + { + "path": "node_modules/responselike/package.json" + }, + { + "path": "node_modules/neo-async/package.json" + }, + { + "path": "node_modules/diff-match-patch/package.json" + }, + { + "path": "node_modules/css-select/package.json" + }, + { + "path": "node_modules/destroy/package.json" + }, + { + "path": "node_modules/uuid/package.json" + }, + { + "path": "node_modules/espower/package.json" + }, + { + "path": "node_modules/espower/node_modules/source-map/package.json" + }, + { + "path": "node_modules/registry-auth-token/package.json" + }, + { + "path": "node_modules/xdg-basedir/package.json" + }, + { + "path": "node_modules/event-target-shim/package.json" + }, + { + "path": "node_modules/bluebird/package.json" + }, + { + "path": "node_modules/is-obj/package.json" + }, + { + "path": "node_modules/table/package.json" + }, + { + "path": "node_modules/is-yarn-global/package.json" + }, + { + "path": "node_modules/json-stable-stringify-without-jsonify/package.json" + }, + { + "path": "node_modules/is-promise/package.json" + }, + { + "path": "node_modules/nice-try/package.json" + }, + { + "path": "node_modules/get-caller-file/package.json" + }, + { + "path": "node_modules/es-to-primitive/package.json" + }, + { + "path": ".kokoro/docs.sh" + }, + { + "path": ".kokoro/system-test.sh" + }, + { + "path": ".kokoro/pre-system-test.sh" + }, + { + "path": ".kokoro/common.cfg" + }, + { + "path": ".kokoro/publish.sh" + }, + { + "path": ".kokoro/.gitattributes" + }, + { + "path": ".kokoro/trampoline.sh" + }, + { + "path": ".kokoro/samples-test.sh" + }, + { + "path": ".kokoro/lint.sh" + }, + { + "path": ".kokoro/test.bat" + }, + { + "path": ".kokoro/test.sh" + }, + { + "path": ".kokoro/presubmit/node8/common.cfg" + }, + { + "path": ".kokoro/presubmit/node8/test.cfg" + }, + { + "path": ".kokoro/presubmit/node12/common.cfg" + }, + { + "path": ".kokoro/presubmit/node12/test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/common.cfg" + }, + { + "path": ".kokoro/presubmit/node10/samples-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/docs.cfg" + }, + { + "path": ".kokoro/presubmit/node10/lint.cfg" + }, + { + "path": ".kokoro/presubmit/node10/test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/system-test.cfg" + }, + { + "path": ".kokoro/presubmit/windows/common.cfg" + }, + { + "path": ".kokoro/presubmit/windows/test.cfg" + }, + { + "path": ".kokoro/continuous/node8/common.cfg" + }, + { + "path": ".kokoro/continuous/node8/test.cfg" + }, + { + "path": ".kokoro/continuous/node12/common.cfg" + }, + { + "path": ".kokoro/continuous/node12/test.cfg" + }, + { + "path": ".kokoro/continuous/node10/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/samples-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/docs.cfg" + }, + { + "path": ".kokoro/continuous/node10/lint.cfg" + }, + { + "path": ".kokoro/continuous/node10/test.cfg" + }, + { + "path": ".kokoro/continuous/node10/system-test.cfg" + }, + { + "path": ".kokoro/release/docs.sh" + }, + { + "path": ".kokoro/release/docs.cfg" + }, + { + "path": ".kokoro/release/publish.cfg" + }, + { + "path": "test/index.ts" + }, + { + "path": "test/gapic-translation_service-v3beta1.ts" + }, + { + "path": "test/.eslintrc.yml" + }, + { + "path": "test/gapic-translation_service-v3.ts" + }, + { + "path": "test/mocha.opts" + }, + { + "path": "__pycache__/synth.cpython-36.pyc" + }, + { + "path": "samples/.eslintrc.yml" + }, + { + "path": "samples/hybridGlossaries.js" + }, + { + "path": "samples/package.json" + }, + { + "path": "samples/README.md" + }, + { + "path": "samples/translate.js" + }, + { + "path": "samples/quickstart.js" + }, + { + "path": "samples/automl/automlTranslationPredict.js" + }, + { + "path": "samples/automl/automlTranslationModel.js" + }, + { + "path": "samples/automl/automlTranslationDataset.js" + }, + { + "path": "samples/automl/resources/testInput.txt" + }, + { + "path": "samples/v3/translate_delete_glossary.js" + }, + { + "path": "samples/v3/translate_batch_translate_text.js" + }, + { + "path": "samples/v3/translate_batch_translate_text_with_glossary.js" + }, + { + "path": "samples/v3/translate_translate_text_with_glossary.js" + }, + { + "path": "samples/v3/translate_list_language_names.js" + }, + { + "path": "samples/v3/translate_translate_text.js" + }, + { + "path": "samples/v3/translate_detect_language.js" + }, + { + "path": "samples/v3/translate_translate_text_with_glossary_and_model.js" + }, + { + "path": "samples/v3/translate_get_supported_languages_for_target.js" + }, + { + "path": "samples/v3/translate_list_codes.js" + }, + { + "path": "samples/v3/translate_batch_translate_text_with_model.js" + }, + { + "path": "samples/v3/translate_get_supported_languages.js" + }, + { + "path": "samples/v3/translate_create_glossary.js" + }, + { + "path": "samples/v3/translate_translate_text_with_model.js" + }, + { + "path": "samples/v3/translate_get_glossary.js" + }, + { + "path": "samples/v3/translate_list_glossary.js" + }, + { + "path": "samples/v3/translate_batch_translate_text_with_glossary_and_model.js" + }, + { + "path": "samples/test/hybridGlossaries.test.js" + }, + { + "path": "samples/test/translate.test.js" + }, + { + "path": "samples/test/.eslintrc.yml" + }, + { + "path": "samples/test/automlTranslation.test.js" + }, + { + "path": "samples/test/quickstart.test.js" + }, + { + "path": "samples/test/v3/translate_list_codes.test.js" + }, + { + "path": "samples/test/v3/translate_translate_text_with_glossary_and_model.test.js" + }, + { + "path": "samples/test/v3/translate_get_glossary.test.js" + }, + { + "path": "samples/test/v3/translate_get_supported_languages.test.js" + }, + { + "path": "samples/test/v3/translate_get_supported_languages_for_targets.test.js" + }, + { + "path": "samples/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js" + }, + { + "path": "samples/test/v3/translate_list_glossary.test.js" + }, + { + "path": "samples/test/v3/translate_batch_translate_text.test.js" + }, + { + "path": "samples/test/v3/translate_batch_translate_text_with_glossary.test.js" + }, + { + "path": "samples/test/v3/translate_create_glossary.test.js" + }, + { + "path": "samples/test/v3/translate_translate_text.test.js" + }, + { + "path": "samples/test/v3/translate_detect_language.test.js" + }, + { + "path": "samples/test/v3/translate_list_language_names.test.js" + }, + { + "path": "samples/test/v3/translate_translate_text_with_model.test.js" + }, + { + "path": "samples/test/v3/translate_delete_glossary.test.js" + }, + { + "path": "samples/test/v3/translate_batch_translate_text_with_model.test.js" + }, + { + "path": "samples/test/v3/translate_translate_text_with_glossary.test.js" + }, + { + "path": "samples/test/v3beta1/translate_list_codes_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_batch_translate_text_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_list_language_names_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_translate_text_with_glossary_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_delete_glossary_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_detect_language_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_list_glossary_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_translate_text_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_translate_text_with_model_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_get_glossary_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_create_glossary_beta.test.js" + }, + { + "path": "samples/resources/example.png" + }, + { + "path": "samples/v3beta1/translate_detect_language_beta.js" + }, + { + "path": "samples/v3beta1/translate_translate_text_with_model_beta.js" + }, + { + "path": "samples/v3beta1/translate_list_codes_beta.js" + }, + { + "path": "samples/v3beta1/translate_delete_glossary_beta.js" + }, + { + "path": "samples/v3beta1/translate_translate_text_with_glossary_beta.js" + }, + { + "path": "samples/v3beta1/translate_get_glossary_beta.js" + }, + { + "path": "samples/v3beta1/translate_batch_translate_text_beta.js" + }, + { + "path": "samples/v3beta1/translate_list_language_names_beta.js" + }, + { + "path": "samples/v3beta1/translate_create_glossary_beta.js" + }, + { + "path": "samples/v3beta1/translate_translate_text_beta.js" + }, + { + "path": "samples/v3beta1/translate_list_glossary_beta.js" + }, + { + "path": ".github/release-please.yml" + }, + { + "path": ".github/PULL_REQUEST_TEMPLATE.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/support_request.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/feature_request.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/bug_report.md" + }, + { + "path": "build/protos/protos.json" + }, + { + "path": "build/protos/protos.js" + }, + { + "path": "build/protos/protos.d.ts" + }, + { + "path": "build/protos/google/cloud/common_resources.proto" + }, + { + "path": "build/protos/google/cloud/translate/v3/translation_service.proto" + }, + { + "path": "build/protos/google/cloud/translate/v3beta1/translation_service.proto" + }, + { + "path": "build/test/index.js.map" + }, + { + "path": "build/test/gapic-translation_service-v3beta1.js.map" + }, + { + "path": "build/test/index.js" + }, + { + "path": "build/test/gapic-translation_service-v3.d.ts" + }, + { + "path": "build/test/index.d.ts" + }, + { + "path": "build/test/gapic-translation_service-v3.js.map" + }, + { + "path": "build/test/gapic-translation_service-v3beta1.js" + }, + { + "path": "build/test/gapic-translation_service-v3.js" + }, + { + "path": "build/test/gapic-translation_service-v3beta1.d.ts" + }, + { + "path": "build/system-test/install.js.map" + }, + { + "path": "build/system-test/install.d.ts" + }, + { + "path": "build/system-test/translate.d.ts" + }, + { + "path": "build/system-test/install.js" + }, + { + "path": "build/system-test/translate.js" + }, + { + "path": "build/system-test/translate.js.map" + }, + { + "path": "build/src/index.js.map" + }, + { + "path": "build/src/index.js" + }, + { + "path": "build/src/index.d.ts" + }, + { + "path": "build/src/v2/index.js.map" + }, + { + "path": "build/src/v2/index.js" + }, + { + "path": "build/src/v2/index.d.ts" + }, + { + "path": "build/src/v3/translation_service_client.d.ts" + }, + { + "path": "build/src/v3/index.js.map" + }, + { + "path": "build/src/v3/translation_service_client.js" + }, + { + "path": "build/src/v3/index.js" + }, + { + "path": "build/src/v3/index.d.ts" + }, + { + "path": "build/src/v3/translation_service_client_config.json" + }, + { + "path": "build/src/v3/translation_service_client.js.map" + }, + { + "path": "build/src/v3beta1/translation_service_client.d.ts" + }, + { + "path": "build/src/v3beta1/index.js.map" + }, + { + "path": "build/src/v3beta1/translation_service_client.js" + }, + { + "path": "build/src/v3beta1/index.js" + }, + { + "path": "build/src/v3beta1/index.d.ts" + }, + { + "path": "build/src/v3beta1/translation_service_client_config.json" + }, + { + "path": "build/src/v3beta1/translation_service_client.js.map" + }, + { + "path": "system-test/translate.ts" + }, + { + "path": "system-test/.eslintrc.yml" + }, + { + "path": "system-test/install.ts" + }, + { + "path": "system-test/fixtures/sample/src/index.ts" + }, + { + "path": "system-test/fixtures/sample/src/index.js" + }, + { + "path": "src/index.ts" + }, + { + "path": "src/v2/index.ts" + }, + { + "path": "src/v3/index.ts" + }, + { + "path": "src/v3/translation_service_client.ts" + }, + { + "path": "src/v3/translation_service_client_config.json" + }, + { + "path": "src/v3/translation_service_proto_list.json" + }, + { + "path": "src/v3beta1/index.ts" + }, + { + "path": "src/v3beta1/.eslintrc.yml" + }, + { + "path": "src/v3beta1/translation_service_client.ts" + }, + { + "path": "src/v3beta1/translation_service_client_config.json" + }, + { + "path": "src/v3beta1/translation_service_proto_list.json" + } ] } \ No newline at end of file From 59ca1268d3d23922360cabf09511409349f689a7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2019 08:23:19 -0800 Subject: [PATCH 310/513] chore: release 5.1.3 (#409) --- packages/google-cloud-translate/CHANGELOG.md | 9 +++++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 7dfdf2c4d0e..3771cdfecca 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,15 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [5.1.3](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.2...v5.1.3) (2019-12-16) + + +### Bug Fixes + +* refactored request call to supress unhandled promise rejection ([#406](https://www.github.com/googleapis/nodejs-translate/issues/406)) ([19fc9c7](https://www.github.com/googleapis/nodejs-translate/commit/19fc9c7d24e5b8d16f32d80023b81294e02d34d6)) +* removed display_name from sample ([f518b1a](https://www.github.com/googleapis/nodejs-translate/commit/f518b1a9b405626e058f9f143d3e8929af1401db)) +* update translate_create_glossary.js ([#403](https://www.github.com/googleapis/nodejs-translate/issues/403)) ([aa10fc7](https://www.github.com/googleapis/nodejs-translate/commit/aa10fc7ac9299895b7e87ebec574e27871e0bd1d)) + ### [5.1.2](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.1...v5.1.2) (2019-12-11) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index ecae425b73e..379c68c2237 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "5.1.2", + "version": "5.1.3", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index a104e2b2588..a2d7a1851f7 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^5.1.2", + "@google-cloud/translate": "^5.1.3", "@google-cloud/vision": "^1.2.0", "yargs": "^15.0.0" }, From 2daa153778d025099725582c9d32041c670e724f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 18 Dec 2019 11:59:29 -0800 Subject: [PATCH 311/513] fix: increase timeout from 20s to 60s (#411) --- .../v3/translation_service_client_config.json | 4 +- .../translation_service_client_config.json | 4 +- .../google-cloud-translate/synth.metadata | 1799 ++++++++--------- 3 files changed, 890 insertions(+), 917 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client_config.json b/packages/google-cloud-translate/src/v3/translation_service_client_config.json index fda9369d83f..1bddde9c201 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client_config.json +++ b/packages/google-cloud-translate/src/v3/translation_service_client_config.json @@ -13,9 +13,9 @@ "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 20000, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json index db6fab77c0a..0e66a2202d9 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json @@ -13,9 +13,9 @@ "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 20000, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index cf91c38471c..ca9d5d5f24e 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2019-12-13T12:27:17.330029Z", + "updateTime": "2019-12-18T12:28:27.381194Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2085a0d3c76180ee843cf2ecef2b94ca5266be31", - "internalRef": "285233245" + "sha": "3352100a15ede383f5ab3c34599f7a10a3d066fe", + "internalRef": "286065440" } }, { @@ -39,2689 +39,2662 @@ ], "newFiles": [ { - "path": "tslint.json" + "path": "package.json" }, { - "path": "codecov.yaml" + "path": "webpack.config.js" }, { - "path": "tsconfig.json" + "path": "linkinator.config.json" }, { - "path": "CONTRIBUTING.md" + "path": ".eslintrc.yml" }, { - "path": "renovate.json" + "path": ".prettierrc" }, { - "path": ".prettierrc" + "path": "codecov.yaml" }, { - "path": "linkinator.config.json" + "path": ".gitignore" }, { - "path": ".clang-format" + "path": "package-lock.json" }, { - "path": ".repo-metadata.json" + "path": "tslint.json" }, { - "path": ".readme-partials.yml" + "path": "tsconfig.json" }, { - "path": "CODE_OF_CONDUCT.md" + "path": ".nycrc" }, { - "path": ".eslintrc.yml" + "path": ".clang-format" }, { "path": "synth.metadata" }, { - "path": ".nycrc" + "path": "CONTRIBUTING.md" }, { - "path": "LICENSE" + "path": "README.md" }, { - "path": "CHANGELOG.md" + "path": ".repo-metadata.json" }, { - "path": "synth.py" + "path": ".jsdoc.js" }, { - "path": ".eslintignore" + "path": "renovate.json" }, { - "path": ".jsdoc.js" + "path": "CODE_OF_CONDUCT.md" }, { - "path": ".prettierignore" + "path": "LICENSE" }, { - "path": "webpack.config.js" + "path": ".readme-partials.yml" }, { - "path": "package.json" + "path": ".eslintignore" }, { - "path": "README.md" + "path": ".prettierignore" }, { - "path": ".gitignore" + "path": "CHANGELOG.md" }, { - "path": "package-lock.json" + "path": "synth.py" }, { - "path": ".git/HEAD" + "path": "protos/protos.json" }, { - "path": ".git/description" + "path": "protos/protos.d.ts" }, { - "path": ".git/shallow" + "path": "protos/protos.js" }, { - "path": ".git/config" + "path": "protos/google/cloud/common_resources.proto" }, { - "path": ".git/index" + "path": "protos/google/cloud/translate/v3beta1/translation_service.proto" }, { - "path": ".git/packed-refs" + "path": "protos/google/cloud/translate/v3/translation_service.proto" }, { - "path": ".git/logs/HEAD" + "path": "node_modules/meow/package.json" }, { - "path": ".git/logs/refs/remotes/origin/HEAD" + "path": "node_modules/meow/node_modules/read-pkg-up/package.json" }, { - "path": ".git/logs/refs/heads/autosynth" + "path": "node_modules/meow/node_modules/p-limit/package.json" }, { - "path": ".git/logs/refs/heads/master" + "path": "node_modules/meow/node_modules/find-up/package.json" }, { - "path": ".git/info/exclude" + "path": "node_modules/meow/node_modules/camelcase/package.json" }, { - "path": ".git/hooks/pre-applypatch.sample" + "path": "node_modules/meow/node_modules/p-locate/package.json" }, { - "path": ".git/hooks/commit-msg.sample" + "path": "node_modules/meow/node_modules/p-try/package.json" }, { - "path": ".git/hooks/pre-push.sample" + "path": "node_modules/meow/node_modules/path-exists/package.json" }, { - "path": ".git/hooks/post-update.sample" + "path": "node_modules/meow/node_modules/yargs-parser/package.json" }, { - "path": ".git/hooks/update.sample" + "path": "node_modules/meow/node_modules/locate-path/package.json" }, { - "path": ".git/hooks/pre-commit.sample" + "path": "node_modules/eslint/package.json" }, { - "path": ".git/hooks/pre-rebase.sample" + "path": "node_modules/eslint/node_modules/which/package.json" }, { - "path": ".git/hooks/prepare-commit-msg.sample" + "path": "node_modules/eslint/node_modules/shebang-regex/package.json" }, { - "path": ".git/hooks/applypatch-msg.sample" + "path": "node_modules/eslint/node_modules/cross-spawn/package.json" }, { - "path": ".git/hooks/pre-receive.sample" + "path": "node_modules/eslint/node_modules/cross-spawn/index.js" }, { - "path": ".git/hooks/fsmonitor-watchman.sample" + "path": "node_modules/eslint/node_modules/cross-spawn/README.md" }, { - "path": ".git/refs/remotes/origin/HEAD" + "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" }, { - "path": ".git/refs/heads/autosynth" + "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" }, { - "path": ".git/refs/heads/master" + "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" }, { - "path": ".git/objects/pack/pack-aeb825b05c07e0ff972d78bcc4e8c18a679f6e57.idx" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" }, { - "path": ".git/objects/pack/pack-aeb825b05c07e0ff972d78bcc4e8c18a679f6e57.pack" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" }, { - "path": "protos/protos.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" }, { - "path": "protos/protos.js" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" }, { - "path": "protos/protos.d.ts" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" }, { - "path": "protos/google/cloud/common_resources.proto" + "path": "node_modules/eslint/node_modules/debug/package.json" }, { - "path": "protos/google/cloud/translate/v3/translation_service.proto" + "path": "node_modules/eslint/node_modules/shebang-command/package.json" }, { - "path": "protos/google/cloud/translate/v3beta1/translation_service.proto" + "path": "node_modules/eslint/node_modules/path-key/package.json" }, { - "path": ".bots/header-checker-lint.json" + "path": "node_modules/espower-source/package.json" }, { - "path": "node_modules/eslint-plugin-node/package.json" + "path": "node_modules/espower-source/node_modules/acorn/package.json" }, { - "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" + "path": "node_modules/multi-stage-sourcemap/package.json" }, { - "path": "node_modules/is-callable/package.json" + "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" }, { - "path": "node_modules/natural-compare/package.json" + "path": "node_modules/escallmatch/package.json" }, { - "path": "node_modules/indent-string/package.json" + "path": "node_modules/escallmatch/node_modules/esprima/package.json" }, { - "path": "node_modules/ansi-colors/package.json" + "path": "node_modules/error-ex/package.json" }, { - "path": "node_modules/uglify-js/package.json" + "path": "node_modules/safer-buffer/package.json" }, { - "path": "node_modules/mimic-fn/package.json" + "path": "node_modules/crypto-random-string/package.json" }, { - "path": "node_modules/path-is-absolute/package.json" + "path": "node_modules/unique-string/package.json" }, { - "path": "node_modules/yargs/package.json" + "path": "node_modules/path-type/package.json" }, { - "path": "node_modules/yargs/node_modules/p-locate/package.json" + "path": "node_modules/path-type/node_modules/pify/package.json" }, { - "path": "node_modules/yargs/node_modules/locate-path/package.json" + "path": "node_modules/esquery/package.json" }, { - "path": "node_modules/yargs/node_modules/path-exists/package.json" + "path": "node_modules/array-find/package.json" }, { - "path": "node_modules/yargs/node_modules/find-up/package.json" + "path": "node_modules/power-assert-renderer-comparison/package.json" }, { - "path": "node_modules/is-ci/package.json" + "path": "node_modules/fresh/package.json" }, { - "path": "node_modules/esrecurse/package.json" + "path": "node_modules/ent/package.json" }, { - "path": "node_modules/array-find/package.json" + "path": "node_modules/parse5/package.json" }, { - "path": "node_modules/asynckit/package.json" + "path": "node_modules/espurify/package.json" }, { - "path": "node_modules/string.prototype.trimleft/package.json" + "path": "node_modules/restore-cursor/package.json" }, { - "path": "node_modules/once/package.json" + "path": "node_modules/is-windows/package.json" }, { - "path": "node_modules/http-proxy-agent/package.json" + "path": "node_modules/flatted/package.json" }, { - "path": "node_modules/http-proxy-agent/node_modules/ms/package.json" + "path": "node_modules/cliui/package.json" }, { - "path": "node_modules/http-proxy-agent/node_modules/debug/package.json" + "path": "node_modules/signal-exit/package.json" }, { - "path": "node_modules/p-locate/package.json" + "path": "node_modules/deep-equal/package.json" }, { - "path": "node_modules/typedarray-to-buffer/index.js" + "path": "node_modules/empower-core/package.json" }, { - "path": "node_modules/typedarray-to-buffer/LICENSE" + "path": "node_modules/resolve/package.json" }, { - "path": "node_modules/typedarray-to-buffer/.travis.yml" + "path": "node_modules/uc.micro/package.json" }, { - "path": "node_modules/typedarray-to-buffer/package.json" + "path": "node_modules/spdx-exceptions/package.json" }, { - "path": "node_modules/typedarray-to-buffer/README.md" + "path": "node_modules/power-assert-renderer-file/package.json" }, { - "path": "node_modules/typedarray-to-buffer/.airtap.yml" + "path": "node_modules/object.getownpropertydescriptors/package.json" }, { - "path": "node_modules/typedarray-to-buffer/test/basic.js" + "path": "node_modules/spdx-correct/package.json" }, { - "path": "node_modules/progress/package.json" + "path": "node_modules/power-assert-context-reducer-ast/package.json" }, { - "path": "node_modules/camelcase-keys/package.json" + "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" }, { - "path": "node_modules/camelcase-keys/node_modules/camelcase/package.json" + "path": "node_modules/ms/package.json" }, { - "path": "node_modules/is-html/package.json" + "path": "node_modules/eslint-config-prettier/package.json" }, { - "path": "node_modules/regexpp/package.json" + "path": "node_modules/diff-match-patch/package.json" }, { - "path": "node_modules/url-parse-lax/package.json" + "path": "node_modules/power-assert-context-formatter/package.json" }, { - "path": "node_modules/markdown-it/package.json" + "path": "node_modules/tslint-config-prettier/package.json" }, { - "path": "node_modules/deep-is/package.json" + "path": "node_modules/entities/package.json" }, { - "path": "node_modules/statuses/package.json" + "path": "node_modules/process-nextick-args/package.json" }, { - "path": "node_modules/eventemitter3/package.json" + "path": "node_modules/write/package.json" }, { - "path": "node_modules/stringifier/package.json" + "path": "node_modules/to-readable-stream/package.json" }, { - "path": "node_modules/trim-newlines/package.json" + "path": "node_modules/typescript/package.json" }, { - "path": "node_modules/v8-compile-cache/package.json" + "path": "node_modules/statuses/package.json" }, { - "path": "node_modules/got/package.json" + "path": "node_modules/natural-compare/package.json" }, { - "path": "node_modules/got/node_modules/get-stream/package.json" + "path": "node_modules/onetime/package.json" }, { - "path": "node_modules/ci-info/package.json" + "path": "node_modules/xmlcreate/package.json" }, { - "path": "node_modules/error-ex/package.json" + "path": "node_modules/glob/package.json" }, { - "path": "node_modules/object.getownpropertydescriptors/package.json" + "path": "node_modules/latest-version/package.json" }, { - "path": "node_modules/escodegen/package.json" + "path": "node_modules/y18n/package.json" }, { - "path": "node_modules/escodegen/node_modules/esprima/package.json" + "path": "node_modules/responselike/package.json" }, { - "path": "node_modules/callsites/package.json" + "path": "node_modules/nth-check/package.json" }, { - "path": "node_modules/dot-prop/package.json" + "path": "node_modules/escodegen/package.json" }, { - "path": "node_modules/stream-shift/package.json" + "path": "node_modules/escodegen/node_modules/esprima/package.json" }, { - "path": "node_modules/wordwrap/package.json" + "path": "node_modules/brace-expansion/package.json" }, { - "path": "node_modules/is-date-object/package.json" + "path": "node_modules/type-name/package.json" }, { - "path": "node_modules/long/package.json" + "path": "node_modules/figures/package.json" }, { - "path": "node_modules/functional-red-black-tree/package.json" + "path": "node_modules/mime-types/package.json" }, { - "path": "node_modules/graceful-fs/package.json" + "path": "node_modules/cli-boxes/package.json" }, { - "path": "node_modules/is-regex/package.json" + "path": "node_modules/normalize-url/package.json" }, { - "path": "node_modules/lodash.at/package.json" + "path": "node_modules/xtend/package.json" }, { - "path": "node_modules/locate-path/package.json" + "path": "node_modules/core-util-is/package.json" }, { - "path": "node_modules/onetime/package.json" + "path": "node_modules/widest-line/package.json" }, { - "path": "node_modules/decompress-response/package.json" + "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/css-what/package.json" + "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/toidentifier/package.json" + "path": "node_modules/widest-line/node_modules/string-width/package.json" }, { - "path": "node_modules/google-p12-pem/package.json" + "path": "node_modules/through/package.json" }, { - "path": "node_modules/ee-first/package.json" + "path": "node_modules/domutils/package.json" }, { - "path": "node_modules/es-abstract/package.json" + "path": "node_modules/c8/package.json" }, { - "path": "node_modules/execa/package.json" + "path": "node_modules/jsdoc-region-tag/package.json" }, { - "path": "node_modules/execa/node_modules/shebang-command/package.json" + "path": "node_modules/which/package.json" }, { - "path": "node_modules/execa/node_modules/which/package.json" + "path": "node_modules/map-obj/package.json" }, { - "path": "node_modules/execa/node_modules/is-stream/package.json" + "path": "node_modules/function-bind/package.json" }, { - "path": "node_modules/execa/node_modules/shebang-regex/package.json" + "path": "node_modules/require-directory/package.json" }, { - "path": "node_modules/execa/node_modules/cross-spawn/package.json" + "path": "node_modules/npm-bundled/package.json" }, { - "path": "node_modules/execa/node_modules/lru-cache/package.json" + "path": "node_modules/write-file-atomic/package.json" }, { - "path": "node_modules/execa/node_modules/yallist/package.json" + "path": "node_modules/resolve-from/package.json" }, { - "path": "node_modules/globals/package.json" + "path": "node_modules/espower-location-detector/package.json" }, { - "path": "node_modules/color-convert/package.json" - }, - { - "path": "node_modules/duplexer3/package.json" - }, - { - "path": "node_modules/esutils/package.json" - }, - { - "path": "node_modules/es6-map/package.json" - }, - { - "path": "node_modules/js2xmlparser/package.json" - }, - { - "path": "node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/cli-width/package.json" + "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" }, { - "path": "node_modules/escape-string-regexp/package.json" + "path": "node_modules/mime/package.json" }, { - "path": "node_modules/registry-url/package.json" + "path": "node_modules/read-pkg-up/package.json" }, { - "path": "node_modules/os-tmpdir/package.json" + "path": "node_modules/read-pkg-up/node_modules/find-up/package.json" }, { - "path": "node_modules/object.assign/package.json" + "path": "node_modules/read-pkg-up/node_modules/p-locate/package.json" }, { - "path": "node_modules/mdurl/package.json" + "path": "node_modules/read-pkg-up/node_modules/path-exists/package.json" }, { - "path": "node_modules/minimist/package.json" + "path": "node_modules/read-pkg-up/node_modules/locate-path/package.json" }, { - "path": "node_modules/mute-stream/package.json" + "path": "node_modules/npm-normalize-package-bin/package.json" }, { - "path": "node_modules/p-try/package.json" + "path": "node_modules/npm-packlist/package.json" }, { - "path": "node_modules/gts/package.json" + "path": "node_modules/setprototypeof/package.json" }, { - "path": "node_modules/gts/node_modules/color-convert/package.json" + "path": "node_modules/strip-indent/package.json" }, { - "path": "node_modules/gts/node_modules/has-flag/package.json" + "path": "node_modules/event-emitter/package.json" }, { - "path": "node_modules/gts/node_modules/color-name/package.json" + "path": "node_modules/ci-info/package.json" }, { - "path": "node_modules/gts/node_modules/supports-color/package.json" + "path": "node_modules/ansi-styles/package.json" }, { - "path": "node_modules/gts/node_modules/ansi-styles/package.json" + "path": "node_modules/@sindresorhus/is/package.json" }, { - "path": "node_modules/gts/node_modules/chalk/package.json" + "path": "node_modules/is-promise/package.json" }, { - "path": "node_modules/gcp-metadata/package.json" + "path": "node_modules/server-destroy/package.json" }, { - "path": "node_modules/urlgrey/package.json" + "path": "node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/builtin-modules/package.json" + "path": "node_modules/mkdirp/package.json" }, { - "path": "node_modules/is-typedarray/package.json" + "path": "node_modules/mkdirp/node_modules/minimist/package.json" }, { - "path": "node_modules/loud-rejection/package.json" + "path": "node_modules/yallist/package.json" }, { - "path": "node_modules/object-keys/package.json" + "path": "node_modules/esutils/package.json" }, { - "path": "node_modules/requizzle/package.json" + "path": "node_modules/through2/package.json" }, { - "path": "node_modules/end-of-stream/package.json" + "path": "node_modules/es6-promisify/package.json" }, { - "path": "node_modules/spdx-correct/package.json" + "path": "node_modules/lodash/package.json" }, { - "path": "node_modules/parse5/package.json" + "path": "node_modules/power-assert-renderer-diagram/package.json" }, { - "path": "node_modules/domhandler/package.json" + "path": "node_modules/d/package.json" }, { - "path": "node_modules/ini/package.json" + "path": "node_modules/mimic-fn/package.json" }, { - "path": "node_modules/strip-ansi/package.json" + "path": "node_modules/depd/package.json" }, { - "path": "node_modules/decamelize-keys/package.json" + "path": "node_modules/acorn-jsx/package.json" }, { - "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" + "path": "node_modules/is-typedarray/package.json" }, { - "path": "node_modules/map-obj/package.json" + "path": "node_modules/neo-async/package.json" }, { - "path": "node_modules/get-stream/package.json" + "path": "node_modules/gts/package.json" }, { - "path": "node_modules/chardet/package.json" + "path": "node_modules/gts/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/write-file-atomic/package.json" + "path": "node_modules/gts/node_modules/color-name/package.json" }, { - "path": "node_modules/flat/package.json" + "path": "node_modules/gts/node_modules/color-convert/package.json" }, { - "path": "node_modules/balanced-match/package.json" + "path": "node_modules/gts/node_modules/chalk/package.json" }, { - "path": "node_modules/esquery/package.json" + "path": "node_modules/gts/node_modules/has-flag/package.json" }, { - "path": "node_modules/set-blocking/package.json" + "path": "node_modules/gts/node_modules/supports-color/package.json" }, { - "path": "node_modules/configstore/package.json" + "path": "node_modules/protobufjs/package.json" }, { - "path": "node_modules/configstore/node_modules/write-file-atomic/package.json" + "path": "node_modules/protobufjs/cli/package.json" }, { - "path": "node_modules/configstore/node_modules/pify/package.json" + "path": "node_modules/protobufjs/cli/package-lock.json" }, { - "path": "node_modules/configstore/node_modules/make-dir/package.json" + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" }, { - "path": "node_modules/dom-serializer/package.json" + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" }, { - "path": "node_modules/process-nextick-args/package.json" + "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" }, { - "path": "node_modules/defer-to-connect/package.json" + "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" }, { - "path": "node_modules/c8/package.json" + "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" }, { - "path": "node_modules/klaw/package.json" + "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" }, { - "path": "node_modules/latest-version/package.json" + "path": "node_modules/p-finally/package.json" }, { "path": "node_modules/istanbul-lib-report/package.json" }, { - "path": "node_modules/eastasianwidth/package.json" - }, - { - "path": "node_modules/mimic-response/package.json" - }, - { - "path": "node_modules/rimraf/package.json" - }, - { - "path": "node_modules/camelcase/package.json" + "path": "node_modules/readable-stream/package.json" }, { - "path": "node_modules/domutils/package.json" + "path": "node_modules/define-properties/package.json" }, { - "path": "node_modules/file-entry-cache/package.json" + "path": "node_modules/es-to-primitive/package.json" }, { - "path": "node_modules/lowercase-keys/package.json" + "path": "node_modules/p-limit/package.json" }, { - "path": "node_modules/acorn-jsx/package.json" + "path": "node_modules/power-assert-renderer-assertion/package.json" }, { - "path": "node_modules/run-async/package.json" + "path": "node_modules/is-yarn-global/package.json" }, { - "path": "node_modules/markdown-it-anchor/package.json" + "path": "node_modules/wrappy/package.json" }, { - "path": "node_modules/power-assert-renderer-comparison/package.json" + "path": "node_modules/pack-n-play/package.json" }, { - "path": "node_modules/uri-js/package.json" + "path": "node_modules/pack-n-play/node_modules/tmp/package.json" }, { - "path": "node_modules/commander/package.json" + "path": "node_modules/pack-n-play/node_modules/tmp/node_modules/rimraf/package.json" }, { - "path": "node_modules/ms/package.json" + "path": "node_modules/lodash.camelcase/package.json" }, { - "path": "node_modules/power-assert-renderer-base/package.json" + "path": "node_modules/ajv/package.json" }, { - "path": "node_modules/teeny-request/package.json" + "path": "node_modules/lodash.at/package.json" }, { - "path": "node_modules/boolbase/package.json" + "path": "node_modules/find-up/package.json" }, { - "path": "node_modules/object-is/package.json" + "path": "node_modules/merge-descriptors/package.json" }, { - "path": "node_modules/ent/package.json" + "path": "node_modules/pify/package.json" }, { - "path": "node_modules/inflight/package.json" + "path": "node_modules/ansi-regex/package.json" }, { - "path": "node_modules/on-finished/package.json" + "path": "node_modules/is-arrayish/package.json" }, { - "path": "node_modules/wide-align/package.json" + "path": "node_modules/builtin-modules/package.json" }, { - "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" + "path": "node_modules/os-tmpdir/package.json" }, { - "path": "node_modules/wide-align/node_modules/string-width/package.json" + "path": "node_modules/walkdir/package.json" }, { - "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" + "path": "node_modules/progress/package.json" }, { - "path": "node_modules/v8-to-istanbul/package.json" + "path": "node_modules/base64-js/package.json" }, { - "path": "node_modules/v8-to-istanbul/node_modules/source-map/package.json" + "path": "node_modules/buffer-equal-constant-time/package.json" }, { - "path": "node_modules/decamelize/package.json" + "path": "node_modules/jwa/package.json" }, { - "path": "node_modules/handlebars/package.json" + "path": "node_modules/chownr/package.json" }, { - "path": "node_modules/json-parse-better-errors/package.json" + "path": "node_modules/astral-regex/package.json" }, { - "path": "node_modules/es6-symbol/package.json" + "path": "node_modules/is-plain-obj/package.json" }, { - "path": "node_modules/load-json-file/package.json" + "path": "node_modules/core-js/package.json" }, { - "path": "node_modules/load-json-file/node_modules/pify/package.json" + "path": "node_modules/imurmurhash/package.json" }, { - "path": "node_modules/call-signature/package.json" + "path": "node_modules/cli-cursor/package.json" }, { - "path": "node_modules/optimist/package.json" + "path": "node_modules/markdown-it/package.json" }, { - "path": "node_modules/http-errors/package.json" + "path": "node_modules/esprima/package.json" }, { - "path": "node_modules/escape-html/package.json" + "path": "node_modules/make-dir/package.json" }, { - "path": "node_modules/safer-buffer/package.json" + "path": "node_modules/make-dir/node_modules/semver/package.json" }, { - "path": "node_modules/yargs-unparser/package.json" + "path": "node_modules/boolbase/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" + "path": "node_modules/destroy/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" + "path": "node_modules/object-is/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" + "path": "node_modules/diff/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" + "path": "node_modules/camelcase/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" + "path": "node_modules/pseudomap/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" + "path": "node_modules/bluebird/package.json" }, { - "path": "node_modules/form-data/package.json" + "path": "node_modules/ansi-escapes/package.json" }, { - "path": "node_modules/has-flag/package.json" + "path": "node_modules/graceful-fs/package.json" }, { - "path": "node_modules/string.prototype.trimright/package.json" + "path": "node_modules/v8-to-istanbul/package.json" }, { - "path": "node_modules/read-pkg-up/package.json" + "path": "node_modules/v8-to-istanbul/node_modules/source-map/package.json" }, { - "path": "node_modules/read-pkg-up/node_modules/p-locate/package.json" + "path": "node_modules/taffydb/package.json" }, { - "path": "node_modules/read-pkg-up/node_modules/locate-path/package.json" + "path": "node_modules/es6-iterator/package.json" }, { - "path": "node_modules/read-pkg-up/node_modules/path-exists/package.json" + "path": "node_modules/semver/package.json" }, { - "path": "node_modules/read-pkg-up/node_modules/find-up/package.json" + "path": "node_modules/is-buffer/package.json" }, { - "path": "node_modules/jsdoc-region-tag/package.json" + "path": "node_modules/browser-stdout/package.json" }, { - "path": "node_modules/shebang-command/package.json" + "path": "node_modules/fs.realpath/package.json" }, { - "path": "node_modules/path-exists/package.json" + "path": "node_modules/is-html/package.json" }, { - "path": "node_modules/power-assert-renderer-file/package.json" + "path": "node_modules/decamelize/package.json" }, { - "path": "node_modules/es6-promisify/package.json" + "path": "node_modules/read-pkg/package.json" }, { - "path": "node_modules/tsutils/package.json" + "path": "node_modules/deep-extend/package.json" }, { - "path": "node_modules/underscore/package.json" + "path": "node_modules/color-name/package.json" }, { - "path": "node_modules/eslint/package.json" + "path": "node_modules/handlebars/package.json" }, { - "path": "node_modules/eslint/node_modules/shebang-command/package.json" + "path": "node_modules/fast-levenshtein/package.json" }, { - "path": "node_modules/eslint/node_modules/which/package.json" + "path": "node_modules/type-check/package.json" }, { - "path": "node_modules/eslint/node_modules/debug/package.json" + "path": "node_modules/ansi-colors/package.json" }, { - "path": "node_modules/eslint/node_modules/shebang-regex/package.json" + "path": "node_modules/flat-cache/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/index.js" + "path": "node_modules/flat-cache/node_modules/rimraf/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" + "path": "node_modules/p-queue/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" + "path": "node_modules/callsites/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/package.json" + "path": "node_modules/shebang-regex/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/README.md" + "path": "node_modules/uuid/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" + "path": "node_modules/require-main-filename/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" + "path": "node_modules/is-path-inside/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" + "path": "node_modules/fast-deep-equal/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" + "path": "node_modules/es6-map/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" + "path": "node_modules/uglify-js/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" + "path": "node_modules/pump/package.json" }, { - "path": "node_modules/eslint/node_modules/path-key/package.json" + "path": "node_modules/is-date-object/package.json" }, { - "path": "node_modules/test-exclude/package.json" + "path": "node_modules/eventemitter3/package.json" }, { - "path": "node_modules/serve-static/package.json" + "path": "node_modules/inherits/package.json" }, { - "path": "node_modules/@babel/parser/package.json" + "path": "node_modules/minipass/package.json" }, { - "path": "node_modules/@babel/highlight/package.json" + "path": "node_modules/minipass/node_modules/yallist/package.json" }, { - "path": "node_modules/@babel/code-frame/package.json" + "path": "node_modules/markdown-it-anchor/package.json" }, { - "path": "node_modules/es6-iterator/package.json" + "path": "node_modules/get-caller-file/package.json" }, { - "path": "node_modules/deep-extend/package.json" + "path": "node_modules/espower/package.json" }, { - "path": "node_modules/strip-json-comments/package.json" + "path": "node_modules/espower/node_modules/source-map/package.json" }, { - "path": "node_modules/type-fest/package.json" + "path": "node_modules/mute-stream/package.json" }, { - "path": "node_modules/he/package.json" + "path": "node_modules/p-locate/package.json" }, { - "path": "node_modules/power-assert-formatter/package.json" + "path": "node_modules/minimatch/package.json" }, { - "path": "node_modules/json-bigint/package.json" + "path": "node_modules/argparse/package.json" }, { - "path": "node_modules/prepend-http/package.json" + "path": "node_modules/path-parse/package.json" }, { - "path": "node_modules/extend/package.json" + "path": "node_modules/escope/package.json" }, { - "path": "node_modules/argv/package.json" + "path": "node_modules/eslint-plugin-prettier/package.json" }, { - "path": "node_modules/color-name/package.json" + "path": "node_modules/configstore/package.json" }, { - "path": "node_modules/diff/package.json" + "path": "node_modules/configstore/node_modules/write-file-atomic/package.json" }, { - "path": "node_modules/hosted-git-info/package.json" + "path": "node_modules/configstore/node_modules/pify/package.json" }, { - "path": "node_modules/require-main-filename/package.json" + "path": "node_modules/configstore/node_modules/make-dir/package.json" }, { - "path": "node_modules/node-fetch/package.json" + "path": "node_modules/is-ci/package.json" }, { - "path": "node_modules/finalhandler/package.json" + "path": "node_modules/loud-rejection/package.json" }, { - "path": "node_modules/finalhandler/node_modules/ms/package.json" + "path": "node_modules/p-try/package.json" }, { - "path": "node_modules/finalhandler/node_modules/debug/package.json" + "path": "node_modules/jsdoc-fresh/package.json" }, { - "path": "node_modules/js-tokens/package.json" + "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" }, { - "path": "node_modules/fast-deep-equal/package.json" + "path": "node_modules/istanbul-reports/package.json" }, { - "path": "node_modules/linkinator/package.json" + "path": "node_modules/safe-buffer/package.json" }, { - "path": "node_modules/linkinator/node_modules/color-convert/package.json" + "path": "node_modules/prepend-http/package.json" }, { - "path": "node_modules/linkinator/node_modules/has-flag/package.json" + "path": "node_modules/path-exists/package.json" }, { - "path": "node_modules/linkinator/node_modules/color-name/package.json" + "path": "node_modules/trim-newlines/package.json" }, { - "path": "node_modules/linkinator/node_modules/supports-color/package.json" + "path": "node_modules/on-finished/package.json" }, { - "path": "node_modules/linkinator/node_modules/ansi-styles/package.json" + "path": "node_modules/furi/package.json" }, { - "path": "node_modules/linkinator/node_modules/chalk/package.json" + "path": "node_modules/has-symbols/package.json" }, { - "path": "node_modules/jsdoc/package.json" + "path": "node_modules/decompress-response/package.json" }, { - "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" + "path": "node_modules/util-deprecate/package.json" }, { - "path": "node_modules/which/package.json" + "path": "node_modules/duplexer3/package.json" }, { - "path": "node_modules/lodash.camelcase/package.json" + "path": "node_modules/color-convert/package.json" }, { - "path": "node_modules/prelude-ls/package.json" + "path": "node_modules/term-size/package.json" }, { - "path": "node_modules/type-name/package.json" + "path": "node_modules/decamelize-keys/package.json" }, { - "path": "node_modules/is-extglob/package.json" + "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" }, { - "path": "node_modules/imurmurhash/package.json" + "path": "node_modules/urlgrey/package.json" }, { - "path": "node_modules/amdefine/package.json" + "path": "node_modules/url-parse-lax/package.json" }, { - "path": "node_modules/supports-color/package.json" + "path": "node_modules/acorn-es7-plugin/package.json" }, { - "path": "node_modules/escope/package.json" + "path": "node_modules/log-symbols/package.json" }, { - "path": "node_modules/eslint-plugin-prettier/package.json" + "path": "node_modules/global-dirs/package.json" }, { - "path": "node_modules/normalize-package-data/package.json" + "path": "node_modules/power-assert-util-string-width/package.json" }, { - "path": "node_modules/normalize-package-data/node_modules/semver/package.json" + "path": "node_modules/boxen/package.json" }, { - "path": "node_modules/punycode/package.json" + "path": "node_modules/boxen/node_modules/type-fest/package.json" }, { - "path": "node_modules/istanbul-reports/package.json" + "path": "node_modules/traverse/package.json" }, { - "path": "node_modules/eslint-utils/package.json" + "path": "node_modules/deep-is/package.json" }, { - "path": "node_modules/string-width/package.json" + "path": "node_modules/event-target-shim/package.json" }, { - "path": "node_modules/p-cancelable/package.json" + "path": "node_modules/execa/package.json" }, { - "path": "node_modules/npm-bundled/package.json" + "path": "node_modules/execa/node_modules/which/package.json" }, { - "path": "node_modules/iconv-lite/package.json" + "path": "node_modules/execa/node_modules/yallist/package.json" }, { - "path": "node_modules/istanbul-lib-coverage/package.json" + "path": "node_modules/execa/node_modules/shebang-regex/package.json" }, { - "path": "node_modules/spdx-license-ids/package.json" + "path": "node_modules/execa/node_modules/cross-spawn/package.json" }, { - "path": "node_modules/through/package.json" + "path": "node_modules/execa/node_modules/is-stream/package.json" }, { - "path": "node_modules/pseudomap/package.json" + "path": "node_modules/execa/node_modules/shebang-command/package.json" }, { - "path": "node_modules/npm-normalize-package-bin/package.json" + "path": "node_modules/execa/node_modules/lru-cache/package.json" }, { - "path": "node_modules/codecov/package.json" + "path": "node_modules/update-notifier/package.json" }, { - "path": "node_modules/codecov/node_modules/teeny-request/package.json" + "path": "node_modules/estraverse/package.json" }, { - "path": "node_modules/codecov/node_modules/https-proxy-agent/package.json" + "path": "node_modules/combined-stream/package.json" }, { - "path": "node_modules/semver/package.json" + "path": "node_modules/file-entry-cache/package.json" }, { - "path": "node_modules/read-pkg/package.json" + "path": "node_modules/cheerio/package.json" }, { - "path": "node_modules/arrify/package.json" + "path": "node_modules/p-timeout/package.json" }, { - "path": "node_modules/gtoken/package.json" + "path": "node_modules/@types/tough-cookie/package.json" }, { - "path": "node_modules/power-assert-renderer-assertion/package.json" + "path": "node_modules/@types/node/package.json" }, { - "path": "node_modules/prettier-linter-helpers/package.json" + "path": "node_modules/@types/is-windows/package.json" }, { - "path": "node_modules/jsdoc-fresh/package.json" + "path": "node_modules/@types/caseless/package.json" }, { - "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" + "path": "node_modules/@types/color-name/package.json" }, { - "path": "node_modules/@protobufjs/fetch/package.json" + "path": "node_modules/@types/istanbul-lib-coverage/package.json" }, { - "path": "node_modules/@protobufjs/utf8/package.json" + "path": "node_modules/@types/proxyquire/package.json" }, { - "path": "node_modules/@protobufjs/aspromise/package.json" + "path": "node_modules/@types/request/package.json" }, { - "path": "node_modules/@protobufjs/path/package.json" + "path": "node_modules/@types/is/package.json" }, { - "path": "node_modules/@protobufjs/float/package.json" + "path": "node_modules/@types/extend/package.json" }, { - "path": "node_modules/@protobufjs/eventemitter/package.json" + "path": "node_modules/@types/mocha/package.json" }, { - "path": "node_modules/@protobufjs/codegen/package.json" + "path": "node_modules/@types/long/package.json" }, { - "path": "node_modules/@protobufjs/inquire/package.json" + "path": "node_modules/istanbul-lib-coverage/package.json" }, { - "path": "node_modules/@protobufjs/base64/package.json" + "path": "node_modules/send/package.json" }, { - "path": "node_modules/@protobufjs/pool/package.json" + "path": "node_modules/send/node_modules/ms/package.json" }, { - "path": "node_modules/safe-buffer/package.json" + "path": "node_modules/send/node_modules/mime/package.json" }, { - "path": "node_modules/import-fresh/package.json" + "path": "node_modules/send/node_modules/debug/package.json" }, { - "path": "node_modules/js-yaml/package.json" + "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" }, { - "path": "node_modules/foreground-child/package.json" + "path": "node_modules/wide-align/package.json" }, { - "path": "node_modules/external-editor/package.json" + "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/abort-controller/package.json" + "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/google-auth-library/package.json" + "path": "node_modules/wide-align/node_modules/string-width/package.json" }, { - "path": "node_modules/catharsis/package.json" + "path": "node_modules/get-stdin/package.json" }, { - "path": "node_modules/wrap-ansi/package.json" + "path": "node_modules/emoji-regex/package.json" }, { - "path": "node_modules/mocha/package.json" + "path": "node_modules/dot-prop/package.json" }, { - "path": "node_modules/mocha/node_modules/yargs/package.json" + "path": "node_modules/array-find-index/package.json" }, { - "path": "node_modules/mocha/node_modules/p-locate/package.json" + "path": "node_modules/arrify/package.json" }, { - "path": "node_modules/mocha/node_modules/locate-path/package.json" + "path": "node_modules/mimic-response/package.json" }, { - "path": "node_modules/mocha/node_modules/ms/package.json" + "path": "node_modules/ecdsa-sig-formatter/package.json" }, { - "path": "node_modules/mocha/node_modules/path-exists/package.json" + "path": "node_modules/stringifier/package.json" }, { - "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" + "path": "node_modules/codecov/package.json" }, { - "path": "node_modules/mocha/node_modules/diff/package.json" + "path": "node_modules/codecov/node_modules/https-proxy-agent/package.json" }, { - "path": "node_modules/mocha/node_modules/which/package.json" + "path": "node_modules/codecov/node_modules/teeny-request/package.json" }, { - "path": "node_modules/mocha/node_modules/supports-color/package.json" + "path": "node_modules/text-table/package.json" }, { - "path": "node_modules/mocha/node_modules/find-up/package.json" + "path": "node_modules/form-data/package.json" }, { - "path": "node_modules/mocha/node_modules/glob/package.json" + "path": "node_modules/escape-html/package.json" }, { - "path": "node_modules/mocha/node_modules/yargs-parser/package.json" + "path": "node_modules/stream-events/package.json" }, { - "path": "node_modules/empower/package.json" + "path": "node_modules/es6-set/package.json" }, { - "path": "node_modules/http2spy/package.json" + "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" }, { - "path": "node_modules/agent-base/package.json" + "path": "node_modules/semver-diff/package.json" }, { - "path": "node_modules/fast-diff/package.json" + "path": "node_modules/semver-diff/node_modules/semver/package.json" }, { - "path": "node_modules/flat-cache/package.json" + "path": "node_modules/merge-estraverse-visitors/package.json" }, { - "path": "node_modules/flat-cache/node_modules/rimraf/package.json" + "path": "node_modules/defer-to-connect/package.json" }, { - "path": "node_modules/htmlparser2/package.json" + "path": "node_modules/delayed-stream/package.json" }, { - "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" + "path": "node_modules/fast-diff/package.json" }, { - "path": "node_modules/npm-run-path/package.json" + "path": "node_modules/acorn/package.json" }, { - "path": "node_modules/npm-run-path/node_modules/path-key/package.json" + "path": "node_modules/rc/package.json" }, { - "path": "node_modules/rxjs/package.json" + "path": "node_modules/rc/node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/fs.realpath/package.json" + "path": "node_modules/rc/node_modules/minimist/package.json" }, { - "path": "node_modules/source-map-support/package.json" + "path": "node_modules/ansi-align/package.json" }, { - "path": "node_modules/fs-minipass/package.json" + "path": "node_modules/wrap-ansi/package.json" }, { - "path": "node_modules/parse-json/package.json" + "path": "node_modules/string.prototype.trimright/package.json" }, { - "path": "node_modules/debug/package.json" + "path": "node_modules/strip-ansi/package.json" }, { - "path": "node_modules/multi-stage-sourcemap/package.json" + "path": "node_modules/object-inspect/package.json" }, { - "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" + "path": "node_modules/normalize-package-data/package.json" }, { - "path": "node_modules/type/package.json" + "path": "node_modules/normalize-package-data/node_modules/semver/package.json" }, { - "path": "node_modules/isarray/package.json" + "path": "node_modules/path-is-absolute/package.json" }, { - "path": "node_modules/widest-line/package.json" + "path": "node_modules/http-cache-semantics/package.json" }, { - "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" + "path": "node_modules/hosted-git-info/package.json" }, { - "path": "node_modules/widest-line/node_modules/string-width/package.json" + "path": "node_modules/es6-weak-map/package.json" }, { - "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" + "path": "node_modules/@bcoe/v8-coverage/package.json" }, { - "path": "node_modules/event-emitter/package.json" + "path": "node_modules/js-yaml/package.json" }, { - "path": "node_modules/power-assert/package.json" + "path": "node_modules/test-exclude/package.json" }, { - "path": "node_modules/@google-cloud/common/package.json" + "path": "node_modules/parent-module/package.json" }, { - "path": "node_modules/@google-cloud/promisify/package.json" + "path": "node_modules/yargs-parser/package.json" }, { - "path": "node_modules/@google-cloud/projectify/package.json" + "path": "node_modules/etag/package.json" }, { - "path": "node_modules/has-yarn/package.json" + "path": "node_modules/call-signature/package.json" }, { - "path": "node_modules/base64-js/package.json" + "path": "node_modules/power-assert-formatter/package.json" }, { - "path": "node_modules/restore-cursor/package.json" + "path": "node_modules/ee-first/package.json" }, { - "path": "node_modules/es6-promise/package.json" + "path": "node_modules/regexpp/package.json" }, { - "path": "node_modules/mime-types/package.json" + "path": "node_modules/parse-json/package.json" }, { - "path": "node_modules/clone-response/package.json" + "path": "node_modules/iconv-lite/package.json" }, { - "path": "node_modules/tslint/package.json" + "path": "node_modules/is-object/package.json" }, { - "path": "node_modules/tslint/node_modules/semver/package.json" + "path": "node_modules/empower-assert/package.json" }, { - "path": "node_modules/crypto-random-string/package.json" + "path": "node_modules/end-of-stream/package.json" }, { - "path": "node_modules/es5-ext/package.json" + "path": "node_modules/eslint-visitor-keys/package.json" }, { - "path": "node_modules/is-stream/package.json" + "path": "node_modules/finalhandler/package.json" }, { - "path": "node_modules/shebang-regex/package.json" + "path": "node_modules/finalhandler/node_modules/ms/package.json" }, { - "path": "node_modules/jsonexport/package.json" + "path": "node_modules/finalhandler/node_modules/debug/package.json" }, { - "path": "node_modules/fast-json-stable-stringify/package.json" + "path": "node_modules/unpipe/package.json" }, { - "path": "node_modules/espurify/package.json" + "path": "node_modules/css-what/package.json" }, { - "path": "node_modules/fresh/package.json" + "path": "node_modules/convert-source-map/package.json" }, { - "path": "node_modules/cross-spawn/package.json" + "path": "node_modules/functional-red-black-tree/package.json" }, { - "path": "node_modules/type-check/package.json" + "path": "node_modules/json-stable-stringify-without-jsonify/package.json" }, { - "path": "node_modules/tmp/package.json" + "path": "node_modules/punycode/package.json" }, { - "path": "node_modules/inherits/package.json" + "path": "node_modules/has/package.json" }, { - "path": "node_modules/find-up/package.json" + "path": "node_modules/array-filter/package.json" }, { - "path": "node_modules/is-symbol/package.json" + "path": "node_modules/prettier-linter-helpers/package.json" }, { - "path": "node_modules/traverse/package.json" + "path": "node_modules/clone-response/package.json" }, { - "path": "node_modules/es6-set/package.json" + "path": "node_modules/balanced-match/package.json" }, { - "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" + "path": "node_modules/google-gax/package.json" }, { - "path": "node_modules/furi/package.json" + "path": "node_modules/cross-spawn/package.json" }, { - "path": "node_modules/gaxios/package.json" + "path": "node_modules/eslint-scope/package.json" }, { - "path": "node_modules/pump/package.json" + "path": "node_modules/debug/package.json" }, { - "path": "node_modules/log-symbols/package.json" + "path": "node_modules/yargs-unparser/package.json" }, { - "path": "node_modules/doctrine/package.json" + "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" }, { - "path": "node_modules/es6-weak-map/package.json" + "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" }, { - "path": "node_modules/delayed-stream/package.json" + "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" }, { - "path": "node_modules/d/package.json" + "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" }, { - "path": "node_modules/@types/tough-cookie/package.json" + "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" }, { - "path": "node_modules/@types/long/package.json" + "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" }, { - "path": "node_modules/@types/extend/package.json" + "path": "node_modules/spdx-license-ids/package.json" }, { - "path": "node_modules/@types/color-name/package.json" + "path": "node_modules/call-matcher/package.json" }, { - "path": "node_modules/@types/istanbul-lib-coverage/package.json" + "path": "node_modules/currently-unhandled/package.json" }, { - "path": "node_modules/@types/mocha/package.json" + "path": "node_modules/import-lazy/package.json" }, { - "path": "node_modules/@types/node/package.json" + "path": "node_modules/json-parse-better-errors/package.json" }, { - "path": "node_modules/@types/is-windows/package.json" + "path": "node_modules/p-cancelable/package.json" }, { - "path": "node_modules/@types/caseless/package.json" + "path": "node_modules/ncp/package.json" }, { - "path": "node_modules/@types/request/package.json" + "path": "node_modules/is-stream/package.json" }, { - "path": "node_modules/@types/is/package.json" + "path": "node_modules/argv/package.json" }, { - "path": "node_modules/@types/proxyquire/package.json" + "path": "node_modules/type-fest/package.json" }, { - "path": "node_modules/strip-indent/package.json" + "path": "node_modules/cli-width/package.json" }, { - "path": "node_modules/empower-core/package.json" + "path": "node_modules/doctrine/package.json" }, { - "path": "node_modules/empower-assert/package.json" + "path": "node_modules/lodash.has/package.json" }, { - "path": "node_modules/keyv/package.json" + "path": "node_modules/xdg-basedir/package.json" }, { - "path": "node_modules/brace-expansion/package.json" + "path": "node_modules/isexe/package.json" }, { - "path": "node_modules/eslint-scope/package.json" + "path": "node_modules/levn/package.json" }, { - "path": "node_modules/update-notifier/package.json" + "path": "node_modules/proxyquire/package.json" }, { - "path": "node_modules/inquirer/package.json" + "path": "node_modules/fast-json-stable-stringify/package.json" }, { - "path": "node_modules/inquirer/node_modules/emoji-regex/package.json" + "path": "node_modules/http-errors/package.json" }, { - "path": "node_modules/inquirer/node_modules/string-width/package.json" + "path": "node_modules/eastasianwidth/package.json" }, { - "path": "node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi/package.json" + "path": "node_modules/shebang-command/package.json" }, { - "path": "node_modules/inquirer/node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/concat-map/package.json" }, { - "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" + "path": "node_modules/http2spy/package.json" }, { - "path": "node_modules/slice-ansi/package.json" + "path": "node_modules/tmp/package.json" }, { - "path": "node_modules/path-is-inside/package.json" + "path": "node_modules/string_decoder/package.json" }, { - "path": "node_modules/is-path-inside/package.json" + "path": "node_modules/fast-text-encoding/package.json" }, { - "path": "node_modules/which-module/package.json" + "path": "node_modules/is-installed-globally/package.json" }, { - "path": "node_modules/sprintf-js/package.json" + "path": "node_modules/domhandler/package.json" }, { - "path": "node_modules/power-assert-context-formatter/package.json" + "path": "node_modules/jws/package.json" }, { - "path": "node_modules/word-wrap/package.json" + "path": "node_modules/glob-parent/package.json" }, { - "path": "node_modules/normalize-url/package.json" + "path": "node_modules/load-json-file/package.json" }, { - "path": "node_modules/term-size/package.json" + "path": "node_modules/load-json-file/node_modules/pify/package.json" }, { - "path": "node_modules/mkdirp/package.json" + "path": "node_modules/is-stream-ended/package.json" }, { - "path": "node_modules/mkdirp/node_modules/minimist/package.json" + "path": "node_modules/json-schema-traverse/package.json" }, { - "path": "node_modules/setprototypeof/package.json" + "path": "node_modules/run-async/package.json" }, { - "path": "node_modules/entities/package.json" + "path": "node_modules/is-symbol/package.json" }, { - "path": "node_modules/send/package.json" + "path": "node_modules/spdx-expression-parse/package.json" }, { - "path": "node_modules/send/node_modules/ms/package.json" + "path": "node_modules/word-wrap/package.json" }, { - "path": "node_modules/send/node_modules/debug/package.json" + "path": "node_modules/linkinator/package.json" }, { - "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" + "path": "node_modules/linkinator/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/send/node_modules/mime/package.json" + "path": "node_modules/linkinator/node_modules/color-name/package.json" }, { - "path": "node_modules/eslint-visitor-keys/package.json" + "path": "node_modules/linkinator/node_modules/color-convert/package.json" }, { - "path": "node_modules/intelli-espower-loader/package.json" + "path": "node_modules/linkinator/node_modules/chalk/package.json" }, { - "path": "node_modules/taffydb/package.json" + "path": "node_modules/linkinator/node_modules/has-flag/package.json" }, { - "path": "node_modules/espree/package.json" + "path": "node_modules/linkinator/node_modules/supports-color/package.json" }, { - "path": "node_modules/readable-stream/package.json" + "path": "node_modules/tar/package.json" }, { - "path": "node_modules/minipass/package.json" + "path": "node_modules/tar/node_modules/yallist/package.json" }, { - "path": "node_modules/minipass/node_modules/yallist/package.json" + "path": "node_modules/tsutils/package.json" }, { - "path": "node_modules/parseurl/package.json" + "path": "node_modules/power-assert/package.json" }, { - "path": "node_modules/spdx-expression-parse/package.json" + "path": "node_modules/get-stream/package.json" }, { - "path": "node_modules/google-gax/package.json" + "path": "node_modules/chalk/package.json" }, { - "path": "node_modules/astral-regex/package.json" + "path": "node_modules/chalk/node_modules/supports-color/package.json" }, { - "path": "node_modules/regexp.prototype.flags/package.json" + "path": "node_modules/path-is-inside/package.json" }, { - "path": "node_modules/mime-db/package.json" + "path": "node_modules/ignore/package.json" }, { - "path": "node_modules/p-timeout/package.json" + "path": "node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/boxen/package.json" + "path": "node_modules/json-buffer/package.json" }, { - "path": "node_modules/boxen/node_modules/type-fest/package.json" + "path": "node_modules/ignore-walk/package.json" }, { - "path": "node_modules/tar/package.json" + "path": "node_modules/eslint-utils/package.json" }, { - "path": "node_modules/tar/node_modules/yallist/package.json" + "path": "node_modules/object.assign/package.json" }, { - "path": "node_modules/ansi-styles/package.json" + "path": "node_modules/node-forge/package.json" }, { - "path": "node_modules/glob-parent/package.json" + "path": "node_modules/locate-path/package.json" }, { - "path": "node_modules/json-schema-traverse/package.json" + "path": "node_modules/registry-url/package.json" }, { - "path": "node_modules/lodash/package.json" + "path": "node_modules/requizzle/package.json" }, { - "path": "node_modules/server-destroy/package.json" + "path": "node_modules/tslint/package.json" }, { - "path": "node_modules/cheerio/package.json" + "path": "node_modules/tslint/node_modules/semver/package.json" }, { - "path": "node_modules/growl/package.json" + "path": "node_modules/keyv/package.json" }, { - "path": "node_modules/http-cache-semantics/package.json" + "path": "node_modules/strip-eof/package.json" }, { - "path": "node_modules/levn/package.json" + "path": "node_modules/lowercase-keys/package.json" }, { - "path": "node_modules/resolve-from/package.json" + "path": "node_modules/flat/package.json" }, { - "path": "node_modules/protobufjs/package.json" + "path": "node_modules/html-tags/package.json" }, { - "path": "node_modules/protobufjs/cli/package.json" + "path": "node_modules/gtoken/package.json" }, { - "path": "node_modules/protobufjs/cli/package-lock.json" + "path": "node_modules/es5-ext/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" + "path": "node_modules/has-flag/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" + "path": "node_modules/domelementtype/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" + "path": "node_modules/serve-static/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" + "path": "node_modules/underscore/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" + "path": "node_modules/prettier/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" + "path": "node_modules/got/package.json" }, { - "path": "node_modules/walkdir/package.json" + "path": "node_modules/got/node_modules/get-stream/package.json" }, { - "path": "node_modules/browser-stdout/package.json" + "path": "node_modules/marked/package.json" }, { - "path": "node_modules/@bcoe/v8-coverage/package.json" + "path": "node_modules/@babel/highlight/package.json" }, { - "path": "node_modules/strip-bom/package.json" + "path": "node_modules/@babel/code-frame/package.json" }, { - "path": "node_modules/html-tags/package.json" + "path": "node_modules/@babel/parser/package.json" }, { - "path": "node_modules/eslint-plugin-es/package.json" + "path": "node_modules/js2xmlparser/package.json" }, { - "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" + "path": "node_modules/ext/package.json" }, { - "path": "node_modules/esprima/package.json" + "path": "node_modules/ext/node_modules/type/package.json" }, { - "path": "node_modules/cli-cursor/package.json" + "path": "node_modules/espree/package.json" }, { - "path": "node_modules/meow/package.json" + "path": "node_modules/fill-keys/package.json" }, { - "path": "node_modules/meow/node_modules/p-locate/package.json" + "path": "node_modules/https-proxy-agent/package.json" }, { - "path": "node_modules/meow/node_modules/locate-path/package.json" + "path": "node_modules/validate-npm-package-license/package.json" }, { - "path": "node_modules/meow/node_modules/p-try/package.json" + "path": "node_modules/string-width/package.json" }, { - "path": "node_modules/meow/node_modules/camelcase/package.json" + "path": "node_modules/klaw/package.json" }, { - "path": "node_modules/meow/node_modules/read-pkg-up/package.json" + "path": "node_modules/power-assert-context-traversal/package.json" }, { - "path": "node_modules/meow/node_modules/path-exists/package.json" + "path": "node_modules/stubs/package.json" }, { - "path": "node_modules/meow/node_modules/find-up/package.json" + "path": "node_modules/http-proxy-agent/package.json" }, { - "path": "node_modules/meow/node_modules/p-limit/package.json" + "path": "node_modules/http-proxy-agent/node_modules/debug/package.json" }, { - "path": "node_modules/meow/node_modules/yargs-parser/package.json" + "path": "node_modules/http-proxy-agent/node_modules/agent-base/package.json" }, { - "path": "node_modules/jws/package.json" + "path": "node_modules/package-json/package.json" }, { - "path": "node_modules/core-js/package.json" + "path": "node_modules/is-callable/package.json" }, { - "path": "node_modules/to-readable-stream/package.json" + "path": "node_modules/is-url/package.json" }, { - "path": "node_modules/json-buffer/package.json" + "path": "node_modules/is/package.json" }, { - "path": "node_modules/espower-source/package.json" + "path": "node_modules/set-blocking/package.json" }, { - "path": "node_modules/espower-source/node_modules/acorn/package.json" + "path": "node_modules/parseurl/package.json" }, { - "path": "node_modules/is-npm/package.json" + "path": "node_modules/range-parser/package.json" }, { - "path": "node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/extend/package.json" }, { - "path": "node_modules/path-parse/package.json" + "path": "node_modules/node-environment-flags/package.json" }, { - "path": "node_modules/lru-cache/package.json" + "path": "node_modules/node-environment-flags/node_modules/semver/package.json" }, { - "path": "node_modules/glob/package.json" + "path": "node_modules/is-arguments/package.json" }, { - "path": "node_modules/pify/package.json" + "path": "node_modules/jsdoc/package.json" }, { - "path": "node_modules/object-inspect/package.json" + "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" }, { - "path": "node_modules/universal-deep-strict-equal/package.json" + "path": "node_modules/optimist/package.json" }, { - "path": "node_modules/espower-location-detector/package.json" + "path": "node_modules/optionator/package.json" }, { - "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" + "path": "node_modules/espower-loader/package.json" }, { - "path": "node_modules/wrappy/package.json" + "path": "node_modules/espower-loader/node_modules/source-map/package.json" }, { - "path": "node_modules/is-url/package.json" + "path": "node_modules/espower-loader/node_modules/source-map-support/package.json" }, { - "path": "node_modules/escallmatch/package.json" + "path": "node_modules/redent/package.json" }, { - "path": "node_modules/escallmatch/node_modules/esprima/package.json" + "path": "node_modules/eslint-plugin-es/package.json" }, { - "path": "node_modules/string_decoder/package.json" + "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" }, { - "path": "node_modules/is-windows/package.json" + "path": "node_modules/cacheable-request/package.json" }, { - "path": "node_modules/ansi-escapes/package.json" + "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" }, { - "path": "node_modules/argparse/package.json" + "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" }, { - "path": "node_modules/minimatch/package.json" + "path": "node_modules/foreground-child/package.json" }, { - "path": "node_modules/encodeurl/package.json" + "path": "node_modules/camelcase-keys/package.json" }, { - "path": "node_modules/define-properties/package.json" + "path": "node_modules/camelcase-keys/node_modules/camelcase/package.json" }, { - "path": "node_modules/require-directory/package.json" + "path": "node_modules/json-bigint/package.json" }, { - "path": "node_modules/p-limit/package.json" + "path": "node_modules/htmlparser2/package.json" }, { - "path": "node_modules/bignumber.js/package.json" + "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" }, { - "path": "node_modules/make-dir/package.json" + "path": "node_modules/rimraf/package.json" }, { - "path": "node_modules/make-dir/node_modules/semver/package.json" + "path": "node_modules/commander/package.json" }, { - "path": "node_modules/source-map/package.json" + "path": "node_modules/node-fetch/package.json" }, { - "path": "node_modules/uc.micro/package.json" + "path": "node_modules/abort-controller/package.json" }, { - "path": "node_modules/eslint-config-prettier/package.json" + "path": "node_modules/type/package.json" }, { - "path": "node_modules/path-key/package.json" + "path": "node_modules/he/package.json" }, { - "path": "node_modules/validate-npm-package-license/package.json" + "path": "node_modules/module-not-found-error/package.json" }, { - "path": "node_modules/node-environment-flags/package.json" + "path": "node_modules/bignumber.js/package.json" }, { - "path": "node_modules/node-environment-flags/node_modules/semver/package.json" + "path": "node_modules/minimist/package.json" }, { - "path": "node_modules/minimist-options/package.json" + "path": "node_modules/growl/package.json" }, { - "path": "node_modules/minimist-options/node_modules/arrify/package.json" + "path": "node_modules/source-map/package.json" }, { - "path": "node_modules/signal-exit/package.json" + "path": "node_modules/@szmarczak/http-timer/package.json" }, { - "path": "node_modules/mime/package.json" + "path": "node_modules/minizlib/package.json" }, { - "path": "node_modules/spdx-exceptions/package.json" + "path": "node_modules/minizlib/node_modules/yallist/package.json" }, { - "path": "node_modules/acorn/package.json" + "path": "node_modules/string.prototype.trimleft/package.json" }, { - "path": "node_modules/ecdsa-sig-formatter/package.json" + "path": "node_modules/quick-lru/package.json" }, { - "path": "node_modules/p-queue/package.json" + "path": "node_modules/rxjs/package.json" }, { - "path": "node_modules/linkify-it/package.json" + "path": "node_modules/nice-try/package.json" }, { - "path": "node_modules/depd/package.json" + "path": "node_modules/tslib/package.json" }, { - "path": "node_modules/chalk/package.json" + "path": "node_modules/chardet/package.json" }, { - "path": "node_modules/chalk/node_modules/supports-color/package.json" + "path": "node_modules/globals/package.json" }, { - "path": "node_modules/has-symbols/package.json" + "path": "node_modules/agent-base/package.json" }, { - "path": "node_modules/typescript/package.json" + "path": "node_modules/@grpc/proto-loader/package.json" }, { - "path": "node_modules/domelementtype/package.json" + "path": "node_modules/@grpc/grpc-js/package.json" }, { - "path": "node_modules/ignore/package.json" + "path": "node_modules/intelli-espower-loader/package.json" }, { - "path": "node_modules/xtend/package.json" + "path": "node_modules/buffer-from/package.json" }, { - "path": "node_modules/function-bind/package.json" + "path": "node_modules/prelude-ls/package.json" }, { "path": "node_modules/duplexify/package.json" }, { - "path": "node_modules/fill-keys/package.json" + "path": "node_modules/catharsis/package.json" }, { - "path": "node_modules/nth-check/package.json" + "path": "node_modules/mocha/package.json" }, { - "path": "node_modules/stubs/package.json" + "path": "node_modules/mocha/node_modules/ms/package.json" }, { - "path": "node_modules/ansi-align/package.json" + "path": "node_modules/mocha/node_modules/glob/package.json" }, { - "path": "node_modules/fast-text-encoding/package.json" + "path": "node_modules/mocha/node_modules/which/package.json" }, { - "path": "node_modules/stream-events/package.json" + "path": "node_modules/mocha/node_modules/find-up/package.json" }, { - "path": "node_modules/indexof/package.json" + "path": "node_modules/mocha/node_modules/diff/package.json" }, { - "path": "node_modules/ajv/package.json" + "path": "node_modules/mocha/node_modules/p-locate/package.json" }, { - "path": "node_modules/util-deprecate/package.json" + "path": "node_modules/mocha/node_modules/path-exists/package.json" }, { - "path": "node_modules/xmlcreate/package.json" + "path": "node_modules/mocha/node_modules/yargs-parser/package.json" }, { - "path": "node_modules/is-stream-ended/package.json" + "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/is-plain-obj/package.json" + "path": "node_modules/mocha/node_modules/locate-path/package.json" }, { - "path": "node_modules/espower-loader/package.json" + "path": "node_modules/mocha/node_modules/yargs/package.json" }, { - "path": "node_modules/espower-loader/node_modules/source-map-support/package.json" + "path": "node_modules/mocha/node_modules/supports-color/package.json" }, { - "path": "node_modules/espower-loader/node_modules/source-map/package.json" + "path": "node_modules/is-regex/package.json" }, { - "path": "node_modules/strip-eof/package.json" + "path": "node_modules/table/package.json" }, { - "path": "node_modules/currently-unhandled/package.json" + "path": "node_modules/import-fresh/package.json" }, { - "path": "node_modules/merge-estraverse-visitors/package.json" + "path": "node_modules/registry-auth-token/package.json" }, { - "path": "node_modules/module-not-found-error/package.json" + "path": "node_modules/long/package.json" }, { - "path": "node_modules/cliui/package.json" + "path": "node_modules/next-tick/package.json" }, { - "path": "node_modules/acorn-es7-plugin/package.json" + "path": "node_modules/indexof/package.json" }, { - "path": "node_modules/figures/package.json" + "path": "node_modules/object-keys/package.json" }, { - "path": "node_modules/chownr/package.json" + "path": "node_modules/has-yarn/package.json" }, { - "path": "node_modules/@szmarczak/http-timer/package.json" + "path": "node_modules/slice-ansi/package.json" }, { - "path": "node_modules/redent/package.json" + "path": "node_modules/ini/package.json" }, { - "path": "node_modules/ignore-walk/package.json" + "path": "node_modules/typedarray-to-buffer/.travis.yml" }, { - "path": "node_modules/buffer-equal-constant-time/package.json" + "path": "node_modules/typedarray-to-buffer/package.json" }, { - "path": "node_modules/rc/package.json" + "path": "node_modules/typedarray-to-buffer/index.js" }, { - "path": "node_modules/rc/node_modules/minimist/package.json" + "path": "node_modules/typedarray-to-buffer/README.md" }, { - "path": "node_modules/rc/node_modules/strip-json-comments/package.json" + "path": "node_modules/typedarray-to-buffer/.airtap.yml" }, { - "path": "node_modules/power-assert-context-reducer-ast/package.json" + "path": "node_modules/typedarray-to-buffer/LICENSE" }, { - "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" + "path": "node_modules/typedarray-to-buffer/test/basic.js" }, { - "path": "node_modules/buffer-from/package.json" + "path": "node_modules/source-map-support/package.json" }, { - "path": "node_modules/is-glob/package.json" + "path": "node_modules/fs-minipass/package.json" }, { - "path": "node_modules/array-find-index/package.json" + "path": "node_modules/retry-request/package.json" }, { - "path": "node_modules/semver-diff/package.json" + "path": "node_modules/retry-request/node_modules/debug/package.json" }, { - "path": "node_modules/semver-diff/node_modules/semver/package.json" + "path": "node_modules/strip-bom/package.json" }, { - "path": "node_modules/power-assert-context-traversal/package.json" + "path": "node_modules/toidentifier/package.json" }, { - "path": "node_modules/y18n/package.json" + "path": "node_modules/es6-symbol/package.json" }, { - "path": "node_modules/is-installed-globally/package.json" + "path": "node_modules/asynckit/package.json" }, { - "path": "node_modules/p-finally/package.json" + "path": "node_modules/dom-serializer/package.json" }, { - "path": "node_modules/write/package.json" + "path": "node_modules/v8-compile-cache/package.json" }, { - "path": "node_modules/power-assert-renderer-diagram/package.json" + "path": "node_modules/uri-js/package.json" }, { - "path": "node_modules/@sindresorhus/is/package.json" + "path": "node_modules/js-tokens/package.json" }, { - "path": "node_modules/combined-stream/package.json" + "path": "node_modules/isarray/package.json" }, { - "path": "node_modules/ansi-regex/package.json" + "path": "node_modules/es-abstract/package.json" }, { - "path": "node_modules/fast-levenshtein/package.json" + "path": "node_modules/universal-deep-strict-equal/package.json" }, { - "path": "node_modules/isexe/package.json" + "path": "node_modules/google-p12-pem/package.json" }, { - "path": "node_modules/ncp/package.json" + "path": "node_modules/is-extglob/package.json" }, { - "path": "node_modules/parent-module/package.json" + "path": "node_modules/is-glob/package.json" }, { - "path": "node_modules/cacheable-request/package.json" + "path": "node_modules/power-assert-renderer-base/package.json" }, { - "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" + "path": "node_modules/stream-shift/package.json" }, { - "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" + "path": "node_modules/gaxios/package.json" }, { - "path": "node_modules/prettier/package.json" + "path": "node_modules/external-editor/package.json" }, { - "path": "node_modules/cli-boxes/package.json" + "path": "node_modules/empower/package.json" }, { - "path": "node_modules/tslint-config-prettier/package.json" + "path": "node_modules/amdefine/package.json" }, { - "path": "node_modules/merge-descriptors/package.json" + "path": "node_modules/path-key/package.json" }, { - "path": "node_modules/get-stdin/package.json" + "path": "node_modules/yargs/package.json" }, { - "path": "node_modules/is-arrayish/package.json" + "path": "node_modules/yargs/node_modules/find-up/package.json" }, { - "path": "node_modules/https-proxy-agent/package.json" + "path": "node_modules/yargs/node_modules/p-locate/package.json" }, { - "path": "node_modules/pack-n-play/package.json" + "path": "node_modules/yargs/node_modules/path-exists/package.json" }, { - "path": "node_modules/pack-n-play/node_modules/tmp/package.json" + "path": "node_modules/yargs/node_modules/locate-path/package.json" }, { - "path": "node_modules/pack-n-play/node_modules/tmp/node_modules/rimraf/package.json" + "path": "node_modules/is-npm/package.json" }, { - "path": "node_modules/convert-source-map/package.json" + "path": "node_modules/mime-db/package.json" }, { - "path": "node_modules/is-object/package.json" + "path": "node_modules/mdurl/package.json" }, { - "path": "node_modules/unpipe/package.json" + "path": "node_modules/which-module/package.json" }, { - "path": "node_modules/path-type/package.json" + "path": "node_modules/is-obj/package.json" }, { - "path": "node_modules/path-type/node_modules/pify/package.json" + "path": "node_modules/escape-string-regexp/package.json" }, { - "path": "node_modules/unique-string/package.json" + "path": "node_modules/es6-promise/package.json" }, { - "path": "node_modules/package-json/package.json" + "path": "node_modules/wordwrap/package.json" }, { - "path": "node_modules/range-parser/package.json" + "path": "node_modules/minimist-options/package.json" }, { - "path": "node_modules/lodash.has/package.json" + "path": "node_modules/minimist-options/node_modules/arrify/package.json" }, { - "path": "node_modules/array-filter/package.json" + "path": "node_modules/google-auth-library/package.json" }, { - "path": "node_modules/concat-map/package.json" + "path": "node_modules/encodeurl/package.json" }, { - "path": "node_modules/yallist/package.json" + "path": "node_modules/sprintf-js/package.json" }, { - "path": "node_modules/etag/package.json" + "path": "node_modules/regexp.prototype.flags/package.json" }, { - "path": "node_modules/is-buffer/package.json" + "path": "node_modules/lru-cache/package.json" }, { - "path": "node_modules/ext/package.json" + "path": "node_modules/indent-string/package.json" }, { - "path": "node_modules/ext/node_modules/type/package.json" + "path": "node_modules/teeny-request/package.json" }, { - "path": "node_modules/@grpc/grpc-js/package.json" + "path": "node_modules/teeny-request/node_modules/debug/package.json" }, { - "path": "node_modules/@grpc/proto-loader/package.json" + "path": "node_modules/teeny-request/node_modules/https-proxy-agent/package.json" }, { - "path": "node_modules/text-table/package.json" + "path": "node_modules/teeny-request/node_modules/agent-base/package.json" }, { - "path": "node_modules/retry-request/package.json" + "path": "node_modules/jsonexport/package.json" }, { - "path": "node_modules/retry-request/node_modules/debug/package.json" + "path": "node_modules/@protobufjs/pool/package.json" }, { - "path": "node_modules/yargs-parser/package.json" + "path": "node_modules/@protobufjs/utf8/package.json" }, { - "path": "node_modules/minizlib/package.json" + "path": "node_modules/@protobufjs/eventemitter/package.json" }, { - "path": "node_modules/minizlib/node_modules/yallist/package.json" + "path": "node_modules/@protobufjs/aspromise/package.json" }, { - "path": "node_modules/import-lazy/package.json" + "path": "node_modules/@protobufjs/codegen/package.json" }, { - "path": "node_modules/resolve/package.json" + "path": "node_modules/@protobufjs/float/package.json" }, { - "path": "node_modules/core-util-is/package.json" + "path": "node_modules/@protobufjs/base64/package.json" }, { - "path": "node_modules/power-assert-util-string-width/package.json" + "path": "node_modules/@protobufjs/fetch/package.json" }, { - "path": "node_modules/tslib/package.json" + "path": "node_modules/@protobufjs/inquire/package.json" }, { - "path": "node_modules/through2/package.json" + "path": "node_modules/@protobufjs/path/package.json" }, { - "path": "node_modules/call-matcher/package.json" + "path": "node_modules/css-select/package.json" }, { - "path": "node_modules/node-forge/package.json" + "path": "node_modules/@google-cloud/projectify/package.json" }, { - "path": "node_modules/next-tick/package.json" + "path": "node_modules/@google-cloud/promisify/package.json" }, { - "path": "node_modules/is/package.json" + "path": "node_modules/@google-cloud/common/package.json" }, { - "path": "node_modules/global-dirs/package.json" + "path": "node_modules/once/package.json" }, { - "path": "node_modules/is-arguments/package.json" + "path": "node_modules/gcp-metadata/package.json" }, { - "path": "node_modules/flatted/package.json" + "path": "node_modules/esrecurse/package.json" }, { - "path": "node_modules/quick-lru/package.json" + "path": "node_modules/npm-run-path/package.json" }, { - "path": "node_modules/proxyquire/package.json" + "path": "node_modules/npm-run-path/node_modules/path-key/package.json" }, { - "path": "node_modules/npm-packlist/package.json" + "path": "node_modules/inflight/package.json" }, { - "path": "node_modules/has/package.json" + "path": "node_modules/linkify-it/package.json" }, { - "path": "node_modules/deep-equal/package.json" + "path": "node_modules/inquirer/package.json" }, { - "path": "node_modules/marked/package.json" + "path": "node_modules/inquirer/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/optionator/package.json" + "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/jwa/package.json" + "path": "node_modules/inquirer/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/estraverse/package.json" + "path": "node_modules/inquirer/node_modules/string-width/package.json" }, { - "path": "node_modules/responselike/package.json" + "path": "node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/neo-async/package.json" + "path": "node_modules/supports-color/package.json" }, { - "path": "node_modules/diff-match-patch/package.json" + "path": "node_modules/eslint-plugin-node/package.json" }, { - "path": "node_modules/css-select/package.json" + "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" }, { - "path": "node_modules/destroy/package.json" + "path": "test/gapic-translation_service-v3beta1.ts" }, { - "path": "node_modules/uuid/package.json" + "path": "test/.eslintrc.yml" }, { - "path": "node_modules/espower/package.json" + "path": "test/index.ts" }, { - "path": "node_modules/espower/node_modules/source-map/package.json" + "path": "test/gapic-translation_service-v3.ts" }, { - "path": "node_modules/registry-auth-token/package.json" + "path": "test/mocha.opts" }, { - "path": "node_modules/xdg-basedir/package.json" + "path": ".git/packed-refs" }, { - "path": "node_modules/event-target-shim/package.json" + "path": ".git/index" }, { - "path": "node_modules/bluebird/package.json" + "path": ".git/shallow" }, { - "path": "node_modules/is-obj/package.json" + "path": ".git/config" }, { - "path": "node_modules/table/package.json" + "path": ".git/HEAD" }, { - "path": "node_modules/is-yarn-global/package.json" + "path": ".git/refs/heads/autosynth" }, { - "path": "node_modules/json-stable-stringify-without-jsonify/package.json" + "path": ".git/refs/heads/master" }, { - "path": "node_modules/is-promise/package.json" + "path": ".git/refs/remotes/origin/HEAD" }, { - "path": "node_modules/nice-try/package.json" + "path": ".git/refs/tags/v5.1.3" }, { - "path": "node_modules/get-caller-file/package.json" + "path": ".git/logs/HEAD" }, { - "path": "node_modules/es-to-primitive/package.json" + "path": ".git/logs/refs/heads/autosynth" }, { - "path": ".kokoro/docs.sh" + "path": ".git/logs/refs/heads/master" }, { - "path": ".kokoro/system-test.sh" + "path": ".git/logs/refs/remotes/origin/HEAD" }, { - "path": ".kokoro/pre-system-test.sh" + "path": ".git/objects/pack/pack-faf23f230a1ba81d4a76541f30da41728c962cf9.idx" }, { - "path": ".kokoro/common.cfg" + "path": ".git/objects/pack/pack-faf23f230a1ba81d4a76541f30da41728c962cf9.pack" }, { - "path": ".kokoro/publish.sh" + "path": "system-test/.eslintrc.yml" }, { - "path": ".kokoro/.gitattributes" + "path": "system-test/translate.ts" }, { - "path": ".kokoro/trampoline.sh" + "path": "system-test/install.ts" }, { - "path": ".kokoro/samples-test.sh" + "path": "system-test/fixtures/sample/src/index.js" }, { - "path": ".kokoro/lint.sh" + "path": "system-test/fixtures/sample/src/index.ts" }, { - "path": ".kokoro/test.bat" + "path": ".bots/header-checker-lint.json" }, { - "path": ".kokoro/test.sh" + "path": ".github/release-please.yml" }, { - "path": ".kokoro/presubmit/node8/common.cfg" + "path": ".github/PULL_REQUEST_TEMPLATE.md" }, { - "path": ".kokoro/presubmit/node8/test.cfg" + "path": ".github/ISSUE_TEMPLATE/feature_request.md" }, { - "path": ".kokoro/presubmit/node12/common.cfg" + "path": ".github/ISSUE_TEMPLATE/bug_report.md" }, { - "path": ".kokoro/presubmit/node12/test.cfg" + "path": ".github/ISSUE_TEMPLATE/support_request.md" }, { - "path": ".kokoro/presubmit/node10/common.cfg" + "path": "samples/package.json" }, { - "path": ".kokoro/presubmit/node10/samples-test.cfg" + "path": "samples/translate.js" }, { - "path": ".kokoro/presubmit/node10/docs.cfg" + "path": "samples/.eslintrc.yml" }, { - "path": ".kokoro/presubmit/node10/lint.cfg" + "path": "samples/hybridGlossaries.js" }, { - "path": ".kokoro/presubmit/node10/test.cfg" + "path": "samples/README.md" }, { - "path": ".kokoro/presubmit/node10/system-test.cfg" + "path": "samples/quickstart.js" }, { - "path": ".kokoro/presubmit/windows/common.cfg" + "path": "samples/test/.eslintrc.yml" }, { - "path": ".kokoro/presubmit/windows/test.cfg" + "path": "samples/test/quickstart.test.js" }, { - "path": ".kokoro/continuous/node8/common.cfg" + "path": "samples/test/translate.test.js" }, { - "path": ".kokoro/continuous/node8/test.cfg" + "path": "samples/test/hybridGlossaries.test.js" }, { - "path": ".kokoro/continuous/node12/common.cfg" + "path": "samples/test/automlTranslation.test.js" }, { - "path": ".kokoro/continuous/node12/test.cfg" + "path": "samples/test/v3beta1/translate_list_language_names_beta.test.js" }, { - "path": ".kokoro/continuous/node10/common.cfg" + "path": "samples/test/v3beta1/translate_translate_text_beta.test.js" }, { - "path": ".kokoro/continuous/node10/samples-test.cfg" + "path": "samples/test/v3beta1/translate_list_codes_beta.test.js" }, { - "path": ".kokoro/continuous/node10/docs.cfg" + "path": "samples/test/v3beta1/translate_delete_glossary_beta.test.js" }, { - "path": ".kokoro/continuous/node10/lint.cfg" + "path": "samples/test/v3beta1/translate_translate_text_with_model_beta.test.js" }, { - "path": ".kokoro/continuous/node10/test.cfg" + "path": "samples/test/v3beta1/translate_detect_language_beta.test.js" }, { - "path": ".kokoro/continuous/node10/system-test.cfg" + "path": "samples/test/v3beta1/translate_list_glossary_beta.test.js" }, { - "path": ".kokoro/release/docs.sh" + "path": "samples/test/v3beta1/translate_translate_text_with_glossary_beta.test.js" }, { - "path": ".kokoro/release/docs.cfg" + "path": "samples/test/v3beta1/translate_batch_translate_text_beta.test.js" }, { - "path": ".kokoro/release/publish.cfg" + "path": "samples/test/v3beta1/translate_create_glossary_beta.test.js" }, { - "path": "test/index.ts" + "path": "samples/test/v3beta1/translate_get_glossary_beta.test.js" }, { - "path": "test/gapic-translation_service-v3beta1.ts" + "path": "samples/test/v3/translate_translate_text.test.js" }, { - "path": "test/.eslintrc.yml" + "path": "samples/test/v3/translate_create_glossary.test.js" }, { - "path": "test/gapic-translation_service-v3.ts" + "path": "samples/test/v3/translate_list_codes.test.js" }, { - "path": "test/mocha.opts" + "path": "samples/test/v3/translate_batch_translate_text_with_model.test.js" }, { - "path": "__pycache__/synth.cpython-36.pyc" + "path": "samples/test/v3/translate_detect_language.test.js" }, { - "path": "samples/.eslintrc.yml" + "path": "samples/test/v3/translate_batch_translate_text.test.js" }, { - "path": "samples/hybridGlossaries.js" + "path": "samples/test/v3/translate_batch_translate_text_with_glossary.test.js" }, { - "path": "samples/package.json" + "path": "samples/test/v3/translate_list_glossary.test.js" }, { - "path": "samples/README.md" + "path": "samples/test/v3/translate_translate_text_with_glossary_and_model.test.js" }, { - "path": "samples/translate.js" + "path": "samples/test/v3/translate_translate_text_with_model.test.js" }, { - "path": "samples/quickstart.js" + "path": "samples/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js" }, { - "path": "samples/automl/automlTranslationPredict.js" + "path": "samples/test/v3/translate_get_supported_languages.test.js" }, { - "path": "samples/automl/automlTranslationModel.js" + "path": "samples/test/v3/translate_list_language_names.test.js" }, { - "path": "samples/automl/automlTranslationDataset.js" + "path": "samples/test/v3/translate_translate_text_with_glossary.test.js" }, { - "path": "samples/automl/resources/testInput.txt" + "path": "samples/test/v3/translate_get_supported_languages_for_targets.test.js" }, { - "path": "samples/v3/translate_delete_glossary.js" + "path": "samples/test/v3/translate_get_glossary.test.js" }, { - "path": "samples/v3/translate_batch_translate_text.js" + "path": "samples/test/v3/translate_delete_glossary.test.js" }, { - "path": "samples/v3/translate_batch_translate_text_with_glossary.js" + "path": "samples/automl/automlTranslationPredict.js" }, { - "path": "samples/v3/translate_translate_text_with_glossary.js" + "path": "samples/automl/automlTranslationDataset.js" }, { - "path": "samples/v3/translate_list_language_names.js" + "path": "samples/automl/automlTranslationModel.js" }, { - "path": "samples/v3/translate_translate_text.js" + "path": "samples/automl/resources/testInput.txt" }, { - "path": "samples/v3/translate_detect_language.js" + "path": "samples/v3beta1/translate_batch_translate_text_beta.js" }, { - "path": "samples/v3/translate_translate_text_with_glossary_and_model.js" + "path": "samples/v3beta1/translate_delete_glossary_beta.js" }, { - "path": "samples/v3/translate_get_supported_languages_for_target.js" + "path": "samples/v3beta1/translate_list_language_names_beta.js" }, { - "path": "samples/v3/translate_list_codes.js" + "path": "samples/v3beta1/translate_list_codes_beta.js" }, { - "path": "samples/v3/translate_batch_translate_text_with_model.js" + "path": "samples/v3beta1/translate_translate_text_beta.js" }, { - "path": "samples/v3/translate_get_supported_languages.js" + "path": "samples/v3beta1/translate_detect_language_beta.js" }, { - "path": "samples/v3/translate_create_glossary.js" + "path": "samples/v3beta1/translate_translate_text_with_glossary_beta.js" }, { - "path": "samples/v3/translate_translate_text_with_model.js" + "path": "samples/v3beta1/translate_translate_text_with_model_beta.js" }, { - "path": "samples/v3/translate_get_glossary.js" + "path": "samples/v3beta1/translate_create_glossary_beta.js" }, { - "path": "samples/v3/translate_list_glossary.js" + "path": "samples/v3beta1/translate_list_glossary_beta.js" }, { - "path": "samples/v3/translate_batch_translate_text_with_glossary_and_model.js" + "path": "samples/v3beta1/translate_get_glossary_beta.js" }, { - "path": "samples/test/hybridGlossaries.test.js" + "path": "samples/resources/example.png" }, { - "path": "samples/test/translate.test.js" + "path": "samples/v3/translate_translate_text_with_model.js" }, { - "path": "samples/test/.eslintrc.yml" + "path": "samples/v3/translate_batch_translate_text.js" }, { - "path": "samples/test/automlTranslation.test.js" + "path": "samples/v3/translate_create_glossary.js" }, { - "path": "samples/test/quickstart.test.js" + "path": "samples/v3/translate_translate_text.js" }, { - "path": "samples/test/v3/translate_list_codes.test.js" + "path": "samples/v3/translate_get_supported_languages.js" }, { - "path": "samples/test/v3/translate_translate_text_with_glossary_and_model.test.js" + "path": "samples/v3/translate_detect_language.js" }, { - "path": "samples/test/v3/translate_get_glossary.test.js" + "path": "samples/v3/translate_translate_text_with_glossary_and_model.js" }, { - "path": "samples/test/v3/translate_get_supported_languages.test.js" + "path": "samples/v3/translate_list_language_names.js" }, { - "path": "samples/test/v3/translate_get_supported_languages_for_targets.test.js" + "path": "samples/v3/translate_batch_translate_text_with_glossary_and_model.js" }, { - "path": "samples/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js" + "path": "samples/v3/translate_delete_glossary.js" }, { - "path": "samples/test/v3/translate_list_glossary.test.js" + "path": "samples/v3/translate_list_glossary.js" }, { - "path": "samples/test/v3/translate_batch_translate_text.test.js" + "path": "samples/v3/translate_batch_translate_text_with_glossary.js" }, { - "path": "samples/test/v3/translate_batch_translate_text_with_glossary.test.js" + "path": "samples/v3/translate_get_supported_languages_for_target.js" }, { - "path": "samples/test/v3/translate_create_glossary.test.js" + "path": "samples/v3/translate_translate_text_with_glossary.js" }, { - "path": "samples/test/v3/translate_translate_text.test.js" + "path": "samples/v3/translate_batch_translate_text_with_model.js" }, { - "path": "samples/test/v3/translate_detect_language.test.js" + "path": "samples/v3/translate_get_glossary.js" }, { - "path": "samples/test/v3/translate_list_language_names.test.js" + "path": "samples/v3/translate_list_codes.js" }, { - "path": "samples/test/v3/translate_translate_text_with_model.test.js" + "path": ".kokoro/trampoline.sh" }, { - "path": "samples/test/v3/translate_delete_glossary.test.js" + "path": ".kokoro/test.bat" }, { - "path": "samples/test/v3/translate_batch_translate_text_with_model.test.js" + "path": ".kokoro/pre-system-test.sh" }, { - "path": "samples/test/v3/translate_translate_text_with_glossary.test.js" + "path": ".kokoro/system-test.sh" }, { - "path": "samples/test/v3beta1/translate_list_codes_beta.test.js" + "path": ".kokoro/.gitattributes" }, { - "path": "samples/test/v3beta1/translate_batch_translate_text_beta.test.js" + "path": ".kokoro/lint.sh" }, { - "path": "samples/test/v3beta1/translate_list_language_names_beta.test.js" + "path": ".kokoro/publish.sh" }, { - "path": "samples/test/v3beta1/translate_translate_text_with_glossary_beta.test.js" + "path": ".kokoro/test.sh" }, { - "path": "samples/test/v3beta1/translate_delete_glossary_beta.test.js" + "path": ".kokoro/docs.sh" }, { - "path": "samples/test/v3beta1/translate_detect_language_beta.test.js" + "path": ".kokoro/samples-test.sh" }, { - "path": "samples/test/v3beta1/translate_list_glossary_beta.test.js" + "path": ".kokoro/common.cfg" }, { - "path": "samples/test/v3beta1/translate_translate_text_beta.test.js" + "path": ".kokoro/release/publish.cfg" }, { - "path": "samples/test/v3beta1/translate_translate_text_with_model_beta.test.js" + "path": ".kokoro/release/docs.cfg" }, { - "path": "samples/test/v3beta1/translate_get_glossary_beta.test.js" + "path": ".kokoro/release/docs.sh" }, { - "path": "samples/test/v3beta1/translate_create_glossary_beta.test.js" + "path": ".kokoro/presubmit/node10/samples-test.cfg" }, { - "path": "samples/resources/example.png" + "path": ".kokoro/presubmit/node10/system-test.cfg" }, { - "path": "samples/v3beta1/translate_detect_language_beta.js" + "path": ".kokoro/presubmit/node10/docs.cfg" }, { - "path": "samples/v3beta1/translate_translate_text_with_model_beta.js" + "path": ".kokoro/presubmit/node10/lint.cfg" }, { - "path": "samples/v3beta1/translate_list_codes_beta.js" + "path": ".kokoro/presubmit/node10/common.cfg" }, { - "path": "samples/v3beta1/translate_delete_glossary_beta.js" + "path": ".kokoro/presubmit/node10/test.cfg" }, { - "path": "samples/v3beta1/translate_translate_text_with_glossary_beta.js" + "path": ".kokoro/presubmit/node12/common.cfg" }, { - "path": "samples/v3beta1/translate_get_glossary_beta.js" + "path": ".kokoro/presubmit/node12/test.cfg" }, { - "path": "samples/v3beta1/translate_batch_translate_text_beta.js" + "path": ".kokoro/presubmit/windows/common.cfg" }, { - "path": "samples/v3beta1/translate_list_language_names_beta.js" + "path": ".kokoro/presubmit/windows/test.cfg" }, { - "path": "samples/v3beta1/translate_create_glossary_beta.js" + "path": ".kokoro/presubmit/node8/common.cfg" }, { - "path": "samples/v3beta1/translate_translate_text_beta.js" + "path": ".kokoro/presubmit/node8/test.cfg" }, { - "path": "samples/v3beta1/translate_list_glossary_beta.js" + "path": ".kokoro/continuous/node10/samples-test.cfg" }, { - "path": ".github/release-please.yml" + "path": ".kokoro/continuous/node10/system-test.cfg" }, { - "path": ".github/PULL_REQUEST_TEMPLATE.md" + "path": ".kokoro/continuous/node10/docs.cfg" }, { - "path": ".github/ISSUE_TEMPLATE/support_request.md" + "path": ".kokoro/continuous/node10/lint.cfg" }, { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" + "path": ".kokoro/continuous/node10/common.cfg" }, { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" + "path": ".kokoro/continuous/node10/test.cfg" }, { - "path": "build/protos/protos.json" + "path": ".kokoro/continuous/node12/common.cfg" }, { - "path": "build/protos/protos.js" + "path": ".kokoro/continuous/node12/test.cfg" }, { - "path": "build/protos/protos.d.ts" + "path": ".kokoro/continuous/node8/common.cfg" }, { - "path": "build/protos/google/cloud/common_resources.proto" + "path": ".kokoro/continuous/node8/test.cfg" }, { - "path": "build/protos/google/cloud/translate/v3/translation_service.proto" + "path": "__pycache__/synth.cpython-36.pyc" }, { - "path": "build/protos/google/cloud/translate/v3beta1/translation_service.proto" + "path": "src/index.ts" }, { - "path": "build/test/index.js.map" + "path": "src/v3beta1/translation_service_client.ts" }, { - "path": "build/test/gapic-translation_service-v3beta1.js.map" + "path": "src/v3beta1/.eslintrc.yml" }, { - "path": "build/test/index.js" + "path": "src/v3beta1/translation_service_client_config.json" }, { - "path": "build/test/gapic-translation_service-v3.d.ts" + "path": "src/v3beta1/translation_service_proto_list.json" }, { - "path": "build/test/index.d.ts" + "path": "src/v3beta1/index.ts" }, { - "path": "build/test/gapic-translation_service-v3.js.map" + "path": "src/v3/translation_service_client.ts" }, { - "path": "build/test/gapic-translation_service-v3beta1.js" + "path": "src/v3/translation_service_client_config.json" }, { - "path": "build/test/gapic-translation_service-v3.js" + "path": "src/v3/translation_service_proto_list.json" }, { - "path": "build/test/gapic-translation_service-v3beta1.d.ts" + "path": "src/v3/index.ts" }, { - "path": "build/system-test/install.js.map" + "path": "src/v2/index.ts" }, { - "path": "build/system-test/install.d.ts" + "path": "build/protos/protos.json" }, { - "path": "build/system-test/translate.d.ts" + "path": "build/protos/protos.d.ts" }, { - "path": "build/system-test/install.js" + "path": "build/protos/protos.js" }, { - "path": "build/system-test/translate.js" + "path": "build/protos/google/cloud/common_resources.proto" }, { - "path": "build/system-test/translate.js.map" + "path": "build/protos/google/cloud/translate/v3beta1/translation_service.proto" }, { - "path": "build/src/index.js.map" + "path": "build/protos/google/cloud/translate/v3/translation_service.proto" }, { - "path": "build/src/index.js" + "path": "build/test/index.js" }, { - "path": "build/src/index.d.ts" + "path": "build/test/gapic-translation_service-v3beta1.d.ts" }, { - "path": "build/src/v2/index.js.map" + "path": "build/test/gapic-translation_service-v3.js.map" }, { - "path": "build/src/v2/index.js" + "path": "build/test/gapic-translation_service-v3.js" }, { - "path": "build/src/v2/index.d.ts" + "path": "build/test/index.js.map" }, { - "path": "build/src/v3/translation_service_client.d.ts" + "path": "build/test/gapic-translation_service-v3beta1.js.map" }, { - "path": "build/src/v3/index.js.map" + "path": "build/test/index.d.ts" }, { - "path": "build/src/v3/translation_service_client.js" + "path": "build/test/gapic-translation_service-v3beta1.js" }, { - "path": "build/src/v3/index.js" + "path": "build/test/gapic-translation_service-v3.d.ts" }, { - "path": "build/src/v3/index.d.ts" + "path": "build/system-test/install.d.ts" }, { - "path": "build/src/v3/translation_service_client_config.json" + "path": "build/system-test/translate.js" }, { - "path": "build/src/v3/translation_service_client.js.map" + "path": "build/system-test/install.js.map" }, { - "path": "build/src/v3beta1/translation_service_client.d.ts" + "path": "build/system-test/install.js" }, { - "path": "build/src/v3beta1/index.js.map" + "path": "build/system-test/translate.d.ts" }, { - "path": "build/src/v3beta1/translation_service_client.js" + "path": "build/system-test/translate.js.map" }, { - "path": "build/src/v3beta1/index.js" + "path": "build/src/index.js" }, { - "path": "build/src/v3beta1/index.d.ts" + "path": "build/src/index.js.map" }, { - "path": "build/src/v3beta1/translation_service_client_config.json" + "path": "build/src/index.d.ts" }, { - "path": "build/src/v3beta1/translation_service_client.js.map" + "path": "build/src/v3beta1/index.js" }, { - "path": "system-test/translate.ts" + "path": "build/src/v3beta1/translation_service_client.d.ts" }, { - "path": "system-test/.eslintrc.yml" + "path": "build/src/v3beta1/translation_service_client_config.json" }, { - "path": "system-test/install.ts" + "path": "build/src/v3beta1/translation_service_client.js" }, { - "path": "system-test/fixtures/sample/src/index.ts" + "path": "build/src/v3beta1/translation_service_client.js.map" }, { - "path": "system-test/fixtures/sample/src/index.js" + "path": "build/src/v3beta1/index.js.map" }, { - "path": "src/index.ts" + "path": "build/src/v3beta1/index.d.ts" }, { - "path": "src/v2/index.ts" + "path": "build/src/v3/index.js" }, { - "path": "src/v3/index.ts" + "path": "build/src/v3/translation_service_client.d.ts" }, { - "path": "src/v3/translation_service_client.ts" + "path": "build/src/v3/translation_service_client_config.json" }, { - "path": "src/v3/translation_service_client_config.json" + "path": "build/src/v3/translation_service_client.js" }, { - "path": "src/v3/translation_service_proto_list.json" + "path": "build/src/v3/translation_service_client.js.map" }, { - "path": "src/v3beta1/index.ts" + "path": "build/src/v3/index.js.map" }, { - "path": "src/v3beta1/.eslintrc.yml" + "path": "build/src/v3/index.d.ts" }, { - "path": "src/v3beta1/translation_service_client.ts" + "path": "build/src/v2/index.js" }, { - "path": "src/v3beta1/translation_service_client_config.json" + "path": "build/src/v2/index.js.map" }, { - "path": "src/v3beta1/translation_service_proto_list.json" + "path": "build/src/v2/index.d.ts" } ] } \ No newline at end of file From 3dc0247c100666385443685a8c4672b8df0d1275 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 30 Dec 2019 14:29:07 -0800 Subject: [PATCH 312/513] refactor: use explicit mocha imports (#416) --- packages/google-cloud-translate/samples/.eslintrc.yml | 1 - .../google-cloud-translate/samples/test/quickstart.test.js | 1 + packages/google-cloud-translate/src/v3beta1/.eslintrc.yml | 3 --- packages/google-cloud-translate/system-test/.eslintrc.yml | 4 ---- packages/google-cloud-translate/system-test/translate.ts | 1 + packages/google-cloud-translate/test/.eslintrc.yml | 5 ----- .../test/gapic-translation_service-v3.ts | 1 + .../test/gapic-translation_service-v3beta1.ts | 1 + packages/google-cloud-translate/test/index.ts | 1 + 9 files changed, 5 insertions(+), 13 deletions(-) delete mode 100644 packages/google-cloud-translate/src/v3beta1/.eslintrc.yml delete mode 100644 packages/google-cloud-translate/system-test/.eslintrc.yml delete mode 100644 packages/google-cloud-translate/test/.eslintrc.yml diff --git a/packages/google-cloud-translate/samples/.eslintrc.yml b/packages/google-cloud-translate/samples/.eslintrc.yml index 7e847a0e1eb..282535f55f6 100644 --- a/packages/google-cloud-translate/samples/.eslintrc.yml +++ b/packages/google-cloud-translate/samples/.eslintrc.yml @@ -1,4 +1,3 @@ --- rules: no-console: off - no-warning-comments: off diff --git a/packages/google-cloud-translate/samples/test/quickstart.test.js b/packages/google-cloud-translate/samples/test/quickstart.test.js index fec6f136e7b..b9e9ea11b9e 100644 --- a/packages/google-cloud-translate/samples/test/quickstart.test.js +++ b/packages/google-cloud-translate/samples/test/quickstart.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const cp = require('child_process'); const path = require('path'); diff --git a/packages/google-cloud-translate/src/v3beta1/.eslintrc.yml b/packages/google-cloud-translate/src/v3beta1/.eslintrc.yml deleted file mode 100644 index 46afd952546..00000000000 --- a/packages/google-cloud-translate/src/v3beta1/.eslintrc.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -rules: - node/no-missing-require: off diff --git a/packages/google-cloud-translate/system-test/.eslintrc.yml b/packages/google-cloud-translate/system-test/.eslintrc.yml deleted file mode 100644 index dc5d9b0171b..00000000000 --- a/packages/google-cloud-translate/system-test/.eslintrc.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -env: - mocha: true - diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 2fe7af060f3..d68223cf9a0 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -15,6 +15,7 @@ */ import * as assert from 'assert'; +import {describe, it} from 'mocha'; import {TranslationServiceClient} from '../src'; const http2spy = require('http2spy'); diff --git a/packages/google-cloud-translate/test/.eslintrc.yml b/packages/google-cloud-translate/test/.eslintrc.yml deleted file mode 100644 index fb2657e4cc9..00000000000 --- a/packages/google-cloud-translate/test/.eslintrc.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -env: - mocha: true -rules: - node/no-missing-require: off diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts index e5dfc4e3af8..13b826e9704 100644 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts @@ -18,6 +18,7 @@ import * as protosTypes from '../protos/protos'; import * as assert from 'assert'; +import {describe, it} from 'mocha'; const translationserviceModule = require('../src'); const FAKE_STATUS_CODE = 1; diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts index 132a9e86b44..c4a92ca821e 100644 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts @@ -18,6 +18,7 @@ import * as protosTypes from '../protos/protos'; import * as assert from 'assert'; +import {describe, it} from 'mocha'; const translationserviceModule = require('../src'); const FAKE_STATUS_CODE = 1; diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index 25f2652caa4..7344065222c 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -21,6 +21,7 @@ import { } from '@google-cloud/common/build/src/util'; import * as pfy from '@google-cloud/promisify'; import * as assert from 'assert'; +import {describe, it} from 'mocha'; import * as extend from 'extend'; import * as proxyquire from 'proxyquire'; import * as r from 'request'; From c5d0b7e05b784b304147b6e17fd85f1c738c1bcb Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 31 Dec 2019 04:01:23 +0200 Subject: [PATCH 313/513] chore(deps): update dependency eslint-plugin-node to v11 (#415) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 379c68c2237..6927d067a59 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -63,7 +63,7 @@ "codecov": "^3.0.2", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^10.0.0", + "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", "google-auth-library": "^5.7.0", "gts": "^1.0.0", From 29c60f1486e116252b51f5e7f2635df9986c11cc Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 31 Dec 2019 20:20:55 +0200 Subject: [PATCH 314/513] chore(deps): update dependency c8 to v7 (#414) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 6927d067a59..f0df1c1c238 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -59,7 +59,7 @@ "@types/node": "^10.5.7", "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", - "c8": "^6.0.0", + "c8": "^7.0.0", "codecov": "^3.0.2", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", From 55a74b343450a6c8917f6752fe3a6eed011f1de2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 31 Dec 2019 10:21:37 -0800 Subject: [PATCH 315/513] docs: new license format; improved sample instructions (#413) --- packages/google-cloud-translate/.jsdoc.js | 29 +- .../google-cloud-translate/samples/README.md | 14 +- .../google-cloud-translate/synth.metadata | 1777 ++++++++--------- 3 files changed, 911 insertions(+), 909 deletions(-) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index 119851e1525..16df9e27c15 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -1,18 +1,17 @@ -/*! - * Copyright 2018 Google LLC. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2019 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 +// +// https://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. +// 'use strict'; diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index c7141d7637f..5dce327bfdf 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -82,6 +82,12 @@ For example, to run the `translate_list_codes_beta` sample, you would run the fo node v3beta1/translate_list_codes_beta.js "your_project_id" ``` +`cd samples` + +`npm install` + +`cd ..` + ## Samples @@ -95,7 +101,7 @@ View the [source code](https://github.com/googleapis/nodejs-translate/blob/maste __Usage:__ -`node hybridGlossaries.js` +`node samples/hybridGlossaries.js` ----- @@ -112,7 +118,7 @@ View the [source code](https://github.com/googleapis/nodejs-translate/blob/maste __Usage:__ -`node quickstart.js` +`node samples/quickstart.js` ----- @@ -129,7 +135,7 @@ View the [source code](https://github.com/googleapis/nodejs-translate/blob/maste __Usage:__ -`node translate.js` +`node samples/translate.js` @@ -138,4 +144,4 @@ __Usage:__ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md -[product-docs]: https://cloud.google.com/translate/docs/ \ No newline at end of file +[product-docs]: https://cloud.google.com/translate/docs/ diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index ca9d5d5f24e..e92e1e7b5d2 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2019-12-18T12:28:27.381194Z", + "updateTime": "2019-12-21T12:30:40.237642Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3352100a15ede383f5ab3c34599f7a10a3d066fe", - "internalRef": "286065440" + "sha": "1a380ea21dea9b6ac6ad28c60ad96d9d73574e19", + "internalRef": "286616241" } }, { @@ -38,2663 +38,2660 @@ } ], "newFiles": [ + { + "path": ".repo-metadata.json" + }, + { + "path": "README.md" + }, { "path": "package.json" }, { - "path": "webpack.config.js" + "path": "CHANGELOG.md" }, { - "path": "linkinator.config.json" + "path": ".gitignore" }, { - "path": ".eslintrc.yml" + "path": "CODE_OF_CONDUCT.md" }, { - "path": ".prettierrc" + "path": "webpack.config.js" }, { - "path": "codecov.yaml" + "path": "CONTRIBUTING.md" }, { - "path": ".gitignore" + "path": ".prettierrc" }, { "path": "package-lock.json" }, { - "path": "tslint.json" + "path": ".eslintignore" }, { - "path": "tsconfig.json" + "path": "linkinator.config.json" }, { - "path": ".nycrc" + "path": ".eslintrc.yml" }, { - "path": ".clang-format" + "path": "renovate.json" }, { "path": "synth.metadata" }, { - "path": "CONTRIBUTING.md" + "path": ".prettierignore" }, { - "path": "README.md" + "path": "synth.py" }, { - "path": ".repo-metadata.json" + "path": ".readme-partials.yml" }, { - "path": ".jsdoc.js" + "path": "codecov.yaml" }, { - "path": "renovate.json" + "path": "tslint.json" }, { - "path": "CODE_OF_CONDUCT.md" + "path": ".clang-format" }, { - "path": "LICENSE" + "path": ".jsdoc.js" }, { - "path": ".readme-partials.yml" + "path": "LICENSE" }, { - "path": ".eslintignore" + "path": ".nycrc" }, { - "path": ".prettierignore" + "path": "tsconfig.json" }, { - "path": "CHANGELOG.md" + "path": "src/index.ts" }, { - "path": "synth.py" + "path": "src/v3/translation_service_client_config.json" }, { - "path": "protos/protos.json" + "path": "src/v3/translation_service_proto_list.json" }, { - "path": "protos/protos.d.ts" + "path": "src/v3/index.ts" }, { - "path": "protos/protos.js" + "path": "src/v3/translation_service_client.ts" }, { - "path": "protos/google/cloud/common_resources.proto" + "path": "src/v2/index.ts" }, { - "path": "protos/google/cloud/translate/v3beta1/translation_service.proto" + "path": "src/v3beta1/translation_service_client_config.json" }, { - "path": "protos/google/cloud/translate/v3/translation_service.proto" + "path": "src/v3beta1/translation_service_proto_list.json" }, { - "path": "node_modules/meow/package.json" + "path": "src/v3beta1/index.ts" }, { - "path": "node_modules/meow/node_modules/read-pkg-up/package.json" + "path": "src/v3beta1/.eslintrc.yml" }, { - "path": "node_modules/meow/node_modules/p-limit/package.json" + "path": "src/v3beta1/translation_service_client.ts" }, { - "path": "node_modules/meow/node_modules/find-up/package.json" + "path": "build/src/index.d.ts" }, { - "path": "node_modules/meow/node_modules/camelcase/package.json" + "path": "build/src/index.js.map" }, { - "path": "node_modules/meow/node_modules/p-locate/package.json" + "path": "build/src/index.js" }, { - "path": "node_modules/meow/node_modules/p-try/package.json" + "path": "build/src/v3/index.d.ts" }, { - "path": "node_modules/meow/node_modules/path-exists/package.json" + "path": "build/src/v3/translation_service_client.d.ts" }, { - "path": "node_modules/meow/node_modules/yargs-parser/package.json" + "path": "build/src/v3/translation_service_client_config.json" }, { - "path": "node_modules/meow/node_modules/locate-path/package.json" + "path": "build/src/v3/index.js.map" }, { - "path": "node_modules/eslint/package.json" + "path": "build/src/v3/translation_service_client.js.map" }, { - "path": "node_modules/eslint/node_modules/which/package.json" + "path": "build/src/v3/translation_service_client.js" }, { - "path": "node_modules/eslint/node_modules/shebang-regex/package.json" + "path": "build/src/v3/index.js" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/package.json" + "path": "build/src/v2/index.d.ts" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/index.js" + "path": "build/src/v2/index.js.map" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/README.md" + "path": "build/src/v2/index.js" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" + "path": "build/src/v3beta1/index.d.ts" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" + "path": "build/src/v3beta1/translation_service_client.d.ts" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" + "path": "build/src/v3beta1/translation_service_client_config.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" + "path": "build/src/v3beta1/index.js.map" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" + "path": "build/src/v3beta1/translation_service_client.js.map" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" + "path": "build/src/v3beta1/translation_service_client.js" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" + "path": "build/src/v3beta1/index.js" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" + "path": "build/protos/protos.json" }, { - "path": "node_modules/eslint/node_modules/debug/package.json" + "path": "build/protos/protos.js" }, { - "path": "node_modules/eslint/node_modules/shebang-command/package.json" + "path": "build/protos/protos.d.ts" }, { - "path": "node_modules/eslint/node_modules/path-key/package.json" + "path": "build/protos/google/cloud/common_resources.proto" }, { - "path": "node_modules/espower-source/package.json" + "path": "build/protos/google/cloud/translate/v3/translation_service.proto" }, { - "path": "node_modules/espower-source/node_modules/acorn/package.json" + "path": "build/protos/google/cloud/translate/v3beta1/translation_service.proto" }, { - "path": "node_modules/multi-stage-sourcemap/package.json" + "path": "build/test/index.d.ts" }, { - "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" + "path": "build/test/gapic-translation_service-v3.js.map" }, { - "path": "node_modules/escallmatch/package.json" + "path": "build/test/index.js.map" }, { - "path": "node_modules/escallmatch/node_modules/esprima/package.json" + "path": "build/test/gapic-translation_service-v3beta1.js.map" }, { - "path": "node_modules/error-ex/package.json" + "path": "build/test/gapic-translation_service-v3.d.ts" }, { - "path": "node_modules/safer-buffer/package.json" + "path": "build/test/index.js" }, { - "path": "node_modules/crypto-random-string/package.json" + "path": "build/test/gapic-translation_service-v3beta1.d.ts" }, { - "path": "node_modules/unique-string/package.json" + "path": "build/test/gapic-translation_service-v3.js" }, { - "path": "node_modules/path-type/package.json" + "path": "build/test/gapic-translation_service-v3beta1.js" }, { - "path": "node_modules/path-type/node_modules/pify/package.json" + "path": "build/system-test/translate.d.ts" }, { - "path": "node_modules/esquery/package.json" + "path": "build/system-test/install.js.map" }, { - "path": "node_modules/array-find/package.json" + "path": "build/system-test/install.d.ts" }, { - "path": "node_modules/power-assert-renderer-comparison/package.json" + "path": "build/system-test/install.js" }, { - "path": "node_modules/fresh/package.json" + "path": "build/system-test/translate.js.map" }, { - "path": "node_modules/ent/package.json" + "path": "build/system-test/translate.js" }, { - "path": "node_modules/parse5/package.json" + "path": ".bots/header-checker-lint.json" }, { - "path": "node_modules/espurify/package.json" + "path": "__pycache__/synth.cpython-36.pyc" }, { - "path": "node_modules/restore-cursor/package.json" + "path": "samples/hybridGlossaries.js" }, { - "path": "node_modules/is-windows/package.json" + "path": "samples/README.md" }, { - "path": "node_modules/flatted/package.json" + "path": "samples/package.json" }, { - "path": "node_modules/cliui/package.json" + "path": "samples/.eslintrc.yml" }, { - "path": "node_modules/signal-exit/package.json" + "path": "samples/translate.js" }, { - "path": "node_modules/deep-equal/package.json" + "path": "samples/quickstart.js" }, { - "path": "node_modules/empower-core/package.json" + "path": "samples/v3/translate_translate_text_with_model.js" }, { - "path": "node_modules/resolve/package.json" + "path": "samples/v3/translate_get_supported_languages_for_target.js" }, { - "path": "node_modules/uc.micro/package.json" + "path": "samples/v3/translate_list_glossary.js" }, { - "path": "node_modules/spdx-exceptions/package.json" + "path": "samples/v3/translate_create_glossary.js" }, { - "path": "node_modules/power-assert-renderer-file/package.json" + "path": "samples/v3/translate_translate_text.js" }, { - "path": "node_modules/object.getownpropertydescriptors/package.json" + "path": "samples/v3/translate_get_glossary.js" }, { - "path": "node_modules/spdx-correct/package.json" + "path": "samples/v3/translate_batch_translate_text_with_glossary_and_model.js" }, { - "path": "node_modules/power-assert-context-reducer-ast/package.json" + "path": "samples/v3/translate_detect_language.js" }, { - "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" + "path": "samples/v3/translate_list_language_names.js" }, { - "path": "node_modules/ms/package.json" + "path": "samples/v3/translate_list_codes.js" }, { - "path": "node_modules/eslint-config-prettier/package.json" + "path": "samples/v3/translate_translate_text_with_glossary_and_model.js" }, { - "path": "node_modules/diff-match-patch/package.json" + "path": "samples/v3/translate_delete_glossary.js" }, { - "path": "node_modules/power-assert-context-formatter/package.json" + "path": "samples/v3/translate_batch_translate_text_with_model.js" }, { - "path": "node_modules/tslint-config-prettier/package.json" + "path": "samples/v3/translate_translate_text_with_glossary.js" }, { - "path": "node_modules/entities/package.json" + "path": "samples/v3/translate_get_supported_languages.js" }, { - "path": "node_modules/process-nextick-args/package.json" + "path": "samples/v3/translate_batch_translate_text.js" }, { - "path": "node_modules/write/package.json" + "path": "samples/v3/translate_batch_translate_text_with_glossary.js" }, { - "path": "node_modules/to-readable-stream/package.json" + "path": "samples/automl/automlTranslationDataset.js" }, { - "path": "node_modules/typescript/package.json" + "path": "samples/automl/automlTranslationPredict.js" }, { - "path": "node_modules/statuses/package.json" + "path": "samples/automl/automlTranslationModel.js" }, { - "path": "node_modules/natural-compare/package.json" + "path": "samples/automl/resources/testInput.txt" }, { - "path": "node_modules/onetime/package.json" + "path": "samples/v3beta1/translate_delete_glossary_beta.js" }, { - "path": "node_modules/xmlcreate/package.json" + "path": "samples/v3beta1/translate_batch_translate_text_beta.js" }, { - "path": "node_modules/glob/package.json" + "path": "samples/v3beta1/translate_list_language_names_beta.js" }, { - "path": "node_modules/latest-version/package.json" + "path": "samples/v3beta1/translate_detect_language_beta.js" }, { - "path": "node_modules/y18n/package.json" + "path": "samples/v3beta1/translate_translate_text_with_glossary_beta.js" }, { - "path": "node_modules/responselike/package.json" + "path": "samples/v3beta1/translate_get_glossary_beta.js" }, { - "path": "node_modules/nth-check/package.json" + "path": "samples/v3beta1/translate_list_codes_beta.js" }, { - "path": "node_modules/escodegen/package.json" + "path": "samples/v3beta1/translate_list_glossary_beta.js" }, { - "path": "node_modules/escodegen/node_modules/esprima/package.json" + "path": "samples/v3beta1/translate_translate_text_beta.js" }, { - "path": "node_modules/brace-expansion/package.json" + "path": "samples/v3beta1/translate_create_glossary_beta.js" }, { - "path": "node_modules/type-name/package.json" + "path": "samples/v3beta1/translate_translate_text_with_model_beta.js" }, { - "path": "node_modules/figures/package.json" + "path": "samples/test/automlTranslation.test.js" }, { - "path": "node_modules/mime-types/package.json" + "path": "samples/test/quickstart.test.js" }, { - "path": "node_modules/cli-boxes/package.json" + "path": "samples/test/hybridGlossaries.test.js" }, { - "path": "node_modules/normalize-url/package.json" + "path": "samples/test/translate.test.js" }, { - "path": "node_modules/xtend/package.json" + "path": "samples/test/.eslintrc.yml" }, { - "path": "node_modules/core-util-is/package.json" + "path": "samples/test/v3/translate_translate_text.test.js" }, { - "path": "node_modules/widest-line/package.json" + "path": "samples/test/v3/translate_list_codes.test.js" }, { - "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" + "path": "samples/test/v3/translate_delete_glossary.test.js" }, { - "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" + "path": "samples/test/v3/translate_translate_text_with_glossary.test.js" }, { - "path": "node_modules/widest-line/node_modules/string-width/package.json" + "path": "samples/test/v3/translate_batch_translate_text_with_model.test.js" }, { - "path": "node_modules/through/package.json" + "path": "samples/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js" }, { - "path": "node_modules/domutils/package.json" + "path": "samples/test/v3/translate_get_supported_languages_for_targets.test.js" }, { - "path": "node_modules/c8/package.json" + "path": "samples/test/v3/translate_list_language_names.test.js" }, { - "path": "node_modules/jsdoc-region-tag/package.json" + "path": "samples/test/v3/translate_get_glossary.test.js" }, { - "path": "node_modules/which/package.json" + "path": "samples/test/v3/translate_translate_text_with_glossary_and_model.test.js" }, { - "path": "node_modules/map-obj/package.json" + "path": "samples/test/v3/translate_batch_translate_text.test.js" }, { - "path": "node_modules/function-bind/package.json" + "path": "samples/test/v3/translate_create_glossary.test.js" }, { - "path": "node_modules/require-directory/package.json" + "path": "samples/test/v3/translate_detect_language.test.js" }, { - "path": "node_modules/npm-bundled/package.json" + "path": "samples/test/v3/translate_list_glossary.test.js" }, { - "path": "node_modules/write-file-atomic/package.json" + "path": "samples/test/v3/translate_batch_translate_text_with_glossary.test.js" }, { - "path": "node_modules/resolve-from/package.json" + "path": "samples/test/v3/translate_get_supported_languages.test.js" }, { - "path": "node_modules/espower-location-detector/package.json" + "path": "samples/test/v3/translate_translate_text_with_model.test.js" }, { - "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" + "path": "samples/test/v3beta1/translate_list_language_names_beta.test.js" }, { - "path": "node_modules/mime/package.json" + "path": "samples/test/v3beta1/translate_delete_glossary_beta.test.js" }, { - "path": "node_modules/read-pkg-up/package.json" + "path": "samples/test/v3beta1/translate_detect_language_beta.test.js" }, { - "path": "node_modules/read-pkg-up/node_modules/find-up/package.json" + "path": "samples/test/v3beta1/translate_list_glossary_beta.test.js" }, { - "path": "node_modules/read-pkg-up/node_modules/p-locate/package.json" + "path": "samples/test/v3beta1/translate_create_glossary_beta.test.js" }, { - "path": "node_modules/read-pkg-up/node_modules/path-exists/package.json" + "path": "samples/test/v3beta1/translate_list_codes_beta.test.js" }, { - "path": "node_modules/read-pkg-up/node_modules/locate-path/package.json" + "path": "samples/test/v3beta1/translate_translate_text_beta.test.js" }, { - "path": "node_modules/npm-normalize-package-bin/package.json" + "path": "samples/test/v3beta1/translate_get_glossary_beta.test.js" }, { - "path": "node_modules/npm-packlist/package.json" + "path": "samples/test/v3beta1/translate_batch_translate_text_beta.test.js" }, { - "path": "node_modules/setprototypeof/package.json" + "path": "samples/test/v3beta1/translate_translate_text_with_glossary_beta.test.js" }, { - "path": "node_modules/strip-indent/package.json" + "path": "samples/test/v3beta1/translate_translate_text_with_model_beta.test.js" }, { - "path": "node_modules/event-emitter/package.json" + "path": "samples/resources/example.png" }, { - "path": "node_modules/ci-info/package.json" + "path": ".github/PULL_REQUEST_TEMPLATE.md" }, { - "path": "node_modules/ansi-styles/package.json" + "path": ".github/release-please.yml" }, { - "path": "node_modules/@sindresorhus/is/package.json" + "path": ".github/ISSUE_TEMPLATE/support_request.md" }, { - "path": "node_modules/is-promise/package.json" + "path": ".github/ISSUE_TEMPLATE/feature_request.md" }, { - "path": "node_modules/server-destroy/package.json" + "path": ".github/ISSUE_TEMPLATE/bug_report.md" }, { - "path": "node_modules/is-fullwidth-code-point/package.json" + "path": ".kokoro/pre-system-test.sh" }, { - "path": "node_modules/mkdirp/package.json" + "path": ".kokoro/test.sh" }, { - "path": "node_modules/mkdirp/node_modules/minimist/package.json" + "path": ".kokoro/docs.sh" }, { - "path": "node_modules/yallist/package.json" + "path": ".kokoro/samples-test.sh" }, { - "path": "node_modules/esutils/package.json" + "path": ".kokoro/.gitattributes" }, { - "path": "node_modules/through2/package.json" + "path": ".kokoro/trampoline.sh" }, { - "path": "node_modules/es6-promisify/package.json" + "path": ".kokoro/lint.sh" }, { - "path": "node_modules/lodash/package.json" + "path": ".kokoro/publish.sh" }, { - "path": "node_modules/power-assert-renderer-diagram/package.json" + "path": ".kokoro/test.bat" }, { - "path": "node_modules/d/package.json" + "path": ".kokoro/common.cfg" }, { - "path": "node_modules/mimic-fn/package.json" + "path": ".kokoro/system-test.sh" }, { - "path": "node_modules/depd/package.json" + "path": ".kokoro/release/docs.cfg" }, { - "path": "node_modules/acorn-jsx/package.json" + "path": ".kokoro/release/docs.sh" }, { - "path": "node_modules/is-typedarray/package.json" + "path": ".kokoro/release/publish.cfg" }, { - "path": "node_modules/neo-async/package.json" + "path": ".kokoro/continuous/node10/lint.cfg" }, { - "path": "node_modules/gts/package.json" + "path": ".kokoro/continuous/node10/docs.cfg" }, { - "path": "node_modules/gts/node_modules/ansi-styles/package.json" + "path": ".kokoro/continuous/node10/test.cfg" }, { - "path": "node_modules/gts/node_modules/color-name/package.json" + "path": ".kokoro/continuous/node10/system-test.cfg" }, { - "path": "node_modules/gts/node_modules/color-convert/package.json" + "path": ".kokoro/continuous/node10/samples-test.cfg" }, { - "path": "node_modules/gts/node_modules/chalk/package.json" + "path": ".kokoro/continuous/node10/common.cfg" }, { - "path": "node_modules/gts/node_modules/has-flag/package.json" + "path": ".kokoro/continuous/node8/test.cfg" }, { - "path": "node_modules/gts/node_modules/supports-color/package.json" + "path": ".kokoro/continuous/node8/common.cfg" }, { - "path": "node_modules/protobufjs/package.json" + "path": ".kokoro/continuous/node12/test.cfg" }, { - "path": "node_modules/protobufjs/cli/package.json" + "path": ".kokoro/continuous/node12/common.cfg" }, { - "path": "node_modules/protobufjs/cli/package-lock.json" + "path": ".kokoro/presubmit/node10/lint.cfg" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" + "path": ".kokoro/presubmit/node10/docs.cfg" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" + "path": ".kokoro/presubmit/node10/test.cfg" }, { - "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" + "path": ".kokoro/presubmit/node10/system-test.cfg" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" + "path": ".kokoro/presubmit/node10/samples-test.cfg" }, { - "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" + "path": ".kokoro/presubmit/node10/common.cfg" }, { - "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" + "path": ".kokoro/presubmit/node8/test.cfg" }, { - "path": "node_modules/p-finally/package.json" + "path": ".kokoro/presubmit/node8/common.cfg" }, { - "path": "node_modules/istanbul-lib-report/package.json" + "path": ".kokoro/presubmit/node12/test.cfg" }, { - "path": "node_modules/readable-stream/package.json" + "path": ".kokoro/presubmit/node12/common.cfg" }, { - "path": "node_modules/define-properties/package.json" + "path": ".kokoro/presubmit/windows/test.cfg" }, { - "path": "node_modules/es-to-primitive/package.json" + "path": ".kokoro/presubmit/windows/common.cfg" }, { - "path": "node_modules/p-limit/package.json" + "path": "protos/protos.json" }, { - "path": "node_modules/power-assert-renderer-assertion/package.json" + "path": "protos/protos.js" }, { - "path": "node_modules/is-yarn-global/package.json" + "path": "protos/protos.d.ts" }, { - "path": "node_modules/wrappy/package.json" + "path": "protos/google/cloud/common_resources.proto" }, { - "path": "node_modules/pack-n-play/package.json" + "path": "protos/google/cloud/translate/v3/translation_service.proto" }, { - "path": "node_modules/pack-n-play/node_modules/tmp/package.json" + "path": "protos/google/cloud/translate/v3beta1/translation_service.proto" }, { - "path": "node_modules/pack-n-play/node_modules/tmp/node_modules/rimraf/package.json" + "path": ".git/packed-refs" }, { - "path": "node_modules/lodash.camelcase/package.json" + "path": ".git/HEAD" }, { - "path": "node_modules/ajv/package.json" + "path": ".git/config" }, { - "path": "node_modules/lodash.at/package.json" + "path": ".git/index" }, { - "path": "node_modules/find-up/package.json" + "path": ".git/shallow" }, { - "path": "node_modules/merge-descriptors/package.json" + "path": ".git/logs/HEAD" }, { - "path": "node_modules/pify/package.json" + "path": ".git/logs/refs/remotes/origin/HEAD" }, { - "path": "node_modules/ansi-regex/package.json" + "path": ".git/logs/refs/heads/autosynth" }, { - "path": "node_modules/is-arrayish/package.json" + "path": ".git/logs/refs/heads/master" }, { - "path": "node_modules/builtin-modules/package.json" + "path": ".git/refs/remotes/origin/HEAD" }, { - "path": "node_modules/os-tmpdir/package.json" + "path": ".git/refs/heads/autosynth" }, { - "path": "node_modules/walkdir/package.json" + "path": ".git/refs/heads/master" }, { - "path": "node_modules/progress/package.json" + "path": ".git/objects/pack/pack-38890517f21289e63ddc5a09b2224d6760b678f6.pack" }, { - "path": "node_modules/base64-js/package.json" + "path": ".git/objects/pack/pack-38890517f21289e63ddc5a09b2224d6760b678f6.idx" }, { - "path": "node_modules/buffer-equal-constant-time/package.json" + "path": "test/gapic-translation_service-v3.ts" }, { - "path": "node_modules/jwa/package.json" + "path": "test/index.ts" }, { - "path": "node_modules/chownr/package.json" + "path": "test/.eslintrc.yml" }, { - "path": "node_modules/astral-regex/package.json" + "path": "test/gapic-translation_service-v3beta1.ts" }, { - "path": "node_modules/is-plain-obj/package.json" + "path": "test/mocha.opts" }, { - "path": "node_modules/core-js/package.json" + "path": "system-test/.eslintrc.yml" }, { - "path": "node_modules/imurmurhash/package.json" + "path": "system-test/translate.ts" }, { - "path": "node_modules/cli-cursor/package.json" + "path": "system-test/install.ts" }, { - "path": "node_modules/markdown-it/package.json" + "path": "system-test/fixtures/sample/src/index.ts" }, { - "path": "node_modules/esprima/package.json" + "path": "system-test/fixtures/sample/src/index.js" }, { - "path": "node_modules/make-dir/package.json" + "path": "node_modules/strip-bom/package.json" }, { - "path": "node_modules/make-dir/node_modules/semver/package.json" + "path": "node_modules/string-width/package.json" }, { - "path": "node_modules/boolbase/package.json" + "path": "node_modules/is-callable/package.json" }, { - "path": "node_modules/destroy/package.json" + "path": "node_modules/util-deprecate/package.json" }, { - "path": "node_modules/object-is/package.json" + "path": "node_modules/gts/package.json" }, { - "path": "node_modules/diff/package.json" + "path": "node_modules/gts/node_modules/has-flag/package.json" }, { - "path": "node_modules/camelcase/package.json" + "path": "node_modules/gts/node_modules/color-name/package.json" }, { - "path": "node_modules/pseudomap/package.json" + "path": "node_modules/gts/node_modules/color-convert/package.json" }, { - "path": "node_modules/bluebird/package.json" + "path": "node_modules/gts/node_modules/supports-color/package.json" }, { - "path": "node_modules/ansi-escapes/package.json" + "path": "node_modules/gts/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/graceful-fs/package.json" + "path": "node_modules/gts/node_modules/chalk/package.json" }, { - "path": "node_modules/v8-to-istanbul/package.json" + "path": "node_modules/require-directory/package.json" }, { - "path": "node_modules/v8-to-istanbul/node_modules/source-map/package.json" + "path": "node_modules/update-notifier/package.json" }, { - "path": "node_modules/taffydb/package.json" + "path": "node_modules/esprima/package.json" }, { - "path": "node_modules/es6-iterator/package.json" + "path": "node_modules/string_decoder/package.json" }, { - "path": "node_modules/semver/package.json" + "path": "node_modules/mocha/package.json" }, { - "path": "node_modules/is-buffer/package.json" + "path": "node_modules/mocha/node_modules/locate-path/package.json" }, { - "path": "node_modules/browser-stdout/package.json" + "path": "node_modules/mocha/node_modules/find-up/package.json" }, { - "path": "node_modules/fs.realpath/package.json" + "path": "node_modules/mocha/node_modules/diff/package.json" }, { - "path": "node_modules/is-html/package.json" + "path": "node_modules/mocha/node_modules/yargs-parser/package.json" }, { - "path": "node_modules/decamelize/package.json" + "path": "node_modules/mocha/node_modules/supports-color/package.json" }, { - "path": "node_modules/read-pkg/package.json" + "path": "node_modules/mocha/node_modules/which/package.json" }, { - "path": "node_modules/deep-extend/package.json" + "path": "node_modules/mocha/node_modules/path-exists/package.json" }, { - "path": "node_modules/color-name/package.json" + "path": "node_modules/mocha/node_modules/p-locate/package.json" }, { - "path": "node_modules/handlebars/package.json" + "path": "node_modules/mocha/node_modules/glob/package.json" }, { - "path": "node_modules/fast-levenshtein/package.json" + "path": "node_modules/mocha/node_modules/ms/package.json" }, { - "path": "node_modules/type-check/package.json" + "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/ansi-colors/package.json" + "path": "node_modules/mocha/node_modules/yargs/package.json" }, { - "path": "node_modules/flat-cache/package.json" + "path": "node_modules/is-arguments/package.json" }, { - "path": "node_modules/flat-cache/node_modules/rimraf/package.json" + "path": "node_modules/core-util-is/package.json" }, { - "path": "node_modules/p-queue/package.json" + "path": "node_modules/wrap-ansi/package.json" }, { - "path": "node_modules/callsites/package.json" + "path": "node_modules/minimist-options/package.json" }, { - "path": "node_modules/shebang-regex/package.json" + "path": "node_modules/minimist-options/node_modules/arrify/package.json" }, { - "path": "node_modules/uuid/package.json" + "path": "node_modules/underscore/package.json" }, { - "path": "node_modules/require-main-filename/package.json" + "path": "node_modules/keyv/package.json" }, { - "path": "node_modules/is-path-inside/package.json" + "path": "node_modules/glob-parent/package.json" }, { - "path": "node_modules/fast-deep-equal/package.json" + "path": "node_modules/walkdir/package.json" }, { - "path": "node_modules/es6-map/package.json" - }, - { - "path": "node_modules/uglify-js/package.json" - }, - { - "path": "node_modules/pump/package.json" + "path": "node_modules/@protobufjs/codegen/package.json" }, { - "path": "node_modules/is-date-object/package.json" + "path": "node_modules/@protobufjs/inquire/package.json" }, { - "path": "node_modules/eventemitter3/package.json" + "path": "node_modules/@protobufjs/float/package.json" }, { - "path": "node_modules/inherits/package.json" + "path": "node_modules/@protobufjs/base64/package.json" }, { - "path": "node_modules/minipass/package.json" + "path": "node_modules/@protobufjs/aspromise/package.json" }, { - "path": "node_modules/minipass/node_modules/yallist/package.json" + "path": "node_modules/@protobufjs/eventemitter/package.json" }, { - "path": "node_modules/markdown-it-anchor/package.json" + "path": "node_modules/@protobufjs/fetch/package.json" }, { - "path": "node_modules/get-caller-file/package.json" + "path": "node_modules/@protobufjs/utf8/package.json" }, { - "path": "node_modules/espower/package.json" + "path": "node_modules/@protobufjs/path/package.json" }, { - "path": "node_modules/espower/node_modules/source-map/package.json" + "path": "node_modules/@protobufjs/pool/package.json" }, { - "path": "node_modules/mute-stream/package.json" + "path": "node_modules/global-dirs/package.json" }, { - "path": "node_modules/p-locate/package.json" + "path": "node_modules/has-flag/package.json" }, { - "path": "node_modules/minimatch/package.json" + "path": "node_modules/locate-path/package.json" }, { - "path": "node_modules/argparse/package.json" + "path": "node_modules/fill-keys/package.json" }, { - "path": "node_modules/path-parse/package.json" + "path": "node_modules/empower-assert/package.json" }, { - "path": "node_modules/escope/package.json" + "path": "node_modules/convert-source-map/package.json" }, { - "path": "node_modules/eslint-plugin-prettier/package.json" + "path": "node_modules/delayed-stream/package.json" }, { - "path": "node_modules/configstore/package.json" + "path": "node_modules/require-main-filename/package.json" }, { - "path": "node_modules/configstore/node_modules/write-file-atomic/package.json" + "path": "node_modules/bluebird/package.json" }, { - "path": "node_modules/configstore/node_modules/pify/package.json" + "path": "node_modules/string.prototype.trimleft/package.json" }, { - "path": "node_modules/configstore/node_modules/make-dir/package.json" + "path": "node_modules/range-parser/package.json" }, { - "path": "node_modules/is-ci/package.json" + "path": "node_modules/espower-loader/package.json" }, { - "path": "node_modules/loud-rejection/package.json" + "path": "node_modules/espower-loader/node_modules/source-map/package.json" }, { - "path": "node_modules/p-try/package.json" + "path": "node_modules/espower-loader/node_modules/source-map-support/package.json" }, { - "path": "node_modules/jsdoc-fresh/package.json" + "path": "node_modules/defer-to-connect/package.json" }, { - "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" + "path": "node_modules/duplexer3/package.json" }, { - "path": "node_modules/istanbul-reports/package.json" + "path": "node_modules/indent-string/package.json" }, { - "path": "node_modules/safe-buffer/package.json" + "path": "node_modules/eslint/package.json" }, { - "path": "node_modules/prepend-http/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/README.md" }, { - "path": "node_modules/path-exists/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/package.json" }, { - "path": "node_modules/trim-newlines/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" }, { - "path": "node_modules/on-finished/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/index.js" }, { - "path": "node_modules/furi/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" }, { - "path": "node_modules/has-symbols/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" }, { - "path": "node_modules/decompress-response/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" }, { - "path": "node_modules/util-deprecate/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" }, { - "path": "node_modules/duplexer3/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" }, { - "path": "node_modules/color-convert/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" }, { - "path": "node_modules/term-size/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" }, { - "path": "node_modules/decamelize-keys/package.json" + "path": "node_modules/eslint/node_modules/path-key/package.json" }, { - "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" + "path": "node_modules/eslint/node_modules/which/package.json" }, { - "path": "node_modules/urlgrey/package.json" + "path": "node_modules/eslint/node_modules/shebang-regex/package.json" }, { - "path": "node_modules/url-parse-lax/package.json" + "path": "node_modules/eslint/node_modules/shebang-command/package.json" }, { - "path": "node_modules/acorn-es7-plugin/package.json" + "path": "node_modules/eslint/node_modules/debug/package.json" }, { - "path": "node_modules/log-symbols/package.json" + "path": "node_modules/got/package.json" }, { - "path": "node_modules/global-dirs/package.json" + "path": "node_modules/got/node_modules/get-stream/package.json" }, { - "path": "node_modules/power-assert-util-string-width/package.json" + "path": "node_modules/estraverse/package.json" }, { - "path": "node_modules/boxen/package.json" + "path": "node_modules/mdurl/package.json" }, { - "path": "node_modules/boxen/node_modules/type-fest/package.json" + "path": "node_modules/eslint-plugin-node/package.json" }, { - "path": "node_modules/traverse/package.json" + "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" }, { - "path": "node_modules/deep-is/package.json" + "path": "node_modules/resolve-from/package.json" }, { - "path": "node_modules/event-target-shim/package.json" + "path": "node_modules/type-name/package.json" }, { - "path": "node_modules/execa/package.json" + "path": "node_modules/lodash/package.json" }, { - "path": "node_modules/execa/node_modules/which/package.json" + "path": "node_modules/strip-ansi/package.json" }, { - "path": "node_modules/execa/node_modules/yallist/package.json" + "path": "node_modules/safe-buffer/package.json" }, { - "path": "node_modules/execa/node_modules/shebang-regex/package.json" + "path": "node_modules/@szmarczak/http-timer/package.json" }, { - "path": "node_modules/execa/node_modules/cross-spawn/package.json" + "path": "node_modules/parent-module/package.json" }, { - "path": "node_modules/execa/node_modules/is-stream/package.json" + "path": "node_modules/object-keys/package.json" }, { - "path": "node_modules/execa/node_modules/shebang-command/package.json" + "path": "node_modules/write/package.json" }, { - "path": "node_modules/execa/node_modules/lru-cache/package.json" + "path": "node_modules/configstore/package.json" }, { - "path": "node_modules/update-notifier/package.json" + "path": "node_modules/configstore/node_modules/write-file-atomic/package.json" }, { - "path": "node_modules/estraverse/package.json" + "path": "node_modules/configstore/node_modules/pify/package.json" }, { - "path": "node_modules/combined-stream/package.json" + "path": "node_modules/configstore/node_modules/make-dir/package.json" }, { - "path": "node_modules/file-entry-cache/package.json" + "path": "node_modules/v8-to-istanbul/package.json" }, { - "path": "node_modules/cheerio/package.json" + "path": "node_modules/v8-to-istanbul/node_modules/source-map/package.json" }, { - "path": "node_modules/p-timeout/package.json" + "path": "node_modules/dot-prop/package.json" }, { - "path": "node_modules/@types/tough-cookie/package.json" + "path": "node_modules/tsutils/package.json" }, { - "path": "node_modules/@types/node/package.json" + "path": "node_modules/npm-bundled/package.json" }, { - "path": "node_modules/@types/is-windows/package.json" + "path": "node_modules/import-fresh/package.json" }, { - "path": "node_modules/@types/caseless/package.json" + "path": "node_modules/mute-stream/package.json" }, { - "path": "node_modules/@types/color-name/package.json" + "path": "node_modules/wide-align/package.json" }, { - "path": "node_modules/@types/istanbul-lib-coverage/package.json" + "path": "node_modules/wide-align/node_modules/string-width/package.json" }, { - "path": "node_modules/@types/proxyquire/package.json" + "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/@types/request/package.json" + "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/@types/is/package.json" + "path": "node_modules/eslint-scope/package.json" }, { - "path": "node_modules/@types/extend/package.json" + "path": "node_modules/is-promise/package.json" }, { - "path": "node_modules/@types/mocha/package.json" + "path": "node_modules/es6-map/package.json" }, { - "path": "node_modules/@types/long/package.json" + "path": "node_modules/p-finally/package.json" }, { - "path": "node_modules/istanbul-lib-coverage/package.json" + "path": "node_modules/es6-set/package.json" }, { - "path": "node_modules/send/package.json" + "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" }, { - "path": "node_modules/send/node_modules/ms/package.json" + "path": "node_modules/array-find/package.json" }, { - "path": "node_modules/send/node_modules/mime/package.json" + "path": "node_modules/js2xmlparser/package.json" }, { - "path": "node_modules/send/node_modules/debug/package.json" + "path": "node_modules/istanbul-reports/package.json" }, { - "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" + "path": "node_modules/indexof/package.json" }, { - "path": "node_modules/wide-align/package.json" + "path": "node_modules/progress/package.json" }, { - "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" + "path": "node_modules/registry-url/package.json" }, { - "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" + "path": "node_modules/google-gax/package.json" }, { - "path": "node_modules/wide-align/node_modules/string-width/package.json" + "path": "node_modules/mimic-response/package.json" }, { - "path": "node_modules/get-stdin/package.json" + "path": "node_modules/figures/package.json" }, { - "path": "node_modules/emoji-regex/package.json" + "path": "node_modules/eslint-config-prettier/package.json" }, { - "path": "node_modules/dot-prop/package.json" + "path": "node_modules/argparse/package.json" }, { - "path": "node_modules/array-find-index/package.json" + "path": "node_modules/type/package.json" }, { - "path": "node_modules/arrify/package.json" + "path": "node_modules/domhandler/package.json" }, { - "path": "node_modules/mimic-response/package.json" + "path": "node_modules/error-ex/package.json" }, { - "path": "node_modules/ecdsa-sig-formatter/package.json" + "path": "node_modules/ansi-colors/package.json" }, { - "path": "node_modules/stringifier/package.json" + "path": "node_modules/safer-buffer/package.json" }, { - "path": "node_modules/codecov/package.json" + "path": "node_modules/type-fest/package.json" }, { - "path": "node_modules/codecov/node_modules/https-proxy-agent/package.json" + "path": "node_modules/strip-indent/package.json" }, { - "path": "node_modules/codecov/node_modules/teeny-request/package.json" + "path": "node_modules/boxen/package.json" }, { - "path": "node_modules/text-table/package.json" + "path": "node_modules/boxen/node_modules/type-fest/package.json" }, { - "path": "node_modules/form-data/package.json" + "path": "node_modules/flat-cache/package.json" }, { - "path": "node_modules/escape-html/package.json" + "path": "node_modules/flat-cache/node_modules/rimraf/package.json" }, { - "path": "node_modules/stream-events/package.json" + "path": "node_modules/has-symbols/package.json" }, { - "path": "node_modules/es6-set/package.json" + "path": "node_modules/gcp-metadata/package.json" }, { - "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" + "path": "node_modules/ansi-align/package.json" }, { - "path": "node_modules/semver-diff/package.json" + "path": "node_modules/find-up/package.json" }, { - "path": "node_modules/semver-diff/node_modules/semver/package.json" + "path": "node_modules/log-symbols/package.json" }, { "path": "node_modules/merge-estraverse-visitors/package.json" }, { - "path": "node_modules/defer-to-connect/package.json" + "path": "node_modules/is-extglob/package.json" }, { - "path": "node_modules/delayed-stream/package.json" + "path": "node_modules/json-stable-stringify-without-jsonify/package.json" }, { - "path": "node_modules/fast-diff/package.json" + "path": "node_modules/prettier/package.json" }, { - "path": "node_modules/acorn/package.json" + "path": "node_modules/jsonexport/package.json" }, { - "path": "node_modules/rc/package.json" + "path": "node_modules/wrappy/package.json" }, { - "path": "node_modules/rc/node_modules/strip-json-comments/package.json" + "path": "node_modules/npm-run-path/package.json" }, { - "path": "node_modules/rc/node_modules/minimist/package.json" + "path": "node_modules/npm-run-path/node_modules/path-key/package.json" }, { - "path": "node_modules/ansi-align/package.json" + "path": "node_modules/map-obj/package.json" }, { - "path": "node_modules/wrap-ansi/package.json" + "path": "node_modules/term-size/package.json" }, { - "path": "node_modules/string.prototype.trimright/package.json" + "path": "node_modules/destroy/package.json" }, { - "path": "node_modules/strip-ansi/package.json" + "path": "node_modules/growl/package.json" }, { - "path": "node_modules/object-inspect/package.json" + "path": "node_modules/http-proxy-agent/package.json" }, { - "path": "node_modules/normalize-package-data/package.json" + "path": "node_modules/http-proxy-agent/node_modules/agent-base/package.json" }, { - "path": "node_modules/normalize-package-data/node_modules/semver/package.json" + "path": "node_modules/http-proxy-agent/node_modules/debug/package.json" }, { - "path": "node_modules/path-is-absolute/package.json" + "path": "node_modules/json-schema-traverse/package.json" }, { - "path": "node_modules/http-cache-semantics/package.json" + "path": "node_modules/npm-packlist/package.json" }, { - "path": "node_modules/hosted-git-info/package.json" + "path": "node_modules/taffydb/package.json" }, { - "path": "node_modules/es6-weak-map/package.json" + "path": "node_modules/cross-spawn/package.json" }, { - "path": "node_modules/@bcoe/v8-coverage/package.json" + "path": "node_modules/loud-rejection/package.json" }, { - "path": "node_modules/js-yaml/package.json" + "path": "node_modules/is-glob/package.json" }, { - "path": "node_modules/test-exclude/package.json" + "path": "node_modules/get-stream/package.json" }, { - "path": "node_modules/parent-module/package.json" + "path": "node_modules/uglify-js/package.json" }, { - "path": "node_modules/yargs-parser/package.json" + "path": "node_modules/minipass/package.json" }, { - "path": "node_modules/etag/package.json" + "path": "node_modules/minipass/node_modules/yallist/package.json" }, { - "path": "node_modules/call-signature/package.json" + "path": "node_modules/optimist/package.json" }, { - "path": "node_modules/power-assert-formatter/package.json" + "path": "node_modules/empower/package.json" }, { - "path": "node_modules/ee-first/package.json" + "path": "node_modules/cacheable-request/package.json" }, { - "path": "node_modules/regexpp/package.json" + "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" }, { - "path": "node_modules/parse-json/package.json" + "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" }, { - "path": "node_modules/iconv-lite/package.json" + "path": "node_modules/is-ci/package.json" }, { - "path": "node_modules/is-object/package.json" + "path": "node_modules/server-destroy/package.json" }, { - "path": "node_modules/empower-assert/package.json" + "path": "node_modules/json-parse-better-errors/package.json" }, { - "path": "node_modules/end-of-stream/package.json" + "path": "node_modules/core-js/package.json" }, { - "path": "node_modules/eslint-visitor-keys/package.json" + "path": "node_modules/set-blocking/package.json" }, { - "path": "node_modules/finalhandler/package.json" + "path": "node_modules/next-tick/package.json" }, { - "path": "node_modules/finalhandler/node_modules/ms/package.json" + "path": "node_modules/catharsis/package.json" }, { - "path": "node_modules/finalhandler/node_modules/debug/package.json" + "path": "node_modules/rimraf/package.json" }, { - "path": "node_modules/unpipe/package.json" + "path": "node_modules/agent-base/package.json" }, { - "path": "node_modules/css-what/package.json" + "path": "node_modules/json-bigint/package.json" }, { - "path": "node_modules/convert-source-map/package.json" + "path": "node_modules/spdx-exceptions/package.json" }, { - "path": "node_modules/functional-red-black-tree/package.json" + "path": "node_modules/color-name/package.json" }, { - "path": "node_modules/json-stable-stringify-without-jsonify/package.json" + "path": "node_modules/through/package.json" }, { - "path": "node_modules/punycode/package.json" + "path": "node_modules/ent/package.json" }, { - "path": "node_modules/has/package.json" + "path": "node_modules/jws/package.json" }, { - "path": "node_modules/array-filter/package.json" + "path": "node_modules/inquirer/package.json" }, { - "path": "node_modules/prettier-linter-helpers/package.json" + "path": "node_modules/inquirer/node_modules/string-width/package.json" }, { - "path": "node_modules/clone-response/package.json" + "path": "node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/balanced-match/package.json" + "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/google-gax/package.json" + "path": "node_modules/inquirer/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/cross-spawn/package.json" + "path": "node_modules/inquirer/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/eslint-scope/package.json" + "path": "node_modules/etag/package.json" }, { - "path": "node_modules/debug/package.json" + "path": "node_modules/power-assert-formatter/package.json" }, { - "path": "node_modules/yargs-unparser/package.json" + "path": "node_modules/text-table/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" + "path": "node_modules/color-convert/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" + "path": "node_modules/escope/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" + "path": "node_modules/ansi-regex/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" + "path": "node_modules/is-installed-globally/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" + "path": "node_modules/redent/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" + "path": "node_modules/is-buffer/package.json" }, { - "path": "node_modules/spdx-license-ids/package.json" + "path": "node_modules/esrecurse/package.json" }, { - "path": "node_modules/call-matcher/package.json" + "path": "node_modules/tslint/package.json" }, { - "path": "node_modules/currently-unhandled/package.json" + "path": "node_modules/tslint/node_modules/semver/package.json" }, { - "path": "node_modules/import-lazy/package.json" + "path": "node_modules/decamelize/package.json" }, { - "path": "node_modules/json-parse-better-errors/package.json" + "path": "node_modules/parse-json/package.json" }, { - "path": "node_modules/p-cancelable/package.json" + "path": "node_modules/mime/package.json" }, { - "path": "node_modules/ncp/package.json" + "path": "node_modules/google-auth-library/package.json" }, { - "path": "node_modules/is-stream/package.json" + "path": "node_modules/ignore/package.json" }, { - "path": "node_modules/argv/package.json" + "path": "node_modules/depd/package.json" }, { - "path": "node_modules/type-fest/package.json" + "path": "node_modules/camelcase-keys/package.json" }, { - "path": "node_modules/cli-width/package.json" + "path": "node_modules/camelcase-keys/node_modules/camelcase/package.json" }, { - "path": "node_modules/doctrine/package.json" + "path": "node_modules/ansi-escapes/package.json" }, { - "path": "node_modules/lodash.has/package.json" + "path": "node_modules/decompress-response/package.json" }, { - "path": "node_modules/xdg-basedir/package.json" + "path": "node_modules/end-of-stream/package.json" }, { - "path": "node_modules/isexe/package.json" + "path": "node_modules/diff-match-patch/package.json" }, { - "path": "node_modules/levn/package.json" + "path": "node_modules/amdefine/package.json" }, { - "path": "node_modules/proxyquire/package.json" + "path": "node_modules/event-emitter/package.json" }, { - "path": "node_modules/fast-json-stable-stringify/package.json" + "path": "node_modules/is-windows/package.json" }, { - "path": "node_modules/http-errors/package.json" + "path": "node_modules/diff/package.json" }, { - "path": "node_modules/eastasianwidth/package.json" + "path": "node_modules/tmp/package.json" }, { - "path": "node_modules/shebang-command/package.json" + "path": "node_modules/source-map/package.json" }, { - "path": "node_modules/concat-map/package.json" + "path": "node_modules/is-obj/package.json" }, { - "path": "node_modules/http2spy/package.json" + "path": "node_modules/yargs-parser/package.json" }, { - "path": "node_modules/tmp/package.json" + "path": "node_modules/teeny-request/package.json" }, { - "path": "node_modules/string_decoder/package.json" + "path": "node_modules/teeny-request/node_modules/agent-base/package.json" }, { - "path": "node_modules/fast-text-encoding/package.json" + "path": "node_modules/teeny-request/node_modules/https-proxy-agent/package.json" }, { - "path": "node_modules/is-installed-globally/package.json" + "path": "node_modules/teeny-request/node_modules/debug/package.json" }, { - "path": "node_modules/domhandler/package.json" + "path": "node_modules/escape-string-regexp/package.json" }, { - "path": "node_modules/jws/package.json" + "path": "node_modules/es-abstract/package.json" }, { - "path": "node_modules/glob-parent/package.json" + "path": "node_modules/linkinator/package.json" }, { - "path": "node_modules/load-json-file/package.json" + "path": "node_modules/linkinator/node_modules/has-flag/package.json" }, { - "path": "node_modules/load-json-file/node_modules/pify/package.json" + "path": "node_modules/linkinator/node_modules/color-name/package.json" }, { - "path": "node_modules/is-stream-ended/package.json" + "path": "node_modules/linkinator/node_modules/color-convert/package.json" }, { - "path": "node_modules/json-schema-traverse/package.json" + "path": "node_modules/linkinator/node_modules/supports-color/package.json" }, { - "path": "node_modules/run-async/package.json" + "path": "node_modules/linkinator/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/is-symbol/package.json" + "path": "node_modules/linkinator/node_modules/chalk/package.json" }, { - "path": "node_modules/spdx-expression-parse/package.json" + "path": "node_modules/import-lazy/package.json" }, { - "path": "node_modules/word-wrap/package.json" + "path": "node_modules/inflight/package.json" }, { - "path": "node_modules/linkinator/package.json" + "path": "node_modules/concat-map/package.json" }, { - "path": "node_modules/linkinator/node_modules/ansi-styles/package.json" + "path": "node_modules/object.assign/package.json" }, { - "path": "node_modules/linkinator/node_modules/color-name/package.json" + "path": "node_modules/es6-symbol/package.json" }, { - "path": "node_modules/linkinator/node_modules/color-convert/package.json" + "path": "node_modules/semver/package.json" }, { - "path": "node_modules/linkinator/node_modules/chalk/package.json" + "path": "node_modules/jsdoc-fresh/package.json" }, { - "path": "node_modules/linkinator/node_modules/has-flag/package.json" + "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" }, { - "path": "node_modules/linkinator/node_modules/supports-color/package.json" + "path": "node_modules/is-typedarray/package.json" }, { - "path": "node_modules/tar/package.json" + "path": "node_modules/htmlparser2/package.json" }, { - "path": "node_modules/tar/node_modules/yallist/package.json" + "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" }, { - "path": "node_modules/tsutils/package.json" + "path": "node_modules/cli-boxes/package.json" }, { - "path": "node_modules/power-assert/package.json" + "path": "node_modules/stubs/package.json" }, { - "path": "node_modules/get-stream/package.json" + "path": "node_modules/supports-color/package.json" }, { - "path": "node_modules/chalk/package.json" + "path": "node_modules/path-key/package.json" }, { - "path": "node_modules/chalk/node_modules/supports-color/package.json" + "path": "node_modules/lru-cache/package.json" }, { - "path": "node_modules/path-is-inside/package.json" + "path": "node_modules/module-not-found-error/package.json" }, { - "path": "node_modules/ignore/package.json" + "path": "node_modules/rc/package.json" }, { - "path": "node_modules/strip-json-comments/package.json" + "path": "node_modules/rc/node_modules/minimist/package.json" }, { - "path": "node_modules/json-buffer/package.json" + "path": "node_modules/rc/node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/ignore-walk/package.json" + "path": "node_modules/yargs-unparser/package.json" }, { - "path": "node_modules/eslint-utils/package.json" + "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" }, { - "path": "node_modules/object.assign/package.json" + "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" }, { - "path": "node_modules/node-forge/package.json" + "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" }, { - "path": "node_modules/locate-path/package.json" + "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" }, { - "path": "node_modules/registry-url/package.json" + "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" }, { - "path": "node_modules/requizzle/package.json" + "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" }, { - "path": "node_modules/tslint/package.json" + "path": "node_modules/abort-controller/package.json" }, { - "path": "node_modules/tslint/node_modules/semver/package.json" + "path": "node_modules/http-errors/package.json" }, { - "path": "node_modules/keyv/package.json" + "path": "node_modules/marked/package.json" }, { - "path": "node_modules/strip-eof/package.json" + "path": "node_modules/is-plain-obj/package.json" }, { - "path": "node_modules/lowercase-keys/package.json" + "path": "node_modules/minimatch/package.json" }, { - "path": "node_modules/flat/package.json" + "path": "node_modules/combined-stream/package.json" }, { - "path": "node_modules/html-tags/package.json" + "path": "node_modules/send/package.json" }, { - "path": "node_modules/gtoken/package.json" + "path": "node_modules/send/node_modules/mime/package.json" }, { - "path": "node_modules/es5-ext/package.json" + "path": "node_modules/send/node_modules/ms/package.json" }, { - "path": "node_modules/has-flag/package.json" + "path": "node_modules/send/node_modules/debug/package.json" }, { - "path": "node_modules/domelementtype/package.json" + "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" }, { - "path": "node_modules/serve-static/package.json" + "path": "node_modules/css-select/package.json" }, { - "path": "node_modules/underscore/package.json" + "path": "node_modules/uri-js/package.json" }, { - "path": "node_modules/prettier/package.json" + "path": "node_modules/google-p12-pem/package.json" }, { - "path": "node_modules/got/package.json" + "path": "node_modules/npm-normalize-package-bin/package.json" }, { - "path": "node_modules/got/node_modules/get-stream/package.json" + "path": "node_modules/spdx-license-ids/package.json" }, { - "path": "node_modules/marked/package.json" + "path": "node_modules/yallist/package.json" }, { - "path": "node_modules/@babel/highlight/package.json" + "path": "node_modules/setprototypeof/package.json" }, { - "path": "node_modules/@babel/code-frame/package.json" + "path": "node_modules/hosted-git-info/package.json" }, { - "path": "node_modules/@babel/parser/package.json" + "path": "node_modules/argv/package.json" }, { - "path": "node_modules/js2xmlparser/package.json" + "path": "node_modules/package-json/package.json" }, { - "path": "node_modules/ext/package.json" + "path": "node_modules/write-file-atomic/package.json" }, { - "path": "node_modules/ext/node_modules/type/package.json" + "path": "node_modules/external-editor/package.json" }, { - "path": "node_modules/espree/package.json" + "path": "node_modules/@sindresorhus/is/package.json" }, { - "path": "node_modules/fill-keys/package.json" + "path": "node_modules/lodash.camelcase/package.json" }, { - "path": "node_modules/https-proxy-agent/package.json" + "path": "node_modules/arrify/package.json" }, { - "path": "node_modules/validate-npm-package-license/package.json" + "path": "node_modules/ansi-styles/package.json" }, { - "path": "node_modules/string-width/package.json" + "path": "node_modules/parseurl/package.json" }, { - "path": "node_modules/klaw/package.json" + "path": "node_modules/boolbase/package.json" }, { - "path": "node_modules/power-assert-context-traversal/package.json" + "path": "node_modules/is/package.json" }, { - "path": "node_modules/stubs/package.json" + "path": "node_modules/cliui/package.json" }, { - "path": "node_modules/http-proxy-agent/package.json" + "path": "node_modules/balanced-match/package.json" }, { - "path": "node_modules/http-proxy-agent/node_modules/debug/package.json" + "path": "node_modules/acorn/package.json" }, { - "path": "node_modules/http-proxy-agent/node_modules/agent-base/package.json" + "path": "node_modules/load-json-file/package.json" }, { - "path": "node_modules/package-json/package.json" + "path": "node_modules/load-json-file/node_modules/pify/package.json" }, { - "path": "node_modules/is-callable/package.json" + "path": "node_modules/builtin-modules/package.json" }, { - "path": "node_modules/is-url/package.json" + "path": "node_modules/widest-line/package.json" }, { - "path": "node_modules/is/package.json" + "path": "node_modules/widest-line/node_modules/string-width/package.json" }, { - "path": "node_modules/set-blocking/package.json" + "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/parseurl/package.json" + "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/range-parser/package.json" + "path": "node_modules/which/package.json" }, { - "path": "node_modules/extend/package.json" + "path": "node_modules/@bcoe/v8-coverage/package.json" }, { - "path": "node_modules/node-environment-flags/package.json" + "path": "node_modules/prettier-linter-helpers/package.json" }, { - "path": "node_modules/node-environment-flags/node_modules/semver/package.json" + "path": "node_modules/object-inspect/package.json" }, { - "path": "node_modules/is-arguments/package.json" + "path": "node_modules/retry-request/package.json" }, { - "path": "node_modules/jsdoc/package.json" + "path": "node_modules/retry-request/node_modules/debug/package.json" }, { - "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" + "path": "node_modules/is-arrayish/package.json" }, { - "path": "node_modules/optimist/package.json" + "path": "node_modules/shebang-regex/package.json" }, { - "path": "node_modules/optionator/package.json" + "path": "node_modules/clone-response/package.json" }, { - "path": "node_modules/espower-loader/package.json" + "path": "node_modules/deep-is/package.json" }, { - "path": "node_modules/espower-loader/node_modules/source-map/package.json" + "path": "node_modules/regexpp/package.json" }, { - "path": "node_modules/espower-loader/node_modules/source-map-support/package.json" + "path": "node_modules/node-forge/package.json" }, { - "path": "node_modules/redent/package.json" + "path": "node_modules/power-assert/package.json" }, { - "path": "node_modules/eslint-plugin-es/package.json" + "path": "node_modules/path-is-absolute/package.json" }, { - "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" + "path": "node_modules/ignore-walk/package.json" }, { - "path": "node_modules/cacheable-request/package.json" + "path": "node_modules/finalhandler/package.json" }, { - "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" + "path": "node_modules/finalhandler/node_modules/ms/package.json" }, { - "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" + "path": "node_modules/finalhandler/node_modules/debug/package.json" }, { - "path": "node_modules/foreground-child/package.json" + "path": "node_modules/source-map-support/package.json" }, { - "path": "node_modules/camelcase-keys/package.json" + "path": "node_modules/stream-events/package.json" }, { - "path": "node_modules/camelcase-keys/node_modules/camelcase/package.json" + "path": "node_modules/buffer-equal-constant-time/package.json" }, { - "path": "node_modules/json-bigint/package.json" + "path": "node_modules/path-parse/package.json" }, { - "path": "node_modules/htmlparser2/package.json" + "path": "node_modules/decamelize-keys/package.json" }, { - "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" + "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" }, { - "path": "node_modules/rimraf/package.json" + "path": "node_modules/os-tmpdir/package.json" }, { - "path": "node_modules/commander/package.json" + "path": "node_modules/power-assert-util-string-width/package.json" }, { - "path": "node_modules/node-fetch/package.json" + "path": "node_modules/url-parse-lax/package.json" }, { - "path": "node_modules/abort-controller/package.json" + "path": "node_modules/linkify-it/package.json" }, { - "path": "node_modules/type/package.json" + "path": "node_modules/merge-descriptors/package.json" }, { - "path": "node_modules/he/package.json" + "path": "node_modules/minimist/package.json" }, { - "path": "node_modules/module-not-found-error/package.json" + "path": "node_modules/fresh/package.json" }, { - "path": "node_modules/bignumber.js/package.json" + "path": "node_modules/power-assert-context-formatter/package.json" }, { - "path": "node_modules/minimist/package.json" + "path": "node_modules/is-stream/package.json" }, { - "path": "node_modules/growl/package.json" + "path": "node_modules/call-matcher/package.json" }, { - "path": "node_modules/source-map/package.json" + "path": "node_modules/is-stream-ended/package.json" }, { - "path": "node_modules/@szmarczak/http-timer/package.json" + "path": "node_modules/slice-ansi/package.json" }, { - "path": "node_modules/minizlib/package.json" + "path": "node_modules/onetime/package.json" }, { - "path": "node_modules/minizlib/node_modules/yallist/package.json" + "path": "node_modules/spdx-correct/package.json" }, { - "path": "node_modules/string.prototype.trimleft/package.json" + "path": "node_modules/fast-deep-equal/package.json" }, { - "path": "node_modules/quick-lru/package.json" + "path": "node_modules/readable-stream/package.json" }, { - "path": "node_modules/rxjs/package.json" + "path": "node_modules/xdg-basedir/package.json" }, { - "path": "node_modules/nice-try/package.json" + "path": "node_modules/v8-compile-cache/package.json" }, { - "path": "node_modules/tslib/package.json" + "path": "node_modules/callsites/package.json" }, { - "path": "node_modules/chardet/package.json" + "path": "node_modules/power-assert-renderer-assertion/package.json" }, { - "path": "node_modules/globals/package.json" + "path": "node_modules/pify/package.json" }, { - "path": "node_modules/agent-base/package.json" + "path": "node_modules/stream-shift/package.json" }, { - "path": "node_modules/@grpc/proto-loader/package.json" + "path": "node_modules/crypto-random-string/package.json" }, { - "path": "node_modules/@grpc/grpc-js/package.json" + "path": "node_modules/escodegen/package.json" }, { - "path": "node_modules/intelli-espower-loader/package.json" + "path": "node_modules/escodegen/node_modules/esprima/package.json" }, { - "path": "node_modules/buffer-from/package.json" + "path": "node_modules/entities/package.json" }, { - "path": "node_modules/prelude-ls/package.json" + "path": "node_modules/object.getownpropertydescriptors/package.json" }, { - "path": "node_modules/duplexify/package.json" + "path": "node_modules/power-assert-renderer-file/package.json" }, { - "path": "node_modules/catharsis/package.json" + "path": "node_modules/unpipe/package.json" }, { - "path": "node_modules/mocha/package.json" + "path": "node_modules/html-tags/package.json" }, { - "path": "node_modules/mocha/node_modules/ms/package.json" + "path": "node_modules/array-filter/package.json" }, { - "path": "node_modules/mocha/node_modules/glob/package.json" + "path": "node_modules/furi/package.json" }, { - "path": "node_modules/mocha/node_modules/which/package.json" + "path": "node_modules/pack-n-play/package.json" }, { - "path": "node_modules/mocha/node_modules/find-up/package.json" + "path": "node_modules/pack-n-play/node_modules/tmp/package.json" }, { - "path": "node_modules/mocha/node_modules/diff/package.json" + "path": "node_modules/pack-n-play/node_modules/tmp/node_modules/rimraf/package.json" }, { - "path": "node_modules/mocha/node_modules/p-locate/package.json" + "path": "node_modules/strip-eof/package.json" }, { - "path": "node_modules/mocha/node_modules/path-exists/package.json" + "path": "node_modules/is-path-inside/package.json" }, { - "path": "node_modules/mocha/node_modules/yargs-parser/package.json" + "path": "node_modules/ini/package.json" }, { - "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" + "path": "node_modules/currently-unhandled/package.json" }, { - "path": "node_modules/mocha/node_modules/locate-path/package.json" + "path": "node_modules/validate-npm-package-license/package.json" }, { - "path": "node_modules/mocha/node_modules/yargs/package.json" + "path": "node_modules/bignumber.js/package.json" }, { - "path": "node_modules/mocha/node_modules/supports-color/package.json" + "path": "node_modules/is-yarn-global/package.json" }, { - "path": "node_modules/is-regex/package.json" + "path": "node_modules/lodash.has/package.json" }, { - "path": "node_modules/table/package.json" + "path": "node_modules/camelcase/package.json" }, { - "path": "node_modules/import-fresh/package.json" + "path": "node_modules/prelude-ls/package.json" }, { - "path": "node_modules/registry-auth-token/package.json" + "path": "node_modules/codecov/package.json" }, { - "path": "node_modules/long/package.json" + "path": "node_modules/codecov/node_modules/teeny-request/package.json" }, { - "path": "node_modules/next-tick/package.json" + "path": "node_modules/codecov/node_modules/https-proxy-agent/package.json" }, { - "path": "node_modules/indexof/package.json" + "path": "node_modules/http2spy/package.json" }, { - "path": "node_modules/object-keys/package.json" + "path": "node_modules/es6-promise/package.json" }, { - "path": "node_modules/has-yarn/package.json" + "path": "node_modules/doctrine/package.json" }, { - "path": "node_modules/slice-ansi/package.json" + "path": "node_modules/path-exists/package.json" }, { - "path": "node_modules/ini/package.json" + "path": "node_modules/deep-extend/package.json" }, { - "path": "node_modules/typedarray-to-buffer/.travis.yml" + "path": "node_modules/nth-check/package.json" }, { - "path": "node_modules/typedarray-to-buffer/package.json" + "path": "node_modules/isarray/package.json" }, { - "path": "node_modules/typedarray-to-buffer/index.js" + "path": "node_modules/es-to-primitive/package.json" }, { - "path": "node_modules/typedarray-to-buffer/README.md" + "path": "node_modules/https-proxy-agent/package.json" }, { - "path": "node_modules/typedarray-to-buffer/.airtap.yml" + "path": "node_modules/eslint-plugin-es/package.json" }, { - "path": "node_modules/typedarray-to-buffer/LICENSE" + "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" }, { - "path": "node_modules/typedarray-to-buffer/test/basic.js" + "path": "node_modules/path-type/package.json" }, { - "path": "node_modules/source-map-support/package.json" + "path": "node_modules/path-type/node_modules/pify/package.json" }, { "path": "node_modules/fs-minipass/package.json" }, { - "path": "node_modules/retry-request/package.json" - }, - { - "path": "node_modules/retry-request/node_modules/debug/package.json" + "path": "node_modules/fast-json-stable-stringify/package.json" }, { - "path": "node_modules/strip-bom/package.json" + "path": "node_modules/p-locate/package.json" }, { - "path": "node_modules/toidentifier/package.json" + "path": "node_modules/intelli-espower-loader/package.json" }, { - "path": "node_modules/es6-symbol/package.json" + "path": "node_modules/node-fetch/package.json" }, { - "path": "node_modules/asynckit/package.json" + "path": "node_modules/registry-auth-token/package.json" }, { - "path": "node_modules/dom-serializer/package.json" + "path": "node_modules/esutils/package.json" }, { - "path": "node_modules/v8-compile-cache/package.json" + "path": "node_modules/which-module/package.json" }, { - "path": "node_modules/uri-js/package.json" + "path": "node_modules/function-bind/package.json" }, { - "path": "node_modules/js-tokens/package.json" + "path": "node_modules/trim-newlines/package.json" }, { - "path": "node_modules/isarray/package.json" + "path": "node_modules/event-target-shim/package.json" }, { - "path": "node_modules/es-abstract/package.json" + "path": "node_modules/on-finished/package.json" }, { - "path": "node_modules/universal-deep-strict-equal/package.json" + "path": "node_modules/y18n/package.json" }, { - "path": "node_modules/google-p12-pem/package.json" + "path": "node_modules/quick-lru/package.json" }, { - "path": "node_modules/is-extglob/package.json" + "path": "node_modules/js-yaml/package.json" }, { - "path": "node_modules/is-glob/package.json" + "path": "node_modules/flat/package.json" }, { - "path": "node_modules/power-assert-renderer-base/package.json" + "path": "node_modules/normalize-package-data/package.json" }, { - "path": "node_modules/stream-shift/package.json" + "path": "node_modules/normalize-package-data/node_modules/semver/package.json" }, { - "path": "node_modules/gaxios/package.json" + "path": "node_modules/es6-iterator/package.json" }, { - "path": "node_modules/external-editor/package.json" + "path": "node_modules/typescript/package.json" }, { - "path": "node_modules/empower/package.json" + "path": "node_modules/mkdirp/package.json" }, { - "path": "node_modules/amdefine/package.json" + "path": "node_modules/mkdirp/node_modules/minimist/package.json" }, { - "path": "node_modules/path-key/package.json" + "path": "node_modules/fast-text-encoding/package.json" }, { - "path": "node_modules/yargs/package.json" + "path": "node_modules/acorn-es7-plugin/package.json" }, { - "path": "node_modules/yargs/node_modules/find-up/package.json" + "path": "node_modules/through2/package.json" }, { - "path": "node_modules/yargs/node_modules/p-locate/package.json" + "path": "node_modules/eslint-visitor-keys/package.json" }, { - "path": "node_modules/yargs/node_modules/path-exists/package.json" + "path": "node_modules/glob/package.json" }, { - "path": "node_modules/yargs/node_modules/locate-path/package.json" + "path": "node_modules/inherits/package.json" }, { - "path": "node_modules/is-npm/package.json" + "path": "node_modules/string.prototype.trimright/package.json" }, { - "path": "node_modules/mime-db/package.json" + "path": "node_modules/punycode/package.json" }, { - "path": "node_modules/mdurl/package.json" + "path": "node_modules/es5-ext/package.json" }, { - "path": "node_modules/which-module/package.json" + "path": "node_modules/is-date-object/package.json" }, { - "path": "node_modules/is-obj/package.json" + "path": "node_modules/sprintf-js/package.json" }, { - "path": "node_modules/escape-string-regexp/package.json" + "path": "node_modules/is-npm/package.json" }, { - "path": "node_modules/es6-promise/package.json" + "path": "node_modules/has-yarn/package.json" }, { - "path": "node_modules/wordwrap/package.json" + "path": "node_modules/get-stdin/package.json" }, { - "path": "node_modules/minimist-options/package.json" + "path": "node_modules/shebang-command/package.json" }, { - "path": "node_modules/minimist-options/node_modules/arrify/package.json" + "path": "node_modules/empower-core/package.json" }, { - "path": "node_modules/google-auth-library/package.json" + "path": "node_modules/imurmurhash/package.json" }, { - "path": "node_modules/encodeurl/package.json" + "path": "node_modules/globals/package.json" }, { - "path": "node_modules/sprintf-js/package.json" + "path": "node_modules/latest-version/package.json" }, { - "path": "node_modules/regexp.prototype.flags/package.json" + "path": "node_modules/natural-compare/package.json" }, { - "path": "node_modules/lru-cache/package.json" + "path": "node_modules/commander/package.json" }, { - "path": "node_modules/indent-string/package.json" + "path": "node_modules/path-is-inside/package.json" }, { - "path": "node_modules/teeny-request/package.json" + "path": "node_modules/rxjs/package.json" }, { - "path": "node_modules/teeny-request/node_modules/debug/package.json" + "path": "node_modules/node-environment-flags/package.json" }, { - "path": "node_modules/teeny-request/node_modules/https-proxy-agent/package.json" + "path": "node_modules/node-environment-flags/node_modules/semver/package.json" }, { - "path": "node_modules/teeny-request/node_modules/agent-base/package.json" + "path": "node_modules/p-limit/package.json" }, { - "path": "node_modules/jsonexport/package.json" + "path": "node_modules/call-signature/package.json" }, { - "path": "node_modules/@protobufjs/pool/package.json" + "path": "node_modules/istanbul-lib-coverage/package.json" }, { - "path": "node_modules/@protobufjs/utf8/package.json" + "path": "node_modules/neo-async/package.json" }, { - "path": "node_modules/@protobufjs/eventemitter/package.json" + "path": "node_modules/foreground-child/package.json" }, { - "path": "node_modules/@protobufjs/aspromise/package.json" + "path": "node_modules/he/package.json" }, { - "path": "node_modules/@protobufjs/codegen/package.json" + "path": "node_modules/tar/package.json" }, { - "path": "node_modules/@protobufjs/float/package.json" + "path": "node_modules/tar/node_modules/yallist/package.json" }, { - "path": "node_modules/@protobufjs/base64/package.json" + "path": "node_modules/mime-types/package.json" }, { - "path": "node_modules/@protobufjs/fetch/package.json" + "path": "node_modules/meow/package.json" }, { - "path": "node_modules/@protobufjs/inquire/package.json" + "path": "node_modules/meow/node_modules/locate-path/package.json" }, { - "path": "node_modules/@protobufjs/path/package.json" + "path": "node_modules/meow/node_modules/find-up/package.json" }, { - "path": "node_modules/css-select/package.json" + "path": "node_modules/meow/node_modules/yargs-parser/package.json" }, { - "path": "node_modules/@google-cloud/projectify/package.json" + "path": "node_modules/meow/node_modules/camelcase/package.json" }, { - "path": "node_modules/@google-cloud/promisify/package.json" + "path": "node_modules/meow/node_modules/path-exists/package.json" }, { - "path": "node_modules/@google-cloud/common/package.json" + "path": "node_modules/meow/node_modules/p-locate/package.json" }, { - "path": "node_modules/once/package.json" + "path": "node_modules/meow/node_modules/p-limit/package.json" }, { - "path": "node_modules/gcp-metadata/package.json" + "path": "node_modules/meow/node_modules/p-try/package.json" }, { - "path": "node_modules/esrecurse/package.json" + "path": "node_modules/meow/node_modules/read-pkg-up/package.json" }, { - "path": "node_modules/npm-run-path/package.json" + "path": "node_modules/chownr/package.json" }, { - "path": "node_modules/npm-run-path/node_modules/path-key/package.json" + "path": "node_modules/toidentifier/package.json" }, { - "path": "node_modules/inflight/package.json" + "path": "node_modules/execa/package.json" }, { - "path": "node_modules/linkify-it/package.json" + "path": "node_modules/execa/node_modules/cross-spawn/package.json" }, { - "path": "node_modules/inquirer/package.json" + "path": "node_modules/execa/node_modules/lru-cache/package.json" }, { - "path": "node_modules/inquirer/node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/execa/node_modules/yallist/package.json" }, { - "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" + "path": "node_modules/execa/node_modules/which/package.json" }, { - "path": "node_modules/inquirer/node_modules/emoji-regex/package.json" + "path": "node_modules/execa/node_modules/shebang-regex/package.json" }, { - "path": "node_modules/inquirer/node_modules/string-width/package.json" + "path": "node_modules/execa/node_modules/is-stream/package.json" }, { - "path": "node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi/package.json" + "path": "node_modules/execa/node_modules/shebang-command/package.json" }, { - "path": "node_modules/supports-color/package.json" + "path": "node_modules/levn/package.json" }, { - "path": "node_modules/eslint-plugin-node/package.json" + "path": "node_modules/unique-string/package.json" }, { - "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" + "path": "node_modules/gaxios/package.json" }, { - "path": "test/gapic-translation_service-v3beta1.ts" + "path": "node_modules/power-assert-renderer-base/package.json" }, { - "path": "test/.eslintrc.yml" + "path": "node_modules/browser-stdout/package.json" }, { - "path": "test/index.ts" + "path": "node_modules/regexp.prototype.flags/package.json" }, { - "path": "test/gapic-translation_service-v3.ts" + "path": "node_modules/run-async/package.json" }, { - "path": "test/mocha.opts" + "path": "node_modules/cheerio/package.json" }, { - "path": ".git/packed-refs" + "path": "node_modules/eslint-utils/package.json" }, { - "path": ".git/index" + "path": "node_modules/prepend-http/package.json" }, { - "path": ".git/shallow" + "path": "node_modules/urlgrey/package.json" }, { - "path": ".git/config" + "path": "node_modules/define-properties/package.json" }, { - "path": ".git/HEAD" + "path": "node_modules/p-timeout/package.json" }, { - "path": ".git/refs/heads/autosynth" + "path": "node_modules/cli-cursor/package.json" }, { - "path": ".git/refs/heads/master" + "path": "node_modules/pump/package.json" }, { - "path": ".git/refs/remotes/origin/HEAD" + "path": "node_modules/stringifier/package.json" }, { - "path": ".git/refs/tags/v5.1.3" + "path": "node_modules/espower-location-detector/package.json" }, { - "path": ".git/logs/HEAD" + "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" }, { - "path": ".git/logs/refs/heads/autosynth" + "path": "node_modules/escape-html/package.json" }, { - "path": ".git/logs/refs/heads/master" + "path": "node_modules/http-cache-semantics/package.json" }, { - "path": ".git/logs/refs/remotes/origin/HEAD" + "path": "node_modules/to-readable-stream/package.json" }, { - "path": ".git/objects/pack/pack-faf23f230a1ba81d4a76541f30da41728c962cf9.idx" + "path": "node_modules/eastasianwidth/package.json" }, { - "path": ".git/objects/pack/pack-faf23f230a1ba81d4a76541f30da41728c962cf9.pack" + "path": "node_modules/chardet/package.json" }, { - "path": "system-test/.eslintrc.yml" + "path": "node_modules/js-tokens/package.json" }, { - "path": "system-test/translate.ts" + "path": "node_modules/chalk/package.json" }, { - "path": "system-test/install.ts" + "path": "node_modules/chalk/node_modules/supports-color/package.json" }, { - "path": "system-test/fixtures/sample/src/index.js" + "path": "node_modules/is-regex/package.json" }, { - "path": "system-test/fixtures/sample/src/index.ts" + "path": "node_modules/ajv/package.json" }, { - "path": ".bots/header-checker-lint.json" + "path": "node_modules/spdx-expression-parse/package.json" }, { - "path": ".github/release-please.yml" + "path": "node_modules/cli-width/package.json" }, { - "path": ".github/PULL_REQUEST_TEMPLATE.md" + "path": "node_modules/ms/package.json" }, { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" + "path": "node_modules/istanbul-lib-report/package.json" }, { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" + "path": "node_modules/base64-js/package.json" }, { - "path": ".github/ISSUE_TEMPLATE/support_request.md" + "path": "node_modules/encodeurl/package.json" }, { - "path": "samples/package.json" + "path": "node_modules/json-buffer/package.json" }, { - "path": "samples/translate.js" + "path": "node_modules/file-entry-cache/package.json" }, { - "path": "samples/.eslintrc.yml" + "path": "node_modules/gtoken/package.json" }, { - "path": "samples/hybridGlossaries.js" + "path": "node_modules/klaw/package.json" }, { - "path": "samples/README.md" + "path": "node_modules/functional-red-black-tree/package.json" }, { - "path": "samples/quickstart.js" + "path": "node_modules/dom-serializer/package.json" }, { - "path": "samples/test/.eslintrc.yml" + "path": "node_modules/is-symbol/package.json" }, { - "path": "samples/test/quickstart.test.js" + "path": "node_modules/@babel/parser/package.json" }, { - "path": "samples/test/translate.test.js" + "path": "node_modules/@babel/highlight/package.json" }, { - "path": "samples/test/hybridGlossaries.test.js" + "path": "node_modules/@babel/code-frame/package.json" }, { - "path": "samples/test/automlTranslation.test.js" + "path": "node_modules/form-data/package.json" }, { - "path": "samples/test/v3beta1/translate_list_language_names_beta.test.js" + "path": "node_modules/type-check/package.json" }, { - "path": "samples/test/v3beta1/translate_translate_text_beta.test.js" + "path": "node_modules/iconv-lite/package.json" }, { - "path": "samples/test/v3beta1/translate_list_codes_beta.test.js" + "path": "node_modules/is-url/package.json" }, { - "path": "samples/test/v3beta1/translate_delete_glossary_beta.test.js" + "path": "node_modules/domutils/package.json" }, { - "path": "samples/test/v3beta1/translate_translate_text_with_model_beta.test.js" + "path": "node_modules/p-queue/package.json" }, { - "path": "samples/test/v3beta1/translate_detect_language_beta.test.js" + "path": "node_modules/eventemitter3/package.json" }, { - "path": "samples/test/v3beta1/translate_list_glossary_beta.test.js" + "path": "node_modules/ext/package.json" }, { - "path": "samples/test/v3beta1/translate_translate_text_with_glossary_beta.test.js" + "path": "node_modules/ext/node_modules/type/package.json" }, { - "path": "samples/test/v3beta1/translate_batch_translate_text_beta.test.js" + "path": "node_modules/deep-equal/package.json" }, { - "path": "samples/test/v3beta1/translate_create_glossary_beta.test.js" + "path": "node_modules/mime-db/package.json" }, { - "path": "samples/test/v3beta1/translate_get_glossary_beta.test.js" + "path": "node_modules/parse5/package.json" }, { - "path": "samples/test/v3/translate_translate_text.test.js" + "path": "node_modules/flatted/package.json" }, { - "path": "samples/test/v3/translate_create_glossary.test.js" + "path": "node_modules/once/package.json" }, { - "path": "samples/test/v3/translate_list_codes.test.js" + "path": "node_modules/universal-deep-strict-equal/package.json" }, { - "path": "samples/test/v3/translate_batch_translate_text_with_model.test.js" + "path": "node_modules/brace-expansion/package.json" }, { - "path": "samples/test/v3/translate_detect_language.test.js" + "path": "node_modules/jsdoc-region-tag/package.json" }, { - "path": "samples/test/v3/translate_batch_translate_text.test.js" + "path": "node_modules/markdown-it-anchor/package.json" }, { - "path": "samples/test/v3/translate_batch_translate_text_with_glossary.test.js" + "path": "node_modules/traverse/package.json" }, { - "path": "samples/test/v3/translate_list_glossary.test.js" + "path": "node_modules/restore-cursor/package.json" }, { - "path": "samples/test/v3/translate_translate_text_with_glossary_and_model.test.js" + "path": "node_modules/lodash.at/package.json" }, { - "path": "samples/test/v3/translate_translate_text_with_model.test.js" + "path": "node_modules/graceful-fs/package.json" }, { - "path": "samples/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js" + "path": "node_modules/responselike/package.json" }, { - "path": "samples/test/v3/translate_get_supported_languages.test.js" + "path": "node_modules/pseudomap/package.json" }, { - "path": "samples/test/v3/translate_list_language_names.test.js" + "path": "node_modules/espurify/package.json" }, { - "path": "samples/test/v3/translate_translate_text_with_glossary.test.js" + "path": "node_modules/espree/package.json" }, { - "path": "samples/test/v3/translate_get_supported_languages_for_targets.test.js" + "path": "node_modules/power-assert-renderer-diagram/package.json" }, { - "path": "samples/test/v3/translate_get_glossary.test.js" + "path": "node_modules/word-wrap/package.json" }, { - "path": "samples/test/v3/translate_delete_glossary.test.js" + "path": "node_modules/espower-source/package.json" }, { - "path": "samples/automl/automlTranslationPredict.js" + "path": "node_modules/espower-source/node_modules/acorn/package.json" }, { - "path": "samples/automl/automlTranslationDataset.js" + "path": "node_modules/normalize-url/package.json" }, { - "path": "samples/automl/automlTranslationModel.js" + "path": "node_modules/wordwrap/package.json" }, { - "path": "samples/automl/resources/testInput.txt" + "path": "node_modules/ee-first/package.json" }, { - "path": "samples/v3beta1/translate_batch_translate_text_beta.js" + "path": "node_modules/table/package.json" }, { - "path": "samples/v3beta1/translate_delete_glossary_beta.js" + "path": "node_modules/handlebars/package.json" }, { - "path": "samples/v3beta1/translate_list_language_names_beta.js" + "path": "node_modules/es6-weak-map/package.json" }, { - "path": "samples/v3beta1/translate_list_codes_beta.js" + "path": "node_modules/protobufjs/package.json" }, { - "path": "samples/v3beta1/translate_translate_text_beta.js" + "path": "node_modules/protobufjs/cli/package.json" }, { - "path": "samples/v3beta1/translate_detect_language_beta.js" + "path": "node_modules/protobufjs/cli/package-lock.json" }, { - "path": "samples/v3beta1/translate_translate_text_with_glossary_beta.js" + "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" }, { - "path": "samples/v3beta1/translate_translate_text_with_model_beta.js" + "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" }, { - "path": "samples/v3beta1/translate_create_glossary_beta.js" + "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" }, { - "path": "samples/v3beta1/translate_list_glossary_beta.js" + "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" }, { - "path": "samples/v3beta1/translate_get_glossary_beta.js" + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" }, { - "path": "samples/resources/example.png" + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" }, { - "path": "samples/v3/translate_translate_text_with_model.js" + "path": "node_modules/espower/package.json" }, { - "path": "samples/v3/translate_batch_translate_text.js" + "path": "node_modules/espower/node_modules/source-map/package.json" }, { - "path": "samples/v3/translate_create_glossary.js" + "path": "node_modules/strip-json-comments/package.json" }, { - "path": "samples/v3/translate_translate_text.js" + "path": "node_modules/asynckit/package.json" }, { - "path": "samples/v3/translate_get_supported_languages.js" + "path": "node_modules/process-nextick-args/package.json" }, { - "path": "samples/v3/translate_detect_language.js" + "path": "node_modules/uuid/package.json" }, { - "path": "samples/v3/translate_translate_text_with_glossary_and_model.js" + "path": "node_modules/array-find-index/package.json" }, { - "path": "samples/v3/translate_list_language_names.js" + "path": "node_modules/astral-regex/package.json" }, { - "path": "samples/v3/translate_batch_translate_text_with_glossary_and_model.js" + "path": "node_modules/@grpc/proto-loader/package.json" }, { - "path": "samples/v3/translate_delete_glossary.js" + "path": "node_modules/@grpc/grpc-js/package.json" }, { - "path": "samples/v3/translate_list_glossary.js" + "path": "node_modules/test-exclude/package.json" }, { - "path": "samples/v3/translate_batch_translate_text_with_glossary.js" + "path": "node_modules/es6-promisify/package.json" }, { - "path": "samples/v3/translate_get_supported_languages_for_target.js" + "path": "node_modules/proxyquire/package.json" }, { - "path": "samples/v3/translate_translate_text_with_glossary.js" + "path": "node_modules/p-try/package.json" }, { - "path": "samples/v3/translate_batch_translate_text_with_model.js" + "path": "node_modules/optionator/package.json" }, { - "path": "samples/v3/translate_get_glossary.js" + "path": "node_modules/requizzle/package.json" }, { - "path": "samples/v3/translate_list_codes.js" + "path": "node_modules/c8/package.json" }, { - "path": ".kokoro/trampoline.sh" + "path": "node_modules/fast-levenshtein/package.json" }, { - "path": ".kokoro/test.bat" + "path": "node_modules/statuses/package.json" }, { - "path": ".kokoro/pre-system-test.sh" + "path": "node_modules/semver-diff/package.json" }, { - "path": ".kokoro/system-test.sh" + "path": "node_modules/semver-diff/node_modules/semver/package.json" }, { - "path": ".kokoro/.gitattributes" + "path": "node_modules/signal-exit/package.json" }, { - "path": ".kokoro/lint.sh" + "path": "node_modules/jsdoc/package.json" }, { - "path": ".kokoro/publish.sh" + "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" }, { - "path": ".kokoro/test.sh" + "path": "node_modules/duplexify/package.json" }, { - "path": ".kokoro/docs.sh" + "path": "node_modules/object-is/package.json" }, { - "path": ".kokoro/samples-test.sh" + "path": "node_modules/tslib/package.json" }, { - "path": ".kokoro/common.cfg" + "path": "node_modules/extend/package.json" }, { - "path": ".kokoro/release/publish.cfg" + "path": "node_modules/power-assert-context-reducer-ast/package.json" }, { - "path": ".kokoro/release/docs.cfg" + "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" }, { - "path": ".kokoro/release/docs.sh" + "path": "node_modules/css-what/package.json" }, { - "path": ".kokoro/presubmit/node10/samples-test.cfg" + "path": "node_modules/power-assert-renderer-comparison/package.json" }, { - "path": ".kokoro/presubmit/node10/system-test.cfg" + "path": "node_modules/ecdsa-sig-formatter/package.json" }, { - "path": ".kokoro/presubmit/node10/docs.cfg" + "path": "node_modules/typedarray-to-buffer/README.md" }, { - "path": ".kokoro/presubmit/node10/lint.cfg" + "path": "node_modules/typedarray-to-buffer/package.json" }, { - "path": ".kokoro/presubmit/node10/common.cfg" + "path": "node_modules/typedarray-to-buffer/.travis.yml" }, { - "path": ".kokoro/presubmit/node10/test.cfg" + "path": "node_modules/typedarray-to-buffer/index.js" }, { - "path": ".kokoro/presubmit/node12/common.cfg" + "path": "node_modules/typedarray-to-buffer/.airtap.yml" }, { - "path": ".kokoro/presubmit/node12/test.cfg" + "path": "node_modules/typedarray-to-buffer/LICENSE" }, { - "path": ".kokoro/presubmit/windows/common.cfg" + "path": "node_modules/typedarray-to-buffer/test/basic.js" }, { - "path": ".kokoro/presubmit/windows/test.cfg" + "path": "node_modules/markdown-it/package.json" }, { - "path": ".kokoro/presubmit/node8/common.cfg" + "path": "node_modules/tslint-config-prettier/package.json" }, { - "path": ".kokoro/presubmit/node8/test.cfg" + "path": "node_modules/buffer-from/package.json" }, { - "path": ".kokoro/continuous/node10/samples-test.cfg" + "path": "node_modules/minizlib/package.json" }, { - "path": ".kokoro/continuous/node10/system-test.cfg" + "path": "node_modules/minizlib/node_modules/yallist/package.json" }, { - "path": ".kokoro/continuous/node10/docs.cfg" + "path": "node_modules/domelementtype/package.json" }, { - "path": ".kokoro/continuous/node10/lint.cfg" + "path": "node_modules/ci-info/package.json" }, { - "path": ".kokoro/continuous/node10/common.cfg" + "path": "node_modules/@types/caseless/package.json" }, { - "path": ".kokoro/continuous/node10/test.cfg" + "path": "node_modules/@types/mocha/package.json" }, { - "path": ".kokoro/continuous/node12/common.cfg" + "path": "node_modules/@types/color-name/package.json" }, { - "path": ".kokoro/continuous/node12/test.cfg" + "path": "node_modules/@types/is-windows/package.json" }, { - "path": ".kokoro/continuous/node8/common.cfg" + "path": "node_modules/@types/is/package.json" }, { - "path": ".kokoro/continuous/node8/test.cfg" + "path": "node_modules/@types/tough-cookie/package.json" }, { - "path": "__pycache__/synth.cpython-36.pyc" + "path": "node_modules/@types/istanbul-lib-coverage/package.json" }, { - "path": "src/index.ts" + "path": "node_modules/@types/node/package.json" }, { - "path": "src/v3beta1/translation_service_client.ts" + "path": "node_modules/@types/request/package.json" }, { - "path": "src/v3beta1/.eslintrc.yml" + "path": "node_modules/@types/proxyquire/package.json" }, { - "path": "src/v3beta1/translation_service_client_config.json" + "path": "node_modules/@types/extend/package.json" }, { - "path": "src/v3beta1/translation_service_proto_list.json" + "path": "node_modules/@types/long/package.json" }, { - "path": "src/v3beta1/index.ts" + "path": "node_modules/serve-static/package.json" }, { - "path": "src/v3/translation_service_client.ts" + "path": "node_modules/make-dir/package.json" }, { - "path": "src/v3/translation_service_client_config.json" + "path": "node_modules/make-dir/node_modules/semver/package.json" }, { - "path": "src/v3/translation_service_proto_list.json" + "path": "node_modules/esquery/package.json" }, { - "path": "src/v3/index.ts" + "path": "node_modules/ncp/package.json" }, { - "path": "src/v2/index.ts" + "path": "node_modules/emoji-regex/package.json" }, { - "path": "build/protos/protos.json" + "path": "node_modules/read-pkg/package.json" }, { - "path": "build/protos/protos.d.ts" + "path": "node_modules/fast-diff/package.json" }, { - "path": "build/protos/protos.js" + "path": "node_modules/xtend/package.json" }, { - "path": "build/protos/google/cloud/common_resources.proto" + "path": "node_modules/resolve/package.json" }, { - "path": "build/protos/google/cloud/translate/v3beta1/translation_service.proto" + "path": "node_modules/lowercase-keys/package.json" }, { - "path": "build/protos/google/cloud/translate/v3/translation_service.proto" + "path": "node_modules/is-fullwidth-code-point/package.json" }, { - "path": "build/test/index.js" + "path": "node_modules/read-pkg-up/package.json" }, { - "path": "build/test/gapic-translation_service-v3beta1.d.ts" + "path": "node_modules/read-pkg-up/node_modules/locate-path/package.json" }, { - "path": "build/test/gapic-translation_service-v3.js.map" + "path": "node_modules/read-pkg-up/node_modules/find-up/package.json" }, { - "path": "build/test/gapic-translation_service-v3.js" + "path": "node_modules/read-pkg-up/node_modules/path-exists/package.json" }, { - "path": "build/test/index.js.map" + "path": "node_modules/read-pkg-up/node_modules/p-locate/package.json" }, { - "path": "build/test/gapic-translation_service-v3beta1.js.map" + "path": "node_modules/@google-cloud/projectify/package.json" }, { - "path": "build/test/index.d.ts" + "path": "node_modules/@google-cloud/common/package.json" }, { - "path": "build/test/gapic-translation_service-v3beta1.js" + "path": "node_modules/@google-cloud/promisify/package.json" }, { - "path": "build/test/gapic-translation_service-v3.d.ts" + "path": "node_modules/p-cancelable/package.json" }, { - "path": "build/system-test/install.d.ts" + "path": "node_modules/acorn-jsx/package.json" }, { - "path": "build/system-test/translate.js" + "path": "node_modules/power-assert-context-traversal/package.json" }, { - "path": "build/system-test/install.js.map" + "path": "node_modules/long/package.json" }, { - "path": "build/system-test/install.js" + "path": "node_modules/d/package.json" }, { - "path": "build/system-test/translate.d.ts" + "path": "node_modules/debug/package.json" }, { - "path": "build/system-test/translate.js.map" + "path": "node_modules/mimic-fn/package.json" }, { - "path": "build/src/index.js" + "path": "node_modules/is-object/package.json" }, { - "path": "build/src/index.js.map" + "path": "node_modules/isexe/package.json" }, { - "path": "build/src/index.d.ts" + "path": "node_modules/multi-stage-sourcemap/package.json" }, { - "path": "build/src/v3beta1/index.js" + "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" }, { - "path": "build/src/v3beta1/translation_service_client.d.ts" + "path": "node_modules/uc.micro/package.json" }, { - "path": "build/src/v3beta1/translation_service_client_config.json" + "path": "node_modules/fs.realpath/package.json" }, { - "path": "build/src/v3beta1/translation_service_client.js" + "path": "node_modules/eslint-plugin-prettier/package.json" }, { - "path": "build/src/v3beta1/translation_service_client.js.map" + "path": "node_modules/yargs/package.json" }, { - "path": "build/src/v3beta1/index.js.map" + "path": "node_modules/yargs/node_modules/locate-path/package.json" }, { - "path": "build/src/v3beta1/index.d.ts" + "path": "node_modules/yargs/node_modules/find-up/package.json" }, { - "path": "build/src/v3/index.js" + "path": "node_modules/yargs/node_modules/path-exists/package.json" }, { - "path": "build/src/v3/translation_service_client.d.ts" + "path": "node_modules/yargs/node_modules/p-locate/package.json" }, { - "path": "build/src/v3/translation_service_client_config.json" + "path": "node_modules/nice-try/package.json" }, { - "path": "build/src/v3/translation_service_client.js" + "path": "node_modules/has/package.json" }, { - "path": "build/src/v3/translation_service_client.js.map" + "path": "node_modules/xmlcreate/package.json" }, { - "path": "build/src/v3/index.js.map" + "path": "node_modules/escallmatch/package.json" }, { - "path": "build/src/v3/index.d.ts" + "path": "node_modules/escallmatch/node_modules/esprima/package.json" }, { - "path": "build/src/v2/index.js" + "path": "node_modules/is-html/package.json" }, { - "path": "build/src/v2/index.js.map" + "path": "node_modules/get-caller-file/package.json" }, { - "path": "build/src/v2/index.d.ts" + "path": "node_modules/jwa/package.json" } ] } \ No newline at end of file From 362853a95bbb3ee97fdaf0fd36afd18e0b2ae732 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 3 Jan 2020 21:42:32 -0800 Subject: [PATCH 316/513] fix: better client close(), update .nycrc --- packages/google-cloud-translate/.nycrc | 1 + .../google-cloud-translate/protos/protos.d.ts | 2 +- .../google-cloud-translate/protos/protos.js | 2 +- .../src/v3/translation_service_client.ts | 6 +- .../src/v3beta1/translation_service_client.ts | 6 +- .../google-cloud-translate/synth.metadata | 1923 +++++++++-------- .../system-test/install.ts | 1 + 7 files changed, 1063 insertions(+), 878 deletions(-) diff --git a/packages/google-cloud-translate/.nycrc b/packages/google-cloud-translate/.nycrc index 367688844eb..b18d5472b62 100644 --- a/packages/google-cloud-translate/.nycrc +++ b/packages/google-cloud-translate/.nycrc @@ -12,6 +12,7 @@ "**/scripts", "**/protos", "**/test", + "**/*.d.ts", ".jsdoc.js", "**/.jsdoc.js", "karma.conf.js", diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index 1ae026a4f64..c5b2642eaae 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index 3bf1543a509..5999f8bfd7f 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 1ce373d4c6e..2e6dcbbe930 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -254,6 +254,9 @@ export class TranslationServiceClient { for (const methodName of translationServiceStubMethods) { const innerCallPromise = this.translationServiceStub.then( stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } return stub[methodName].apply(stub, args); }, (err: Error | null | undefined) => () => { @@ -274,9 +277,6 @@ export class TranslationServiceClient { callOptions?: CallOptions, callback?: APICallback ) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } return apiCall(argument, callOptions, callback); }; } diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index a187e17bc3d..658da3b588b 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -254,6 +254,9 @@ export class TranslationServiceClient { for (const methodName of translationServiceStubMethods) { const innerCallPromise = this.translationServiceStub.then( stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } return stub[methodName].apply(stub, args); }, (err: Error | null | undefined) => () => { @@ -274,9 +277,6 @@ export class TranslationServiceClient { callOptions?: CallOptions, callback?: APICallback ) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } return apiCall(argument, callOptions, callback); }; } diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index e92e1e7b5d2..df61b8f427c 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2019-12-21T12:30:40.237642Z", + "updateTime": "2020-01-03T12:23:48.750289Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1a380ea21dea9b6ac6ad28c60ad96d9d73574e19", - "internalRef": "286616241" + "sha": "4d45a6399e9444fbddaeb1c86aabfde210723714", + "internalRef": "287908369" } }, { @@ -38,224 +38,254 @@ } ], "newFiles": [ + { + "path": "synth.metadata" + }, { "path": ".repo-metadata.json" }, { - "path": "README.md" + "path": "CONTRIBUTING.md" }, { - "path": "package.json" + "path": "linkinator.config.json" }, { - "path": "CHANGELOG.md" + "path": ".prettierignore" + }, + { + "path": "tsconfig.json" + }, + { + "path": ".jsdoc.js" }, { "path": ".gitignore" }, + { + "path": "synth.py" + }, { "path": "CODE_OF_CONDUCT.md" }, { - "path": "webpack.config.js" + "path": "README.md" }, { - "path": "CONTRIBUTING.md" + "path": "package-lock.json" }, { "path": ".prettierrc" }, { - "path": "package-lock.json" + "path": ".readme-partials.yml" }, { - "path": ".eslintignore" + "path": "codecov.yaml" }, { - "path": "linkinator.config.json" + "path": ".nycrc" + }, + { + "path": "package.json" + }, + { + "path": ".clang-format" + }, + { + "path": "webpack.config.js" }, { "path": ".eslintrc.yml" }, + { + "path": "tslint.json" + }, { "path": "renovate.json" }, { - "path": "synth.metadata" + "path": "LICENSE" }, { - "path": ".prettierignore" + "path": "CHANGELOG.md" }, { - "path": "synth.py" + "path": ".eslintignore" }, { - "path": ".readme-partials.yml" + "path": ".github/PULL_REQUEST_TEMPLATE.md" }, { - "path": "codecov.yaml" + "path": ".github/release-please.yml" }, { - "path": "tslint.json" + "path": ".github/ISSUE_TEMPLATE/support_request.md" }, { - "path": ".clang-format" + "path": ".github/ISSUE_TEMPLATE/bug_report.md" }, { - "path": ".jsdoc.js" + "path": ".github/ISSUE_TEMPLATE/feature_request.md" }, { - "path": "LICENSE" + "path": ".kokoro/samples-test.sh" }, { - "path": ".nycrc" + "path": ".kokoro/system-test.sh" }, { - "path": "tsconfig.json" + "path": ".kokoro/docs.sh" }, { - "path": "src/index.ts" + "path": ".kokoro/lint.sh" }, { - "path": "src/v3/translation_service_client_config.json" + "path": ".kokoro/pre-system-test.sh" }, { - "path": "src/v3/translation_service_proto_list.json" + "path": ".kokoro/.gitattributes" }, { - "path": "src/v3/index.ts" + "path": ".kokoro/publish.sh" }, { - "path": "src/v3/translation_service_client.ts" + "path": ".kokoro/trampoline.sh" }, { - "path": "src/v2/index.ts" + "path": ".kokoro/common.cfg" }, { - "path": "src/v3beta1/translation_service_client_config.json" + "path": ".kokoro/test.bat" }, { - "path": "src/v3beta1/translation_service_proto_list.json" + "path": ".kokoro/test.sh" }, { - "path": "src/v3beta1/index.ts" + "path": ".kokoro/release/docs.sh" }, { - "path": "src/v3beta1/.eslintrc.yml" + "path": ".kokoro/release/docs.cfg" }, { - "path": "src/v3beta1/translation_service_client.ts" + "path": ".kokoro/release/publish.cfg" }, { - "path": "build/src/index.d.ts" + "path": ".kokoro/presubmit/node12/test.cfg" }, { - "path": "build/src/index.js.map" + "path": ".kokoro/presubmit/node12/common.cfg" }, { - "path": "build/src/index.js" + "path": ".kokoro/presubmit/node8/test.cfg" }, { - "path": "build/src/v3/index.d.ts" + "path": ".kokoro/presubmit/node8/common.cfg" }, { - "path": "build/src/v3/translation_service_client.d.ts" + "path": ".kokoro/presubmit/windows/test.cfg" }, { - "path": "build/src/v3/translation_service_client_config.json" + "path": ".kokoro/presubmit/windows/common.cfg" }, { - "path": "build/src/v3/index.js.map" + "path": ".kokoro/presubmit/node10/lint.cfg" }, { - "path": "build/src/v3/translation_service_client.js.map" + "path": ".kokoro/presubmit/node10/system-test.cfg" }, { - "path": "build/src/v3/translation_service_client.js" + "path": ".kokoro/presubmit/node10/test.cfg" }, { - "path": "build/src/v3/index.js" + "path": ".kokoro/presubmit/node10/docs.cfg" }, { - "path": "build/src/v2/index.d.ts" + "path": ".kokoro/presubmit/node10/common.cfg" }, { - "path": "build/src/v2/index.js.map" + "path": ".kokoro/presubmit/node10/samples-test.cfg" }, { - "path": "build/src/v2/index.js" + "path": ".kokoro/continuous/node12/test.cfg" }, { - "path": "build/src/v3beta1/index.d.ts" + "path": ".kokoro/continuous/node12/common.cfg" }, { - "path": "build/src/v3beta1/translation_service_client.d.ts" + "path": ".kokoro/continuous/node8/test.cfg" }, { - "path": "build/src/v3beta1/translation_service_client_config.json" + "path": ".kokoro/continuous/node8/common.cfg" }, { - "path": "build/src/v3beta1/index.js.map" + "path": ".kokoro/continuous/node10/lint.cfg" }, { - "path": "build/src/v3beta1/translation_service_client.js.map" + "path": ".kokoro/continuous/node10/system-test.cfg" }, { - "path": "build/src/v3beta1/translation_service_client.js" + "path": ".kokoro/continuous/node10/test.cfg" }, { - "path": "build/src/v3beta1/index.js" + "path": ".kokoro/continuous/node10/docs.cfg" }, { - "path": "build/protos/protos.json" + "path": ".kokoro/continuous/node10/common.cfg" }, { - "path": "build/protos/protos.js" + "path": ".kokoro/continuous/node10/samples-test.cfg" }, { - "path": "build/protos/protos.d.ts" + "path": "test/gapic-translation_service-v3.ts" }, { - "path": "build/protos/google/cloud/common_resources.proto" + "path": "test/mocha.opts" }, { - "path": "build/protos/google/cloud/translate/v3/translation_service.proto" + "path": "test/index.ts" }, { - "path": "build/protos/google/cloud/translate/v3beta1/translation_service.proto" + "path": "test/gapic-translation_service-v3beta1.ts" }, { - "path": "build/test/index.d.ts" + "path": "system-test/install.ts" }, { - "path": "build/test/gapic-translation_service-v3.js.map" + "path": "system-test/translate.ts" }, { - "path": "build/test/index.js.map" + "path": "system-test/fixtures/sample/src/index.ts" + }, + { + "path": "system-test/fixtures/sample/src/index.js" }, { "path": "build/test/gapic-translation_service-v3beta1.js.map" }, + { + "path": "build/test/gapic-translation_service-v3beta1.js" + }, { "path": "build/test/gapic-translation_service-v3.d.ts" }, { - "path": "build/test/index.js" + "path": "build/test/gapic-translation_service-v3.js.map" }, { - "path": "build/test/gapic-translation_service-v3beta1.d.ts" + "path": "build/test/index.js" }, { - "path": "build/test/gapic-translation_service-v3.js" + "path": "build/test/gapic-translation_service-v3beta1.d.ts" }, { - "path": "build/test/gapic-translation_service-v3beta1.js" + "path": "build/test/index.js.map" }, { - "path": "build/system-test/translate.d.ts" + "path": "build/test/gapic-translation_service-v3.js" }, { - "path": "build/system-test/install.js.map" + "path": "build/test/index.d.ts" }, { "path": "build/system-test/install.d.ts" @@ -263,1379 +293,1529 @@ { "path": "build/system-test/install.js" }, + { + "path": "build/system-test/install.js.map" + }, { "path": "build/system-test/translate.js.map" }, { "path": "build/system-test/translate.js" }, + { + "path": "build/system-test/translate.d.ts" + }, + { + "path": "build/protos/protos.d.ts" + }, + { + "path": "build/protos/protos.js" + }, + { + "path": "build/protos/protos.json" + }, + { + "path": "build/protos/google/cloud/common_resources.proto" + }, + { + "path": "build/protos/google/cloud/translate/v3/translation_service.proto" + }, + { + "path": "build/protos/google/cloud/translate/v3beta1/translation_service.proto" + }, + { + "path": "build/src/index.js" + }, + { + "path": "build/src/index.js.map" + }, + { + "path": "build/src/index.d.ts" + }, + { + "path": "build/src/v2/index.js" + }, + { + "path": "build/src/v2/index.js.map" + }, + { + "path": "build/src/v2/index.d.ts" + }, + { + "path": "build/src/v3/translation_service_client.js" + }, + { + "path": "build/src/v3/index.js" + }, + { + "path": "build/src/v3/translation_service_client.d.ts" + }, + { + "path": "build/src/v3/index.js.map" + }, + { + "path": "build/src/v3/translation_service_client.js.map" + }, + { + "path": "build/src/v3/translation_service_client_config.json" + }, + { + "path": "build/src/v3/index.d.ts" + }, + { + "path": "build/src/v3beta1/translation_service_client.js" + }, + { + "path": "build/src/v3beta1/index.js" + }, + { + "path": "build/src/v3beta1/translation_service_client.d.ts" + }, + { + "path": "build/src/v3beta1/index.js.map" + }, + { + "path": "build/src/v3beta1/translation_service_client.js.map" + }, + { + "path": "build/src/v3beta1/translation_service_client_config.json" + }, + { + "path": "build/src/v3beta1/index.d.ts" + }, + { + "path": "protos/protos.d.ts" + }, + { + "path": "protos/protos.js" + }, + { + "path": "protos/protos.json" + }, + { + "path": "protos/google/cloud/common_resources.proto" + }, + { + "path": "protos/google/cloud/translate/v3/translation_service.proto" + }, + { + "path": "protos/google/cloud/translate/v3beta1/translation_service.proto" + }, + { + "path": ".git/shallow" + }, + { + "path": ".git/HEAD" + }, + { + "path": ".git/config" + }, + { + "path": ".git/packed-refs" + }, + { + "path": ".git/index" + }, + { + "path": ".git/objects/pack/pack-b67b28657a67221ddfc91efff045dbcdc4d20f92.idx" + }, + { + "path": ".git/objects/pack/pack-b67b28657a67221ddfc91efff045dbcdc4d20f92.pack" + }, + { + "path": ".git/logs/HEAD" + }, + { + "path": ".git/logs/refs/heads/master" + }, + { + "path": ".git/logs/refs/heads/autosynth" + }, + { + "path": ".git/logs/refs/remotes/origin/HEAD" + }, + { + "path": ".git/refs/heads/master" + }, + { + "path": ".git/refs/heads/autosynth" + }, + { + "path": ".git/refs/remotes/origin/HEAD" + }, { "path": ".bots/header-checker-lint.json" }, { - "path": "__pycache__/synth.cpython-36.pyc" + "path": "src/index.ts" }, { - "path": "samples/hybridGlossaries.js" + "path": "src/v2/index.ts" }, { - "path": "samples/README.md" + "path": "src/v3/index.ts" }, { - "path": "samples/package.json" + "path": "src/v3/translation_service_client.ts" }, { - "path": "samples/.eslintrc.yml" + "path": "src/v3/translation_service_proto_list.json" }, { - "path": "samples/translate.js" + "path": "src/v3/translation_service_client_config.json" }, { - "path": "samples/quickstart.js" + "path": "src/v3beta1/index.ts" }, { - "path": "samples/v3/translate_translate_text_with_model.js" + "path": "src/v3beta1/translation_service_client.ts" }, { - "path": "samples/v3/translate_get_supported_languages_for_target.js" + "path": "src/v3beta1/translation_service_proto_list.json" }, { - "path": "samples/v3/translate_list_glossary.js" + "path": "src/v3beta1/translation_service_client_config.json" }, { - "path": "samples/v3/translate_create_glossary.js" + "path": "node_modules/progress/package.json" }, { - "path": "samples/v3/translate_translate_text.js" + "path": "node_modules/is-ci/package.json" }, { - "path": "samples/v3/translate_get_glossary.js" + "path": "node_modules/module-not-found-error/package.json" }, { - "path": "samples/v3/translate_batch_translate_text_with_glossary_and_model.js" + "path": "node_modules/lru-cache/package.json" }, { - "path": "samples/v3/translate_detect_language.js" + "path": "node_modules/destroy/package.json" }, { - "path": "samples/v3/translate_list_language_names.js" + "path": "node_modules/power-assert-context-formatter/package.json" }, { - "path": "samples/v3/translate_list_codes.js" + "path": "node_modules/fast-json-stable-stringify/package.json" }, { - "path": "samples/v3/translate_translate_text_with_glossary_and_model.js" + "path": "node_modules/nice-try/package.json" }, { - "path": "samples/v3/translate_delete_glossary.js" + "path": "node_modules/which-module/package.json" }, { - "path": "samples/v3/translate_batch_translate_text_with_model.js" + "path": "node_modules/array-find/package.json" }, { - "path": "samples/v3/translate_translate_text_with_glossary.js" + "path": "node_modules/catharsis/package.json" }, { - "path": "samples/v3/translate_get_supported_languages.js" + "path": "node_modules/is-promise/package.json" }, { - "path": "samples/v3/translate_batch_translate_text.js" + "path": "node_modules/v8-compile-cache/package.json" }, { - "path": "samples/v3/translate_batch_translate_text_with_glossary.js" + "path": "node_modules/doctrine/package.json" }, { - "path": "samples/automl/automlTranslationDataset.js" + "path": "node_modules/callsites/package.json" }, { - "path": "samples/automl/automlTranslationPredict.js" + "path": "node_modules/diff/package.json" }, { - "path": "samples/automl/automlTranslationModel.js" + "path": "node_modules/hosted-git-info/package.json" }, { - "path": "samples/automl/resources/testInput.txt" + "path": "node_modules/color-name/package.json" }, { - "path": "samples/v3beta1/translate_delete_glossary_beta.js" + "path": "node_modules/asynckit/package.json" }, { - "path": "samples/v3beta1/translate_batch_translate_text_beta.js" + "path": "node_modules/defer-to-connect/package.json" }, { - "path": "samples/v3beta1/translate_list_language_names_beta.js" + "path": "node_modules/unpipe/package.json" }, { - "path": "samples/v3beta1/translate_detect_language_beta.js" + "path": "node_modules/emoji-regex/package.json" }, { - "path": "samples/v3beta1/translate_translate_text_with_glossary_beta.js" + "path": "node_modules/http-errors/package.json" }, { - "path": "samples/v3beta1/translate_get_glossary_beta.js" + "path": "node_modules/eventemitter3/package.json" }, { - "path": "samples/v3beta1/translate_list_codes_beta.js" + "path": "node_modules/esutils/package.json" }, { - "path": "samples/v3beta1/translate_list_glossary_beta.js" + "path": "node_modules/npm-run-path/package.json" }, { - "path": "samples/v3beta1/translate_translate_text_beta.js" + "path": "node_modules/npm-run-path/node_modules/path-key/package.json" }, { - "path": "samples/v3beta1/translate_create_glossary_beta.js" + "path": "node_modules/he/package.json" }, { - "path": "samples/v3beta1/translate_translate_text_with_model_beta.js" + "path": "node_modules/pack-n-play/package.json" }, { - "path": "samples/test/automlTranslation.test.js" + "path": "node_modules/pack-n-play/node_modules/tmp/package.json" }, { - "path": "samples/test/quickstart.test.js" + "path": "node_modules/pack-n-play/node_modules/tmp/node_modules/rimraf/package.json" }, { - "path": "samples/test/hybridGlossaries.test.js" + "path": "node_modules/on-finished/package.json" }, { - "path": "samples/test/translate.test.js" + "path": "node_modules/linkinator/package.json" }, { - "path": "samples/test/.eslintrc.yml" + "path": "node_modules/linkinator/node_modules/update-notifier/package.json" }, { - "path": "samples/test/v3/translate_translate_text.test.js" + "path": "node_modules/linkinator/node_modules/dot-prop/package.json" }, { - "path": "samples/test/v3/translate_list_codes.test.js" + "path": "node_modules/linkinator/node_modules/redent/package.json" }, { - "path": "samples/test/v3/translate_delete_glossary.test.js" + "path": "node_modules/linkinator/node_modules/semver-diff/package.json" }, { - "path": "samples/test/v3/translate_translate_text_with_glossary.test.js" + "path": "node_modules/linkinator/node_modules/map-obj/package.json" }, { - "path": "samples/test/v3/translate_batch_translate_text_with_model.test.js" + "path": "node_modules/linkinator/node_modules/meow/package.json" }, { - "path": "samples/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js" + "path": "node_modules/linkinator/node_modules/term-size/package.json" }, { - "path": "samples/test/v3/translate_get_supported_languages_for_targets.test.js" + "path": "node_modules/linkinator/node_modules/crypto-random-string/package.json" }, { - "path": "samples/test/v3/translate_list_language_names.test.js" + "path": "node_modules/linkinator/node_modules/indent-string/package.json" }, { - "path": "samples/test/v3/translate_get_glossary.test.js" + "path": "node_modules/linkinator/node_modules/camelcase-keys/package.json" }, { - "path": "samples/test/v3/translate_translate_text_with_glossary_and_model.test.js" + "path": "node_modules/linkinator/node_modules/is-obj/package.json" }, { - "path": "samples/test/v3/translate_batch_translate_text.test.js" + "path": "node_modules/linkinator/node_modules/read-pkg-up/package.json" }, { - "path": "samples/test/v3/translate_create_glossary.test.js" + "path": "node_modules/linkinator/node_modules/is-path-inside/package.json" }, { - "path": "samples/test/v3/translate_detect_language.test.js" + "path": "node_modules/linkinator/node_modules/boxen/package.json" }, { - "path": "samples/test/v3/translate_list_glossary.test.js" + "path": "node_modules/linkinator/node_modules/chalk/package.json" }, { - "path": "samples/test/v3/translate_batch_translate_text_with_glossary.test.js" + "path": "node_modules/linkinator/node_modules/arrify/package.json" }, { - "path": "samples/test/v3/translate_get_supported_languages.test.js" + "path": "node_modules/linkinator/node_modules/widest-line/package.json" }, { - "path": "samples/test/v3/translate_translate_text_with_model.test.js" + "path": "node_modules/linkinator/node_modules/global-dirs/package.json" }, { - "path": "samples/test/v3beta1/translate_list_language_names_beta.test.js" + "path": "node_modules/linkinator/node_modules/parse-json/package.json" }, { - "path": "samples/test/v3beta1/translate_delete_glossary_beta.test.js" + "path": "node_modules/linkinator/node_modules/xdg-basedir/package.json" }, { - "path": "samples/test/v3beta1/translate_detect_language_beta.test.js" + "path": "node_modules/linkinator/node_modules/is-npm/package.json" }, { - "path": "samples/test/v3beta1/translate_list_glossary_beta.test.js" + "path": "node_modules/linkinator/node_modules/read-pkg/package.json" }, { - "path": "samples/test/v3beta1/translate_create_glossary_beta.test.js" + "path": "node_modules/linkinator/node_modules/read-pkg/node_modules/type-fest/package.json" }, { - "path": "samples/test/v3beta1/translate_list_codes_beta.test.js" + "path": "node_modules/linkinator/node_modules/is-installed-globally/package.json" }, { - "path": "samples/test/v3beta1/translate_translate_text_beta.test.js" + "path": "node_modules/linkinator/node_modules/trim-newlines/package.json" }, { - "path": "samples/test/v3beta1/translate_get_glossary_beta.test.js" + "path": "node_modules/linkinator/node_modules/semver/package.json" }, { - "path": "samples/test/v3beta1/translate_batch_translate_text_beta.test.js" + "path": "node_modules/linkinator/node_modules/unique-string/package.json" }, { - "path": "samples/test/v3beta1/translate_translate_text_with_glossary_beta.test.js" + "path": "node_modules/linkinator/node_modules/strip-indent/package.json" }, { - "path": "samples/test/v3beta1/translate_translate_text_with_model_beta.test.js" + "path": "node_modules/linkinator/node_modules/quick-lru/package.json" }, { - "path": "samples/resources/example.png" + "path": "node_modules/linkinator/node_modules/minimist-options/package.json" }, { - "path": ".github/PULL_REQUEST_TEMPLATE.md" + "path": "node_modules/linkinator/node_modules/configstore/package.json" }, { - "path": ".github/release-please.yml" + "path": "node_modules/update-notifier/package.json" }, { - "path": ".github/ISSUE_TEMPLATE/support_request.md" + "path": "node_modules/p-cancelable/package.json" }, { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" + "path": "node_modules/markdown-it/package.json" }, { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" + "path": "node_modules/dot-prop/package.json" }, { - "path": ".kokoro/pre-system-test.sh" + "path": "node_modules/require-main-filename/package.json" }, { - "path": ".kokoro/test.sh" + "path": "node_modules/fast-diff/package.json" }, { - "path": ".kokoro/docs.sh" + "path": "node_modules/lodash.camelcase/package.json" }, { - "path": ".kokoro/samples-test.sh" + "path": "node_modules/redent/package.json" }, { - "path": ".kokoro/.gitattributes" + "path": "node_modules/resolve/package.json" }, { - "path": ".kokoro/trampoline.sh" + "path": "node_modules/globals/package.json" }, { - "path": ".kokoro/lint.sh" + "path": "node_modules/combined-stream/package.json" }, { - "path": ".kokoro/publish.sh" + "path": "node_modules/is-html/package.json" }, { - "path": ".kokoro/test.bat" + "path": "node_modules/range-parser/package.json" }, { - "path": ".kokoro/common.cfg" + "path": "node_modules/string.prototype.trimright/package.json" }, { - "path": ".kokoro/system-test.sh" + "path": "node_modules/inflight/package.json" }, { - "path": ".kokoro/release/docs.cfg" + "path": "node_modules/debug/package.json" }, { - "path": ".kokoro/release/docs.sh" + "path": "node_modules/htmlparser2/package.json" }, { - "path": ".kokoro/release/publish.cfg" + "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" }, { - "path": ".kokoro/continuous/node10/lint.cfg" + "path": "node_modules/semver-diff/package.json" }, { - "path": ".kokoro/continuous/node10/docs.cfg" + "path": "node_modules/semver-diff/node_modules/semver/package.json" }, { - "path": ".kokoro/continuous/node10/test.cfg" + "path": "node_modules/tsutils/package.json" }, { - "path": ".kokoro/continuous/node10/system-test.cfg" + "path": "node_modules/multi-stage-sourcemap/package.json" }, { - "path": ".kokoro/continuous/node10/samples-test.cfg" + "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" }, { - "path": ".kokoro/continuous/node10/common.cfg" + "path": "node_modules/ms/package.json" }, { - "path": ".kokoro/continuous/node8/test.cfg" + "path": "node_modules/linkify-it/package.json" }, { - "path": ".kokoro/continuous/node8/common.cfg" + "path": "node_modules/through/package.json" }, { - "path": ".kokoro/continuous/node12/test.cfg" + "path": "node_modules/power-assert-renderer-file/package.json" }, { - "path": ".kokoro/continuous/node12/common.cfg" + "path": "node_modules/string-width/package.json" }, { - "path": ".kokoro/presubmit/node10/lint.cfg" + "path": "node_modules/html-escaper/package.json" }, { - "path": ".kokoro/presubmit/node10/docs.cfg" + "path": "node_modules/type/package.json" }, { - "path": ".kokoro/presubmit/node10/test.cfg" + "path": "node_modules/type-fest/package.json" }, { - "path": ".kokoro/presubmit/node10/system-test.cfg" + "path": "node_modules/is/package.json" }, { - "path": ".kokoro/presubmit/node10/samples-test.cfg" + "path": "node_modules/intelli-espower-loader/package.json" }, { - "path": ".kokoro/presubmit/node10/common.cfg" + "path": "node_modules/parseurl/package.json" }, { - "path": ".kokoro/presubmit/node8/test.cfg" + "path": "node_modules/buffer-from/package.json" }, { - "path": ".kokoro/presubmit/node8/common.cfg" + "path": "node_modules/google-p12-pem/package.json" }, { - "path": ".kokoro/presubmit/node12/test.cfg" + "path": "node_modules/get-caller-file/package.json" + }, + { + "path": "node_modules/klaw/package.json" }, { - "path": ".kokoro/presubmit/node12/common.cfg" + "path": "node_modules/http-proxy-agent/package.json" }, { - "path": ".kokoro/presubmit/windows/test.cfg" + "path": "node_modules/http-proxy-agent/node_modules/debug/package.json" }, { - "path": ".kokoro/presubmit/windows/common.cfg" + "path": "node_modules/http-proxy-agent/node_modules/agent-base/package.json" }, { - "path": "protos/protos.json" + "path": "node_modules/map-obj/package.json" }, { - "path": "protos/protos.js" + "path": "node_modules/node-fetch/package.json" }, { - "path": "protos/protos.d.ts" + "path": "node_modules/jsonexport/package.json" }, { - "path": "protos/google/cloud/common_resources.proto" + "path": "node_modules/isexe/package.json" }, { - "path": "protos/google/cloud/translate/v3/translation_service.proto" + "path": "node_modules/escallmatch/package.json" }, { - "path": "protos/google/cloud/translate/v3beta1/translation_service.proto" + "path": "node_modules/escallmatch/node_modules/esprima/package.json" }, { - "path": ".git/packed-refs" + "path": "node_modules/espower/package.json" }, { - "path": ".git/HEAD" + "path": "node_modules/espower/node_modules/source-map/package.json" }, { - "path": ".git/config" + "path": "node_modules/run-async/package.json" }, { - "path": ".git/index" + "path": "node_modules/validate-npm-package-license/package.json" }, { - "path": ".git/shallow" + "path": "node_modules/file-entry-cache/package.json" }, { - "path": ".git/logs/HEAD" + "path": "node_modules/meow/package.json" }, { - "path": ".git/logs/refs/remotes/origin/HEAD" + "path": "node_modules/meow/node_modules/camelcase/package.json" }, { - "path": ".git/logs/refs/heads/autosynth" + "path": "node_modules/meow/node_modules/yargs-parser/package.json" }, { - "path": ".git/logs/refs/heads/master" + "path": "node_modules/concat-map/package.json" }, { - "path": ".git/refs/remotes/origin/HEAD" + "path": "node_modules/term-size/package.json" }, { - "path": ".git/refs/heads/autosynth" + "path": "node_modules/xmlcreate/package.json" }, { - "path": ".git/refs/heads/master" + "path": "node_modules/ansi-regex/package.json" }, { - "path": ".git/objects/pack/pack-38890517f21289e63ddc5a09b2224d6760b678f6.pack" + "path": "node_modules/yallist/package.json" }, { - "path": ".git/objects/pack/pack-38890517f21289e63ddc5a09b2224d6760b678f6.idx" + "path": "node_modules/json-bigint/package.json" }, { - "path": "test/gapic-translation_service-v3.ts" + "path": "node_modules/stream-events/package.json" }, { - "path": "test/index.ts" + "path": "node_modules/resolve-from/package.json" }, { - "path": "test/.eslintrc.yml" + "path": "node_modules/is-buffer/package.json" }, { - "path": "test/gapic-translation_service-v3beta1.ts" + "path": "node_modules/cliui/package.json" }, { - "path": "test/mocha.opts" + "path": "node_modules/toidentifier/package.json" }, { - "path": "system-test/.eslintrc.yml" + "path": "node_modules/balanced-match/package.json" }, { - "path": "system-test/translate.ts" + "path": "node_modules/marked/package.json" }, { - "path": "system-test/install.ts" + "path": "node_modules/wrappy/package.json" }, { - "path": "system-test/fixtures/sample/src/index.ts" + "path": "node_modules/jsdoc-region-tag/package.json" }, { - "path": "system-test/fixtures/sample/src/index.js" + "path": "node_modules/json-stable-stringify-without-jsonify/package.json" }, { - "path": "node_modules/strip-bom/package.json" + "path": "node_modules/glob-parent/package.json" }, { - "path": "node_modules/string-width/package.json" + "path": "node_modules/xtend/package.json" }, { - "path": "node_modules/is-callable/package.json" + "path": "node_modules/is-arguments/package.json" }, { - "path": "node_modules/util-deprecate/package.json" + "path": "node_modules/set-blocking/package.json" }, { - "path": "node_modules/gts/package.json" + "path": "node_modules/istanbul-lib-report/package.json" }, { - "path": "node_modules/gts/node_modules/has-flag/package.json" + "path": "node_modules/load-json-file/package.json" }, { - "path": "node_modules/gts/node_modules/color-name/package.json" + "path": "node_modules/ansi-align/package.json" }, { - "path": "node_modules/gts/node_modules/color-convert/package.json" + "path": "node_modules/ansi-align/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/gts/node_modules/supports-color/package.json" + "path": "node_modules/ansi-align/node_modules/string-width/package.json" }, { - "path": "node_modules/gts/node_modules/ansi-styles/package.json" + "path": "node_modules/ansi-align/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/gts/node_modules/chalk/package.json" + "path": "node_modules/ansi-align/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/require-directory/package.json" + "path": "node_modules/ansi-align/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/update-notifier/package.json" + "path": "node_modules/duplexer3/package.json" }, { "path": "node_modules/esprima/package.json" }, { - "path": "node_modules/string_decoder/package.json" + "path": "node_modules/is-stream-ended/package.json" }, { - "path": "node_modules/mocha/package.json" + "path": "node_modules/minimatch/package.json" }, { - "path": "node_modules/mocha/node_modules/locate-path/package.json" + "path": "node_modules/crypto-random-string/package.json" }, { - "path": "node_modules/mocha/node_modules/find-up/package.json" + "path": "node_modules/growl/package.json" }, { - "path": "node_modules/mocha/node_modules/diff/package.json" + "path": "node_modules/string.prototype.trimleft/package.json" }, { - "path": "node_modules/mocha/node_modules/yargs-parser/package.json" + "path": "node_modules/istanbul-lib-coverage/package.json" }, { - "path": "node_modules/mocha/node_modules/supports-color/package.json" + "path": "node_modules/normalize-package-data/package.json" }, { - "path": "node_modules/mocha/node_modules/which/package.json" + "path": "node_modules/normalize-package-data/node_modules/semver/package.json" }, { - "path": "node_modules/mocha/node_modules/path-exists/package.json" + "path": "node_modules/fast-text-encoding/package.json" }, { - "path": "node_modules/mocha/node_modules/p-locate/package.json" + "path": "node_modules/tar/package.json" }, { - "path": "node_modules/mocha/node_modules/glob/package.json" + "path": "node_modules/tar/node_modules/yallist/package.json" }, { - "path": "node_modules/mocha/node_modules/ms/package.json" + "path": "node_modules/server-destroy/package.json" }, { - "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" + "path": "node_modules/prelude-ls/package.json" }, { - "path": "node_modules/mocha/node_modules/yargs/package.json" + "path": "node_modules/d/package.json" }, { - "path": "node_modules/is-arguments/package.json" + "path": "node_modules/protobufjs/package.json" }, { - "path": "node_modules/core-util-is/package.json" + "path": "node_modules/protobufjs/cli/package-lock.json" }, { - "path": "node_modules/wrap-ansi/package.json" + "path": "node_modules/protobufjs/cli/package.json" }, { - "path": "node_modules/minimist-options/package.json" + "path": "node_modules/protobufjs/cli/node_modules/uglify-js/package.json" }, { - "path": "node_modules/minimist-options/node_modules/arrify/package.json" + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" }, { - "path": "node_modules/underscore/package.json" + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" }, { - "path": "node_modules/keyv/package.json" + "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" }, { - "path": "node_modules/glob-parent/package.json" + "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" }, { - "path": "node_modules/walkdir/package.json" + "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" }, { - "path": "node_modules/@protobufjs/codegen/package.json" + "path": "node_modules/protobufjs/cli/node_modules/commander/package.json" }, { - "path": "node_modules/@protobufjs/inquire/package.json" + "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" }, { - "path": "node_modules/@protobufjs/float/package.json" + "path": "node_modules/protobufjs/cli/node_modules/source-map/package.json" }, { - "path": "node_modules/@protobufjs/base64/package.json" + "path": "node_modules/domhandler/package.json" }, { - "path": "node_modules/@protobufjs/aspromise/package.json" + "path": "node_modules/ansi-escapes/package.json" }, { - "path": "node_modules/@protobufjs/eventemitter/package.json" + "path": "node_modules/power-assert-renderer-base/package.json" }, { - "path": "node_modules/@protobufjs/fetch/package.json" + "path": "node_modules/boolbase/package.json" }, { - "path": "node_modules/@protobufjs/utf8/package.json" + "path": "node_modules/indent-string/package.json" }, { - "path": "node_modules/@protobufjs/path/package.json" + "path": "node_modules/lodash/package.json" }, { - "path": "node_modules/@protobufjs/pool/package.json" + "path": "node_modules/taffydb/package.json" }, { - "path": "node_modules/global-dirs/package.json" + "path": "node_modules/extend/package.json" }, { - "path": "node_modules/has-flag/package.json" + "path": "node_modules/is-yarn-global/package.json" }, { - "path": "node_modules/locate-path/package.json" + "path": "node_modules/dom-serializer/package.json" }, { - "path": "node_modules/fill-keys/package.json" + "path": "node_modules/end-of-stream/package.json" }, { - "path": "node_modules/empower-assert/package.json" + "path": "node_modules/log-symbols/package.json" }, { - "path": "node_modules/convert-source-map/package.json" + "path": "node_modules/is-callable/package.json" }, { - "path": "node_modules/delayed-stream/package.json" + "path": "node_modules/es5-ext/package.json" }, { - "path": "node_modules/require-main-filename/package.json" + "path": "node_modules/stringifier/package.json" }, { - "path": "node_modules/bluebird/package.json" + "path": "node_modules/es6-weak-map/package.json" }, { - "path": "node_modules/string.prototype.trimleft/package.json" + "path": "node_modules/camelcase-keys/package.json" }, { - "path": "node_modules/range-parser/package.json" + "path": "node_modules/camelcase-keys/node_modules/camelcase/package.json" }, { - "path": "node_modules/espower-loader/package.json" + "path": "node_modules/decompress-response/package.json" }, { - "path": "node_modules/espower-loader/node_modules/source-map/package.json" + "path": "node_modules/js-yaml/package.json" }, { - "path": "node_modules/espower-loader/node_modules/source-map-support/package.json" + "path": "node_modules/cli-boxes/package.json" }, { - "path": "node_modules/defer-to-connect/package.json" + "path": "node_modules/is-obj/package.json" }, { - "path": "node_modules/duplexer3/package.json" + "path": "node_modules/is-typedarray/package.json" }, { - "path": "node_modules/indent-string/package.json" + "path": "node_modules/registry-auth-token/package.json" }, { - "path": "node_modules/eslint/package.json" + "path": "node_modules/read-pkg-up/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/README.md" + "path": "node_modules/read-pkg-up/node_modules/p-locate/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/package.json" + "path": "node_modules/read-pkg-up/node_modules/locate-path/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" + "path": "node_modules/read-pkg-up/node_modules/p-try/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/index.js" + "path": "node_modules/read-pkg-up/node_modules/p-limit/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" + "path": "node_modules/read-pkg-up/node_modules/find-up/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" + "path": "node_modules/read-pkg-up/node_modules/path-exists/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" + "path": "node_modules/buffer-equal-constant-time/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" + "path": "node_modules/@bcoe/v8-coverage/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" + "path": "node_modules/eslint-scope/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" + "path": "node_modules/stream-shift/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" + "path": "node_modules/is-extglob/package.json" }, { - "path": "node_modules/eslint/node_modules/path-key/package.json" + "path": "node_modules/typedarray-to-buffer/index.js" }, { - "path": "node_modules/eslint/node_modules/which/package.json" + "path": "node_modules/typedarray-to-buffer/README.md" }, { - "path": "node_modules/eslint/node_modules/shebang-regex/package.json" + "path": "node_modules/typedarray-to-buffer/.airtap.yml" }, { - "path": "node_modules/eslint/node_modules/shebang-command/package.json" + "path": "node_modules/typedarray-to-buffer/.travis.yml" }, { - "path": "node_modules/eslint/node_modules/debug/package.json" + "path": "node_modules/typedarray-to-buffer/package.json" }, { - "path": "node_modules/got/package.json" + "path": "node_modules/typedarray-to-buffer/LICENSE" }, { - "path": "node_modules/got/node_modules/get-stream/package.json" + "path": "node_modules/typedarray-to-buffer/test/basic.js" }, { - "path": "node_modules/estraverse/package.json" + "path": "node_modules/restore-cursor/package.json" }, { - "path": "node_modules/mdurl/package.json" + "path": "node_modules/mimic-response/package.json" }, { - "path": "node_modules/eslint-plugin-node/package.json" + "path": "node_modules/normalize-url/package.json" }, { - "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" + "path": "node_modules/fresh/package.json" }, { - "path": "node_modules/resolve-from/package.json" + "path": "node_modules/imurmurhash/package.json" }, { - "path": "node_modules/type-name/package.json" + "path": "node_modules/indexof/package.json" }, { - "path": "node_modules/lodash/package.json" + "path": "node_modules/codecov/package.json" }, { - "path": "node_modules/strip-ansi/package.json" + "path": "node_modules/codecov/node_modules/https-proxy-agent/package.json" }, { - "path": "node_modules/safe-buffer/package.json" + "path": "node_modules/codecov/node_modules/teeny-request/package.json" }, { - "path": "node_modules/@szmarczak/http-timer/package.json" + "path": "node_modules/ajv/package.json" }, { - "path": "node_modules/parent-module/package.json" + "path": "node_modules/is-path-inside/package.json" }, { - "path": "node_modules/object-keys/package.json" + "path": "node_modules/import-lazy/package.json" }, { - "path": "node_modules/write/package.json" + "path": "node_modules/json-schema-traverse/package.json" }, { - "path": "node_modules/configstore/package.json" + "path": "node_modules/ncp/package.json" }, { - "path": "node_modules/configstore/node_modules/write-file-atomic/package.json" + "path": "node_modules/rxjs/package.json" }, { - "path": "node_modules/configstore/node_modules/pify/package.json" + "path": "node_modules/p-locate/package.json" }, { - "path": "node_modules/configstore/node_modules/make-dir/package.json" + "path": "node_modules/figures/package.json" }, { - "path": "node_modules/v8-to-istanbul/package.json" + "path": "node_modules/underscore/package.json" }, { - "path": "node_modules/v8-to-istanbul/node_modules/source-map/package.json" + "path": "node_modules/finalhandler/package.json" }, { - "path": "node_modules/dot-prop/package.json" + "path": "node_modules/finalhandler/node_modules/debug/package.json" }, { - "path": "node_modules/tsutils/package.json" + "path": "node_modules/finalhandler/node_modules/ms/package.json" }, { - "path": "node_modules/npm-bundled/package.json" + "path": "node_modules/ignore/package.json" + }, + { + "path": "node_modules/argv/package.json" }, { - "path": "node_modules/import-fresh/package.json" + "path": "node_modules/path-is-absolute/package.json" }, { - "path": "node_modules/mute-stream/package.json" + "path": "node_modules/graceful-fs/package.json" }, { - "path": "node_modules/wide-align/package.json" + "path": "node_modules/currently-unhandled/package.json" }, { - "path": "node_modules/wide-align/node_modules/string-width/package.json" + "path": "node_modules/minizlib/package.json" }, { - "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" + "path": "node_modules/minizlib/node_modules/yallist/package.json" }, { - "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" + "path": "node_modules/google-gax/package.json" }, { - "path": "node_modules/eslint-scope/package.json" + "path": "node_modules/onetime/package.json" }, { - "path": "node_modules/is-promise/package.json" + "path": "node_modules/path-key/package.json" }, { - "path": "node_modules/es6-map/package.json" + "path": "node_modules/core-util-is/package.json" }, { - "path": "node_modules/p-finally/package.json" + "path": "node_modules/array-filter/package.json" }, { - "path": "node_modules/es6-set/package.json" + "path": "node_modules/delayed-stream/package.json" }, { - "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" + "path": "node_modules/prepend-http/package.json" }, { - "path": "node_modules/array-find/package.json" + "path": "node_modules/write/package.json" }, { - "path": "node_modules/js2xmlparser/package.json" + "path": "node_modules/duplexify/package.json" }, { - "path": "node_modules/istanbul-reports/package.json" + "path": "node_modules/camelcase/package.json" }, { - "path": "node_modules/indexof/package.json" + "path": "node_modules/error-ex/package.json" }, { - "path": "node_modules/progress/package.json" + "path": "node_modules/empower-assert/package.json" }, { - "path": "node_modules/registry-url/package.json" + "path": "node_modules/boxen/package.json" }, { - "path": "node_modules/google-gax/package.json" + "path": "node_modules/boxen/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/mimic-response/package.json" + "path": "node_modules/boxen/node_modules/string-width/package.json" }, { - "path": "node_modules/figures/package.json" + "path": "node_modules/boxen/node_modules/type-fest/package.json" }, { - "path": "node_modules/eslint-config-prettier/package.json" + "path": "node_modules/boxen/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/argparse/package.json" + "path": "node_modules/boxen/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/type/package.json" + "path": "node_modules/boxen/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/domhandler/package.json" + "path": "node_modules/node-environment-flags/package.json" }, { - "path": "node_modules/error-ex/package.json" + "path": "node_modules/node-environment-flags/node_modules/semver/package.json" }, { - "path": "node_modules/ansi-colors/package.json" + "path": "node_modules/c8/package.json" }, { - "path": "node_modules/safer-buffer/package.json" + "path": "node_modules/gcp-metadata/package.json" }, { - "path": "node_modules/type-fest/package.json" + "path": "node_modules/json-buffer/package.json" }, { - "path": "node_modules/strip-indent/package.json" + "path": "node_modules/mkdirp/package.json" }, { - "path": "node_modules/boxen/package.json" + "path": "node_modules/bluebird/package.json" }, { - "path": "node_modules/boxen/node_modules/type-fest/package.json" + "path": "node_modules/shebang-command/package.json" }, { - "path": "node_modules/flat-cache/package.json" + "path": "node_modules/serve-static/package.json" }, { - "path": "node_modules/flat-cache/node_modules/rimraf/package.json" + "path": "node_modules/path-parse/package.json" }, { - "path": "node_modules/has-symbols/package.json" + "path": "node_modules/mime/package.json" }, { - "path": "node_modules/gcp-metadata/package.json" + "path": "node_modules/yargs-unparser/package.json" }, { - "path": "node_modules/ansi-align/package.json" + "path": "node_modules/yargs-unparser/node_modules/color-name/package.json" }, { - "path": "node_modules/find-up/package.json" + "path": "node_modules/yargs-unparser/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/log-symbols/package.json" + "path": "node_modules/yargs-unparser/node_modules/string-width/package.json" }, { - "path": "node_modules/merge-estraverse-visitors/package.json" + "path": "node_modules/yargs-unparser/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/is-extglob/package.json" + "path": "node_modules/yargs-unparser/node_modules/cliui/package.json" }, { - "path": "node_modules/json-stable-stringify-without-jsonify/package.json" + "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" }, { - "path": "node_modules/prettier/package.json" + "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" }, { - "path": "node_modules/jsonexport/package.json" + "path": "node_modules/yargs-unparser/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/wrappy/package.json" + "path": "node_modules/yargs-unparser/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/npm-run-path/package.json" + "path": "node_modules/yargs-unparser/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/npm-run-path/node_modules/path-key/package.json" + "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" }, { - "path": "node_modules/map-obj/package.json" + "path": "node_modules/yargs-unparser/node_modules/wrap-ansi/package.json" }, { - "path": "node_modules/term-size/package.json" + "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" }, { - "path": "node_modules/destroy/package.json" + "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" }, { - "path": "node_modules/growl/package.json" + "path": "node_modules/yargs-unparser/node_modules/color-convert/package.json" }, { - "path": "node_modules/http-proxy-agent/package.json" + "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" }, { - "path": "node_modules/http-proxy-agent/node_modules/agent-base/package.json" + "path": "node_modules/lines-and-columns/package.json" }, { - "path": "node_modules/http-proxy-agent/node_modules/debug/package.json" + "path": "node_modules/is-url/package.json" }, { - "path": "node_modules/json-schema-traverse/package.json" + "path": "node_modules/chalk/package.json" }, { - "path": "node_modules/npm-packlist/package.json" + "path": "node_modules/chalk/node_modules/color-name/package.json" }, { - "path": "node_modules/taffydb/package.json" + "path": "node_modules/chalk/node_modules/has-flag/package.json" }, { - "path": "node_modules/cross-spawn/package.json" + "path": "node_modules/chalk/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/loud-rejection/package.json" + "path": "node_modules/chalk/node_modules/supports-color/package.json" }, { - "path": "node_modules/is-glob/package.json" + "path": "node_modules/chalk/node_modules/color-convert/package.json" }, { - "path": "node_modules/get-stream/package.json" + "path": "node_modules/locate-path/package.json" }, { - "path": "node_modules/uglify-js/package.json" + "path": "node_modules/spdx-expression-parse/package.json" }, { - "path": "node_modules/minipass/package.json" + "path": "node_modules/power-assert-util-string-width/package.json" }, { - "path": "node_modules/minipass/node_modules/yallist/package.json" + "path": "node_modules/esquery/package.json" }, { - "path": "node_modules/optimist/package.json" + "path": "node_modules/to-readable-stream/package.json" }, { - "path": "node_modules/empower/package.json" + "path": "node_modules/jsdoc-fresh/package.json" }, { - "path": "node_modules/cacheable-request/package.json" + "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" }, { - "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" + "path": "node_modules/espower-location-detector/package.json" }, { - "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" + "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" }, { - "path": "node_modules/is-ci/package.json" + "path": "node_modules/strip-ansi/package.json" }, { - "path": "node_modules/server-destroy/package.json" + "path": "node_modules/is-arrayish/package.json" }, { - "path": "node_modules/json-parse-better-errors/package.json" + "path": "node_modules/prettier-linter-helpers/package.json" }, { - "path": "node_modules/core-js/package.json" + "path": "node_modules/chardet/package.json" }, { - "path": "node_modules/set-blocking/package.json" + "path": "node_modules/amdefine/package.json" }, { - "path": "node_modules/next-tick/package.json" + "path": "node_modules/http-cache-semantics/package.json" }, { - "path": "node_modules/catharsis/package.json" + "path": "node_modules/has-flag/package.json" }, { - "path": "node_modules/rimraf/package.json" + "path": "node_modules/cheerio/package.json" }, { - "path": "node_modules/agent-base/package.json" + "path": "node_modules/domelementtype/package.json" }, { - "path": "node_modules/json-bigint/package.json" + "path": "node_modules/npm-normalize-package-bin/package.json" }, { - "path": "node_modules/spdx-exceptions/package.json" + "path": "node_modules/@szmarczak/http-timer/package.json" }, { - "path": "node_modules/color-name/package.json" + "path": "node_modules/tmp/package.json" }, { - "path": "node_modules/through/package.json" + "path": "node_modules/entities/package.json" }, { - "path": "node_modules/ent/package.json" + "path": "node_modules/execa/package.json" }, { - "path": "node_modules/jws/package.json" + "path": "node_modules/execa/node_modules/lru-cache/package.json" }, { - "path": "node_modules/inquirer/package.json" + "path": "node_modules/execa/node_modules/yallist/package.json" }, { - "path": "node_modules/inquirer/node_modules/string-width/package.json" + "path": "node_modules/execa/node_modules/shebang-command/package.json" }, { - "path": "node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi/package.json" + "path": "node_modules/execa/node_modules/is-stream/package.json" }, { - "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" + "path": "node_modules/execa/node_modules/which/package.json" }, { - "path": "node_modules/inquirer/node_modules/emoji-regex/package.json" + "path": "node_modules/execa/node_modules/shebang-regex/package.json" }, { - "path": "node_modules/inquirer/node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/execa/node_modules/cross-spawn/package.json" }, { - "path": "node_modules/etag/package.json" + "path": "node_modules/strip-bom/package.json" }, { - "path": "node_modules/power-assert-formatter/package.json" + "path": "node_modules/argparse/package.json" }, { - "path": "node_modules/text-table/package.json" + "path": "node_modules/has/package.json" }, { - "path": "node_modules/color-convert/package.json" + "path": "node_modules/ee-first/package.json" }, { - "path": "node_modules/escope/package.json" + "path": "node_modules/object-inspect/package.json" }, { - "path": "node_modules/ansi-regex/package.json" + "path": "node_modules/deep-equal/package.json" }, { - "path": "node_modules/is-installed-globally/package.json" + "path": "node_modules/table/package.json" }, { - "path": "node_modules/redent/package.json" + "path": "node_modules/table/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/is-buffer/package.json" + "path": "node_modules/table/node_modules/string-width/package.json" }, { - "path": "node_modules/esrecurse/package.json" + "path": "node_modules/table/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/tslint/package.json" + "path": "node_modules/table/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/tslint/node_modules/semver/package.json" + "path": "node_modules/table/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/decamelize/package.json" + "path": "node_modules/spdx-correct/package.json" }, { - "path": "node_modules/parse-json/package.json" + "path": "node_modules/get-stream/package.json" }, { - "path": "node_modules/mime/package.json" + "path": "node_modules/chownr/package.json" }, { - "path": "node_modules/google-auth-library/package.json" + "path": "node_modules/power-assert/package.json" }, { - "path": "node_modules/ignore/package.json" + "path": "node_modules/statuses/package.json" }, { - "path": "node_modules/depd/package.json" + "path": "node_modules/@istanbuljs/schema/package.json" }, { - "path": "node_modules/camelcase-keys/package.json" + "path": "node_modules/es6-set/package.json" }, { - "path": "node_modules/camelcase-keys/node_modules/camelcase/package.json" + "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" }, { - "path": "node_modules/ansi-escapes/package.json" + "path": "node_modules/proxyquire/package.json" }, { - "path": "node_modules/decompress-response/package.json" + "path": "node_modules/istanbul-reports/package.json" }, { - "path": "node_modules/end-of-stream/package.json" + "path": "node_modules/@grpc/grpc-js/package.json" }, { - "path": "node_modules/diff-match-patch/package.json" + "path": "node_modules/@grpc/grpc-js/node_modules/semver/package.json" }, { - "path": "node_modules/amdefine/package.json" + "path": "node_modules/@grpc/proto-loader/package.json" }, { - "path": "node_modules/event-emitter/package.json" + "path": "node_modules/lowercase-keys/package.json" }, { - "path": "node_modules/is-windows/package.json" + "path": "node_modules/etag/package.json" }, { - "path": "node_modules/diff/package.json" + "path": "node_modules/y18n/package.json" }, { - "path": "node_modules/tmp/package.json" + "path": "node_modules/diff-match-patch/package.json" }, { - "path": "node_modules/source-map/package.json" + "path": "node_modules/merge-descriptors/package.json" }, { - "path": "node_modules/is-obj/package.json" + "path": "node_modules/es6-iterator/package.json" }, { - "path": "node_modules/yargs-parser/package.json" + "path": "node_modules/eslint-plugin-node/package.json" }, { - "path": "node_modules/teeny-request/package.json" + "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" }, { - "path": "node_modules/teeny-request/node_modules/agent-base/package.json" + "path": "node_modules/eslint-plugin-node/node_modules/semver/package.json" }, { - "path": "node_modules/teeny-request/node_modules/https-proxy-agent/package.json" + "path": "node_modules/eslint-plugin-node/node_modules/eslint-utils/package.json" }, { - "path": "node_modules/teeny-request/node_modules/debug/package.json" + "path": "node_modules/natural-compare/package.json" }, { - "path": "node_modules/escape-string-regexp/package.json" + "path": "node_modules/uuid/package.json" }, { - "path": "node_modules/es-abstract/package.json" + "path": "node_modules/event-target-shim/package.json" }, { - "path": "node_modules/linkinator/package.json" + "path": "node_modules/arrify/package.json" }, { - "path": "node_modules/linkinator/node_modules/has-flag/package.json" + "path": "node_modules/widest-line/package.json" }, { - "path": "node_modules/linkinator/node_modules/color-name/package.json" + "path": "node_modules/widest-line/node_modules/string-width/package.json" }, { - "path": "node_modules/linkinator/node_modules/color-convert/package.json" + "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/linkinator/node_modules/supports-color/package.json" + "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/linkinator/node_modules/ansi-styles/package.json" + "path": "node_modules/widest-line/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/linkinator/node_modules/chalk/package.json" + "path": "node_modules/ignore-walk/package.json" }, { - "path": "node_modules/import-lazy/package.json" + "path": "node_modules/util-deprecate/package.json" }, { - "path": "node_modules/inflight/package.json" + "path": "node_modules/function-bind/package.json" }, { - "path": "node_modules/concat-map/package.json" + "path": "node_modules/object-is/package.json" }, { - "path": "node_modules/object.assign/package.json" + "path": "node_modules/@types/color-name/package.json" }, { - "path": "node_modules/es6-symbol/package.json" + "path": "node_modules/@types/request/package.json" }, { - "path": "node_modules/semver/package.json" + "path": "node_modules/@types/is/package.json" }, { - "path": "node_modules/jsdoc-fresh/package.json" + "path": "node_modules/@types/tough-cookie/package.json" }, { - "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" + "path": "node_modules/@types/node/package.json" }, { - "path": "node_modules/is-typedarray/package.json" + "path": "node_modules/@types/istanbul-lib-coverage/package.json" }, { - "path": "node_modules/htmlparser2/package.json" + "path": "node_modules/@types/normalize-package-data/package.json" }, { - "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" + "path": "node_modules/@types/extend/package.json" }, { - "path": "node_modules/cli-boxes/package.json" + "path": "node_modules/@types/proxyquire/package.json" }, { - "path": "node_modules/stubs/package.json" + "path": "node_modules/@types/is-windows/package.json" }, { - "path": "node_modules/supports-color/package.json" + "path": "node_modules/@types/caseless/package.json" }, { - "path": "node_modules/path-key/package.json" + "path": "node_modules/@types/mocha/package.json" }, { - "path": "node_modules/lru-cache/package.json" + "path": "node_modules/@types/minimist/package.json" }, { - "path": "node_modules/module-not-found-error/package.json" + "path": "node_modules/@types/fs-extra/package.json" }, { - "path": "node_modules/rc/package.json" + "path": "node_modules/@types/long/package.json" }, { - "path": "node_modules/rc/node_modules/minimist/package.json" + "path": "node_modules/is-windows/package.json" }, { - "path": "node_modules/rc/node_modules/strip-json-comments/package.json" + "path": "node_modules/levn/package.json" }, { - "path": "node_modules/yargs-unparser/package.json" + "path": "node_modules/pseudomap/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" + "path": "node_modules/global-dirs/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" + "path": "node_modules/power-assert-renderer-diagram/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" + "path": "node_modules/is-stream/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" + "path": "node_modules/es6-symbol/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" + "path": "node_modules/parse-json/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" + "path": "node_modules/xdg-basedir/package.json" }, { - "path": "node_modules/abort-controller/package.json" + "path": "node_modules/spdx-license-ids/package.json" }, { - "path": "node_modules/http-errors/package.json" + "path": "node_modules/google-auth-library/package.json" }, { - "path": "node_modules/marked/package.json" + "path": "node_modules/brace-expansion/package.json" }, { - "path": "node_modules/is-plain-obj/package.json" + "path": "node_modules/builtin-modules/package.json" }, { - "path": "node_modules/minimatch/package.json" + "path": "node_modules/tslint/package.json" }, { - "path": "node_modules/combined-stream/package.json" + "path": "node_modules/tslint/node_modules/semver/package.json" }, { - "path": "node_modules/send/package.json" + "path": "node_modules/type-name/package.json" }, { - "path": "node_modules/send/node_modules/mime/package.json" + "path": "node_modules/define-properties/package.json" }, { - "path": "node_modules/send/node_modules/ms/package.json" + "path": "node_modules/universal-deep-strict-equal/package.json" }, { - "path": "node_modules/send/node_modules/debug/package.json" + "path": "node_modules/jws/package.json" }, { - "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" + "path": "node_modules/minipass/package.json" }, { - "path": "node_modules/css-select/package.json" + "path": "node_modules/minipass/node_modules/yallist/package.json" }, { - "path": "node_modules/uri-js/package.json" + "path": "node_modules/nth-check/package.json" }, { - "path": "node_modules/google-p12-pem/package.json" + "path": "node_modules/empower/package.json" }, { - "path": "node_modules/npm-normalize-package-bin/package.json" + "path": "node_modules/send/package.json" }, { - "path": "node_modules/spdx-license-ids/package.json" + "path": "node_modules/send/node_modules/debug/package.json" }, { - "path": "node_modules/yallist/package.json" + "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" }, { - "path": "node_modules/setprototypeof/package.json" + "path": "node_modules/send/node_modules/ms/package.json" }, { - "path": "node_modules/hosted-git-info/package.json" + "path": "node_modules/send/node_modules/mime/package.json" }, { - "path": "node_modules/argv/package.json" + "path": "node_modules/require-directory/package.json" }, { - "path": "node_modules/package-json/package.json" + "path": "node_modules/object.assign/package.json" }, { - "path": "node_modules/write-file-atomic/package.json" + "path": "node_modules/is-npm/package.json" }, { - "path": "node_modules/external-editor/package.json" + "path": "node_modules/fs-minipass/package.json" }, { - "path": "node_modules/@sindresorhus/is/package.json" + "path": "node_modules/min-indent/package.json" }, { - "path": "node_modules/lodash.camelcase/package.json" + "path": "node_modules/functional-red-black-tree/package.json" }, { - "path": "node_modules/arrify/package.json" + "path": "node_modules/read-pkg/package.json" }, { - "path": "node_modules/ansi-styles/package.json" + "path": "node_modules/registry-url/package.json" }, { - "path": "node_modules/parseurl/package.json" + "path": "node_modules/is-regex/package.json" }, { - "path": "node_modules/boolbase/package.json" + "path": "node_modules/es-abstract/package.json" }, { - "path": "node_modules/is/package.json" + "path": "node_modules/parent-module/package.json" }, { - "path": "node_modules/cliui/package.json" + "path": "node_modules/signal-exit/package.json" }, { - "path": "node_modules/balanced-match/package.json" + "path": "node_modules/import-fresh/package.json" }, { - "path": "node_modules/acorn/package.json" + "path": "node_modules/keyv/package.json" }, { - "path": "node_modules/load-json-file/package.json" + "path": "node_modules/estraverse/package.json" }, { - "path": "node_modules/load-json-file/node_modules/pify/package.json" + "path": "node_modules/fast-deep-equal/package.json" }, { - "path": "node_modules/builtin-modules/package.json" + "path": "node_modules/mute-stream/package.json" }, { - "path": "node_modules/widest-line/package.json" + "path": "node_modules/power-assert-context-traversal/package.json" }, { - "path": "node_modules/widest-line/node_modules/string-width/package.json" + "path": "node_modules/rimraf/package.json" }, { - "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" + "path": "node_modules/is-installed-globally/package.json" }, { - "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" + "path": "node_modules/get-stdin/package.json" }, { - "path": "node_modules/which/package.json" + "path": "node_modules/make-dir/package.json" }, { - "path": "node_modules/@bcoe/v8-coverage/package.json" + "path": "node_modules/make-dir/node_modules/semver/package.json" }, { - "path": "node_modules/prettier-linter-helpers/package.json" + "path": "node_modules/es6-promise/package.json" }, { - "path": "node_modules/object-inspect/package.json" + "path": "node_modules/os-tmpdir/package.json" }, { "path": "node_modules/retry-request/package.json" @@ -1644,1054 +1824,1057 @@ "path": "node_modules/retry-request/node_modules/debug/package.json" }, { - "path": "node_modules/is-arrayish/package.json" + "path": "node_modules/cli-cursor/package.json" }, { - "path": "node_modules/shebang-regex/package.json" + "path": "node_modules/ext/package.json" }, { - "path": "node_modules/clone-response/package.json" + "path": "node_modules/ext/node_modules/type/package.json" }, { - "path": "node_modules/deep-is/package.json" + "path": "node_modules/is-symbol/package.json" }, { - "path": "node_modules/regexpp/package.json" + "path": "node_modules/css-what/package.json" }, { - "path": "node_modules/node-forge/package.json" + "path": "node_modules/ent/package.json" }, { - "path": "node_modules/power-assert/package.json" + "path": "node_modules/punycode/package.json" }, { - "path": "node_modules/path-is-absolute/package.json" + "path": "node_modules/setprototypeof/package.json" }, { - "path": "node_modules/ignore-walk/package.json" + "path": "node_modules/word-wrap/package.json" }, { - "path": "node_modules/finalhandler/package.json" + "path": "node_modules/foreground-child/package.json" }, { - "path": "node_modules/finalhandler/node_modules/ms/package.json" + "path": "node_modules/es6-map/package.json" }, { - "path": "node_modules/finalhandler/node_modules/debug/package.json" + "path": "node_modules/call-signature/package.json" }, { - "path": "node_modules/source-map-support/package.json" + "path": "node_modules/package-json/package.json" }, { - "path": "node_modules/stream-events/package.json" + "path": "node_modules/package-json/node_modules/semver/package.json" }, { - "path": "node_modules/buffer-equal-constant-time/package.json" + "path": "node_modules/css-select/package.json" }, { - "path": "node_modules/path-parse/package.json" + "path": "node_modules/path-is-inside/package.json" }, { - "path": "node_modules/decamelize-keys/package.json" + "path": "node_modules/eslint-plugin-prettier/package.json" }, { - "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" + "path": "node_modules/p-finally/package.json" }, { - "path": "node_modules/os-tmpdir/package.json" + "path": "node_modules/inquirer/package.json" }, { - "path": "node_modules/power-assert-util-string-width/package.json" + "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/url-parse-lax/package.json" + "path": "node_modules/inquirer/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/linkify-it/package.json" + "path": "node_modules/acorn-jsx/package.json" }, { - "path": "node_modules/merge-descriptors/package.json" + "path": "node_modules/glob/package.json" }, { - "path": "node_modules/minimist/package.json" + "path": "node_modules/mocha/package.json" }, { - "path": "node_modules/fresh/package.json" + "path": "node_modules/mocha/node_modules/diff/package.json" }, { - "path": "node_modules/power-assert-context-formatter/package.json" + "path": "node_modules/mocha/node_modules/color-name/package.json" }, { - "path": "node_modules/is-stream/package.json" + "path": "node_modules/mocha/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/call-matcher/package.json" + "path": "node_modules/mocha/node_modules/ms/package.json" }, { - "path": "node_modules/is-stream-ended/package.json" + "path": "node_modules/mocha/node_modules/string-width/package.json" }, { - "path": "node_modules/slice-ansi/package.json" + "path": "node_modules/mocha/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/onetime/package.json" + "path": "node_modules/mocha/node_modules/cliui/package.json" }, { - "path": "node_modules/spdx-correct/package.json" + "path": "node_modules/mocha/node_modules/p-locate/package.json" }, { - "path": "node_modules/fast-deep-equal/package.json" + "path": "node_modules/mocha/node_modules/locate-path/package.json" }, { - "path": "node_modules/readable-stream/package.json" + "path": "node_modules/mocha/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/xdg-basedir/package.json" + "path": "node_modules/mocha/node_modules/has-flag/package.json" }, { - "path": "node_modules/v8-compile-cache/package.json" + "path": "node_modules/mocha/node_modules/glob/package.json" }, { - "path": "node_modules/callsites/package.json" + "path": "node_modules/mocha/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/power-assert-renderer-assertion/package.json" + "path": "node_modules/mocha/node_modules/which/package.json" }, { - "path": "node_modules/pify/package.json" + "path": "node_modules/mocha/node_modules/supports-color/package.json" }, { - "path": "node_modules/stream-shift/package.json" + "path": "node_modules/mocha/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/crypto-random-string/package.json" + "path": "node_modules/mocha/node_modules/find-up/package.json" }, { - "path": "node_modules/escodegen/package.json" + "path": "node_modules/mocha/node_modules/wrap-ansi/package.json" }, { - "path": "node_modules/escodegen/node_modules/esprima/package.json" + "path": "node_modules/mocha/node_modules/path-exists/package.json" }, { - "path": "node_modules/entities/package.json" + "path": "node_modules/mocha/node_modules/yargs/package.json" }, { - "path": "node_modules/object.getownpropertydescriptors/package.json" + "path": "node_modules/mocha/node_modules/color-convert/package.json" }, { - "path": "node_modules/power-assert-renderer-file/package.json" + "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/unpipe/package.json" + "path": "node_modules/mocha/node_modules/yargs-parser/package.json" }, { - "path": "node_modules/html-tags/package.json" + "path": "node_modules/mime-db/package.json" }, { - "path": "node_modules/array-filter/package.json" + "path": "node_modules/loud-rejection/package.json" }, { - "path": "node_modules/furi/package.json" + "path": "node_modules/event-emitter/package.json" }, { - "path": "node_modules/pack-n-play/package.json" + "path": "node_modules/@protobufjs/codegen/package.json" }, { - "path": "node_modules/pack-n-play/node_modules/tmp/package.json" + "path": "node_modules/@protobufjs/base64/package.json" }, { - "path": "node_modules/pack-n-play/node_modules/tmp/node_modules/rimraf/package.json" + "path": "node_modules/@protobufjs/utf8/package.json" }, { - "path": "node_modules/strip-eof/package.json" + "path": "node_modules/@protobufjs/pool/package.json" }, { - "path": "node_modules/is-path-inside/package.json" + "path": "node_modules/@protobufjs/float/package.json" }, { - "path": "node_modules/ini/package.json" + "path": "node_modules/@protobufjs/fetch/package.json" }, { - "path": "node_modules/currently-unhandled/package.json" + "path": "node_modules/@protobufjs/path/package.json" }, { - "path": "node_modules/validate-npm-package-license/package.json" + "path": "node_modules/@protobufjs/aspromise/package.json" }, { - "path": "node_modules/bignumber.js/package.json" + "path": "node_modules/@protobufjs/inquire/package.json" }, { - "path": "node_modules/is-yarn-global/package.json" + "path": "node_modules/@protobufjs/eventemitter/package.json" + }, + { + "path": "node_modules/node-forge/package.json" }, { "path": "node_modules/lodash.has/package.json" }, { - "path": "node_modules/camelcase/package.json" + "path": "node_modules/source-map-support/package.json" }, { - "path": "node_modules/prelude-ls/package.json" + "path": "node_modules/source-map-support/node_modules/source-map/package.json" }, { - "path": "node_modules/codecov/package.json" + "path": "node_modules/has-symbols/package.json" }, { - "path": "node_modules/codecov/node_modules/teeny-request/package.json" + "path": "node_modules/stubs/package.json" }, { - "path": "node_modules/codecov/node_modules/https-proxy-agent/package.json" + "path": "node_modules/espurify/package.json" }, { - "path": "node_modules/http2spy/package.json" + "path": "node_modules/lodash.at/package.json" }, { - "path": "node_modules/es6-promise/package.json" + "path": "node_modules/ansi-styles/package.json" }, { - "path": "node_modules/doctrine/package.json" + "path": "node_modules/merge-estraverse-visitors/package.json" }, { - "path": "node_modules/path-exists/package.json" + "path": "node_modules/ansi-colors/package.json" }, { - "path": "node_modules/deep-extend/package.json" + "path": "node_modules/p-try/package.json" }, { - "path": "node_modules/nth-check/package.json" + "path": "node_modules/is-object/package.json" }, { - "path": "node_modules/isarray/package.json" + "path": "node_modules/escope/package.json" }, { - "path": "node_modules/es-to-primitive/package.json" + "path": "node_modules/json-parse-better-errors/package.json" }, { - "path": "node_modules/https-proxy-agent/package.json" + "path": "node_modules/readable-stream/package.json" }, { - "path": "node_modules/eslint-plugin-es/package.json" + "path": "node_modules/abort-controller/package.json" }, { - "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" + "path": "node_modules/which/package.json" }, { - "path": "node_modules/path-type/package.json" + "path": "node_modules/astral-regex/package.json" }, { - "path": "node_modules/path-type/node_modules/pify/package.json" + "path": "node_modules/escodegen/package.json" }, { - "path": "node_modules/fs-minipass/package.json" + "path": "node_modules/escodegen/node_modules/esprima/package.json" }, { - "path": "node_modules/fast-json-stable-stringify/package.json" + "path": "node_modules/escodegen/node_modules/source-map/package.json" }, { - "path": "node_modules/p-locate/package.json" + "path": "node_modules/minimist/package.json" }, { - "path": "node_modules/intelli-espower-loader/package.json" + "path": "node_modules/clone-response/package.json" }, { - "path": "node_modules/node-fetch/package.json" + "path": "node_modules/ecdsa-sig-formatter/package.json" }, { - "path": "node_modules/registry-auth-token/package.json" + "path": "node_modules/requizzle/package.json" }, { - "path": "node_modules/esutils/package.json" + "path": "node_modules/base64-js/package.json" }, { - "path": "node_modules/which-module/package.json" + "path": "node_modules/pify/package.json" }, { - "path": "node_modules/function-bind/package.json" + "path": "node_modules/object-keys/package.json" }, { "path": "node_modules/trim-newlines/package.json" }, { - "path": "node_modules/event-target-shim/package.json" + "path": "node_modules/deep-is/package.json" }, { - "path": "node_modules/on-finished/package.json" + "path": "node_modules/fast-levenshtein/package.json" }, { - "path": "node_modules/y18n/package.json" + "path": "node_modules/typescript/package.json" }, { - "path": "node_modules/quick-lru/package.json" + "path": "node_modules/shebang-regex/package.json" }, { - "path": "node_modules/js-yaml/package.json" + "path": "node_modules/eslint-plugin-es/package.json" }, { - "path": "node_modules/flat/package.json" + "path": "node_modules/eslint-plugin-es/node_modules/eslint-utils/package.json" }, { - "path": "node_modules/normalize-package-data/package.json" + "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" }, { - "path": "node_modules/normalize-package-data/node_modules/semver/package.json" + "path": "node_modules/semver/package.json" }, { - "path": "node_modules/es6-iterator/package.json" + "path": "node_modules/unique-string/package.json" }, { - "path": "node_modules/typescript/package.json" + "path": "node_modules/decamelize/package.json" }, { - "path": "node_modules/mkdirp/package.json" + "path": "node_modules/acorn/package.json" }, { - "path": "node_modules/mkdirp/node_modules/minimist/package.json" + "path": "node_modules/wide-align/package.json" }, { - "path": "node_modules/fast-text-encoding/package.json" + "path": "node_modules/wide-align/node_modules/string-width/package.json" }, { - "path": "node_modules/acorn-es7-plugin/package.json" + "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/through2/package.json" + "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/eslint-visitor-keys/package.json" + "path": "node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/glob/package.json" + "path": "node_modules/got/package.json" }, { - "path": "node_modules/inherits/package.json" + "path": "node_modules/got/node_modules/get-stream/package.json" }, { - "path": "node_modules/string.prototype.trimright/package.json" + "path": "node_modules/sprintf-js/package.json" }, { - "path": "node_modules/punycode/package.json" + "path": "node_modules/@google-cloud/projectify/package.json" }, { - "path": "node_modules/es5-ext/package.json" + "path": "node_modules/@google-cloud/common/package.json" }, { - "path": "node_modules/is-date-object/package.json" + "path": "node_modules/@google-cloud/promisify/package.json" }, { - "path": "node_modules/sprintf-js/package.json" + "path": "node_modules/isarray/package.json" }, { - "path": "node_modules/is-npm/package.json" + "path": "node_modules/string_decoder/package.json" }, { - "path": "node_modules/has-yarn/package.json" + "path": "node_modules/strip-eof/package.json" }, { - "path": "node_modules/get-stdin/package.json" + "path": "node_modules/p-limit/package.json" }, { - "path": "node_modules/shebang-command/package.json" + "path": "node_modules/url-parse-lax/package.json" }, { - "path": "node_modules/empower-core/package.json" + "path": "node_modules/gts/package.json" }, { - "path": "node_modules/imurmurhash/package.json" + "path": "node_modules/gts/node_modules/chalk/package.json" }, { - "path": "node_modules/globals/package.json" + "path": "node_modules/commander/package.json" }, { - "path": "node_modules/latest-version/package.json" + "path": "node_modules/mimic-fn/package.json" }, { - "path": "node_modules/natural-compare/package.json" + "path": "node_modules/https-proxy-agent/package.json" }, { - "path": "node_modules/commander/package.json" + "path": "node_modules/ini/package.json" }, { - "path": "node_modules/path-is-inside/package.json" + "path": "node_modules/js2xmlparser/package.json" }, { - "path": "node_modules/rxjs/package.json" + "path": "node_modules/spdx-exceptions/package.json" }, { - "path": "node_modules/node-environment-flags/package.json" + "path": "node_modules/external-editor/package.json" }, { - "path": "node_modules/node-environment-flags/node_modules/semver/package.json" + "path": "node_modules/power-assert-formatter/package.json" }, { - "path": "node_modules/p-limit/package.json" + "path": "node_modules/eslint-utils/package.json" }, { - "path": "node_modules/call-signature/package.json" + "path": "node_modules/text-table/package.json" }, { - "path": "node_modules/istanbul-lib-coverage/package.json" + "path": "node_modules/domutils/package.json" }, { - "path": "node_modules/neo-async/package.json" + "path": "node_modules/supports-color/package.json" }, { - "path": "node_modules/foreground-child/package.json" + "path": "node_modules/strip-indent/package.json" }, { - "path": "node_modules/he/package.json" + "path": "node_modules/fs.realpath/package.json" }, { - "path": "node_modules/tar/package.json" + "path": "node_modules/parse5/package.json" }, { - "path": "node_modules/tar/node_modules/yallist/package.json" + "path": "node_modules/decamelize-keys/package.json" }, { - "path": "node_modules/mime-types/package.json" + "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" }, { - "path": "node_modules/meow/package.json" + "path": "node_modules/empower-core/package.json" }, { - "path": "node_modules/meow/node_modules/locate-path/package.json" + "path": "node_modules/acorn-es7-plugin/package.json" }, { - "path": "node_modules/meow/node_modules/find-up/package.json" + "path": "node_modules/p-timeout/package.json" }, { - "path": "node_modules/meow/node_modules/yargs-parser/package.json" + "path": "node_modules/espree/package.json" }, { - "path": "node_modules/meow/node_modules/camelcase/package.json" + "path": "node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/meow/node_modules/path-exists/package.json" + "path": "node_modules/responselike/package.json" }, { - "path": "node_modules/meow/node_modules/p-locate/package.json" + "path": "node_modules/next-tick/package.json" }, { - "path": "node_modules/meow/node_modules/p-limit/package.json" + "path": "node_modules/esrecurse/package.json" }, { - "path": "node_modules/meow/node_modules/p-try/package.json" + "path": "node_modules/bignumber.js/package.json" }, { - "path": "node_modules/meow/node_modules/read-pkg-up/package.json" + "path": "node_modules/source-map/package.json" }, { - "path": "node_modules/chownr/package.json" + "path": "node_modules/find-up/package.json" }, { - "path": "node_modules/toidentifier/package.json" + "path": "node_modules/traverse/package.json" }, { - "path": "node_modules/execa/package.json" + "path": "node_modules/es-to-primitive/package.json" }, { - "path": "node_modules/execa/node_modules/cross-spawn/package.json" + "path": "node_modules/rc/package.json" }, { - "path": "node_modules/execa/node_modules/lru-cache/package.json" + "path": "node_modules/rc/node_modules/minimist/package.json" }, { - "path": "node_modules/execa/node_modules/yallist/package.json" + "path": "node_modules/rc/node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/execa/node_modules/which/package.json" + "path": "node_modules/safe-buffer/package.json" }, { - "path": "node_modules/execa/node_modules/shebang-regex/package.json" + "path": "node_modules/uc.micro/package.json" }, { - "path": "node_modules/execa/node_modules/is-stream/package.json" + "path": "node_modules/flat-cache/package.json" }, { - "path": "node_modules/execa/node_modules/shebang-command/package.json" + "path": "node_modules/flat-cache/node_modules/rimraf/package.json" }, { - "path": "node_modules/levn/package.json" + "path": "node_modules/once/package.json" }, { - "path": "node_modules/unique-string/package.json" + "path": "node_modules/gtoken/package.json" }, { - "path": "node_modules/gaxios/package.json" + "path": "node_modules/urlgrey/package.json" }, { - "path": "node_modules/power-assert-renderer-base/package.json" + "path": "node_modules/convert-source-map/package.json" }, { - "path": "node_modules/browser-stdout/package.json" + "path": "node_modules/is-date-object/package.json" }, { - "path": "node_modules/regexp.prototype.flags/package.json" + "path": "node_modules/tslint-config-prettier/package.json" }, { - "path": "node_modules/run-async/package.json" + "path": "node_modules/escape-string-regexp/package.json" }, { - "path": "node_modules/cheerio/package.json" + "path": "node_modules/iconv-lite/package.json" }, { - "path": "node_modules/eslint-utils/package.json" + "path": "node_modules/is-glob/package.json" }, { - "path": "node_modules/prepend-http/package.json" + "path": "node_modules/furi/package.json" }, { - "path": "node_modules/urlgrey/package.json" + "path": "node_modules/form-data/package.json" }, { - "path": "node_modules/define-properties/package.json" + "path": "node_modules/tslib/package.json" }, { - "path": "node_modules/p-timeout/package.json" + "path": "node_modules/markdown-it-anchor/package.json" }, { - "path": "node_modules/cli-cursor/package.json" + "path": "node_modules/browser-stdout/package.json" }, { - "path": "node_modules/pump/package.json" + "path": "node_modules/path-type/package.json" }, { - "path": "node_modules/stringifier/package.json" + "path": "node_modules/npm-packlist/package.json" }, { - "path": "node_modules/espower-location-detector/package.json" + "path": "node_modules/pump/package.json" }, { - "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" + "path": "node_modules/process-nextick-args/package.json" }, { - "path": "node_modules/escape-html/package.json" + "path": "node_modules/deep-extend/package.json" }, { - "path": "node_modules/http-cache-semantics/package.json" + "path": "node_modules/power-assert-context-reducer-ast/package.json" }, { - "path": "node_modules/to-readable-stream/package.json" + "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" }, { - "path": "node_modules/eastasianwidth/package.json" + "path": "node_modules/type-check/package.json" }, { - "path": "node_modules/chardet/package.json" + "path": "node_modules/teeny-request/package.json" }, { - "path": "node_modules/js-tokens/package.json" + "path": "node_modules/teeny-request/node_modules/debug/package.json" }, { - "path": "node_modules/chalk/package.json" + "path": "node_modules/teeny-request/node_modules/https-proxy-agent/package.json" }, { - "path": "node_modules/chalk/node_modules/supports-color/package.json" + "path": "node_modules/teeny-request/node_modules/agent-base/package.json" }, { - "path": "node_modules/is-regex/package.json" + "path": "node_modules/jwa/package.json" }, { - "path": "node_modules/ajv/package.json" + "path": "node_modules/walkdir/package.json" }, { - "path": "node_modules/spdx-expression-parse/package.json" + "path": "node_modules/hard-rejection/package.json" }, { - "path": "node_modules/cli-width/package.json" + "path": "node_modules/espower-source/package.json" }, { - "path": "node_modules/ms/package.json" + "path": "node_modules/espower-source/node_modules/acorn/package.json" }, { - "path": "node_modules/istanbul-lib-report/package.json" + "path": "node_modules/mime-types/package.json" }, { - "path": "node_modules/base64-js/package.json" + "path": "node_modules/cross-spawn/package.json" }, { - "path": "node_modules/encodeurl/package.json" + "path": "node_modules/@sindresorhus/is/package.json" }, { - "path": "node_modules/json-buffer/package.json" + "path": "node_modules/wrap-ansi/package.json" }, { - "path": "node_modules/file-entry-cache/package.json" + "path": "node_modules/quick-lru/package.json" }, { - "path": "node_modules/gtoken/package.json" + "path": "node_modules/path-exists/package.json" }, { - "path": "node_modules/klaw/package.json" + "path": "node_modules/jsdoc/package.json" }, { - "path": "node_modules/functional-red-black-tree/package.json" + "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" }, { - "path": "node_modules/dom-serializer/package.json" + "path": "node_modules/cacheable-request/package.json" }, { - "path": "node_modules/is-symbol/package.json" + "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" }, { - "path": "node_modules/@babel/parser/package.json" + "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" }, { - "path": "node_modules/@babel/highlight/package.json" + "path": "node_modules/escape-html/package.json" }, { - "path": "node_modules/@babel/code-frame/package.json" + "path": "node_modules/power-assert-renderer-assertion/package.json" }, { - "path": "node_modules/form-data/package.json" + "path": "node_modules/minimist-options/package.json" }, { - "path": "node_modules/type-check/package.json" + "path": "node_modules/minimist-options/node_modules/arrify/package.json" }, { - "path": "node_modules/iconv-lite/package.json" + "path": "node_modules/latest-version/package.json" }, { - "path": "node_modules/is-url/package.json" + "path": "node_modules/optionator/package.json" }, { - "path": "node_modules/domutils/package.json" + "path": "node_modules/slice-ansi/package.json" }, { - "path": "node_modules/p-queue/package.json" + "path": "node_modules/slice-ansi/node_modules/color-name/package.json" }, { - "path": "node_modules/eventemitter3/package.json" + "path": "node_modules/slice-ansi/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/ext/package.json" + "path": "node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/ext/node_modules/type/package.json" + "path": "node_modules/slice-ansi/node_modules/color-convert/package.json" }, { - "path": "node_modules/deep-equal/package.json" + "path": "node_modules/power-assert-renderer-comparison/package.json" }, { - "path": "node_modules/mime-db/package.json" + "path": "node_modules/flatted/package.json" }, { - "path": "node_modules/parse5/package.json" + "path": "node_modules/inherits/package.json" }, { - "path": "node_modules/flatted/package.json" + "path": "node_modules/depd/package.json" }, { - "path": "node_modules/once/package.json" + "path": "node_modules/es6-promisify/package.json" }, { - "path": "node_modules/universal-deep-strict-equal/package.json" + "path": "node_modules/long/package.json" }, { - "path": "node_modules/brace-expansion/package.json" + "path": "node_modules/regexpp/package.json" }, { - "path": "node_modules/jsdoc-region-tag/package.json" + "path": "node_modules/cli-width/package.json" }, { - "path": "node_modules/markdown-it-anchor/package.json" + "path": "node_modules/call-matcher/package.json" }, { - "path": "node_modules/traverse/package.json" + "path": "node_modules/fill-keys/package.json" }, { - "path": "node_modules/restore-cursor/package.json" + "path": "node_modules/http2spy/package.json" }, { - "path": "node_modules/lodash.at/package.json" + "path": "node_modules/eslint/package.json" }, { - "path": "node_modules/graceful-fs/package.json" + "path": "node_modules/eslint/node_modules/debug/package.json" }, { - "path": "node_modules/responselike/package.json" + "path": "node_modules/eslint/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/pseudomap/package.json" + "path": "node_modules/eslint/node_modules/path-key/package.json" }, { - "path": "node_modules/espurify/package.json" + "path": "node_modules/eslint/node_modules/shebang-command/package.json" }, { - "path": "node_modules/espree/package.json" + "path": "node_modules/eslint/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/power-assert-renderer-diagram/package.json" + "path": "node_modules/eslint/node_modules/which/package.json" }, { - "path": "node_modules/word-wrap/package.json" + "path": "node_modules/eslint/node_modules/shebang-regex/package.json" }, { - "path": "node_modules/espower-source/package.json" + "path": "node_modules/eslint/node_modules/semver/package.json" }, { - "path": "node_modules/espower-source/node_modules/acorn/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/index.js" }, { - "path": "node_modules/normalize-url/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/README.md" }, { - "path": "node_modules/wordwrap/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/package.json" }, { - "path": "node_modules/ee-first/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" }, { - "path": "node_modules/table/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" }, { - "path": "node_modules/handlebars/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" }, { - "path": "node_modules/es6-weak-map/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" }, { - "path": "node_modules/protobufjs/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" }, { - "path": "node_modules/protobufjs/cli/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" }, { - "path": "node_modules/protobufjs/cli/package-lock.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" }, { - "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" + "path": "node_modules/npm-bundled/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" + "path": "node_modules/mdurl/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" + "path": "node_modules/v8-to-istanbul/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" + "path": "node_modules/espower-loader/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" + "path": "node_modules/espower-loader/node_modules/source-map-support/package.json" }, { - "path": "node_modules/espower/package.json" + "path": "node_modules/espower-loader/node_modules/source-map/package.json" }, { - "path": "node_modules/espower/node_modules/source-map/package.json" + "path": "node_modules/object.getownpropertydescriptors/package.json" }, { - "path": "node_modules/strip-json-comments/package.json" + "path": "node_modules/array-find-index/package.json" }, { - "path": "node_modules/asynckit/package.json" + "path": "node_modules/html-tags/package.json" }, { - "path": "node_modules/process-nextick-args/package.json" + "path": "node_modules/yargs/package.json" }, { - "path": "node_modules/uuid/package.json" + "path": "node_modules/ci-info/package.json" }, { - "path": "node_modules/array-find-index/package.json" + "path": "node_modules/color-convert/package.json" }, { - "path": "node_modules/astral-regex/package.json" + "path": "node_modules/write-file-atomic/package.json" }, { - "path": "node_modules/@grpc/proto-loader/package.json" + "path": "node_modules/eslint-visitor-keys/package.json" }, { - "path": "node_modules/@grpc/grpc-js/package.json" + "path": "node_modules/agent-base/package.json" }, { - "path": "node_modules/test-exclude/package.json" + "path": "node_modules/flat/package.json" }, { - "path": "node_modules/es6-promisify/package.json" + "path": "node_modules/through2/package.json" }, { - "path": "node_modules/proxyquire/package.json" + "path": "node_modules/gaxios/package.json" }, { - "path": "node_modules/p-try/package.json" + "path": "node_modules/p-queue/package.json" }, { - "path": "node_modules/optionator/package.json" + "path": "node_modules/encodeurl/package.json" }, { - "path": "node_modules/requizzle/package.json" + "path": "node_modules/js-tokens/package.json" }, { - "path": "node_modules/c8/package.json" + "path": "node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/fast-levenshtein/package.json" + "path": "node_modules/eslint-config-prettier/package.json" }, { - "path": "node_modules/statuses/package.json" + "path": "node_modules/uri-js/package.json" }, { - "path": "node_modules/semver-diff/package.json" + "path": "node_modules/test-exclude/package.json" }, { - "path": "node_modules/semver-diff/node_modules/semver/package.json" + "path": "node_modules/safer-buffer/package.json" }, { - "path": "node_modules/signal-exit/package.json" + "path": "node_modules/prettier/package.json" }, { - "path": "node_modules/jsdoc/package.json" + "path": "node_modules/regexp.prototype.flags/package.json" }, { - "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" + "path": "node_modules/yargs-parser/package.json" }, { - "path": "node_modules/duplexify/package.json" + "path": "node_modules/@babel/code-frame/package.json" }, { - "path": "node_modules/object-is/package.json" + "path": "node_modules/@babel/highlight/package.json" }, { - "path": "node_modules/tslib/package.json" + "path": "node_modules/@babel/parser/package.json" }, { - "path": "node_modules/extend/package.json" + "path": "node_modules/configstore/package.json" }, { - "path": "node_modules/power-assert-context-reducer-ast/package.json" + "path": "node_modules/configstore/node_modules/make-dir/package.json" }, { - "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" + "path": "node_modules/configstore/node_modules/write-file-atomic/package.json" }, { - "path": "node_modules/css-what/package.json" + "path": "node_modules/is-plain-obj/package.json" }, { - "path": "node_modules/power-assert-renderer-comparison/package.json" + "path": "node_modules/eastasianwidth/package.json" }, { - "path": "node_modules/ecdsa-sig-formatter/package.json" + "path": "node_modules/has-yarn/package.json" }, { - "path": "node_modules/typedarray-to-buffer/README.md" + "path": "node_modules/core-js/package.json" }, { - "path": "node_modules/typedarray-to-buffer/package.json" + "path": "samples/hybridGlossaries.js" }, { - "path": "node_modules/typedarray-to-buffer/.travis.yml" + "path": "samples/README.md" }, { - "path": "node_modules/typedarray-to-buffer/index.js" + "path": "samples/translate.js" }, { - "path": "node_modules/typedarray-to-buffer/.airtap.yml" + "path": "samples/package.json" }, { - "path": "node_modules/typedarray-to-buffer/LICENSE" + "path": "samples/quickstart.js" }, { - "path": "node_modules/typedarray-to-buffer/test/basic.js" + "path": "samples/.eslintrc.yml" }, { - "path": "node_modules/markdown-it/package.json" + "path": "samples/automl/automlTranslationDataset.js" }, { - "path": "node_modules/tslint-config-prettier/package.json" + "path": "samples/automl/automlTranslationPredict.js" }, { - "path": "node_modules/buffer-from/package.json" + "path": "samples/automl/automlTranslationModel.js" }, { - "path": "node_modules/minizlib/package.json" + "path": "samples/automl/resources/testInput.txt" }, { - "path": "node_modules/minizlib/node_modules/yallist/package.json" + "path": "samples/test/translate.test.js" }, { - "path": "node_modules/domelementtype/package.json" + "path": "samples/test/automlTranslation.test.js" }, { - "path": "node_modules/ci-info/package.json" + "path": "samples/test/quickstart.test.js" }, { - "path": "node_modules/@types/caseless/package.json" + "path": "samples/test/hybridGlossaries.test.js" }, { - "path": "node_modules/@types/mocha/package.json" + "path": "samples/test/v3/translate_create_glossary.test.js" }, { - "path": "node_modules/@types/color-name/package.json" + "path": "samples/test/v3/translate_translate_text_with_glossary.test.js" }, { - "path": "node_modules/@types/is-windows/package.json" + "path": "samples/test/v3/translate_list_language_names.test.js" }, { - "path": "node_modules/@types/is/package.json" + "path": "samples/test/v3/translate_list_codes.test.js" }, { - "path": "node_modules/@types/tough-cookie/package.json" + "path": "samples/test/v3/translate_detect_language.test.js" }, { - "path": "node_modules/@types/istanbul-lib-coverage/package.json" + "path": "samples/test/v3/translate_batch_translate_text_with_glossary.test.js" }, { - "path": "node_modules/@types/node/package.json" + "path": "samples/test/v3/translate_translate_text_with_model.test.js" }, { - "path": "node_modules/@types/request/package.json" + "path": "samples/test/v3/translate_translate_text.test.js" }, { - "path": "node_modules/@types/proxyquire/package.json" + "path": "samples/test/v3/translate_translate_text_with_glossary_and_model.test.js" }, { - "path": "node_modules/@types/extend/package.json" + "path": "samples/test/v3/translate_get_glossary.test.js" }, { - "path": "node_modules/@types/long/package.json" + "path": "samples/test/v3/translate_delete_glossary.test.js" }, { - "path": "node_modules/serve-static/package.json" + "path": "samples/test/v3/translate_list_glossary.test.js" }, { - "path": "node_modules/make-dir/package.json" + "path": "samples/test/v3/translate_get_supported_languages_for_targets.test.js" }, { - "path": "node_modules/make-dir/node_modules/semver/package.json" + "path": "samples/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js" }, { - "path": "node_modules/esquery/package.json" + "path": "samples/test/v3/translate_batch_translate_text_with_model.test.js" }, { - "path": "node_modules/ncp/package.json" + "path": "samples/test/v3/translate_get_supported_languages.test.js" }, { - "path": "node_modules/emoji-regex/package.json" + "path": "samples/test/v3/translate_batch_translate_text.test.js" }, { - "path": "node_modules/read-pkg/package.json" + "path": "samples/test/v3beta1/translate_translate_text_beta.test.js" }, { - "path": "node_modules/fast-diff/package.json" + "path": "samples/test/v3beta1/translate_detect_language_beta.test.js" }, { - "path": "node_modules/xtend/package.json" + "path": "samples/test/v3beta1/translate_get_glossary_beta.test.js" }, { - "path": "node_modules/resolve/package.json" + "path": "samples/test/v3beta1/translate_list_codes_beta.test.js" }, { - "path": "node_modules/lowercase-keys/package.json" + "path": "samples/test/v3beta1/translate_translate_text_with_model_beta.test.js" }, { - "path": "node_modules/is-fullwidth-code-point/package.json" + "path": "samples/test/v3beta1/translate_create_glossary_beta.test.js" }, { - "path": "node_modules/read-pkg-up/package.json" + "path": "samples/test/v3beta1/translate_delete_glossary_beta.test.js" }, { - "path": "node_modules/read-pkg-up/node_modules/locate-path/package.json" + "path": "samples/test/v3beta1/translate_list_language_names_beta.test.js" }, { - "path": "node_modules/read-pkg-up/node_modules/find-up/package.json" + "path": "samples/test/v3beta1/translate_list_glossary_beta.test.js" }, { - "path": "node_modules/read-pkg-up/node_modules/path-exists/package.json" + "path": "samples/test/v3beta1/translate_translate_text_with_glossary_beta.test.js" }, { - "path": "node_modules/read-pkg-up/node_modules/p-locate/package.json" + "path": "samples/test/v3beta1/translate_batch_translate_text_beta.test.js" }, { - "path": "node_modules/@google-cloud/projectify/package.json" + "path": "samples/v3/translate_get_supported_languages_for_target.js" }, { - "path": "node_modules/@google-cloud/common/package.json" + "path": "samples/v3/translate_delete_glossary.js" }, { - "path": "node_modules/@google-cloud/promisify/package.json" + "path": "samples/v3/translate_create_glossary.js" }, { - "path": "node_modules/p-cancelable/package.json" + "path": "samples/v3/translate_get_glossary.js" }, { - "path": "node_modules/acorn-jsx/package.json" + "path": "samples/v3/translate_translate_text_with_glossary_and_model.js" }, { - "path": "node_modules/power-assert-context-traversal/package.json" + "path": "samples/v3/translate_list_codes.js" }, { - "path": "node_modules/long/package.json" + "path": "samples/v3/translate_batch_translate_text.js" }, { - "path": "node_modules/d/package.json" + "path": "samples/v3/translate_detect_language.js" }, { - "path": "node_modules/debug/package.json" + "path": "samples/v3/translate_translate_text_with_glossary.js" }, { - "path": "node_modules/mimic-fn/package.json" + "path": "samples/v3/translate_batch_translate_text_with_glossary.js" }, { - "path": "node_modules/is-object/package.json" + "path": "samples/v3/translate_list_language_names.js" }, { - "path": "node_modules/isexe/package.json" + "path": "samples/v3/translate_translate_text.js" }, { - "path": "node_modules/multi-stage-sourcemap/package.json" + "path": "samples/v3/translate_list_glossary.js" }, { - "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" + "path": "samples/v3/translate_get_supported_languages.js" }, { - "path": "node_modules/uc.micro/package.json" + "path": "samples/v3/translate_translate_text_with_model.js" }, { - "path": "node_modules/fs.realpath/package.json" + "path": "samples/v3/translate_batch_translate_text_with_model.js" }, { - "path": "node_modules/eslint-plugin-prettier/package.json" + "path": "samples/v3/translate_batch_translate_text_with_glossary_and_model.js" }, { - "path": "node_modules/yargs/package.json" + "path": "samples/v3beta1/translate_translate_text_with_glossary_beta.js" }, { - "path": "node_modules/yargs/node_modules/locate-path/package.json" + "path": "samples/v3beta1/translate_get_glossary_beta.js" }, { - "path": "node_modules/yargs/node_modules/find-up/package.json" + "path": "samples/v3beta1/translate_create_glossary_beta.js" }, { - "path": "node_modules/yargs/node_modules/path-exists/package.json" + "path": "samples/v3beta1/translate_list_codes_beta.js" }, { - "path": "node_modules/yargs/node_modules/p-locate/package.json" + "path": "samples/v3beta1/translate_delete_glossary_beta.js" }, { - "path": "node_modules/nice-try/package.json" + "path": "samples/v3beta1/translate_batch_translate_text_beta.js" }, { - "path": "node_modules/has/package.json" + "path": "samples/v3beta1/translate_list_glossary_beta.js" }, { - "path": "node_modules/xmlcreate/package.json" + "path": "samples/v3beta1/translate_list_language_names_beta.js" }, { - "path": "node_modules/escallmatch/package.json" + "path": "samples/v3beta1/translate_translate_text_with_model_beta.js" }, { - "path": "node_modules/escallmatch/node_modules/esprima/package.json" + "path": "samples/v3beta1/translate_detect_language_beta.js" }, { - "path": "node_modules/is-html/package.json" + "path": "samples/v3beta1/translate_translate_text_beta.js" }, { - "path": "node_modules/get-caller-file/package.json" + "path": "samples/resources/example.png" }, { - "path": "node_modules/jwa/package.json" + "path": "__pycache__/synth.cpython-36.pyc" } ] } \ No newline at end of file diff --git a/packages/google-cloud-translate/system-test/install.ts b/packages/google-cloud-translate/system-test/install.ts index 2736aee84f7..c9aa74ec221 100644 --- a/packages/google-cloud-translate/system-test/install.ts +++ b/packages/google-cloud-translate/system-test/install.ts @@ -18,6 +18,7 @@ import {packNTest} from 'pack-n-play'; import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; describe('typescript consumer tests', () => { it('should have correct type signature for typescript users', async function() { From 167476ab18a1602d3efca2698d285b6c6cf848a5 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2020 10:46:59 -0800 Subject: [PATCH 317/513] chore: release 5.1.4 * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-translate/CHANGELOG.md | 9 +++++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 3771cdfecca..eaba1121b00 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,15 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [5.1.4](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.3...v5.1.4) (2020-01-04) + + +### Bug Fixes + +* better client close(), update .nycrc ([f476326](https://www.github.com/googleapis/nodejs-translate/commit/f476326b19e41253ba054cdfa5b7fcdfcb8dc1b2)) +* increase timeout from 20s to 60s ([#411](https://www.github.com/googleapis/nodejs-translate/issues/411)) ([40241fe](https://www.github.com/googleapis/nodejs-translate/commit/40241fea93a2315eae8344c58a9ffed87392eda4)) +* suppress unhandled promise rejection errors ([#417](https://www.github.com/googleapis/nodejs-translate/issues/417)) ([8eb6558](https://www.github.com/googleapis/nodejs-translate/commit/8eb655862b2d9c92f28f5b96eb1158dce3af704c)) + ### [5.1.3](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.2...v5.1.3) (2019-12-16) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index f0df1c1c238..1d9d5f9db6a 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "5.1.3", + "version": "5.1.4", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index a2d7a1851f7..0db7141d0a8 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^5.1.3", + "@google-cloud/translate": "^5.1.4", "@google-cloud/vision": "^1.2.0", "yargs": "^15.0.0" }, From 96ad8f40c33ca3be4295111690a52f415ff8fede Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 7 Jan 2020 00:05:25 +0200 Subject: [PATCH 318/513] chore(deps): update dependency mocha to v7 (#420) --- packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 1d9d5f9db6a..8b94948b61c 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -73,7 +73,7 @@ "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", - "mocha": "^6.1.4", + "mocha": "^7.0.0", "pack-n-play": "^1.0.0-2", "power-assert": "^1.6.0", "prettier": "^1.13.5", diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 0db7141d0a8..d75efccfd98 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -23,7 +23,7 @@ "devDependencies": { "@google-cloud/storage": "^4.0.0", "chai": "^4.2.0", - "mocha": "^6.0.0", + "mocha": "^7.0.0", "uuid": "^3.3.2" } } From cfbc3b27052cbfd1671e2b7f4c2ecf09a6fa51cd Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 23 Jan 2020 16:26:58 -0800 Subject: [PATCH 319/513] chore: clear synth.metadata --- .../google-cloud-translate/synth.metadata | 2880 ----------------- 1 file changed, 2880 deletions(-) delete mode 100644 packages/google-cloud-translate/synth.metadata diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata deleted file mode 100644 index df61b8f427c..00000000000 --- a/packages/google-cloud-translate/synth.metadata +++ /dev/null @@ -1,2880 +0,0 @@ -{ - "updateTime": "2020-01-03T12:23:48.750289Z", - "sources": [ - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4d45a6399e9444fbddaeb1c86aabfde210723714", - "internalRef": "287908369" - } - }, - { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "translate", - "apiVersion": "v3beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "translate", - "apiVersion": "v3", - "language": "typescript", - "generator": "gapic-generator-typescript" - } - } - ], - "newFiles": [ - { - "path": "synth.metadata" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CONTRIBUTING.md" - }, - { - "path": "linkinator.config.json" - }, - { - "path": ".prettierignore" - }, - { - "path": "tsconfig.json" - }, - { - "path": ".jsdoc.js" - }, - { - "path": ".gitignore" - }, - { - "path": "synth.py" - }, - { - "path": "CODE_OF_CONDUCT.md" - }, - { - "path": "README.md" - }, - { - "path": "package-lock.json" - }, - { - "path": ".prettierrc" - }, - { - "path": ".readme-partials.yml" - }, - { - "path": "codecov.yaml" - }, - { - "path": ".nycrc" - }, - { - "path": "package.json" - }, - { - "path": ".clang-format" - }, - { - "path": "webpack.config.js" - }, - { - "path": ".eslintrc.yml" - }, - { - "path": "tslint.json" - }, - { - "path": "renovate.json" - }, - { - "path": "LICENSE" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": ".eslintignore" - }, - { - "path": ".github/PULL_REQUEST_TEMPLATE.md" - }, - { - "path": ".github/release-please.yml" - }, - { - "path": ".github/ISSUE_TEMPLATE/support_request.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" - }, - { - "path": ".kokoro/samples-test.sh" - }, - { - "path": ".kokoro/system-test.sh" - }, - { - "path": ".kokoro/docs.sh" - }, - { - "path": ".kokoro/lint.sh" - }, - { - "path": ".kokoro/pre-system-test.sh" - }, - { - "path": ".kokoro/.gitattributes" - }, - { - "path": ".kokoro/publish.sh" - }, - { - "path": ".kokoro/trampoline.sh" - }, - { - "path": ".kokoro/common.cfg" - }, - { - "path": ".kokoro/test.bat" - }, - { - "path": ".kokoro/test.sh" - }, - { - "path": ".kokoro/release/docs.sh" - }, - { - "path": ".kokoro/release/docs.cfg" - }, - { - "path": ".kokoro/release/publish.cfg" - }, - { - "path": ".kokoro/presubmit/node12/test.cfg" - }, - { - "path": ".kokoro/presubmit/node12/common.cfg" - }, - { - "path": ".kokoro/presubmit/node8/test.cfg" - }, - { - "path": ".kokoro/presubmit/node8/common.cfg" - }, - { - "path": ".kokoro/presubmit/windows/test.cfg" - }, - { - "path": ".kokoro/presubmit/windows/common.cfg" - }, - { - "path": ".kokoro/presubmit/node10/lint.cfg" - }, - { - "path": ".kokoro/presubmit/node10/system-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/docs.cfg" - }, - { - "path": ".kokoro/presubmit/node10/common.cfg" - }, - { - "path": ".kokoro/presubmit/node10/samples-test.cfg" - }, - { - "path": ".kokoro/continuous/node12/test.cfg" - }, - { - "path": ".kokoro/continuous/node12/common.cfg" - }, - { - "path": ".kokoro/continuous/node8/test.cfg" - }, - { - "path": ".kokoro/continuous/node8/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/lint.cfg" - }, - { - "path": ".kokoro/continuous/node10/system-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/test.cfg" - }, - { - "path": ".kokoro/continuous/node10/docs.cfg" - }, - { - "path": ".kokoro/continuous/node10/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/samples-test.cfg" - }, - { - "path": "test/gapic-translation_service-v3.ts" - }, - { - "path": "test/mocha.opts" - }, - { - "path": "test/index.ts" - }, - { - "path": "test/gapic-translation_service-v3beta1.ts" - }, - { - "path": "system-test/install.ts" - }, - { - "path": "system-test/translate.ts" - }, - { - "path": "system-test/fixtures/sample/src/index.ts" - }, - { - "path": "system-test/fixtures/sample/src/index.js" - }, - { - "path": "build/test/gapic-translation_service-v3beta1.js.map" - }, - { - "path": "build/test/gapic-translation_service-v3beta1.js" - }, - { - "path": "build/test/gapic-translation_service-v3.d.ts" - }, - { - "path": "build/test/gapic-translation_service-v3.js.map" - }, - { - "path": "build/test/index.js" - }, - { - "path": "build/test/gapic-translation_service-v3beta1.d.ts" - }, - { - "path": "build/test/index.js.map" - }, - { - "path": "build/test/gapic-translation_service-v3.js" - }, - { - "path": "build/test/index.d.ts" - }, - { - "path": "build/system-test/install.d.ts" - }, - { - "path": "build/system-test/install.js" - }, - { - "path": "build/system-test/install.js.map" - }, - { - "path": "build/system-test/translate.js.map" - }, - { - "path": "build/system-test/translate.js" - }, - { - "path": "build/system-test/translate.d.ts" - }, - { - "path": "build/protos/protos.d.ts" - }, - { - "path": "build/protos/protos.js" - }, - { - "path": "build/protos/protos.json" - }, - { - "path": "build/protos/google/cloud/common_resources.proto" - }, - { - "path": "build/protos/google/cloud/translate/v3/translation_service.proto" - }, - { - "path": "build/protos/google/cloud/translate/v3beta1/translation_service.proto" - }, - { - "path": "build/src/index.js" - }, - { - "path": "build/src/index.js.map" - }, - { - "path": "build/src/index.d.ts" - }, - { - "path": "build/src/v2/index.js" - }, - { - "path": "build/src/v2/index.js.map" - }, - { - "path": "build/src/v2/index.d.ts" - }, - { - "path": "build/src/v3/translation_service_client.js" - }, - { - "path": "build/src/v3/index.js" - }, - { - "path": "build/src/v3/translation_service_client.d.ts" - }, - { - "path": "build/src/v3/index.js.map" - }, - { - "path": "build/src/v3/translation_service_client.js.map" - }, - { - "path": "build/src/v3/translation_service_client_config.json" - }, - { - "path": "build/src/v3/index.d.ts" - }, - { - "path": "build/src/v3beta1/translation_service_client.js" - }, - { - "path": "build/src/v3beta1/index.js" - }, - { - "path": "build/src/v3beta1/translation_service_client.d.ts" - }, - { - "path": "build/src/v3beta1/index.js.map" - }, - { - "path": "build/src/v3beta1/translation_service_client.js.map" - }, - { - "path": "build/src/v3beta1/translation_service_client_config.json" - }, - { - "path": "build/src/v3beta1/index.d.ts" - }, - { - "path": "protos/protos.d.ts" - }, - { - "path": "protos/protos.js" - }, - { - "path": "protos/protos.json" - }, - { - "path": "protos/google/cloud/common_resources.proto" - }, - { - "path": "protos/google/cloud/translate/v3/translation_service.proto" - }, - { - "path": "protos/google/cloud/translate/v3beta1/translation_service.proto" - }, - { - "path": ".git/shallow" - }, - { - "path": ".git/HEAD" - }, - { - "path": ".git/config" - }, - { - "path": ".git/packed-refs" - }, - { - "path": ".git/index" - }, - { - "path": ".git/objects/pack/pack-b67b28657a67221ddfc91efff045dbcdc4d20f92.idx" - }, - { - "path": ".git/objects/pack/pack-b67b28657a67221ddfc91efff045dbcdc4d20f92.pack" - }, - { - "path": ".git/logs/HEAD" - }, - { - "path": ".git/logs/refs/heads/master" - }, - { - "path": ".git/logs/refs/heads/autosynth" - }, - { - "path": ".git/logs/refs/remotes/origin/HEAD" - }, - { - "path": ".git/refs/heads/master" - }, - { - "path": ".git/refs/heads/autosynth" - }, - { - "path": ".git/refs/remotes/origin/HEAD" - }, - { - "path": ".bots/header-checker-lint.json" - }, - { - "path": "src/index.ts" - }, - { - "path": "src/v2/index.ts" - }, - { - "path": "src/v3/index.ts" - }, - { - "path": "src/v3/translation_service_client.ts" - }, - { - "path": "src/v3/translation_service_proto_list.json" - }, - { - "path": "src/v3/translation_service_client_config.json" - }, - { - "path": "src/v3beta1/index.ts" - }, - { - "path": "src/v3beta1/translation_service_client.ts" - }, - { - "path": "src/v3beta1/translation_service_proto_list.json" - }, - { - "path": "src/v3beta1/translation_service_client_config.json" - }, - { - "path": "node_modules/progress/package.json" - }, - { - "path": "node_modules/is-ci/package.json" - }, - { - "path": "node_modules/module-not-found-error/package.json" - }, - { - "path": "node_modules/lru-cache/package.json" - }, - { - "path": "node_modules/destroy/package.json" - }, - { - "path": "node_modules/power-assert-context-formatter/package.json" - }, - { - "path": "node_modules/fast-json-stable-stringify/package.json" - }, - { - "path": "node_modules/nice-try/package.json" - }, - { - "path": "node_modules/which-module/package.json" - }, - { - "path": "node_modules/array-find/package.json" - }, - { - "path": "node_modules/catharsis/package.json" - }, - { - "path": "node_modules/is-promise/package.json" - }, - { - "path": "node_modules/v8-compile-cache/package.json" - }, - { - "path": "node_modules/doctrine/package.json" - }, - { - "path": "node_modules/callsites/package.json" - }, - { - "path": "node_modules/diff/package.json" - }, - { - "path": "node_modules/hosted-git-info/package.json" - }, - { - "path": "node_modules/color-name/package.json" - }, - { - "path": "node_modules/asynckit/package.json" - }, - { - "path": "node_modules/defer-to-connect/package.json" - }, - { - "path": "node_modules/unpipe/package.json" - }, - { - "path": "node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/http-errors/package.json" - }, - { - "path": "node_modules/eventemitter3/package.json" - }, - { - "path": "node_modules/esutils/package.json" - }, - { - "path": "node_modules/npm-run-path/package.json" - }, - { - "path": "node_modules/npm-run-path/node_modules/path-key/package.json" - }, - { - "path": "node_modules/he/package.json" - }, - { - "path": "node_modules/pack-n-play/package.json" - }, - { - "path": "node_modules/pack-n-play/node_modules/tmp/package.json" - }, - { - "path": "node_modules/pack-n-play/node_modules/tmp/node_modules/rimraf/package.json" - }, - { - "path": "node_modules/on-finished/package.json" - }, - { - "path": "node_modules/linkinator/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/update-notifier/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/dot-prop/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/redent/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/semver-diff/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/map-obj/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/meow/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/term-size/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/crypto-random-string/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/indent-string/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/camelcase-keys/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/is-obj/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/read-pkg-up/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/is-path-inside/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/boxen/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/chalk/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/arrify/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/widest-line/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/global-dirs/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/parse-json/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/xdg-basedir/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/is-npm/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/read-pkg/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/read-pkg/node_modules/type-fest/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/is-installed-globally/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/trim-newlines/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/semver/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/unique-string/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/strip-indent/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/quick-lru/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/minimist-options/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/configstore/package.json" - }, - { - "path": "node_modules/update-notifier/package.json" - }, - { - "path": "node_modules/p-cancelable/package.json" - }, - { - "path": "node_modules/markdown-it/package.json" - }, - { - "path": "node_modules/dot-prop/package.json" - }, - { - "path": "node_modules/require-main-filename/package.json" - }, - { - "path": "node_modules/fast-diff/package.json" - }, - { - "path": "node_modules/lodash.camelcase/package.json" - }, - { - "path": "node_modules/redent/package.json" - }, - { - "path": "node_modules/resolve/package.json" - }, - { - "path": "node_modules/globals/package.json" - }, - { - "path": "node_modules/combined-stream/package.json" - }, - { - "path": "node_modules/is-html/package.json" - }, - { - "path": "node_modules/range-parser/package.json" - }, - { - "path": "node_modules/string.prototype.trimright/package.json" - }, - { - "path": "node_modules/inflight/package.json" - }, - { - "path": "node_modules/debug/package.json" - }, - { - "path": "node_modules/htmlparser2/package.json" - }, - { - "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" - }, - { - "path": "node_modules/semver-diff/package.json" - }, - { - "path": "node_modules/semver-diff/node_modules/semver/package.json" - }, - { - "path": "node_modules/tsutils/package.json" - }, - { - "path": "node_modules/multi-stage-sourcemap/package.json" - }, - { - "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" - }, - { - "path": "node_modules/ms/package.json" - }, - { - "path": "node_modules/linkify-it/package.json" - }, - { - "path": "node_modules/through/package.json" - }, - { - "path": "node_modules/power-assert-renderer-file/package.json" - }, - { - "path": "node_modules/string-width/package.json" - }, - { - "path": "node_modules/html-escaper/package.json" - }, - { - "path": "node_modules/type/package.json" - }, - { - "path": "node_modules/type-fest/package.json" - }, - { - "path": "node_modules/is/package.json" - }, - { - "path": "node_modules/intelli-espower-loader/package.json" - }, - { - "path": "node_modules/parseurl/package.json" - }, - { - "path": "node_modules/buffer-from/package.json" - }, - { - "path": "node_modules/google-p12-pem/package.json" - }, - { - "path": "node_modules/get-caller-file/package.json" - }, - { - "path": "node_modules/klaw/package.json" - }, - { - "path": "node_modules/http-proxy-agent/package.json" - }, - { - "path": "node_modules/http-proxy-agent/node_modules/debug/package.json" - }, - { - "path": "node_modules/http-proxy-agent/node_modules/agent-base/package.json" - }, - { - "path": "node_modules/map-obj/package.json" - }, - { - "path": "node_modules/node-fetch/package.json" - }, - { - "path": "node_modules/jsonexport/package.json" - }, - { - "path": "node_modules/isexe/package.json" - }, - { - "path": "node_modules/escallmatch/package.json" - }, - { - "path": "node_modules/escallmatch/node_modules/esprima/package.json" - }, - { - "path": "node_modules/espower/package.json" - }, - { - "path": "node_modules/espower/node_modules/source-map/package.json" - }, - { - "path": "node_modules/run-async/package.json" - }, - { - "path": "node_modules/validate-npm-package-license/package.json" - }, - { - "path": "node_modules/file-entry-cache/package.json" - }, - { - "path": "node_modules/meow/package.json" - }, - { - "path": "node_modules/meow/node_modules/camelcase/package.json" - }, - { - "path": "node_modules/meow/node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/concat-map/package.json" - }, - { - "path": "node_modules/term-size/package.json" - }, - { - "path": "node_modules/xmlcreate/package.json" - }, - { - "path": "node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/yallist/package.json" - }, - { - "path": "node_modules/json-bigint/package.json" - }, - { - "path": "node_modules/stream-events/package.json" - }, - { - "path": "node_modules/resolve-from/package.json" - }, - { - "path": "node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/cliui/package.json" - }, - { - "path": "node_modules/toidentifier/package.json" - }, - { - "path": "node_modules/balanced-match/package.json" - }, - { - "path": "node_modules/marked/package.json" - }, - { - "path": "node_modules/wrappy/package.json" - }, - { - "path": "node_modules/jsdoc-region-tag/package.json" - }, - { - "path": "node_modules/json-stable-stringify-without-jsonify/package.json" - }, - { - "path": "node_modules/glob-parent/package.json" - }, - { - "path": "node_modules/xtend/package.json" - }, - { - "path": "node_modules/is-arguments/package.json" - }, - { - "path": "node_modules/set-blocking/package.json" - }, - { - "path": "node_modules/istanbul-lib-report/package.json" - }, - { - "path": "node_modules/load-json-file/package.json" - }, - { - "path": "node_modules/ansi-align/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/string-width/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/duplexer3/package.json" - }, - { - "path": "node_modules/esprima/package.json" - }, - { - "path": "node_modules/is-stream-ended/package.json" - }, - { - "path": "node_modules/minimatch/package.json" - }, - { - "path": "node_modules/crypto-random-string/package.json" - }, - { - "path": "node_modules/growl/package.json" - }, - { - "path": "node_modules/string.prototype.trimleft/package.json" - }, - { - "path": "node_modules/istanbul-lib-coverage/package.json" - }, - { - "path": "node_modules/normalize-package-data/package.json" - }, - { - "path": "node_modules/normalize-package-data/node_modules/semver/package.json" - }, - { - "path": "node_modules/fast-text-encoding/package.json" - }, - { - "path": "node_modules/tar/package.json" - }, - { - "path": "node_modules/tar/node_modules/yallist/package.json" - }, - { - "path": "node_modules/server-destroy/package.json" - }, - { - "path": "node_modules/prelude-ls/package.json" - }, - { - "path": "node_modules/d/package.json" - }, - { - "path": "node_modules/protobufjs/package.json" - }, - { - "path": "node_modules/protobufjs/cli/package-lock.json" - }, - { - "path": "node_modules/protobufjs/cli/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/uglify-js/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/commander/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/source-map/package.json" - }, - { - "path": "node_modules/domhandler/package.json" - }, - { - "path": "node_modules/ansi-escapes/package.json" - }, - { - "path": "node_modules/power-assert-renderer-base/package.json" - }, - { - "path": "node_modules/boolbase/package.json" - }, - { - "path": "node_modules/indent-string/package.json" - }, - { - "path": "node_modules/lodash/package.json" - }, - { - "path": "node_modules/taffydb/package.json" - }, - { - "path": "node_modules/extend/package.json" - }, - { - "path": "node_modules/is-yarn-global/package.json" - }, - { - "path": "node_modules/dom-serializer/package.json" - }, - { - "path": "node_modules/end-of-stream/package.json" - }, - { - "path": "node_modules/log-symbols/package.json" - }, - { - "path": "node_modules/is-callable/package.json" - }, - { - "path": "node_modules/es5-ext/package.json" - }, - { - "path": "node_modules/stringifier/package.json" - }, - { - "path": "node_modules/es6-weak-map/package.json" - }, - { - "path": "node_modules/camelcase-keys/package.json" - }, - { - "path": "node_modules/camelcase-keys/node_modules/camelcase/package.json" - }, - { - "path": "node_modules/decompress-response/package.json" - }, - { - "path": "node_modules/js-yaml/package.json" - }, - { - "path": "node_modules/cli-boxes/package.json" - }, - { - "path": "node_modules/is-obj/package.json" - }, - { - "path": "node_modules/is-typedarray/package.json" - }, - { - "path": "node_modules/registry-auth-token/package.json" - }, - { - "path": "node_modules/read-pkg-up/package.json" - }, - { - "path": "node_modules/read-pkg-up/node_modules/p-locate/package.json" - }, - { - "path": "node_modules/read-pkg-up/node_modules/locate-path/package.json" - }, - { - "path": "node_modules/read-pkg-up/node_modules/p-try/package.json" - }, - { - "path": "node_modules/read-pkg-up/node_modules/p-limit/package.json" - }, - { - "path": "node_modules/read-pkg-up/node_modules/find-up/package.json" - }, - { - "path": "node_modules/read-pkg-up/node_modules/path-exists/package.json" - }, - { - "path": "node_modules/buffer-equal-constant-time/package.json" - }, - { - "path": "node_modules/@bcoe/v8-coverage/package.json" - }, - { - "path": "node_modules/eslint-scope/package.json" - }, - { - "path": "node_modules/stream-shift/package.json" - }, - { - "path": "node_modules/is-extglob/package.json" - }, - { - "path": "node_modules/typedarray-to-buffer/index.js" - }, - { - "path": "node_modules/typedarray-to-buffer/README.md" - }, - { - "path": "node_modules/typedarray-to-buffer/.airtap.yml" - }, - { - "path": "node_modules/typedarray-to-buffer/.travis.yml" - }, - { - "path": "node_modules/typedarray-to-buffer/package.json" - }, - { - "path": "node_modules/typedarray-to-buffer/LICENSE" - }, - { - "path": "node_modules/typedarray-to-buffer/test/basic.js" - }, - { - "path": "node_modules/restore-cursor/package.json" - }, - { - "path": "node_modules/mimic-response/package.json" - }, - { - "path": "node_modules/normalize-url/package.json" - }, - { - "path": "node_modules/fresh/package.json" - }, - { - "path": "node_modules/imurmurhash/package.json" - }, - { - "path": "node_modules/indexof/package.json" - }, - { - "path": "node_modules/codecov/package.json" - }, - { - "path": "node_modules/codecov/node_modules/https-proxy-agent/package.json" - }, - { - "path": "node_modules/codecov/node_modules/teeny-request/package.json" - }, - { - "path": "node_modules/ajv/package.json" - }, - { - "path": "node_modules/is-path-inside/package.json" - }, - { - "path": "node_modules/import-lazy/package.json" - }, - { - "path": "node_modules/json-schema-traverse/package.json" - }, - { - "path": "node_modules/ncp/package.json" - }, - { - "path": "node_modules/rxjs/package.json" - }, - { - "path": "node_modules/p-locate/package.json" - }, - { - "path": "node_modules/figures/package.json" - }, - { - "path": "node_modules/underscore/package.json" - }, - { - "path": "node_modules/finalhandler/package.json" - }, - { - "path": "node_modules/finalhandler/node_modules/debug/package.json" - }, - { - "path": "node_modules/finalhandler/node_modules/ms/package.json" - }, - { - "path": "node_modules/ignore/package.json" - }, - { - "path": "node_modules/argv/package.json" - }, - { - "path": "node_modules/path-is-absolute/package.json" - }, - { - "path": "node_modules/graceful-fs/package.json" - }, - { - "path": "node_modules/currently-unhandled/package.json" - }, - { - "path": "node_modules/minizlib/package.json" - }, - { - "path": "node_modules/minizlib/node_modules/yallist/package.json" - }, - { - "path": "node_modules/google-gax/package.json" - }, - { - "path": "node_modules/onetime/package.json" - }, - { - "path": "node_modules/path-key/package.json" - }, - { - "path": "node_modules/core-util-is/package.json" - }, - { - "path": "node_modules/array-filter/package.json" - }, - { - "path": "node_modules/delayed-stream/package.json" - }, - { - "path": "node_modules/prepend-http/package.json" - }, - { - "path": "node_modules/write/package.json" - }, - { - "path": "node_modules/duplexify/package.json" - }, - { - "path": "node_modules/camelcase/package.json" - }, - { - "path": "node_modules/error-ex/package.json" - }, - { - "path": "node_modules/empower-assert/package.json" - }, - { - "path": "node_modules/boxen/package.json" - }, - { - "path": "node_modules/boxen/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/boxen/node_modules/string-width/package.json" - }, - { - "path": "node_modules/boxen/node_modules/type-fest/package.json" - }, - { - "path": "node_modules/boxen/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/boxen/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/boxen/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/node-environment-flags/package.json" - }, - { - "path": "node_modules/node-environment-flags/node_modules/semver/package.json" - }, - { - "path": "node_modules/c8/package.json" - }, - { - "path": "node_modules/gcp-metadata/package.json" - }, - { - "path": "node_modules/json-buffer/package.json" - }, - { - "path": "node_modules/mkdirp/package.json" - }, - { - "path": "node_modules/bluebird/package.json" - }, - { - "path": "node_modules/shebang-command/package.json" - }, - { - "path": "node_modules/serve-static/package.json" - }, - { - "path": "node_modules/path-parse/package.json" - }, - { - "path": "node_modules/mime/package.json" - }, - { - "path": "node_modules/yargs-unparser/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/color-name/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/string-width/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/cliui/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/lines-and-columns/package.json" - }, - { - "path": "node_modules/is-url/package.json" - }, - { - "path": "node_modules/chalk/package.json" - }, - { - "path": "node_modules/chalk/node_modules/color-name/package.json" - }, - { - "path": "node_modules/chalk/node_modules/has-flag/package.json" - }, - { - "path": "node_modules/chalk/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/chalk/node_modules/supports-color/package.json" - }, - { - "path": "node_modules/chalk/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/locate-path/package.json" - }, - { - "path": "node_modules/spdx-expression-parse/package.json" - }, - { - "path": "node_modules/power-assert-util-string-width/package.json" - }, - { - "path": "node_modules/esquery/package.json" - }, - { - "path": "node_modules/to-readable-stream/package.json" - }, - { - "path": "node_modules/jsdoc-fresh/package.json" - }, - { - "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" - }, - { - "path": "node_modules/espower-location-detector/package.json" - }, - { - "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" - }, - { - "path": "node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/is-arrayish/package.json" - }, - { - "path": "node_modules/prettier-linter-helpers/package.json" - }, - { - "path": "node_modules/chardet/package.json" - }, - { - "path": "node_modules/amdefine/package.json" - }, - { - "path": "node_modules/http-cache-semantics/package.json" - }, - { - "path": "node_modules/has-flag/package.json" - }, - { - "path": "node_modules/cheerio/package.json" - }, - { - "path": "node_modules/domelementtype/package.json" - }, - { - "path": "node_modules/npm-normalize-package-bin/package.json" - }, - { - "path": "node_modules/@szmarczak/http-timer/package.json" - }, - { - "path": "node_modules/tmp/package.json" - }, - { - "path": "node_modules/entities/package.json" - }, - { - "path": "node_modules/execa/package.json" - }, - { - "path": "node_modules/execa/node_modules/lru-cache/package.json" - }, - { - "path": "node_modules/execa/node_modules/yallist/package.json" - }, - { - "path": "node_modules/execa/node_modules/shebang-command/package.json" - }, - { - "path": "node_modules/execa/node_modules/is-stream/package.json" - }, - { - "path": "node_modules/execa/node_modules/which/package.json" - }, - { - "path": "node_modules/execa/node_modules/shebang-regex/package.json" - }, - { - "path": "node_modules/execa/node_modules/cross-spawn/package.json" - }, - { - "path": "node_modules/strip-bom/package.json" - }, - { - "path": "node_modules/argparse/package.json" - }, - { - "path": "node_modules/has/package.json" - }, - { - "path": "node_modules/ee-first/package.json" - }, - { - "path": "node_modules/object-inspect/package.json" - }, - { - "path": "node_modules/deep-equal/package.json" - }, - { - "path": "node_modules/table/package.json" - }, - { - "path": "node_modules/table/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/table/node_modules/string-width/package.json" - }, - { - "path": "node_modules/table/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/table/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/table/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/spdx-correct/package.json" - }, - { - "path": "node_modules/get-stream/package.json" - }, - { - "path": "node_modules/chownr/package.json" - }, - { - "path": "node_modules/power-assert/package.json" - }, - { - "path": "node_modules/statuses/package.json" - }, - { - "path": "node_modules/@istanbuljs/schema/package.json" - }, - { - "path": "node_modules/es6-set/package.json" - }, - { - "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" - }, - { - "path": "node_modules/proxyquire/package.json" - }, - { - "path": "node_modules/istanbul-reports/package.json" - }, - { - "path": "node_modules/@grpc/grpc-js/package.json" - }, - { - "path": "node_modules/@grpc/grpc-js/node_modules/semver/package.json" - }, - { - "path": "node_modules/@grpc/proto-loader/package.json" - }, - { - "path": "node_modules/lowercase-keys/package.json" - }, - { - "path": "node_modules/etag/package.json" - }, - { - "path": "node_modules/y18n/package.json" - }, - { - "path": "node_modules/diff-match-patch/package.json" - }, - { - "path": "node_modules/merge-descriptors/package.json" - }, - { - "path": "node_modules/es6-iterator/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/node_modules/semver/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/node_modules/eslint-utils/package.json" - }, - { - "path": "node_modules/natural-compare/package.json" - }, - { - "path": "node_modules/uuid/package.json" - }, - { - "path": "node_modules/event-target-shim/package.json" - }, - { - "path": "node_modules/arrify/package.json" - }, - { - "path": "node_modules/widest-line/package.json" - }, - { - "path": "node_modules/widest-line/node_modules/string-width/package.json" - }, - { - "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/widest-line/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/ignore-walk/package.json" - }, - { - "path": "node_modules/util-deprecate/package.json" - }, - { - "path": "node_modules/function-bind/package.json" - }, - { - "path": "node_modules/object-is/package.json" - }, - { - "path": "node_modules/@types/color-name/package.json" - }, - { - "path": "node_modules/@types/request/package.json" - }, - { - "path": "node_modules/@types/is/package.json" - }, - { - "path": "node_modules/@types/tough-cookie/package.json" - }, - { - "path": "node_modules/@types/node/package.json" - }, - { - "path": "node_modules/@types/istanbul-lib-coverage/package.json" - }, - { - "path": "node_modules/@types/normalize-package-data/package.json" - }, - { - "path": "node_modules/@types/extend/package.json" - }, - { - "path": "node_modules/@types/proxyquire/package.json" - }, - { - "path": "node_modules/@types/is-windows/package.json" - }, - { - "path": "node_modules/@types/caseless/package.json" - }, - { - "path": "node_modules/@types/mocha/package.json" - }, - { - "path": "node_modules/@types/minimist/package.json" - }, - { - "path": "node_modules/@types/fs-extra/package.json" - }, - { - "path": "node_modules/@types/long/package.json" - }, - { - "path": "node_modules/is-windows/package.json" - }, - { - "path": "node_modules/levn/package.json" - }, - { - "path": "node_modules/pseudomap/package.json" - }, - { - "path": "node_modules/global-dirs/package.json" - }, - { - "path": "node_modules/power-assert-renderer-diagram/package.json" - }, - { - "path": "node_modules/is-stream/package.json" - }, - { - "path": "node_modules/es6-symbol/package.json" - }, - { - "path": "node_modules/parse-json/package.json" - }, - { - "path": "node_modules/xdg-basedir/package.json" - }, - { - "path": "node_modules/spdx-license-ids/package.json" - }, - { - "path": "node_modules/google-auth-library/package.json" - }, - { - "path": "node_modules/brace-expansion/package.json" - }, - { - "path": "node_modules/builtin-modules/package.json" - }, - { - "path": "node_modules/tslint/package.json" - }, - { - "path": "node_modules/tslint/node_modules/semver/package.json" - }, - { - "path": "node_modules/type-name/package.json" - }, - { - "path": "node_modules/define-properties/package.json" - }, - { - "path": "node_modules/universal-deep-strict-equal/package.json" - }, - { - "path": "node_modules/jws/package.json" - }, - { - "path": "node_modules/minipass/package.json" - }, - { - "path": "node_modules/minipass/node_modules/yallist/package.json" - }, - { - "path": "node_modules/nth-check/package.json" - }, - { - "path": "node_modules/empower/package.json" - }, - { - "path": "node_modules/send/package.json" - }, - { - "path": "node_modules/send/node_modules/debug/package.json" - }, - { - "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" - }, - { - "path": "node_modules/send/node_modules/ms/package.json" - }, - { - "path": "node_modules/send/node_modules/mime/package.json" - }, - { - "path": "node_modules/require-directory/package.json" - }, - { - "path": "node_modules/object.assign/package.json" - }, - { - "path": "node_modules/is-npm/package.json" - }, - { - "path": "node_modules/fs-minipass/package.json" - }, - { - "path": "node_modules/min-indent/package.json" - }, - { - "path": "node_modules/functional-red-black-tree/package.json" - }, - { - "path": "node_modules/read-pkg/package.json" - }, - { - "path": "node_modules/registry-url/package.json" - }, - { - "path": "node_modules/is-regex/package.json" - }, - { - "path": "node_modules/es-abstract/package.json" - }, - { - "path": "node_modules/parent-module/package.json" - }, - { - "path": "node_modules/signal-exit/package.json" - }, - { - "path": "node_modules/import-fresh/package.json" - }, - { - "path": "node_modules/keyv/package.json" - }, - { - "path": "node_modules/estraverse/package.json" - }, - { - "path": "node_modules/fast-deep-equal/package.json" - }, - { - "path": "node_modules/mute-stream/package.json" - }, - { - "path": "node_modules/power-assert-context-traversal/package.json" - }, - { - "path": "node_modules/rimraf/package.json" - }, - { - "path": "node_modules/is-installed-globally/package.json" - }, - { - "path": "node_modules/get-stdin/package.json" - }, - { - "path": "node_modules/make-dir/package.json" - }, - { - "path": "node_modules/make-dir/node_modules/semver/package.json" - }, - { - "path": "node_modules/es6-promise/package.json" - }, - { - "path": "node_modules/os-tmpdir/package.json" - }, - { - "path": "node_modules/retry-request/package.json" - }, - { - "path": "node_modules/retry-request/node_modules/debug/package.json" - }, - { - "path": "node_modules/cli-cursor/package.json" - }, - { - "path": "node_modules/ext/package.json" - }, - { - "path": "node_modules/ext/node_modules/type/package.json" - }, - { - "path": "node_modules/is-symbol/package.json" - }, - { - "path": "node_modules/css-what/package.json" - }, - { - "path": "node_modules/ent/package.json" - }, - { - "path": "node_modules/punycode/package.json" - }, - { - "path": "node_modules/setprototypeof/package.json" - }, - { - "path": "node_modules/word-wrap/package.json" - }, - { - "path": "node_modules/foreground-child/package.json" - }, - { - "path": "node_modules/es6-map/package.json" - }, - { - "path": "node_modules/call-signature/package.json" - }, - { - "path": "node_modules/package-json/package.json" - }, - { - "path": "node_modules/package-json/node_modules/semver/package.json" - }, - { - "path": "node_modules/css-select/package.json" - }, - { - "path": "node_modules/path-is-inside/package.json" - }, - { - "path": "node_modules/eslint-plugin-prettier/package.json" - }, - { - "path": "node_modules/p-finally/package.json" - }, - { - "path": "node_modules/inquirer/package.json" - }, - { - "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/inquirer/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/acorn-jsx/package.json" - }, - { - "path": "node_modules/glob/package.json" - }, - { - "path": "node_modules/mocha/package.json" - }, - { - "path": "node_modules/mocha/node_modules/diff/package.json" - }, - { - "path": "node_modules/mocha/node_modules/color-name/package.json" - }, - { - "path": "node_modules/mocha/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/mocha/node_modules/ms/package.json" - }, - { - "path": "node_modules/mocha/node_modules/string-width/package.json" - }, - { - "path": "node_modules/mocha/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/mocha/node_modules/cliui/package.json" - }, - { - "path": "node_modules/mocha/node_modules/p-locate/package.json" - }, - { - "path": "node_modules/mocha/node_modules/locate-path/package.json" - }, - { - "path": "node_modules/mocha/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/mocha/node_modules/has-flag/package.json" - }, - { - "path": "node_modules/mocha/node_modules/glob/package.json" - }, - { - "path": "node_modules/mocha/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/mocha/node_modules/which/package.json" - }, - { - "path": "node_modules/mocha/node_modules/supports-color/package.json" - }, - { - "path": "node_modules/mocha/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/mocha/node_modules/find-up/package.json" - }, - { - "path": "node_modules/mocha/node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/mocha/node_modules/path-exists/package.json" - }, - { - "path": "node_modules/mocha/node_modules/yargs/package.json" - }, - { - "path": "node_modules/mocha/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" - }, - { - "path": "node_modules/mocha/node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/mime-db/package.json" - }, - { - "path": "node_modules/loud-rejection/package.json" - }, - { - "path": "node_modules/event-emitter/package.json" - }, - { - "path": "node_modules/@protobufjs/codegen/package.json" - }, - { - "path": "node_modules/@protobufjs/base64/package.json" - }, - { - "path": "node_modules/@protobufjs/utf8/package.json" - }, - { - "path": "node_modules/@protobufjs/pool/package.json" - }, - { - "path": "node_modules/@protobufjs/float/package.json" - }, - { - "path": "node_modules/@protobufjs/fetch/package.json" - }, - { - "path": "node_modules/@protobufjs/path/package.json" - }, - { - "path": "node_modules/@protobufjs/aspromise/package.json" - }, - { - "path": "node_modules/@protobufjs/inquire/package.json" - }, - { - "path": "node_modules/@protobufjs/eventemitter/package.json" - }, - { - "path": "node_modules/node-forge/package.json" - }, - { - "path": "node_modules/lodash.has/package.json" - }, - { - "path": "node_modules/source-map-support/package.json" - }, - { - "path": "node_modules/source-map-support/node_modules/source-map/package.json" - }, - { - "path": "node_modules/has-symbols/package.json" - }, - { - "path": "node_modules/stubs/package.json" - }, - { - "path": "node_modules/espurify/package.json" - }, - { - "path": "node_modules/lodash.at/package.json" - }, - { - "path": "node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/merge-estraverse-visitors/package.json" - }, - { - "path": "node_modules/ansi-colors/package.json" - }, - { - "path": "node_modules/p-try/package.json" - }, - { - "path": "node_modules/is-object/package.json" - }, - { - "path": "node_modules/escope/package.json" - }, - { - "path": "node_modules/json-parse-better-errors/package.json" - }, - { - "path": "node_modules/readable-stream/package.json" - }, - { - "path": "node_modules/abort-controller/package.json" - }, - { - "path": "node_modules/which/package.json" - }, - { - "path": "node_modules/astral-regex/package.json" - }, - { - "path": "node_modules/escodegen/package.json" - }, - { - "path": "node_modules/escodegen/node_modules/esprima/package.json" - }, - { - "path": "node_modules/escodegen/node_modules/source-map/package.json" - }, - { - "path": "node_modules/minimist/package.json" - }, - { - "path": "node_modules/clone-response/package.json" - }, - { - "path": "node_modules/ecdsa-sig-formatter/package.json" - }, - { - "path": "node_modules/requizzle/package.json" - }, - { - "path": "node_modules/base64-js/package.json" - }, - { - "path": "node_modules/pify/package.json" - }, - { - "path": "node_modules/object-keys/package.json" - }, - { - "path": "node_modules/trim-newlines/package.json" - }, - { - "path": "node_modules/deep-is/package.json" - }, - { - "path": "node_modules/fast-levenshtein/package.json" - }, - { - "path": "node_modules/typescript/package.json" - }, - { - "path": "node_modules/shebang-regex/package.json" - }, - { - "path": "node_modules/eslint-plugin-es/package.json" - }, - { - "path": "node_modules/eslint-plugin-es/node_modules/eslint-utils/package.json" - }, - { - "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" - }, - { - "path": "node_modules/semver/package.json" - }, - { - "path": "node_modules/unique-string/package.json" - }, - { - "path": "node_modules/decamelize/package.json" - }, - { - "path": "node_modules/acorn/package.json" - }, - { - "path": "node_modules/wide-align/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/string-width/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/got/package.json" - }, - { - "path": "node_modules/got/node_modules/get-stream/package.json" - }, - { - "path": "node_modules/sprintf-js/package.json" - }, - { - "path": "node_modules/@google-cloud/projectify/package.json" - }, - { - "path": "node_modules/@google-cloud/common/package.json" - }, - { - "path": "node_modules/@google-cloud/promisify/package.json" - }, - { - "path": "node_modules/isarray/package.json" - }, - { - "path": "node_modules/string_decoder/package.json" - }, - { - "path": "node_modules/strip-eof/package.json" - }, - { - "path": "node_modules/p-limit/package.json" - }, - { - "path": "node_modules/url-parse-lax/package.json" - }, - { - "path": "node_modules/gts/package.json" - }, - { - "path": "node_modules/gts/node_modules/chalk/package.json" - }, - { - "path": "node_modules/commander/package.json" - }, - { - "path": "node_modules/mimic-fn/package.json" - }, - { - "path": "node_modules/https-proxy-agent/package.json" - }, - { - "path": "node_modules/ini/package.json" - }, - { - "path": "node_modules/js2xmlparser/package.json" - }, - { - "path": "node_modules/spdx-exceptions/package.json" - }, - { - "path": "node_modules/external-editor/package.json" - }, - { - "path": "node_modules/power-assert-formatter/package.json" - }, - { - "path": "node_modules/eslint-utils/package.json" - }, - { - "path": "node_modules/text-table/package.json" - }, - { - "path": "node_modules/domutils/package.json" - }, - { - "path": "node_modules/supports-color/package.json" - }, - { - "path": "node_modules/strip-indent/package.json" - }, - { - "path": "node_modules/fs.realpath/package.json" - }, - { - "path": "node_modules/parse5/package.json" - }, - { - "path": "node_modules/decamelize-keys/package.json" - }, - { - "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" - }, - { - "path": "node_modules/empower-core/package.json" - }, - { - "path": "node_modules/acorn-es7-plugin/package.json" - }, - { - "path": "node_modules/p-timeout/package.json" - }, - { - "path": "node_modules/espree/package.json" - }, - { - "path": "node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/responselike/package.json" - }, - { - "path": "node_modules/next-tick/package.json" - }, - { - "path": "node_modules/esrecurse/package.json" - }, - { - "path": "node_modules/bignumber.js/package.json" - }, - { - "path": "node_modules/source-map/package.json" - }, - { - "path": "node_modules/find-up/package.json" - }, - { - "path": "node_modules/traverse/package.json" - }, - { - "path": "node_modules/es-to-primitive/package.json" - }, - { - "path": "node_modules/rc/package.json" - }, - { - "path": "node_modules/rc/node_modules/minimist/package.json" - }, - { - "path": "node_modules/rc/node_modules/strip-json-comments/package.json" - }, - { - "path": "node_modules/safe-buffer/package.json" - }, - { - "path": "node_modules/uc.micro/package.json" - }, - { - "path": "node_modules/flat-cache/package.json" - }, - { - "path": "node_modules/flat-cache/node_modules/rimraf/package.json" - }, - { - "path": "node_modules/once/package.json" - }, - { - "path": "node_modules/gtoken/package.json" - }, - { - "path": "node_modules/urlgrey/package.json" - }, - { - "path": "node_modules/convert-source-map/package.json" - }, - { - "path": "node_modules/is-date-object/package.json" - }, - { - "path": "node_modules/tslint-config-prettier/package.json" - }, - { - "path": "node_modules/escape-string-regexp/package.json" - }, - { - "path": "node_modules/iconv-lite/package.json" - }, - { - "path": "node_modules/is-glob/package.json" - }, - { - "path": "node_modules/furi/package.json" - }, - { - "path": "node_modules/form-data/package.json" - }, - { - "path": "node_modules/tslib/package.json" - }, - { - "path": "node_modules/markdown-it-anchor/package.json" - }, - { - "path": "node_modules/browser-stdout/package.json" - }, - { - "path": "node_modules/path-type/package.json" - }, - { - "path": "node_modules/npm-packlist/package.json" - }, - { - "path": "node_modules/pump/package.json" - }, - { - "path": "node_modules/process-nextick-args/package.json" - }, - { - "path": "node_modules/deep-extend/package.json" - }, - { - "path": "node_modules/power-assert-context-reducer-ast/package.json" - }, - { - "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" - }, - { - "path": "node_modules/type-check/package.json" - }, - { - "path": "node_modules/teeny-request/package.json" - }, - { - "path": "node_modules/teeny-request/node_modules/debug/package.json" - }, - { - "path": "node_modules/teeny-request/node_modules/https-proxy-agent/package.json" - }, - { - "path": "node_modules/teeny-request/node_modules/agent-base/package.json" - }, - { - "path": "node_modules/jwa/package.json" - }, - { - "path": "node_modules/walkdir/package.json" - }, - { - "path": "node_modules/hard-rejection/package.json" - }, - { - "path": "node_modules/espower-source/package.json" - }, - { - "path": "node_modules/espower-source/node_modules/acorn/package.json" - }, - { - "path": "node_modules/mime-types/package.json" - }, - { - "path": "node_modules/cross-spawn/package.json" - }, - { - "path": "node_modules/@sindresorhus/is/package.json" - }, - { - "path": "node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/quick-lru/package.json" - }, - { - "path": "node_modules/path-exists/package.json" - }, - { - "path": "node_modules/jsdoc/package.json" - }, - { - "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" - }, - { - "path": "node_modules/cacheable-request/package.json" - }, - { - "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" - }, - { - "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" - }, - { - "path": "node_modules/escape-html/package.json" - }, - { - "path": "node_modules/power-assert-renderer-assertion/package.json" - }, - { - "path": "node_modules/minimist-options/package.json" - }, - { - "path": "node_modules/minimist-options/node_modules/arrify/package.json" - }, - { - "path": "node_modules/latest-version/package.json" - }, - { - "path": "node_modules/optionator/package.json" - }, - { - "path": "node_modules/slice-ansi/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/color-name/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/power-assert-renderer-comparison/package.json" - }, - { - "path": "node_modules/flatted/package.json" - }, - { - "path": "node_modules/inherits/package.json" - }, - { - "path": "node_modules/depd/package.json" - }, - { - "path": "node_modules/es6-promisify/package.json" - }, - { - "path": "node_modules/long/package.json" - }, - { - "path": "node_modules/regexpp/package.json" - }, - { - "path": "node_modules/cli-width/package.json" - }, - { - "path": "node_modules/call-matcher/package.json" - }, - { - "path": "node_modules/fill-keys/package.json" - }, - { - "path": "node_modules/http2spy/package.json" - }, - { - "path": "node_modules/eslint/package.json" - }, - { - "path": "node_modules/eslint/node_modules/debug/package.json" - }, - { - "path": "node_modules/eslint/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/eslint/node_modules/path-key/package.json" - }, - { - "path": "node_modules/eslint/node_modules/shebang-command/package.json" - }, - { - "path": "node_modules/eslint/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/eslint/node_modules/which/package.json" - }, - { - "path": "node_modules/eslint/node_modules/shebang-regex/package.json" - }, - { - "path": "node_modules/eslint/node_modules/semver/package.json" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/index.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/README.md" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/package.json" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" - }, - { - "path": "node_modules/npm-bundled/package.json" - }, - { - "path": "node_modules/mdurl/package.json" - }, - { - "path": "node_modules/v8-to-istanbul/package.json" - }, - { - "path": "node_modules/espower-loader/package.json" - }, - { - "path": "node_modules/espower-loader/node_modules/source-map-support/package.json" - }, - { - "path": "node_modules/espower-loader/node_modules/source-map/package.json" - }, - { - "path": "node_modules/object.getownpropertydescriptors/package.json" - }, - { - "path": "node_modules/array-find-index/package.json" - }, - { - "path": "node_modules/html-tags/package.json" - }, - { - "path": "node_modules/yargs/package.json" - }, - { - "path": "node_modules/ci-info/package.json" - }, - { - "path": "node_modules/color-convert/package.json" - }, - { - "path": "node_modules/write-file-atomic/package.json" - }, - { - "path": "node_modules/eslint-visitor-keys/package.json" - }, - { - "path": "node_modules/agent-base/package.json" - }, - { - "path": "node_modules/flat/package.json" - }, - { - "path": "node_modules/through2/package.json" - }, - { - "path": "node_modules/gaxios/package.json" - }, - { - "path": "node_modules/p-queue/package.json" - }, - { - "path": "node_modules/encodeurl/package.json" - }, - { - "path": "node_modules/js-tokens/package.json" - }, - { - "path": "node_modules/strip-json-comments/package.json" - }, - { - "path": "node_modules/eslint-config-prettier/package.json" - }, - { - "path": "node_modules/uri-js/package.json" - }, - { - "path": "node_modules/test-exclude/package.json" - }, - { - "path": "node_modules/safer-buffer/package.json" - }, - { - "path": "node_modules/prettier/package.json" - }, - { - "path": "node_modules/regexp.prototype.flags/package.json" - }, - { - "path": "node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/@babel/code-frame/package.json" - }, - { - "path": "node_modules/@babel/highlight/package.json" - }, - { - "path": "node_modules/@babel/parser/package.json" - }, - { - "path": "node_modules/configstore/package.json" - }, - { - "path": "node_modules/configstore/node_modules/make-dir/package.json" - }, - { - "path": "node_modules/configstore/node_modules/write-file-atomic/package.json" - }, - { - "path": "node_modules/is-plain-obj/package.json" - }, - { - "path": "node_modules/eastasianwidth/package.json" - }, - { - "path": "node_modules/has-yarn/package.json" - }, - { - "path": "node_modules/core-js/package.json" - }, - { - "path": "samples/hybridGlossaries.js" - }, - { - "path": "samples/README.md" - }, - { - "path": "samples/translate.js" - }, - { - "path": "samples/package.json" - }, - { - "path": "samples/quickstart.js" - }, - { - "path": "samples/.eslintrc.yml" - }, - { - "path": "samples/automl/automlTranslationDataset.js" - }, - { - "path": "samples/automl/automlTranslationPredict.js" - }, - { - "path": "samples/automl/automlTranslationModel.js" - }, - { - "path": "samples/automl/resources/testInput.txt" - }, - { - "path": "samples/test/translate.test.js" - }, - { - "path": "samples/test/automlTranslation.test.js" - }, - { - "path": "samples/test/quickstart.test.js" - }, - { - "path": "samples/test/hybridGlossaries.test.js" - }, - { - "path": "samples/test/v3/translate_create_glossary.test.js" - }, - { - "path": "samples/test/v3/translate_translate_text_with_glossary.test.js" - }, - { - "path": "samples/test/v3/translate_list_language_names.test.js" - }, - { - "path": "samples/test/v3/translate_list_codes.test.js" - }, - { - "path": "samples/test/v3/translate_detect_language.test.js" - }, - { - "path": "samples/test/v3/translate_batch_translate_text_with_glossary.test.js" - }, - { - "path": "samples/test/v3/translate_translate_text_with_model.test.js" - }, - { - "path": "samples/test/v3/translate_translate_text.test.js" - }, - { - "path": "samples/test/v3/translate_translate_text_with_glossary_and_model.test.js" - }, - { - "path": "samples/test/v3/translate_get_glossary.test.js" - }, - { - "path": "samples/test/v3/translate_delete_glossary.test.js" - }, - { - "path": "samples/test/v3/translate_list_glossary.test.js" - }, - { - "path": "samples/test/v3/translate_get_supported_languages_for_targets.test.js" - }, - { - "path": "samples/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js" - }, - { - "path": "samples/test/v3/translate_batch_translate_text_with_model.test.js" - }, - { - "path": "samples/test/v3/translate_get_supported_languages.test.js" - }, - { - "path": "samples/test/v3/translate_batch_translate_text.test.js" - }, - { - "path": "samples/test/v3beta1/translate_translate_text_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_detect_language_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_get_glossary_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_list_codes_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_translate_text_with_model_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_create_glossary_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_delete_glossary_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_list_language_names_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_list_glossary_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_translate_text_with_glossary_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_batch_translate_text_beta.test.js" - }, - { - "path": "samples/v3/translate_get_supported_languages_for_target.js" - }, - { - "path": "samples/v3/translate_delete_glossary.js" - }, - { - "path": "samples/v3/translate_create_glossary.js" - }, - { - "path": "samples/v3/translate_get_glossary.js" - }, - { - "path": "samples/v3/translate_translate_text_with_glossary_and_model.js" - }, - { - "path": "samples/v3/translate_list_codes.js" - }, - { - "path": "samples/v3/translate_batch_translate_text.js" - }, - { - "path": "samples/v3/translate_detect_language.js" - }, - { - "path": "samples/v3/translate_translate_text_with_glossary.js" - }, - { - "path": "samples/v3/translate_batch_translate_text_with_glossary.js" - }, - { - "path": "samples/v3/translate_list_language_names.js" - }, - { - "path": "samples/v3/translate_translate_text.js" - }, - { - "path": "samples/v3/translate_list_glossary.js" - }, - { - "path": "samples/v3/translate_get_supported_languages.js" - }, - { - "path": "samples/v3/translate_translate_text_with_model.js" - }, - { - "path": "samples/v3/translate_batch_translate_text_with_model.js" - }, - { - "path": "samples/v3/translate_batch_translate_text_with_glossary_and_model.js" - }, - { - "path": "samples/v3beta1/translate_translate_text_with_glossary_beta.js" - }, - { - "path": "samples/v3beta1/translate_get_glossary_beta.js" - }, - { - "path": "samples/v3beta1/translate_create_glossary_beta.js" - }, - { - "path": "samples/v3beta1/translate_list_codes_beta.js" - }, - { - "path": "samples/v3beta1/translate_delete_glossary_beta.js" - }, - { - "path": "samples/v3beta1/translate_batch_translate_text_beta.js" - }, - { - "path": "samples/v3beta1/translate_list_glossary_beta.js" - }, - { - "path": "samples/v3beta1/translate_list_language_names_beta.js" - }, - { - "path": "samples/v3beta1/translate_translate_text_with_model_beta.js" - }, - { - "path": "samples/v3beta1/translate_detect_language_beta.js" - }, - { - "path": "samples/v3beta1/translate_translate_text_beta.js" - }, - { - "path": "samples/resources/example.png" - }, - { - "path": "__pycache__/synth.cpython-36.pyc" - } - ] -} \ No newline at end of file From f7f093eda6c24b71c1ce90bfcf3cc991fbab125d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 27 Jan 2020 16:14:47 -0800 Subject: [PATCH 320/513] chore: regenerate synth.metadata (#428) --- .../google-cloud-translate/synth.metadata | 522 ++++++++++++++++++ 1 file changed, 522 insertions(+) create mode 100644 packages/google-cloud-translate/synth.metadata diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata new file mode 100644 index 00000000000..7951d1b0592 --- /dev/null +++ b/packages/google-cloud-translate/synth.metadata @@ -0,0 +1,522 @@ +{ + "updateTime": "2020-01-24T12:39:25.395288Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "e26cab8afd19d396b929039dac5d874cf0b5336c", + "internalRef": "291240093" + } + }, + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2019.10.17" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "translate", + "apiVersion": "v3beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "translate", + "apiVersion": "v3", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + } + ], + "newFiles": [ + { + "path": ".bots/header-checker-lint.json" + }, + { + "path": ".clang-format" + }, + { + "path": ".eslintignore" + }, + { + "path": ".eslintrc.yml" + }, + { + "path": ".github/ISSUE_TEMPLATE/bug_report.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/feature_request.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/support_request.md" + }, + { + "path": ".github/PULL_REQUEST_TEMPLATE.md" + }, + { + "path": ".github/release-please.yml" + }, + { + "path": ".gitignore" + }, + { + "path": ".jsdoc.js" + }, + { + "path": ".kokoro/.gitattributes" + }, + { + "path": ".kokoro/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/docs.cfg" + }, + { + "path": ".kokoro/continuous/node10/lint.cfg" + }, + { + "path": ".kokoro/continuous/node10/samples-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/system-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/test.cfg" + }, + { + "path": ".kokoro/continuous/node12/common.cfg" + }, + { + "path": ".kokoro/continuous/node12/test.cfg" + }, + { + "path": ".kokoro/continuous/node8/common.cfg" + }, + { + "path": ".kokoro/continuous/node8/test.cfg" + }, + { + "path": ".kokoro/docs.sh" + }, + { + "path": ".kokoro/lint.sh" + }, + { + "path": ".kokoro/pre-system-test.sh" + }, + { + "path": ".kokoro/presubmit/node10/common.cfg" + }, + { + "path": ".kokoro/presubmit/node10/docs.cfg" + }, + { + "path": ".kokoro/presubmit/node10/lint.cfg" + }, + { + "path": ".kokoro/presubmit/node10/samples-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/system-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/test.cfg" + }, + { + "path": ".kokoro/presubmit/node12/common.cfg" + }, + { + "path": ".kokoro/presubmit/node12/test.cfg" + }, + { + "path": ".kokoro/presubmit/node8/common.cfg" + }, + { + "path": ".kokoro/presubmit/node8/test.cfg" + }, + { + "path": ".kokoro/presubmit/windows/common.cfg" + }, + { + "path": ".kokoro/presubmit/windows/test.cfg" + }, + { + "path": ".kokoro/publish.sh" + }, + { + "path": ".kokoro/release/docs.cfg" + }, + { + "path": ".kokoro/release/docs.sh" + }, + { + "path": ".kokoro/release/publish.cfg" + }, + { + "path": ".kokoro/samples-test.sh" + }, + { + "path": ".kokoro/system-test.sh" + }, + { + "path": ".kokoro/test.bat" + }, + { + "path": ".kokoro/test.sh" + }, + { + "path": ".kokoro/trampoline.sh" + }, + { + "path": ".nycrc" + }, + { + "path": ".prettierignore" + }, + { + "path": ".prettierrc" + }, + { + "path": ".readme-partials.yml" + }, + { + "path": ".repo-metadata.json" + }, + { + "path": "CHANGELOG.md" + }, + { + "path": "CODE_OF_CONDUCT.md" + }, + { + "path": "CONTRIBUTING.md" + }, + { + "path": "LICENSE" + }, + { + "path": "README.md" + }, + { + "path": "codecov.yaml" + }, + { + "path": "linkinator.config.json" + }, + { + "path": "package.json" + }, + { + "path": "protos/google/cloud/common_resources.proto" + }, + { + "path": "protos/google/cloud/translate/v3/translation_service.proto" + }, + { + "path": "protos/google/cloud/translate/v3beta1/translation_service.proto" + }, + { + "path": "protos/protos.d.ts" + }, + { + "path": "protos/protos.js" + }, + { + "path": "protos/protos.json" + }, + { + "path": "renovate.json" + }, + { + "path": "samples/.eslintrc.yml" + }, + { + "path": "samples/README.md" + }, + { + "path": "samples/automl/automlTranslationDataset.js" + }, + { + "path": "samples/automl/automlTranslationModel.js" + }, + { + "path": "samples/automl/automlTranslationPredict.js" + }, + { + "path": "samples/automl/resources/testInput.txt" + }, + { + "path": "samples/hybridGlossaries.js" + }, + { + "path": "samples/package.json" + }, + { + "path": "samples/quickstart.js" + }, + { + "path": "samples/resources/example.png" + }, + { + "path": "samples/test/automlTranslation.test.js" + }, + { + "path": "samples/test/hybridGlossaries.test.js" + }, + { + "path": "samples/test/quickstart.test.js" + }, + { + "path": "samples/test/translate.test.js" + }, + { + "path": "samples/test/v3/translate_batch_translate_text.test.js" + }, + { + "path": "samples/test/v3/translate_batch_translate_text_with_glossary.test.js" + }, + { + "path": "samples/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js" + }, + { + "path": "samples/test/v3/translate_batch_translate_text_with_model.test.js" + }, + { + "path": "samples/test/v3/translate_create_glossary.test.js" + }, + { + "path": "samples/test/v3/translate_delete_glossary.test.js" + }, + { + "path": "samples/test/v3/translate_detect_language.test.js" + }, + { + "path": "samples/test/v3/translate_get_glossary.test.js" + }, + { + "path": "samples/test/v3/translate_get_supported_languages.test.js" + }, + { + "path": "samples/test/v3/translate_get_supported_languages_for_targets.test.js" + }, + { + "path": "samples/test/v3/translate_list_codes.test.js" + }, + { + "path": "samples/test/v3/translate_list_glossary.test.js" + }, + { + "path": "samples/test/v3/translate_list_language_names.test.js" + }, + { + "path": "samples/test/v3/translate_translate_text.test.js" + }, + { + "path": "samples/test/v3/translate_translate_text_with_glossary.test.js" + }, + { + "path": "samples/test/v3/translate_translate_text_with_glossary_and_model.test.js" + }, + { + "path": "samples/test/v3/translate_translate_text_with_model.test.js" + }, + { + "path": "samples/test/v3beta1/translate_batch_translate_text_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_create_glossary_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_delete_glossary_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_detect_language_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_get_glossary_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_list_codes_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_list_glossary_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_list_language_names_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_translate_text_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_translate_text_with_glossary_beta.test.js" + }, + { + "path": "samples/test/v3beta1/translate_translate_text_with_model_beta.test.js" + }, + { + "path": "samples/translate.js" + }, + { + "path": "samples/v3/translate_batch_translate_text.js" + }, + { + "path": "samples/v3/translate_batch_translate_text_with_glossary.js" + }, + { + "path": "samples/v3/translate_batch_translate_text_with_glossary_and_model.js" + }, + { + "path": "samples/v3/translate_batch_translate_text_with_model.js" + }, + { + "path": "samples/v3/translate_create_glossary.js" + }, + { + "path": "samples/v3/translate_delete_glossary.js" + }, + { + "path": "samples/v3/translate_detect_language.js" + }, + { + "path": "samples/v3/translate_get_glossary.js" + }, + { + "path": "samples/v3/translate_get_supported_languages.js" + }, + { + "path": "samples/v3/translate_get_supported_languages_for_target.js" + }, + { + "path": "samples/v3/translate_list_codes.js" + }, + { + "path": "samples/v3/translate_list_glossary.js" + }, + { + "path": "samples/v3/translate_list_language_names.js" + }, + { + "path": "samples/v3/translate_translate_text.js" + }, + { + "path": "samples/v3/translate_translate_text_with_glossary.js" + }, + { + "path": "samples/v3/translate_translate_text_with_glossary_and_model.js" + }, + { + "path": "samples/v3/translate_translate_text_with_model.js" + }, + { + "path": "samples/v3beta1/translate_batch_translate_text_beta.js" + }, + { + "path": "samples/v3beta1/translate_create_glossary_beta.js" + }, + { + "path": "samples/v3beta1/translate_delete_glossary_beta.js" + }, + { + "path": "samples/v3beta1/translate_detect_language_beta.js" + }, + { + "path": "samples/v3beta1/translate_get_glossary_beta.js" + }, + { + "path": "samples/v3beta1/translate_list_codes_beta.js" + }, + { + "path": "samples/v3beta1/translate_list_glossary_beta.js" + }, + { + "path": "samples/v3beta1/translate_list_language_names_beta.js" + }, + { + "path": "samples/v3beta1/translate_translate_text_beta.js" + }, + { + "path": "samples/v3beta1/translate_translate_text_with_glossary_beta.js" + }, + { + "path": "samples/v3beta1/translate_translate_text_with_model_beta.js" + }, + { + "path": "src/index.ts" + }, + { + "path": "src/v2/index.ts" + }, + { + "path": "src/v3/index.ts" + }, + { + "path": "src/v3/translation_service_client.ts" + }, + { + "path": "src/v3/translation_service_client_config.json" + }, + { + "path": "src/v3/translation_service_proto_list.json" + }, + { + "path": "src/v3beta1/index.ts" + }, + { + "path": "src/v3beta1/translation_service_client.ts" + }, + { + "path": "src/v3beta1/translation_service_client_config.json" + }, + { + "path": "src/v3beta1/translation_service_proto_list.json" + }, + { + "path": "synth.py" + }, + { + "path": "system-test/fixtures/sample/src/index.js" + }, + { + "path": "system-test/fixtures/sample/src/index.ts" + }, + { + "path": "system-test/install.ts" + }, + { + "path": "system-test/translate.ts" + }, + { + "path": "test/gapic-translation_service-v3.ts" + }, + { + "path": "test/gapic-translation_service-v3beta1.ts" + }, + { + "path": "test/index.ts" + }, + { + "path": "test/mocha.opts" + }, + { + "path": "tsconfig.json" + }, + { + "path": "tslint.json" + }, + { + "path": "webpack.config.js" + } + ] +} \ No newline at end of file From e64d23d67f2e38898520c698b53b783562dc742a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 28 Jan 2020 14:41:22 -0800 Subject: [PATCH 321/513] fix: enum, bytes, and Long types now accept strings --- .../google-cloud-translate/protos/protos.d.ts | 124 +++++++++--------- .../google-cloud-translate/synth.metadata | 10 +- 2 files changed, 69 insertions(+), 65 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index c5b2642eaae..cd698846872 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -1761,16 +1761,16 @@ export namespace google { interface IBatchTranslateMetadata { /** BatchTranslateMetadata state */ - state?: (google.cloud.translation.v3.BatchTranslateMetadata.State|null); + state?: (google.cloud.translation.v3.BatchTranslateMetadata.State|keyof typeof google.cloud.translation.v3.BatchTranslateMetadata.State|null); /** BatchTranslateMetadata translatedCharacters */ - translatedCharacters?: (number|Long|null); + translatedCharacters?: (number|Long|string|null); /** BatchTranslateMetadata failedCharacters */ - failedCharacters?: (number|Long|null); + failedCharacters?: (number|Long|string|null); /** BatchTranslateMetadata totalCharacters */ - totalCharacters?: (number|Long|null); + totalCharacters?: (number|Long|string|null); /** BatchTranslateMetadata submitTime */ submitTime?: (google.protobuf.ITimestamp|null); @@ -1786,16 +1786,16 @@ export namespace google { constructor(properties?: google.cloud.translation.v3.IBatchTranslateMetadata); /** BatchTranslateMetadata state. */ - public state: google.cloud.translation.v3.BatchTranslateMetadata.State; + public state: (google.cloud.translation.v3.BatchTranslateMetadata.State|keyof typeof google.cloud.translation.v3.BatchTranslateMetadata.State); /** BatchTranslateMetadata translatedCharacters. */ - public translatedCharacters: (number|Long); + public translatedCharacters: (number|Long|string); /** BatchTranslateMetadata failedCharacters. */ - public failedCharacters: (number|Long); + public failedCharacters: (number|Long|string); /** BatchTranslateMetadata totalCharacters. */ - public totalCharacters: (number|Long); + public totalCharacters: (number|Long|string); /** BatchTranslateMetadata submitTime. */ public submitTime?: (google.protobuf.ITimestamp|null); @@ -1888,13 +1888,13 @@ export namespace google { interface IBatchTranslateResponse { /** BatchTranslateResponse totalCharacters */ - totalCharacters?: (number|Long|null); + totalCharacters?: (number|Long|string|null); /** BatchTranslateResponse translatedCharacters */ - translatedCharacters?: (number|Long|null); + translatedCharacters?: (number|Long|string|null); /** BatchTranslateResponse failedCharacters */ - failedCharacters?: (number|Long|null); + failedCharacters?: (number|Long|string|null); /** BatchTranslateResponse submitTime */ submitTime?: (google.protobuf.ITimestamp|null); @@ -1913,13 +1913,13 @@ export namespace google { constructor(properties?: google.cloud.translation.v3.IBatchTranslateResponse); /** BatchTranslateResponse totalCharacters. */ - public totalCharacters: (number|Long); + public totalCharacters: (number|Long|string); /** BatchTranslateResponse translatedCharacters. */ - public translatedCharacters: (number|Long); + public translatedCharacters: (number|Long|string); /** BatchTranslateResponse failedCharacters. */ - public failedCharacters: (number|Long); + public failedCharacters: (number|Long|string); /** BatchTranslateResponse submitTime. */ public submitTime?: (google.protobuf.ITimestamp|null); @@ -2896,7 +2896,7 @@ export namespace google { name?: (string|null); /** CreateGlossaryMetadata state */ - state?: (google.cloud.translation.v3.CreateGlossaryMetadata.State|null); + state?: (google.cloud.translation.v3.CreateGlossaryMetadata.State|keyof typeof google.cloud.translation.v3.CreateGlossaryMetadata.State|null); /** CreateGlossaryMetadata submitTime */ submitTime?: (google.protobuf.ITimestamp|null); @@ -2915,7 +2915,7 @@ export namespace google { public name: string; /** CreateGlossaryMetadata state. */ - public state: google.cloud.translation.v3.CreateGlossaryMetadata.State; + public state: (google.cloud.translation.v3.CreateGlossaryMetadata.State|keyof typeof google.cloud.translation.v3.CreateGlossaryMetadata.State); /** CreateGlossaryMetadata submitTime. */ public submitTime?: (google.protobuf.ITimestamp|null); @@ -3011,7 +3011,7 @@ export namespace google { name?: (string|null); /** DeleteGlossaryMetadata state */ - state?: (google.cloud.translation.v3.DeleteGlossaryMetadata.State|null); + state?: (google.cloud.translation.v3.DeleteGlossaryMetadata.State|keyof typeof google.cloud.translation.v3.DeleteGlossaryMetadata.State|null); /** DeleteGlossaryMetadata submitTime */ submitTime?: (google.protobuf.ITimestamp|null); @@ -3030,7 +3030,7 @@ export namespace google { public name: string; /** DeleteGlossaryMetadata state. */ - public state: google.cloud.translation.v3.DeleteGlossaryMetadata.State; + public state: (google.cloud.translation.v3.DeleteGlossaryMetadata.State|keyof typeof google.cloud.translation.v3.DeleteGlossaryMetadata.State); /** DeleteGlossaryMetadata submitTime. */ public submitTime?: (google.protobuf.ITimestamp|null); @@ -4960,16 +4960,16 @@ export namespace google { interface IBatchTranslateMetadata { /** BatchTranslateMetadata state */ - state?: (google.cloud.translation.v3beta1.BatchTranslateMetadata.State|null); + state?: (google.cloud.translation.v3beta1.BatchTranslateMetadata.State|keyof typeof google.cloud.translation.v3beta1.BatchTranslateMetadata.State|null); /** BatchTranslateMetadata translatedCharacters */ - translatedCharacters?: (number|Long|null); + translatedCharacters?: (number|Long|string|null); /** BatchTranslateMetadata failedCharacters */ - failedCharacters?: (number|Long|null); + failedCharacters?: (number|Long|string|null); /** BatchTranslateMetadata totalCharacters */ - totalCharacters?: (number|Long|null); + totalCharacters?: (number|Long|string|null); /** BatchTranslateMetadata submitTime */ submitTime?: (google.protobuf.ITimestamp|null); @@ -4985,16 +4985,16 @@ export namespace google { constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateMetadata); /** BatchTranslateMetadata state. */ - public state: google.cloud.translation.v3beta1.BatchTranslateMetadata.State; + public state: (google.cloud.translation.v3beta1.BatchTranslateMetadata.State|keyof typeof google.cloud.translation.v3beta1.BatchTranslateMetadata.State); /** BatchTranslateMetadata translatedCharacters. */ - public translatedCharacters: (number|Long); + public translatedCharacters: (number|Long|string); /** BatchTranslateMetadata failedCharacters. */ - public failedCharacters: (number|Long); + public failedCharacters: (number|Long|string); /** BatchTranslateMetadata totalCharacters. */ - public totalCharacters: (number|Long); + public totalCharacters: (number|Long|string); /** BatchTranslateMetadata submitTime. */ public submitTime?: (google.protobuf.ITimestamp|null); @@ -5087,13 +5087,13 @@ export namespace google { interface IBatchTranslateResponse { /** BatchTranslateResponse totalCharacters */ - totalCharacters?: (number|Long|null); + totalCharacters?: (number|Long|string|null); /** BatchTranslateResponse translatedCharacters */ - translatedCharacters?: (number|Long|null); + translatedCharacters?: (number|Long|string|null); /** BatchTranslateResponse failedCharacters */ - failedCharacters?: (number|Long|null); + failedCharacters?: (number|Long|string|null); /** BatchTranslateResponse submitTime */ submitTime?: (google.protobuf.ITimestamp|null); @@ -5112,13 +5112,13 @@ export namespace google { constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateResponse); /** BatchTranslateResponse totalCharacters. */ - public totalCharacters: (number|Long); + public totalCharacters: (number|Long|string); /** BatchTranslateResponse translatedCharacters. */ - public translatedCharacters: (number|Long); + public translatedCharacters: (number|Long|string); /** BatchTranslateResponse failedCharacters. */ - public failedCharacters: (number|Long); + public failedCharacters: (number|Long|string); /** BatchTranslateResponse submitTime. */ public submitTime?: (google.protobuf.ITimestamp|null); @@ -6095,7 +6095,7 @@ export namespace google { name?: (string|null); /** CreateGlossaryMetadata state */ - state?: (google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|null); + state?: (google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|keyof typeof google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|null); /** CreateGlossaryMetadata submitTime */ submitTime?: (google.protobuf.ITimestamp|null); @@ -6114,7 +6114,7 @@ export namespace google { public name: string; /** CreateGlossaryMetadata state. */ - public state: google.cloud.translation.v3beta1.CreateGlossaryMetadata.State; + public state: (google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|keyof typeof google.cloud.translation.v3beta1.CreateGlossaryMetadata.State); /** CreateGlossaryMetadata submitTime. */ public submitTime?: (google.protobuf.ITimestamp|null); @@ -6210,7 +6210,7 @@ export namespace google { name?: (string|null); /** DeleteGlossaryMetadata state */ - state?: (google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|null); + state?: (google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|keyof typeof google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|null); /** DeleteGlossaryMetadata submitTime */ submitTime?: (google.protobuf.ITimestamp|null); @@ -6229,7 +6229,7 @@ export namespace google { public name: string; /** DeleteGlossaryMetadata state. */ - public state: google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State; + public state: (google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|keyof typeof google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State); /** DeleteGlossaryMetadata submitTime. */ public submitTime?: (google.protobuf.ITimestamp|null); @@ -6788,7 +6788,7 @@ export namespace google { nameField?: (string|null); /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|null); + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); /** ResourceDescriptor plural */ plural?: (string|null); @@ -6816,7 +6816,7 @@ export namespace google { public nameField: string; /** ResourceDescriptor history. */ - public history: google.api.ResourceDescriptor.History; + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); /** ResourceDescriptor plural. */ public plural: string; @@ -7696,10 +7696,10 @@ export namespace google { number?: (number|null); /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); /** FieldDescriptorProto typeName */ typeName?: (string|null); @@ -7736,10 +7736,10 @@ export namespace google { public number: number; /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); /** FieldDescriptorProto typeName. */ public typeName: string; @@ -8514,7 +8514,7 @@ export namespace google { javaStringCheckUtf8?: (boolean|null); /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); /** FileOptions goPackage */ goPackage?: (string|null); @@ -8590,7 +8590,7 @@ export namespace google { public javaStringCheckUtf8: boolean; /** FileOptions optimizeFor. */ - public optimizeFor: google.protobuf.FileOptions.OptimizeMode; + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); /** FileOptions goPackage. */ public goPackage: string; @@ -8839,13 +8839,13 @@ export namespace google { interface IFieldOptions { /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); /** FieldOptions packed */ packed?: (boolean|null); /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); /** FieldOptions lazy */ lazy?: (boolean|null); @@ -8876,13 +8876,13 @@ export namespace google { constructor(properties?: google.protobuf.IFieldOptions); /** FieldOptions ctype. */ - public ctype: google.protobuf.FieldOptions.CType; + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); /** FieldOptions packed. */ public packed: boolean; /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); /** FieldOptions lazy. */ public lazy: boolean; @@ -9381,7 +9381,7 @@ export namespace google { deprecated?: (boolean|null); /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); /** MethodOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -9409,7 +9409,7 @@ export namespace google { public deprecated: boolean; /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); /** MethodOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -9505,16 +9505,16 @@ export namespace google { identifierValue?: (string|null); /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|null); + positiveIntValue?: (number|Long|string|null); /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|null); + negativeIntValue?: (number|Long|string|null); /** UninterpretedOption doubleValue */ doubleValue?: (number|null); /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|null); + stringValue?: (Uint8Array|string|null); /** UninterpretedOption aggregateValue */ aggregateValue?: (string|null); @@ -9536,16 +9536,16 @@ export namespace google { public identifierValue: string; /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long); + public positiveIntValue: (number|Long|string); /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long); + public negativeIntValue: (number|Long|string); /** UninterpretedOption doubleValue. */ public doubleValue: number; /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; + public stringValue: (Uint8Array|string); /** UninterpretedOption aggregateValue. */ public aggregateValue: string; @@ -10135,7 +10135,7 @@ export namespace google { type_url?: (string|null); /** Any value */ - value?: (Uint8Array|null); + value?: (Uint8Array|string|null); } /** Represents an Any. */ @@ -10151,7 +10151,7 @@ export namespace google { public type_url: string; /** Any value. */ - public value: Uint8Array; + public value: (Uint8Array|string); /** * Creates a new Any instance using the specified properties. @@ -10228,7 +10228,7 @@ export namespace google { interface IDuration { /** Duration seconds */ - seconds?: (number|Long|null); + seconds?: (number|Long|string|null); /** Duration nanos */ nanos?: (number|null); @@ -10244,7 +10244,7 @@ export namespace google { constructor(properties?: google.protobuf.IDuration); /** Duration seconds. */ - public seconds: (number|Long); + public seconds: (number|Long|string); /** Duration nanos. */ public nanos: number; @@ -10408,7 +10408,7 @@ export namespace google { interface ITimestamp { /** Timestamp seconds */ - seconds?: (number|Long|null); + seconds?: (number|Long|string|null); /** Timestamp nanos */ nanos?: (number|null); @@ -10424,7 +10424,7 @@ export namespace google { constructor(properties?: google.protobuf.ITimestamp); /** Timestamp seconds. */ - public seconds: (number|Long); + public seconds: (number|Long|string); /** Timestamp nanos. */ public nanos: number; diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 7951d1b0592..69649cfeb4b 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,12 +1,13 @@ { - "updateTime": "2020-01-24T12:39:25.395288Z", + "updateTime": "2020-01-28T12:39:05.132437Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e26cab8afd19d396b929039dac5d874cf0b5336c", - "internalRef": "291240093" + "sha": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea", + "internalRef": "291821782", + "log": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\n" } }, { @@ -482,6 +483,9 @@ { "path": "src/v3beta1/translation_service_proto_list.json" }, + { + "path": "synth.metadata" + }, { "path": "synth.py" }, From 0ddff687f9acc596750d3d62d5d515ba9e1f569a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 30 Jan 2020 16:34:23 +0100 Subject: [PATCH 322/513] chore(deps): update dependency @types/mocha to v7 --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 8b94948b61c..c8c4380e5fe 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -55,7 +55,7 @@ "devDependencies": { "@types/extend": "^3.0.0", "@types/is": "0.0.21", - "@types/mocha": "^5.2.4", + "@types/mocha": "^7.0.0", "@types/node": "^10.5.7", "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", From 3db5ff4eb87bda60641e0e07af0e0edf3e5457b9 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 31 Jan 2020 17:22:51 -0800 Subject: [PATCH 323/513] chore: skip img.shields.io in docs test --- packages/google-cloud-translate/linkinator.config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/linkinator.config.json b/packages/google-cloud-translate/linkinator.config.json index d780d6bfff5..b555215ca02 100644 --- a/packages/google-cloud-translate/linkinator.config.json +++ b/packages/google-cloud-translate/linkinator.config.json @@ -2,6 +2,7 @@ "recurse": true, "skip": [ "https://codecov.io/gh/googleapis/", - "www.googleapis.com" + "www.googleapis.com", + "img.shields.io" ] } From fa82904aae38eb9da96add4769531390e77d0589 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 3 Feb 2020 21:05:55 -0800 Subject: [PATCH 324/513] test: modernize mocha config (#432) --- packages/google-cloud-translate/.mocharc.json | 5 +++++ packages/google-cloud-translate/package.json | 5 +---- packages/google-cloud-translate/test/mocha.opts | 4 ---- 3 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 packages/google-cloud-translate/.mocharc.json delete mode 100644 packages/google-cloud-translate/test/mocha.opts diff --git a/packages/google-cloud-translate/.mocharc.json b/packages/google-cloud-translate/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/packages/google-cloud-translate/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c8c4380e5fe..820ff40120c 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -68,17 +68,14 @@ "google-auth-library": "^5.7.0", "gts": "^1.0.0", "http2spy": "^1.1.0", - "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^7.0.0", "pack-n-play": "^1.0.0-2", - "power-assert": "^1.6.0", - "prettier": "^1.13.5", + "prettier": "^1.13.5", "proxyquire": "^2.0.1", - "source-map-support": "^0.5.6", "typescript": "3.6.4" } } diff --git a/packages/google-cloud-translate/test/mocha.opts b/packages/google-cloud-translate/test/mocha.opts deleted file mode 100644 index 48bf1c3df18..00000000000 --- a/packages/google-cloud-translate/test/mocha.opts +++ /dev/null @@ -1,4 +0,0 @@ ---require source-map-support/register ---require intelli-espower-loader ---timeout 10000 ---throw-deprecation From 3f9d21fab28d92fdc8774319fbf1d52718a94841 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2020 22:28:35 -0800 Subject: [PATCH 325/513] chore: release 5.1.5 (#430) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 4 ++-- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index eaba1121b00..e75e986b092 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [5.1.5](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.4...v5.1.5) (2020-02-04) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([19891e0](https://www.github.com/googleapis/nodejs-translate/commit/19891e07b2f1aaad5552999f1701dc81b5447754)) + ### [5.1.4](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.3...v5.1.4) (2020-01-04) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 820ff40120c..19e91a48dc7 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "5.1.4", + "version": "5.1.5", "license": "Apache-2.0", "author": "Google Inc.", "engines": { @@ -74,7 +74,7 @@ "linkinator": "^1.5.0", "mocha": "^7.0.0", "pack-n-play": "^1.0.0-2", - "prettier": "^1.13.5", + "prettier": "^1.13.5", "proxyquire": "^2.0.1", "typescript": "3.6.4" } diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index d75efccfd98..4b63c36c79d 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^5.1.4", + "@google-cloud/translate": "^5.1.5", "@google-cloud/vision": "^1.2.0", "yargs": "^15.0.0" }, From 07a193038d05f4db5b8cc7b80190326d539ccef8 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 5 Feb 2020 09:01:37 -0800 Subject: [PATCH 326/513] chore: remove header check ignore and clang (#437) --- packages/google-cloud-translate/.bots/header-checker-lint.json | 3 --- packages/google-cloud-translate/.clang-format | 3 --- 2 files changed, 6 deletions(-) delete mode 100644 packages/google-cloud-translate/.bots/header-checker-lint.json delete mode 100644 packages/google-cloud-translate/.clang-format diff --git a/packages/google-cloud-translate/.bots/header-checker-lint.json b/packages/google-cloud-translate/.bots/header-checker-lint.json deleted file mode 100644 index 925a9db39b2..00000000000 --- a/packages/google-cloud-translate/.bots/header-checker-lint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ignoreFiles": ["protos/*"] -} \ No newline at end of file diff --git a/packages/google-cloud-translate/.clang-format b/packages/google-cloud-translate/.clang-format deleted file mode 100644 index 7d6cf97e108..00000000000 --- a/packages/google-cloud-translate/.clang-format +++ /dev/null @@ -1,3 +0,0 @@ -Language: JavaScript -BasedOnStyle: Google -ColumnLimit: 80 \ No newline at end of file From d27bb38f0b72f37d0d0f3f98798177f7ea9d4e81 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 7 Feb 2020 10:32:03 -0800 Subject: [PATCH 327/513] fix: pass x-goog-request-params header for streaming calls --- packages/google-cloud-translate/.gitignore | 4 +- .../src/v3/translation_service_client.ts | 90 ++-- .../src/v3beta1/translation_service_client.ts | 90 ++-- .../google-cloud-translate/synth.metadata | 495 +----------------- .../test/gapic-translation_service-v3.ts | 20 +- .../test/gapic-translation_service-v3beta1.ts | 20 +- 6 files changed, 142 insertions(+), 577 deletions(-) diff --git a/packages/google-cloud-translate/.gitignore b/packages/google-cloud-translate/.gitignore index 4ebc92569bd..5d32b23782f 100644 --- a/packages/google-cloud-translate/.gitignore +++ b/packages/google-cloud-translate/.gitignore @@ -1,12 +1,14 @@ **/*.log **/node_modules .coverage +coverage .nyc_output docs/ out/ +build/ system-test/secrets.js system-test/*key.json *.lock -build +.DS_Store package-lock.json __pycache__ diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 2e6dcbbe930..b744850f623 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -144,12 +144,12 @@ export class TranslationServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - locationPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), glossaryPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/glossaries/{glossary}' ), + locationPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), }; // Some of the methods on this service return "paged" results, @@ -1222,9 +1222,17 @@ export class TranslationServiceClient { */ listGlossariesStream( request?: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.listGlossaries.createStream( this._innerApiCalls.listGlossaries as gax.GaxCall, @@ -1236,43 +1244,6 @@ export class TranslationServiceClient { // -- Path templates -- // -------------------- - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project: string, location: string) { - return this._pathTemplates.locationPathTemplate.render({ - project, - location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this._pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this._pathTemplates.locationPathTemplate.match(locationName) - .location; - } - /** * Return a fully-qualified glossary resource name string. * @@ -1324,6 +1295,43 @@ export class TranslationServiceClient { .glossary; } + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this._pathTemplates.locationPathTemplate.render({ + project, + location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this._pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this._pathTemplates.locationPathTemplate.match(locationName) + .location; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 658da3b588b..a1afed1ade0 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -144,12 +144,12 @@ export class TranslationServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - locationPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), glossaryPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/glossaries/{glossary}' ), + locationPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), }; // Some of the methods on this service return "paged" results, @@ -1238,9 +1238,17 @@ export class TranslationServiceClient { */ listGlossariesStream( request?: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.listGlossaries.createStream( this._innerApiCalls.listGlossaries as gax.GaxCall, @@ -1252,43 +1260,6 @@ export class TranslationServiceClient { // -- Path templates -- // -------------------- - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project: string, location: string) { - return this._pathTemplates.locationPathTemplate.render({ - project, - location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this._pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this._pathTemplates.locationPathTemplate.match(locationName) - .location; - } - /** * Return a fully-qualified glossary resource name string. * @@ -1340,6 +1311,43 @@ export class TranslationServiceClient { .glossary; } + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this._pathTemplates.locationPathTemplate.render({ + project, + location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this._pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this._pathTemplates.locationPathTemplate.match(locationName) + .location; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 69649cfeb4b..28468f2d616 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,20 +1,20 @@ { - "updateTime": "2020-01-28T12:39:05.132437Z", + "updateTime": "2020-02-07T12:42:33.477887Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea", - "internalRef": "291821782", - "log": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\n" + "sha": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585", + "internalRef": "293710856", + "log": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585\nGenerate the Bazel build file for recommendengine public api\n\nPiperOrigin-RevId: 293710856\n\n68477017c4173c98addac0373950c6aa9d7b375f\nMake `language_code` optional for UpdateIntentRequest and BatchUpdateIntentsRequest.\n\nThe comments and proto annotations describe this parameter as optional.\n\nPiperOrigin-RevId: 293703548\n\n16f823f578bca4e845a19b88bb9bc5870ea71ab2\nAdd BUILD.bazel files for managedidentities API\n\nPiperOrigin-RevId: 293698246\n\n2f53fd8178c9a9de4ad10fae8dd17a7ba36133f2\nAdd v1p1beta1 config file\n\nPiperOrigin-RevId: 293696729\n\n052b274138fce2be80f97b6dcb83ab343c7c8812\nAdd source field for user event and add field behavior annotations\n\nPiperOrigin-RevId: 293693115\n\n1e89732b2d69151b1b3418fff3d4cc0434f0dded\ndatacatalog: v1beta1 add three new RPCs to gapic v1beta1 config\n\nPiperOrigin-RevId: 293692823\n\n9c8bd09bbdc7c4160a44f1fbab279b73cd7a2337\nchange the name of AccessApproval service to AccessApprovalAdmin\n\nPiperOrigin-RevId: 293690934\n\n2e23b8fbc45f5d9e200572ca662fe1271bcd6760\nAdd ListEntryGroups method, add http bindings to support entry group tagging, and update some comments.\n\nPiperOrigin-RevId: 293666452\n\n0275e38a4ca03a13d3f47a9613aac8c8b0d3f1f2\nAdd proto_package field to managedidentities API. It is needed for APIs that still depend on artman generation.\n\nPiperOrigin-RevId: 293643323\n\n4cdfe8278cb6f308106580d70648001c9146e759\nRegenerating public protos for Data Catalog to add new Custom Type Entry feature.\n\nPiperOrigin-RevId: 293614782\n\n45d2a569ab526a1fad3720f95eefb1c7330eaada\nEnable client generation for v1 ManagedIdentities API.\n\nPiperOrigin-RevId: 293515675\n\n2c17086b77e6f3bcf04a1f65758dfb0c3da1568f\nAdd the Actions on Google common types (//google/actions/type/*).\n\nPiperOrigin-RevId: 293478245\n\n781aadb932e64a12fb6ead7cd842698d99588433\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293443396\n\ne2602608c9138c2fca24162720e67f9307c30b95\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293442964\n\nc8aef82028d06b7992278fa9294c18570dc86c3d\nAdd cc_proto_library and cc_grpc_library targets for Bigtable protos.\n\nAlso fix indentation of cc_grpc_library targets in Spanner and IAM protos.\n\nPiperOrigin-RevId: 293440538\n\ne2faab04f4cb7f9755072330866689b1943a16e9\ncloudtasks: v2 replace non-standard retry params in gapic config v2\n\nPiperOrigin-RevId: 293424055\n\ndfb4097ea628a8470292c6590a4313aee0c675bd\nerrorreporting: v1beta1 add legacy artman config for php\n\nPiperOrigin-RevId: 293423790\n\nb18aed55b45bfe5b62476292c72759e6c3e573c6\nasset: v1p1beta1 updated comment for `page_size` limit.\n\nPiperOrigin-RevId: 293421386\n\nc9ef36b7956d9859a2fc86ad35fcaa16958ab44f\nbazel: Refactor CI build scripts\n\nPiperOrigin-RevId: 293387911\n\na8ed9d921fdddc61d8467bfd7c1668f0ad90435c\nfix: set Ruby module name for OrgPolicy\n\nPiperOrigin-RevId: 293257997\n\n6c7d28509bd8315de8af0889688ee20099594269\nredis: v1beta1 add UpgradeInstance and connect_mode field to Instance\n\nPiperOrigin-RevId: 293242878\n\nae0abed4fcb4c21f5cb67a82349a049524c4ef68\nredis: v1 add connect_mode field to Instance\n\nPiperOrigin-RevId: 293241914\n\n3f7a0d29b28ee9365771da2b66edf7fa2b4e9c56\nAdds service config definition for bigqueryreservation v1beta1\n\nPiperOrigin-RevId: 293234418\n\n0c88168d5ed6fe353a8cf8cbdc6bf084f6bb66a5\naddition of BUILD & configuration for accessapproval v1\n\nPiperOrigin-RevId: 293219198\n\n39bedc2e30f4778ce81193f6ba1fec56107bcfc4\naccessapproval: v1 publish protos\n\nPiperOrigin-RevId: 293167048\n\n69d9945330a5721cd679f17331a78850e2618226\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080182\n\nf6a1a6b417f39694275ca286110bc3c1ca4db0dc\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080178\n\n29d40b78e3dc1579b0b209463fbcb76e5767f72a\nExpose managedidentities/v1beta1/ API for client library usage.\n\nPiperOrigin-RevId: 292979741\n\na22129a1fb6e18056d576dfb7717aef74b63734a\nExpose managedidentities/v1/ API for client library usage.\n\nPiperOrigin-RevId: 292968186\n\nb5cbe4a4ba64ab19e6627573ff52057a1657773d\nSecurityCenter v1p1beta1: move file-level option on top to workaround protobuf.js bug.\n\nPiperOrigin-RevId: 292647187\n\nb224b317bf20c6a4fbc5030b4a969c3147f27ad3\nAdds API definitions for bigqueryreservation v1beta1.\n\nPiperOrigin-RevId: 292634722\n\nc1468702f9b17e20dd59007c0804a089b83197d2\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 292626173\n\nffdfa4f55ab2f0afc11d0eb68f125ccbd5e404bd\nvision: v1p3beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292605599\n\n78f61482cd028fc1d9892aa5d89d768666a954cd\nvision: v1p1beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292605125\n\n60bb5a294a604fd1778c7ec87b265d13a7106171\nvision: v1p2beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292604980\n\n3bcf7aa79d45eb9ec29ab9036e9359ea325a7fc3\nvision: v1p4beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292604656\n\n2717b8a1c762b26911b45ecc2e4ee01d98401b28\nFix dataproc artman client library generation.\n\nPiperOrigin-RevId: 292555664\n\n7ac66d9be8a7d7de4f13566d8663978c9ee9dcd7\nAdd Dataproc Autoscaling API to V1.\n\nPiperOrigin-RevId: 292450564\n\n5d932b2c1be3a6ef487d094e3cf5c0673d0241dd\n- Improve documentation\n- Add a client_id field to StreamingPullRequest\n\nPiperOrigin-RevId: 292434036\n\neaff9fa8edec3e914995ce832b087039c5417ea7\nmonitoring: v3 publish annotations and client retry config\n\nPiperOrigin-RevId: 292425288\n\n70958bab8c5353870d31a23fb2c40305b050d3fe\nBigQuery Storage Read API v1 clients.\n\nPiperOrigin-RevId: 292407644\n\n7a15e7fe78ff4b6d5c9606a3264559e5bde341d1\nUpdate backend proto for Google Cloud Endpoints\n\nPiperOrigin-RevId: 292391607\n\n3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\ncf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.10.17" + "version": "2020.2.4" } } ], @@ -37,490 +37,5 @@ "generator": "gapic-generator-typescript" } } - ], - "newFiles": [ - { - "path": ".bots/header-checker-lint.json" - }, - { - "path": ".clang-format" - }, - { - "path": ".eslintignore" - }, - { - "path": ".eslintrc.yml" - }, - { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/support_request.md" - }, - { - "path": ".github/PULL_REQUEST_TEMPLATE.md" - }, - { - "path": ".github/release-please.yml" - }, - { - "path": ".gitignore" - }, - { - "path": ".jsdoc.js" - }, - { - "path": ".kokoro/.gitattributes" - }, - { - "path": ".kokoro/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/docs.cfg" - }, - { - "path": ".kokoro/continuous/node10/lint.cfg" - }, - { - "path": ".kokoro/continuous/node10/samples-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/system-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/test.cfg" - }, - { - "path": ".kokoro/continuous/node12/common.cfg" - }, - { - "path": ".kokoro/continuous/node12/test.cfg" - }, - { - "path": ".kokoro/continuous/node8/common.cfg" - }, - { - "path": ".kokoro/continuous/node8/test.cfg" - }, - { - "path": ".kokoro/docs.sh" - }, - { - "path": ".kokoro/lint.sh" - }, - { - "path": ".kokoro/pre-system-test.sh" - }, - { - "path": ".kokoro/presubmit/node10/common.cfg" - }, - { - "path": ".kokoro/presubmit/node10/docs.cfg" - }, - { - "path": ".kokoro/presubmit/node10/lint.cfg" - }, - { - "path": ".kokoro/presubmit/node10/samples-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/system-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/test.cfg" - }, - { - "path": ".kokoro/presubmit/node12/common.cfg" - }, - { - "path": ".kokoro/presubmit/node12/test.cfg" - }, - { - "path": ".kokoro/presubmit/node8/common.cfg" - }, - { - "path": ".kokoro/presubmit/node8/test.cfg" - }, - { - "path": ".kokoro/presubmit/windows/common.cfg" - }, - { - "path": ".kokoro/presubmit/windows/test.cfg" - }, - { - "path": ".kokoro/publish.sh" - }, - { - "path": ".kokoro/release/docs.cfg" - }, - { - "path": ".kokoro/release/docs.sh" - }, - { - "path": ".kokoro/release/publish.cfg" - }, - { - "path": ".kokoro/samples-test.sh" - }, - { - "path": ".kokoro/system-test.sh" - }, - { - "path": ".kokoro/test.bat" - }, - { - "path": ".kokoro/test.sh" - }, - { - "path": ".kokoro/trampoline.sh" - }, - { - "path": ".nycrc" - }, - { - "path": ".prettierignore" - }, - { - "path": ".prettierrc" - }, - { - "path": ".readme-partials.yml" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "CODE_OF_CONDUCT.md" - }, - { - "path": "CONTRIBUTING.md" - }, - { - "path": "LICENSE" - }, - { - "path": "README.md" - }, - { - "path": "codecov.yaml" - }, - { - "path": "linkinator.config.json" - }, - { - "path": "package.json" - }, - { - "path": "protos/google/cloud/common_resources.proto" - }, - { - "path": "protos/google/cloud/translate/v3/translation_service.proto" - }, - { - "path": "protos/google/cloud/translate/v3beta1/translation_service.proto" - }, - { - "path": "protos/protos.d.ts" - }, - { - "path": "protos/protos.js" - }, - { - "path": "protos/protos.json" - }, - { - "path": "renovate.json" - }, - { - "path": "samples/.eslintrc.yml" - }, - { - "path": "samples/README.md" - }, - { - "path": "samples/automl/automlTranslationDataset.js" - }, - { - "path": "samples/automl/automlTranslationModel.js" - }, - { - "path": "samples/automl/automlTranslationPredict.js" - }, - { - "path": "samples/automl/resources/testInput.txt" - }, - { - "path": "samples/hybridGlossaries.js" - }, - { - "path": "samples/package.json" - }, - { - "path": "samples/quickstart.js" - }, - { - "path": "samples/resources/example.png" - }, - { - "path": "samples/test/automlTranslation.test.js" - }, - { - "path": "samples/test/hybridGlossaries.test.js" - }, - { - "path": "samples/test/quickstart.test.js" - }, - { - "path": "samples/test/translate.test.js" - }, - { - "path": "samples/test/v3/translate_batch_translate_text.test.js" - }, - { - "path": "samples/test/v3/translate_batch_translate_text_with_glossary.test.js" - }, - { - "path": "samples/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js" - }, - { - "path": "samples/test/v3/translate_batch_translate_text_with_model.test.js" - }, - { - "path": "samples/test/v3/translate_create_glossary.test.js" - }, - { - "path": "samples/test/v3/translate_delete_glossary.test.js" - }, - { - "path": "samples/test/v3/translate_detect_language.test.js" - }, - { - "path": "samples/test/v3/translate_get_glossary.test.js" - }, - { - "path": "samples/test/v3/translate_get_supported_languages.test.js" - }, - { - "path": "samples/test/v3/translate_get_supported_languages_for_targets.test.js" - }, - { - "path": "samples/test/v3/translate_list_codes.test.js" - }, - { - "path": "samples/test/v3/translate_list_glossary.test.js" - }, - { - "path": "samples/test/v3/translate_list_language_names.test.js" - }, - { - "path": "samples/test/v3/translate_translate_text.test.js" - }, - { - "path": "samples/test/v3/translate_translate_text_with_glossary.test.js" - }, - { - "path": "samples/test/v3/translate_translate_text_with_glossary_and_model.test.js" - }, - { - "path": "samples/test/v3/translate_translate_text_with_model.test.js" - }, - { - "path": "samples/test/v3beta1/translate_batch_translate_text_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_create_glossary_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_delete_glossary_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_detect_language_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_get_glossary_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_list_codes_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_list_glossary_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_list_language_names_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_translate_text_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_translate_text_with_glossary_beta.test.js" - }, - { - "path": "samples/test/v3beta1/translate_translate_text_with_model_beta.test.js" - }, - { - "path": "samples/translate.js" - }, - { - "path": "samples/v3/translate_batch_translate_text.js" - }, - { - "path": "samples/v3/translate_batch_translate_text_with_glossary.js" - }, - { - "path": "samples/v3/translate_batch_translate_text_with_glossary_and_model.js" - }, - { - "path": "samples/v3/translate_batch_translate_text_with_model.js" - }, - { - "path": "samples/v3/translate_create_glossary.js" - }, - { - "path": "samples/v3/translate_delete_glossary.js" - }, - { - "path": "samples/v3/translate_detect_language.js" - }, - { - "path": "samples/v3/translate_get_glossary.js" - }, - { - "path": "samples/v3/translate_get_supported_languages.js" - }, - { - "path": "samples/v3/translate_get_supported_languages_for_target.js" - }, - { - "path": "samples/v3/translate_list_codes.js" - }, - { - "path": "samples/v3/translate_list_glossary.js" - }, - { - "path": "samples/v3/translate_list_language_names.js" - }, - { - "path": "samples/v3/translate_translate_text.js" - }, - { - "path": "samples/v3/translate_translate_text_with_glossary.js" - }, - { - "path": "samples/v3/translate_translate_text_with_glossary_and_model.js" - }, - { - "path": "samples/v3/translate_translate_text_with_model.js" - }, - { - "path": "samples/v3beta1/translate_batch_translate_text_beta.js" - }, - { - "path": "samples/v3beta1/translate_create_glossary_beta.js" - }, - { - "path": "samples/v3beta1/translate_delete_glossary_beta.js" - }, - { - "path": "samples/v3beta1/translate_detect_language_beta.js" - }, - { - "path": "samples/v3beta1/translate_get_glossary_beta.js" - }, - { - "path": "samples/v3beta1/translate_list_codes_beta.js" - }, - { - "path": "samples/v3beta1/translate_list_glossary_beta.js" - }, - { - "path": "samples/v3beta1/translate_list_language_names_beta.js" - }, - { - "path": "samples/v3beta1/translate_translate_text_beta.js" - }, - { - "path": "samples/v3beta1/translate_translate_text_with_glossary_beta.js" - }, - { - "path": "samples/v3beta1/translate_translate_text_with_model_beta.js" - }, - { - "path": "src/index.ts" - }, - { - "path": "src/v2/index.ts" - }, - { - "path": "src/v3/index.ts" - }, - { - "path": "src/v3/translation_service_client.ts" - }, - { - "path": "src/v3/translation_service_client_config.json" - }, - { - "path": "src/v3/translation_service_proto_list.json" - }, - { - "path": "src/v3beta1/index.ts" - }, - { - "path": "src/v3beta1/translation_service_client.ts" - }, - { - "path": "src/v3beta1/translation_service_client_config.json" - }, - { - "path": "src/v3beta1/translation_service_proto_list.json" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "system-test/fixtures/sample/src/index.js" - }, - { - "path": "system-test/fixtures/sample/src/index.ts" - }, - { - "path": "system-test/install.ts" - }, - { - "path": "system-test/translate.ts" - }, - { - "path": "test/gapic-translation_service-v3.ts" - }, - { - "path": "test/gapic-translation_service-v3beta1.ts" - }, - { - "path": "test/index.ts" - }, - { - "path": "test/mocha.opts" - }, - { - "path": "tsconfig.json" - }, - { - "path": "tslint.json" - }, - { - "path": "webpack.config.js" - } ] } \ No newline at end of file diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts index 13b826e9704..cec097ab3a5 100644 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts @@ -112,6 +112,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -134,6 +135,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -158,6 +160,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -180,6 +183,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -204,6 +208,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -226,6 +231,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -250,6 +256,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -272,6 +279,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -296,6 +304,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -325,6 +334,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -357,6 +367,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -386,6 +397,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -418,6 +430,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -447,6 +460,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -479,6 +493,7 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock Grpc layer @@ -505,8 +520,9 @@ describe('v3.TranslationServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest = {}; + request.parent = ''; // Mock response - const expectedResponse = {}; + const expectedResponse = {response: 'data'}; // Mock Grpc layer client._innerApiCalls.listGlossaries = ( actualRequest: {}, @@ -525,7 +541,7 @@ describe('v3.TranslationServiceClient', () => { .on('error', (err: FakeError) => { done(err); }); - stream.write(request); + stream.write(expectedResponse); }); }); }); diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts index c4a92ca821e..b1beee2a4b9 100644 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts @@ -116,6 +116,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -140,6 +141,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -166,6 +168,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -190,6 +193,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -216,6 +220,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -240,6 +245,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -266,6 +272,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -290,6 +297,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -316,6 +324,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -347,6 +356,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -381,6 +391,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -412,6 +423,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -446,6 +458,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -477,6 +490,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -511,6 +525,7 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock Grpc layer @@ -539,8 +554,9 @@ describe('v3beta1.TranslationServiceClient', () => { ); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest = {}; + request.parent = ''; // Mock response - const expectedResponse = {}; + const expectedResponse = {response: 'data'}; // Mock Grpc layer client._innerApiCalls.listGlossaries = ( actualRequest: {}, @@ -559,7 +575,7 @@ describe('v3beta1.TranslationServiceClient', () => { .on('error', (err: FakeError) => { done(err); }); - stream.write(request); + stream.write(expectedResponse); }); }); }); From c3cea9c7c3a29fc7223c0f12179dff11f5106da0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2020 14:07:55 -0800 Subject: [PATCH 328/513] chore: release 5.1.6 (#442) --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index e75e986b092..5eab284500f 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [5.1.6](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.5...v5.1.6) (2020-02-07) + + +### Bug Fixes + +* pass x-goog-request-params header for streaming calls ([40c90fa](https://www.github.com/googleapis/nodejs-translate/commit/40c90fa099ef0bd995b5923cd35ba4ac0f9344e1)) + ### [5.1.5](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.4...v5.1.5) (2020-02-04) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 19e91a48dc7..aec82741b63 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "5.1.5", + "version": "5.1.6", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 4b63c36c79d..544c4c92e17 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^5.1.5", + "@google-cloud/translate": "^5.1.6", "@google-cloud/vision": "^1.2.0", "yargs": "^15.0.0" }, From 1b8a0fbb9902c2759a30eb459876f362c175a779 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 10 Feb 2020 18:05:03 +0100 Subject: [PATCH 329/513] chore(deps): update dependency linkinator to v2 --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index aec82741b63..de767d466fa 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -71,7 +71,7 @@ "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", - "linkinator": "^1.5.0", + "linkinator": "^2.0.0", "mocha": "^7.0.0", "pack-n-play": "^1.0.0-2", "prettier": "^1.13.5", From a721bd6d57ad87e5423dcda04be701ee465ac45a Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 13 Feb 2020 07:25:40 -0800 Subject: [PATCH 330/513] build: add GitHub actions config for unit tests (#446) --- packages/google-cloud-translate/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index de767d466fa..d7f5f12795b 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -40,7 +40,8 @@ "pretest": "npm run compile", "presystem-test": "npm run compile", "docs-test": "linkinator docs", - "predocs-test": "npm run docs" + "predocs-test": "npm run docs", + "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { "@google-cloud/common": "^2.0.0", From 6acc2974c60de0a28b6cc592a1bae1f972a82889 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 26 Feb 2020 21:35:17 +0100 Subject: [PATCH 331/513] chore(deps): update dependency uuid to v7 --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 544c4c92e17..f5b92f38185 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -24,6 +24,6 @@ "@google-cloud/storage": "^4.0.0", "chai": "^4.2.0", "mocha": "^7.0.0", - "uuid": "^3.3.2" + "uuid": "^7.0.0" } } From 7d867960eabc7f7a0fc2f0c73163e378131950b9 Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Thu, 27 Feb 2020 10:48:03 -0800 Subject: [PATCH 332/513] feat: export protos in src/index.ts (#451) --- packages/google-cloud-translate/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index af42f24bb15..6bff158bc83 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -68,3 +68,5 @@ export default { v3, TranslationServiceClient, }; +import * as protos from '../protos/protos'; +export {protos}; From 84f28e52e93cadef5e1288eea9065cd7e8a9f3bf Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2020 19:04:04 +0000 Subject: [PATCH 333/513] chore: release 5.2.0 (#454) :robot: I have created a release \*beep\* \*boop\* --- ## [5.2.0](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.6...v5.2.0) (2020-02-27) ### Features * export protos in src/index.ts ([#451](https://www.github.com/googleapis/nodejs-translate/issues/451)) ([a70079e](https://www.github.com/googleapis/nodejs-translate/commit/a70079ea24fe36d7efdd7d028a55fd6acbd6b3e1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 5eab284500f..4436299ccfa 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [5.2.0](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.6...v5.2.0) (2020-02-27) + + +### Features + +* export protos in src/index.ts ([#451](https://www.github.com/googleapis/nodejs-translate/issues/451)) ([a70079e](https://www.github.com/googleapis/nodejs-translate/commit/a70079ea24fe36d7efdd7d028a55fd6acbd6b3e1)) + ### [5.1.6](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.5...v5.1.6) (2020-02-07) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index d7f5f12795b..7786f39f19b 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "5.1.6", + "version": "5.2.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index f5b92f38185..84bd71c54a9 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^5.1.6", + "@google-cloud/translate": "^5.2.0", "@google-cloud/vision": "^1.2.0", "yargs": "^15.0.0" }, From 8f7d6a7a1d639fa5f3c779f60d24b95a93bf2e02 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Thu, 27 Feb 2020 12:06:09 -0800 Subject: [PATCH 334/513] chore: update jsdoc.js (#455) --- packages/google-cloud-translate/.jsdoc.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index 16df9e27c15..8ae377945d3 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -36,11 +36,14 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2018 Google, LLC.', + copyright: 'Copyright 2019 Google, LLC.', includeDate: false, sourceFiles: false, systemName: '@google-cloud/translate', - theme: 'lumen' + theme: 'lumen', + default: { + "outputSourceFiles": false + } }, markdown: { idInHeadings: true From 76674e798566e2aaae3efbf85f6ea5a24d60a0ab Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Thu, 27 Feb 2020 21:42:59 -0800 Subject: [PATCH 335/513] chore: correct .jsdoc.js protos and double quotes (#457) --- packages/google-cloud-translate/.jsdoc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index 8ae377945d3..9c611d1717b 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -31,7 +31,8 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'build/src' + 'build/src', + 'protos' ], includePattern: '\\.js$' }, @@ -42,7 +43,7 @@ module.exports = { systemName: '@google-cloud/translate', theme: 'lumen', default: { - "outputSourceFiles": false + outputSourceFiles: false } }, markdown: { From 0ebedc264f7c748b49bed4520ab2925227b8f3df Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Fri, 28 Feb 2020 16:34:11 -0800 Subject: [PATCH 336/513] chore: update jsdoc with macro license (#459) --- packages/google-cloud-translate/.jsdoc.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index 9c611d1717b..60061058cfa 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; From 852788be567f621f2872870e5f7612bc7d48a730 Mon Sep 17 00:00:00 2001 From: "gcf-merge-on-green[bot]" <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2020 00:22:38 +0000 Subject: [PATCH 337/513] feat: deferred client initialization (#460) This PR includes changes from https://github.com/googleapis/gapic-generator-typescript/pull/317 that will move the asynchronous initialization and authentication from the client constructor to an `initialize()` method. This method will be automatically called when the first RPC call is performed. The client library usage has not changed, there is no need to update any code. If you want to make sure the client is authenticated _before_ the first RPC call, you can do ```js await client.initialize(); ``` manually before calling any client method. --- .../src/v3/translation_service_client.ts | 96 ++++++++++++------ .../src/v3beta1/translation_service_client.ts | 97 +++++++++++++------ .../google-cloud-translate/synth.metadata | 8 +- .../test/gapic-translation_service-v3.ts | 48 +++++++++ .../test/gapic-translation_service-v3beta1.ts | 52 ++++++++++ 5 files changed, 239 insertions(+), 62 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index b744850f623..d0868ab5422 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -45,9 +45,14 @@ export class TranslationServiceClient { private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; operationsClient: gax.OperationsClient; - translationServiceStub: Promise<{[name: string]: Function}>; + translationServiceStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of TranslationServiceClient. @@ -71,8 +76,6 @@ export class TranslationServiceClient { * app is running in an environment which supports * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -102,25 +105,28 @@ export class TranslationServiceClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this.constructor as typeof TranslationServiceClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { - clientHeader.push(`gl-web/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -136,7 +142,7 @@ export class TranslationServiceClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -144,10 +150,10 @@ export class TranslationServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - glossaryPathTemplate: new gaxModule.PathTemplate( + glossaryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/glossaries/{glossary}' ), - locationPathTemplate: new gaxModule.PathTemplate( + locationPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), }; @@ -156,7 +162,7 @@ export class TranslationServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - listGlossaries: new gaxModule.PageDescriptor( + listGlossaries: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'glossaries' @@ -167,13 +173,15 @@ export class TranslationServiceClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = gaxModule + this.operationsClient = this._gaxModule .lro({ auth: this.auth, - grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); const batchTranslateTextResponse = protoFilesRoot.lookup( @@ -196,17 +204,17 @@ export class TranslationServiceClient { ) as gax.protobuf.Type; this._descriptors.longrunning = { - batchTranslateText: new gaxModule.LongrunningDescriptor( + batchTranslateText: new this._gaxModule.LongrunningDescriptor( this.operationsClient, batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) ), - createGlossary: new gaxModule.LongrunningDescriptor( + createGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGlossaryResponse.decode.bind(createGlossaryResponse), createGlossaryMetadata.decode.bind(createGlossaryMetadata) ), - deleteGlossary: new gaxModule.LongrunningDescriptor( + deleteGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata) @@ -214,7 +222,7 @@ export class TranslationServiceClient { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.translation.v3.TranslationService', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -225,17 +233,35 @@ export class TranslationServiceClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this._innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.translationServiceStub) { + return this.translationServiceStub; + } // Put together the "service stub" for // google.cloud.translation.v3.TranslationService. - this.translationServiceStub = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.translationServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.translation.v3.TranslationService' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.translation.v3.TranslationService, - opts + (this._protos as any).google.cloud.translation.v3.TranslationService, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -264,9 +290,9 @@ export class TranslationServiceClient { } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -280,6 +306,8 @@ export class TranslationServiceClient { return apiCall(argument, callOptions, callback); }; } + + return this.translationServiceStub; } /** @@ -465,6 +493,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.translateText(request, options, callback); } detectLanguage( @@ -579,6 +608,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.detectLanguage(request, options, callback); } getSupportedLanguages( @@ -690,6 +720,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.getSupportedLanguages( request, options, @@ -767,6 +798,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getGlossary(request, options, callback); } @@ -910,6 +942,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.batchTranslateText(request, options, callback); } createGlossary( @@ -999,6 +1032,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createGlossary(request, options, callback); } deleteGlossary( @@ -1087,6 +1121,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.deleteGlossary(request, options, callback); } listGlossaries( @@ -1183,6 +1218,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listGlossaries(request, options, callback); } @@ -1234,6 +1270,7 @@ export class TranslationServiceClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listGlossaries.createStream( this._innerApiCalls.listGlossaries as gax.GaxCall, request, @@ -1338,8 +1375,9 @@ export class TranslationServiceClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.translationServiceStub.then(stub => { + return this.translationServiceStub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index a1afed1ade0..6cc33980c57 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -45,9 +45,14 @@ export class TranslationServiceClient { private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; operationsClient: gax.OperationsClient; - translationServiceStub: Promise<{[name: string]: Function}>; + translationServiceStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of TranslationServiceClient. @@ -71,8 +76,6 @@ export class TranslationServiceClient { * app is running in an environment which supports * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -102,25 +105,28 @@ export class TranslationServiceClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this.constructor as typeof TranslationServiceClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { - clientHeader.push(`gl-web/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -136,7 +142,7 @@ export class TranslationServiceClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -144,10 +150,10 @@ export class TranslationServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - glossaryPathTemplate: new gaxModule.PathTemplate( + glossaryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/glossaries/{glossary}' ), - locationPathTemplate: new gaxModule.PathTemplate( + locationPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), }; @@ -156,7 +162,7 @@ export class TranslationServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - listGlossaries: new gaxModule.PageDescriptor( + listGlossaries: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'glossaries' @@ -167,13 +173,15 @@ export class TranslationServiceClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = gaxModule + this.operationsClient = this._gaxModule .lro({ auth: this.auth, - grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); const batchTranslateTextResponse = protoFilesRoot.lookup( @@ -196,17 +204,17 @@ export class TranslationServiceClient { ) as gax.protobuf.Type; this._descriptors.longrunning = { - batchTranslateText: new gaxModule.LongrunningDescriptor( + batchTranslateText: new this._gaxModule.LongrunningDescriptor( this.operationsClient, batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) ), - createGlossary: new gaxModule.LongrunningDescriptor( + createGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGlossaryResponse.decode.bind(createGlossaryResponse), createGlossaryMetadata.decode.bind(createGlossaryMetadata) ), - deleteGlossary: new gaxModule.LongrunningDescriptor( + deleteGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata) @@ -214,7 +222,7 @@ export class TranslationServiceClient { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.translation.v3beta1.TranslationService', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -225,17 +233,36 @@ export class TranslationServiceClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this._innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.translationServiceStub) { + return this.translationServiceStub; + } // Put together the "service stub" for // google.cloud.translation.v3beta1.TranslationService. - this.translationServiceStub = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.translationServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.translation.v3beta1.TranslationService' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.translation.v3beta1.TranslationService, - opts + (this._protos as any).google.cloud.translation.v3beta1 + .TranslationService, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -264,9 +291,9 @@ export class TranslationServiceClient { } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -280,6 +307,8 @@ export class TranslationServiceClient { return apiCall(argument, callOptions, callback); }; } + + return this.translationServiceStub; } /** @@ -473,6 +502,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.translateText(request, options, callback); } detectLanguage( @@ -587,6 +617,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.detectLanguage(request, options, callback); } getSupportedLanguages( @@ -698,6 +729,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.getSupportedLanguages( request, options, @@ -783,6 +815,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getGlossary(request, options, callback); } @@ -926,6 +959,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.batchTranslateText(request, options, callback); } createGlossary( @@ -1015,6 +1049,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createGlossary(request, options, callback); } deleteGlossary( @@ -1103,6 +1138,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.deleteGlossary(request, options, callback); } listGlossaries( @@ -1199,6 +1235,7 @@ export class TranslationServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listGlossaries(request, options, callback); } @@ -1250,6 +1287,7 @@ export class TranslationServiceClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listGlossaries.createStream( this._innerApiCalls.listGlossaries as gax.GaxCall, request, @@ -1354,8 +1392,9 @@ export class TranslationServiceClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.translationServiceStub.then(stub => { + return this.translationServiceStub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 28468f2d616..90b8486d757 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,13 +1,13 @@ { - "updateTime": "2020-02-07T12:42:33.477887Z", + "updateTime": "2020-03-05T23:18:32.065314Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585", - "internalRef": "293710856", - "log": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585\nGenerate the Bazel build file for recommendengine public api\n\nPiperOrigin-RevId: 293710856\n\n68477017c4173c98addac0373950c6aa9d7b375f\nMake `language_code` optional for UpdateIntentRequest and BatchUpdateIntentsRequest.\n\nThe comments and proto annotations describe this parameter as optional.\n\nPiperOrigin-RevId: 293703548\n\n16f823f578bca4e845a19b88bb9bc5870ea71ab2\nAdd BUILD.bazel files for managedidentities API\n\nPiperOrigin-RevId: 293698246\n\n2f53fd8178c9a9de4ad10fae8dd17a7ba36133f2\nAdd v1p1beta1 config file\n\nPiperOrigin-RevId: 293696729\n\n052b274138fce2be80f97b6dcb83ab343c7c8812\nAdd source field for user event and add field behavior annotations\n\nPiperOrigin-RevId: 293693115\n\n1e89732b2d69151b1b3418fff3d4cc0434f0dded\ndatacatalog: v1beta1 add three new RPCs to gapic v1beta1 config\n\nPiperOrigin-RevId: 293692823\n\n9c8bd09bbdc7c4160a44f1fbab279b73cd7a2337\nchange the name of AccessApproval service to AccessApprovalAdmin\n\nPiperOrigin-RevId: 293690934\n\n2e23b8fbc45f5d9e200572ca662fe1271bcd6760\nAdd ListEntryGroups method, add http bindings to support entry group tagging, and update some comments.\n\nPiperOrigin-RevId: 293666452\n\n0275e38a4ca03a13d3f47a9613aac8c8b0d3f1f2\nAdd proto_package field to managedidentities API. It is needed for APIs that still depend on artman generation.\n\nPiperOrigin-RevId: 293643323\n\n4cdfe8278cb6f308106580d70648001c9146e759\nRegenerating public protos for Data Catalog to add new Custom Type Entry feature.\n\nPiperOrigin-RevId: 293614782\n\n45d2a569ab526a1fad3720f95eefb1c7330eaada\nEnable client generation for v1 ManagedIdentities API.\n\nPiperOrigin-RevId: 293515675\n\n2c17086b77e6f3bcf04a1f65758dfb0c3da1568f\nAdd the Actions on Google common types (//google/actions/type/*).\n\nPiperOrigin-RevId: 293478245\n\n781aadb932e64a12fb6ead7cd842698d99588433\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293443396\n\ne2602608c9138c2fca24162720e67f9307c30b95\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293442964\n\nc8aef82028d06b7992278fa9294c18570dc86c3d\nAdd cc_proto_library and cc_grpc_library targets for Bigtable protos.\n\nAlso fix indentation of cc_grpc_library targets in Spanner and IAM protos.\n\nPiperOrigin-RevId: 293440538\n\ne2faab04f4cb7f9755072330866689b1943a16e9\ncloudtasks: v2 replace non-standard retry params in gapic config v2\n\nPiperOrigin-RevId: 293424055\n\ndfb4097ea628a8470292c6590a4313aee0c675bd\nerrorreporting: v1beta1 add legacy artman config for php\n\nPiperOrigin-RevId: 293423790\n\nb18aed55b45bfe5b62476292c72759e6c3e573c6\nasset: v1p1beta1 updated comment for `page_size` limit.\n\nPiperOrigin-RevId: 293421386\n\nc9ef36b7956d9859a2fc86ad35fcaa16958ab44f\nbazel: Refactor CI build scripts\n\nPiperOrigin-RevId: 293387911\n\na8ed9d921fdddc61d8467bfd7c1668f0ad90435c\nfix: set Ruby module name for OrgPolicy\n\nPiperOrigin-RevId: 293257997\n\n6c7d28509bd8315de8af0889688ee20099594269\nredis: v1beta1 add UpgradeInstance and connect_mode field to Instance\n\nPiperOrigin-RevId: 293242878\n\nae0abed4fcb4c21f5cb67a82349a049524c4ef68\nredis: v1 add connect_mode field to Instance\n\nPiperOrigin-RevId: 293241914\n\n3f7a0d29b28ee9365771da2b66edf7fa2b4e9c56\nAdds service config definition for bigqueryreservation v1beta1\n\nPiperOrigin-RevId: 293234418\n\n0c88168d5ed6fe353a8cf8cbdc6bf084f6bb66a5\naddition of BUILD & configuration for accessapproval v1\n\nPiperOrigin-RevId: 293219198\n\n39bedc2e30f4778ce81193f6ba1fec56107bcfc4\naccessapproval: v1 publish protos\n\nPiperOrigin-RevId: 293167048\n\n69d9945330a5721cd679f17331a78850e2618226\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080182\n\nf6a1a6b417f39694275ca286110bc3c1ca4db0dc\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080178\n\n29d40b78e3dc1579b0b209463fbcb76e5767f72a\nExpose managedidentities/v1beta1/ API for client library usage.\n\nPiperOrigin-RevId: 292979741\n\na22129a1fb6e18056d576dfb7717aef74b63734a\nExpose managedidentities/v1/ API for client library usage.\n\nPiperOrigin-RevId: 292968186\n\nb5cbe4a4ba64ab19e6627573ff52057a1657773d\nSecurityCenter v1p1beta1: move file-level option on top to workaround protobuf.js bug.\n\nPiperOrigin-RevId: 292647187\n\nb224b317bf20c6a4fbc5030b4a969c3147f27ad3\nAdds API definitions for bigqueryreservation v1beta1.\n\nPiperOrigin-RevId: 292634722\n\nc1468702f9b17e20dd59007c0804a089b83197d2\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 292626173\n\nffdfa4f55ab2f0afc11d0eb68f125ccbd5e404bd\nvision: v1p3beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292605599\n\n78f61482cd028fc1d9892aa5d89d768666a954cd\nvision: v1p1beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292605125\n\n60bb5a294a604fd1778c7ec87b265d13a7106171\nvision: v1p2beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292604980\n\n3bcf7aa79d45eb9ec29ab9036e9359ea325a7fc3\nvision: v1p4beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292604656\n\n2717b8a1c762b26911b45ecc2e4ee01d98401b28\nFix dataproc artman client library generation.\n\nPiperOrigin-RevId: 292555664\n\n7ac66d9be8a7d7de4f13566d8663978c9ee9dcd7\nAdd Dataproc Autoscaling API to V1.\n\nPiperOrigin-RevId: 292450564\n\n5d932b2c1be3a6ef487d094e3cf5c0673d0241dd\n- Improve documentation\n- Add a client_id field to StreamingPullRequest\n\nPiperOrigin-RevId: 292434036\n\neaff9fa8edec3e914995ce832b087039c5417ea7\nmonitoring: v3 publish annotations and client retry config\n\nPiperOrigin-RevId: 292425288\n\n70958bab8c5353870d31a23fb2c40305b050d3fe\nBigQuery Storage Read API v1 clients.\n\nPiperOrigin-RevId: 292407644\n\n7a15e7fe78ff4b6d5c9606a3264559e5bde341d1\nUpdate backend proto for Google Cloud Endpoints\n\nPiperOrigin-RevId: 292391607\n\n3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\ncf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n" + "sha": "f0b581b5bdf803e45201ecdb3688b60e381628a8", + "internalRef": "299181282", + "log": "f0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\ne7d8a694f4559201e6913f6610069cb08b39274e\nDepend on the latest gapic-generator and resource names plugin.\n\nThis fixes the very old an very annoying bug: https://github.com/googleapis/gapic-generator/pull/3087\n\nPiperOrigin-RevId: 293903652\n\n806b2854a966d55374ee26bb0cef4e30eda17b58\nfix: correct capitalization of Ruby namespaces in SecurityCenter V1p1beta1\n\nPiperOrigin-RevId: 293903613\n\n1b83c92462b14d67a7644e2980f723112472e03a\nPublish annotations and grpc service config for Logging API.\n\nPiperOrigin-RevId: 293893514\n\n" } }, { diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts index cec097ab3a5..52bf06f8d4e 100644 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts @@ -104,12 +104,30 @@ describe('v3.TranslationServiceClient', () => { }); assert(client); }); + it('has initialize method and supports deferred initialization', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.translationServiceStub, undefined); + await client.initialize(); + assert(client.translationServiceStub); + }); + it('has close method', () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); describe('translateText', () => { it('invokes translateText without error', done => { const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest = {}; request.parent = ''; @@ -133,6 +151,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest = {}; request.parent = ''; @@ -158,6 +178,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest = {}; request.parent = ''; @@ -181,6 +203,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest = {}; request.parent = ''; @@ -206,6 +230,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest = {}; request.parent = ''; @@ -229,6 +255,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest = {}; request.parent = ''; @@ -254,6 +282,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest = {}; request.name = ''; @@ -277,6 +307,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest = {}; request.name = ''; @@ -302,6 +334,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest = {}; request.parent = ''; @@ -332,6 +366,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest = {}; request.parent = ''; @@ -365,6 +401,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest = {}; request.parent = ''; @@ -395,6 +433,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest = {}; request.parent = ''; @@ -428,6 +468,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest = {}; request.name = ''; @@ -458,6 +500,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest = {}; request.name = ''; @@ -491,6 +535,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest = {}; request.parent = ''; @@ -518,6 +564,8 @@ describe('v3.TranslationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest = {}; request.parent = ''; diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts index b1beee2a4b9..d939dc5a979 100644 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts @@ -106,6 +106,26 @@ describe('v3beta1.TranslationServiceClient', () => { ); assert(client); }); + it('has initialize method and supports deferred initialization', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.translationServiceStub, undefined); + await client.initialize(); + assert(client.translationServiceStub); + }); + it('has close method', () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); describe('translateText', () => { it('invokes translateText without error', done => { const client = new translationserviceModule.v3beta1.TranslationServiceClient( @@ -114,6 +134,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest = {}; request.parent = ''; @@ -139,6 +161,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest = {}; request.parent = ''; @@ -166,6 +190,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest = {}; request.parent = ''; @@ -191,6 +217,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest = {}; request.parent = ''; @@ -218,6 +246,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest = {}; request.parent = ''; @@ -243,6 +273,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest = {}; request.parent = ''; @@ -270,6 +302,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest = {}; request.name = ''; @@ -295,6 +329,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest = {}; request.name = ''; @@ -322,6 +358,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest = {}; request.parent = ''; @@ -354,6 +392,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest = {}; request.parent = ''; @@ -389,6 +429,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest = {}; request.parent = ''; @@ -421,6 +463,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest = {}; request.parent = ''; @@ -456,6 +500,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest = {}; request.name = ''; @@ -488,6 +534,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest = {}; request.name = ''; @@ -523,6 +571,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest = {}; request.parent = ''; @@ -552,6 +602,8 @@ describe('v3beta1.TranslationServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest = {}; request.parent = ''; From fe77ecc6548450f0fcd6459d0c93dd6eec5312f1 Mon Sep 17 00:00:00 2001 From: "gcf-merge-on-green[bot]" <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2020 01:26:28 +0000 Subject: [PATCH 338/513] build: update linkinator config (#462) --- packages/google-cloud-translate/linkinator.config.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/linkinator.config.json b/packages/google-cloud-translate/linkinator.config.json index b555215ca02..29a223b6db6 100644 --- a/packages/google-cloud-translate/linkinator.config.json +++ b/packages/google-cloud-translate/linkinator.config.json @@ -4,5 +4,7 @@ "https://codecov.io/gh/googleapis/", "www.googleapis.com", "img.shields.io" - ] + ], + "silent": true, + "concurrency": 10 } From 63afb802cfecb1b3684ccb01b54c1d58140e9dea Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 6 Mar 2020 15:06:09 -0800 Subject: [PATCH 339/513] build(tests): fix coveralls and enable build cop (#463) --- packages/google-cloud-translate/.mocharc.js | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/google-cloud-translate/.mocharc.js diff --git a/packages/google-cloud-translate/.mocharc.js b/packages/google-cloud-translate/.mocharc.js new file mode 100644 index 00000000000..ff7b34fa5d1 --- /dev/null +++ b/packages/google-cloud-translate/.mocharc.js @@ -0,0 +1,28 @@ +// Copyright 2020 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config From 10e79b7a449f3fa7e1a33a13c99569ccc27bd86d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2020 16:23:20 -0700 Subject: [PATCH 340/513] chore: release 5.3.0 (#461) --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 4436299ccfa..fde6c8476a6 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [5.3.0](https://www.github.com/googleapis/nodejs-translate/compare/v5.2.0...v5.3.0) (2020-03-06) + + +### Features + +* deferred client initialization ([#460](https://www.github.com/googleapis/nodejs-translate/issues/460)) ([0ed76f4](https://www.github.com/googleapis/nodejs-translate/commit/0ed76f4e83528c2d087a26598535f5daf5a08444)) + ## [5.2.0](https://www.github.com/googleapis/nodejs-translate/compare/v5.1.6...v5.2.0) (2020-02-27) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7786f39f19b..49641514752 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "5.2.0", + "version": "5.3.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 84bd71c54a9..35251e379c3 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^1.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^5.2.0", + "@google-cloud/translate": "^5.3.0", "@google-cloud/vision": "^1.2.0", "yargs": "^15.0.0" }, From 742e0d219cc2372f5bc872718f436e99a4f82a48 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 18 Mar 2020 13:10:24 -0700 Subject: [PATCH 341/513] docs: mention templates in contributing section of README (#465) --- packages/google-cloud-translate/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index b1b6940e2ba..706c53b9c97 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -129,6 +129,12 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-translate/blob/master/CONTRIBUTING.md). +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its template in this +[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). + ## License Apache Version 2.0 From 34fd214dd9b077d1d50a4e52ede3fa33b068451e Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 19 Mar 2020 07:24:04 -0700 Subject: [PATCH 342/513] refactor: drop dependency on is (#468) --- packages/google-cloud-translate/package.json | 2 -- packages/google-cloud-translate/src/index.ts | 28 +++++++++---------- .../google-cloud-translate/src/v2/index.ts | 11 ++++---- .../system-test/translate.ts | 28 +++++++++---------- packages/google-cloud-translate/test/index.ts | 28 +++++++++---------- 5 files changed, 44 insertions(+), 53 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 49641514752..b3d7baa8d82 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -49,13 +49,11 @@ "arrify": "^2.0.0", "extend": "^3.0.2", "google-gax": "^1.11.1", - "is": "^3.2.1", "is-html": "^2.0.0", "protobufjs": "^6.8.8" }, "devDependencies": { "@types/extend": "^3.0.0", - "@types/is": "0.0.21", "@types/mocha": "^7.0.0", "@types/node": "^10.5.7", "@types/proxyquire": "^1.3.28", diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 6bff158bc83..807b96497d1 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -1,18 +1,16 @@ -/*! - * Copyright 2015 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2015 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 +// +// https://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. import * as v2 from './v2'; diff --git a/packages/google-cloud-translate/src/v2/index.ts b/packages/google-cloud-translate/src/v2/index.ts index 35ecf7dc8d9..4b6a2e92d2e 100644 --- a/packages/google-cloud-translate/src/v2/index.ts +++ b/packages/google-cloud-translate/src/v2/index.ts @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2017 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 +// https://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, @@ -17,7 +17,6 @@ import {promisifyAll} from '@google-cloud/promisify'; import arrify = require('arrify'); import * as extend from 'extend'; import {GoogleAuthOptions} from 'google-auth-library'; -import * as is from 'is'; const isHtml = require('is-html'); import { @@ -331,7 +330,7 @@ export class Translate extends Service { callback?: GetLanguagesCallback ): void | Promise<[LanguageResult[], Metadata]> { let target: string; - if (is.fn(targetOrCallback)) { + if (typeof targetOrCallback === 'function') { callback = targetOrCallback as GetLanguagesCallback; target = 'en'; } else { @@ -344,7 +343,7 @@ export class Translate extends Service { qs: {}, } as DecorateRequestOptions; - if (target && is.string(target)) { + if (target && typeof target === 'string') { reqOpts.qs.target = target; } @@ -516,7 +515,7 @@ export class Translate extends Service { format: options.format || (isHtml(input[0]) ? 'html' : 'text'), }; - if (is.string(options)) { + if (typeof options === 'string') { body.target = options; } else { if (options.from) { diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index d68223cf9a0..fbff71198f3 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -1,18 +1,16 @@ -/*! - * Copyright 2015 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2015 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 +// +// https://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. import * as assert from 'assert'; import {describe, it} from 'mocha'; diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index 7344065222c..964ba950770 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -1,18 +1,16 @@ -/*! - * Copyright 2015 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2015 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 +// +// https://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. import {DecorateRequestOptions, util} from '@google-cloud/common'; import { From 404b032e57fbc54f88d511fdfa63f3db5e359ad4 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 19 Mar 2020 09:30:08 -0700 Subject: [PATCH 343/513] chore: remove snippet leading whitespace (#467) --- packages/google-cloud-translate/README.md | 38 +++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 706c53b9c97..f3d35a73912 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -60,31 +60,31 @@ npm install @google-cloud/translate ### Using the client library ```javascript - /** - * TODO(developer): Uncomment the following line before running the sample. - */ - // const projectId = 'YOUR_PROJECT_ID'; +/** + * TODO(developer): Uncomment the following line before running the sample. + */ +// const projectId = 'YOUR_PROJECT_ID'; - // Imports the Google Cloud client library - const {Translate} = require('@google-cloud/translate').v2; +// Imports the Google Cloud client library +const {Translate} = require('@google-cloud/translate').v2; - // Instantiates a client - const translate = new Translate({projectId}); +// Instantiates a client +const translate = new Translate({projectId}); - async function quickStart() { - // The text to translate - const text = 'Hello, world!'; +async function quickStart() { + // The text to translate + const text = 'Hello, world!'; - // The target language - const target = 'ru'; + // The target language + const target = 'ru'; - // Translates some text into Russian - const [translation] = await translate.translate(text, target); - console.log(`Text: ${text}`); - console.log(`Translation: ${translation}`); - } + // Translates some text into Russian + const [translation] = await translate.translate(text, target); + console.log(`Text: ${text}`); + console.log(`Translation: ${translation}`); +} - quickStart(); +quickStart(); ``` From d6159763c260a8216218bba41ed6520252a3b5de Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 23 Mar 2020 18:38:21 -0700 Subject: [PATCH 344/513] docs: document version support goals (#475) --- packages/google-cloud-translate/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index f3d35a73912..4de340ad61a 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -106,6 +106,27 @@ has instructions for running the samples. The [Cloud Translation Node.js Client API Reference][client-docs] documentation also contains samples. +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. + +Client libraries targetting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag for versions + compatible with Node.js 8. + ## Versioning This library follows [Semantic Versioning](http://semver.org/). From b5280f1a9158661c1926af322a71b1a8246ecb84 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Mar 2020 01:13:27 -0700 Subject: [PATCH 345/513] chore: regenerate the code (#474) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2020-03-22 04:52:15,288 synthtool > Executing /tmpfs/src/git/autosynth/working_repo/synth.py. 2020-03-22 04:52:15,343 synthtool > Ensuring dependencies. 2020-03-22 04:52:15,348 synthtool > Cloning googleapis. 2020-03-22 04:52:16,009 synthtool > Pulling Docker image: gapic-generator-typescript:latest latest: Pulling from gapic-images/gapic-generator-typescript Digest: sha256:3762b8bcba247ef4d020ffc7043e2881a20b5fab0ffd98d542f365d3f3a3829d Status: Image is up to date for gcr.io/gapic-images/gapic-generator-typescript:latest 2020-03-22 04:52:16,894 synthtool > Generating code for: google/cloud/translate/v3beta1. 2020-03-22 04:52:18,125 synthtool > Generated code into /tmpfs/tmp/tmpvj0idm32. 2020-03-22 04:52:18,136 synthtool > Pulling Docker image: gapic-generator-typescript:latest latest: Pulling from gapic-images/gapic-generator-typescript Digest: sha256:3762b8bcba247ef4d020ffc7043e2881a20b5fab0ffd98d542f365d3f3a3829d Status: Image is up to date for gcr.io/gapic-images/gapic-generator-typescript:latest 2020-03-22 04:52:19,051 synthtool > Generating code for: google/cloud/translate/v3. 2020-03-22 04:52:20,197 synthtool > Generated code into /tmpfs/tmp/tmp51f2rpv0. .eslintignore .eslintrc.yml .github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/feature_request.md .github/ISSUE_TEMPLATE/support_request.md .github/PULL_REQUEST_TEMPLATE.md .github/publish.yml .github/release-please.yml .github/workflows/ci.yaml .kokoro/common.cfg .kokoro/continuous/node10/common.cfg .kokoro/continuous/node10/docs.cfg .kokoro/continuous/node10/lint.cfg .kokoro/continuous/node10/samples-test.cfg .kokoro/continuous/node10/system-test.cfg .kokoro/continuous/node10/test.cfg .kokoro/continuous/node12/common.cfg .kokoro/continuous/node12/test.cfg .kokoro/continuous/node8/common.cfg .kokoro/continuous/node8/test.cfg .kokoro/docs.sh .kokoro/lint.sh .kokoro/presubmit/node10/common.cfg .kokoro/presubmit/node10/docs.cfg .kokoro/presubmit/node10/lint.cfg .kokoro/presubmit/node10/samples-test.cfg .kokoro/presubmit/node10/system-test.cfg .kokoro/presubmit/node10/test.cfg .kokoro/presubmit/node12/common.cfg .kokoro/presubmit/node12/test.cfg .kokoro/presubmit/node8/common.cfg .kokoro/presubmit/node8/test.cfg .kokoro/presubmit/windows/common.cfg .kokoro/presubmit/windows/test.cfg .kokoro/publish.sh .kokoro/release/docs.cfg .kokoro/release/docs.sh .kokoro/release/publish.cfg .kokoro/samples-test.sh .kokoro/system-test.sh .kokoro/test.bat .kokoro/test.sh .kokoro/trampoline.sh .mocharc.js .nycrc .prettierignore .prettierrc CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE README.md codecov.yaml renovate.json samples/README.md npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > protobufjs@6.8.9 postinstall /tmpfs/src/git/autosynth/working_repo/node_modules/protobufjs > node scripts/postinstall > @google-cloud/translate@5.3.0 prepare /tmpfs/src/git/autosynth/working_repo > npm run compile npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > @google-cloud/translate@5.3.0 compile /tmpfs/src/git/autosynth/working_repo > tsc -p . && cp -r protos build/ npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.1 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) added 634 packages from 356 contributors and audited 1668 packages in 17.864s found 0 vulnerabilities npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > @google-cloud/translate@5.3.0 fix /tmpfs/src/git/autosynth/working_repo > gts fix && eslint --fix '**/*.js' /tmpfs/src/git/autosynth/working_repo/samples/automl/automlTranslationDataset.js 27:26 error "@google-cloud/automl" is not found node/no-missing-require 76:26 error "@google-cloud/automl" is not found node/no-missing-require 122:26 error "@google-cloud/automl" is not found node/no-missing-require 159:26 error "@google-cloud/automl" is not found node/no-missing-require 199:26 error "@google-cloud/automl" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/automl/automlTranslationModel.js 27:26 error "@google-cloud/automl" is not found node/no-missing-require 82:26 error "@google-cloud/automl" is not found node/no-missing-require 124:26 error "@google-cloud/automl" is not found node/no-missing-require 187:26 error "@google-cloud/automl" is not found node/no-missing-require 222:26 error "@google-cloud/automl" is not found node/no-missing-require 252:26 error "@google-cloud/automl" is not found node/no-missing-require 277:26 error "@google-cloud/automl" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/automl/automlTranslationPredict.js 33:26 error "@google-cloud/automl" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/hybridGlossaries.js 27:32 error "@google-cloud/text-to-speech" is not found node/no-missing-require 28:29 error "@google-cloud/translate" is not found node/no-missing-require 29:26 error "@google-cloud/vision" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/quickstart.js 27:31 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/automlTranslation.test.js 17:26 error "chai" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/hybridGlossaries.test.js 18:26 error "chai" is not found node/no-missing-require 20:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/quickstart.test.js 17:26 error "chai" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/translate.test.js 17:26 error "chai" is not found node/no-missing-require 19:29 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_batch_translate_text.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require 20:27 error "@google-cloud/storage" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_batch_translate_text_with_glossary.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require 20:27 error "@google-cloud/storage" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require 20:27 error "@google-cloud/storage" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_batch_translate_text_with_model.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require 20:27 error "@google-cloud/storage" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_create_glossary.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_delete_glossary.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_detect_language.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_get_glossary.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_get_supported_languages.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_get_supported_languages_for_targets.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_list_codes.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_list_glossary.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_list_language_names.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_translate_text.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_translate_text_with_glossary.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_translate_text_with_glossary_and_model.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3/translate_translate_text_with_model.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3beta1/translate_batch_translate_text_beta.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require 20:27 error "@google-cloud/storage" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3beta1/translate_create_glossary_beta.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3beta1/translate_delete_glossary_beta.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3beta1/translate_detect_language_beta.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3beta1/translate_get_glossary_beta.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3beta1/translate_list_codes_beta.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3beta1/translate_list_glossary_beta.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3beta1/translate_list_language_names_beta.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3beta1/translate_translate_text_beta.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3beta1/translate_translate_text_with_glossary_beta.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/v3beta1/translate_translate_text_with_model_beta.test.js 17:26 error "chai" is not found node/no-missing-require 19:44 error "@google-cloud/translate" is not found node/no-missing-require 28:35 warning Unexpected 'todo' comment no-warning-comments /tmpfs/src/git/autosynth/working_repo/samples/translate.js 20:31 error "@google-cloud/translate" is not found node/no-missing-require 49:31 error "@google-cloud/translate" is not found node/no-missing-require 69:31 error "@google-cloud/translate" is not found node/no-missing-require 94:31 error "@google-cloud/translate" is not found node/no-missing-require 124:31 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_batch_translate_text.js 33:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_batch_translate_text_with_glossary.js 35:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_batch_translate_text_with_glossary_and_model.js 37:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_batch_translate_text_with_model.js 35:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_create_glossary.js 31:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_delete_glossary.js 31:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_detect_language.js 31:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_get_glossary.js 31:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_get_supported_languages.js 26:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_get_supported_languages_for_target.js 26:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_list_codes.js 26:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_list_glossary.js 26:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_list_language_names.js 26:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_translate_text.js 31:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_translate_text_with_glossary.js 33:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_translate_text_with_glossary_and_model.js 35:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3/translate_translate_text_with_model.js 33:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3beta1/translate_batch_translate_text_beta.js 32:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3beta1/translate_create_glossary_beta.js 30:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3beta1/translate_delete_glossary_beta.js 30:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3beta1/translate_detect_language_beta.js 30:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3beta1/translate_get_glossary_beta.js 30:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3beta1/translate_list_codes_beta.js 26:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3beta1/translate_list_glossary_beta.js 26:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3beta1/translate_list_language_names_beta.js 26:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3beta1/translate_translate_text_beta.js 31:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3beta1/translate_translate_text_with_glossary_beta.js 31:46 error "@google-cloud/translate" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/v3beta1/translate_translate_text_with_model_beta.js 31:46 error "@google-cloud/translate" is not found node/no-missing-require 32:26 error "@google-cloud/automl" is not found node/no-missing-require ✖ 119 problems (118 errors, 1 warning) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @google-cloud/translate@5.3.0 fix: `gts fix && eslint --fix '**/*.js'` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @google-cloud/translate@5.3.0 fix script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/kbuilder/.npm/_logs/2020-03-22T11_52_53_818Z-debug.log installing semver@^5.5.0 installing uglify-js@^3.3.25 installing espree@^3.5.4 installing escodegen@^1.9.1 2020-03-22 04:53:00,106 synthtool > Wrote metadata to synth.metadata. ```
--- packages/google-cloud-translate/.jsdoc.js | 2 +- packages/google-cloud-translate/src/v3/index.ts | 2 +- .../src/v3/translation_service_client.ts | 12 +++++++++--- .../google-cloud-translate/src/v3beta1/index.ts | 2 +- .../src/v3beta1/translation_service_client.ts | 12 +++++++++--- packages/google-cloud-translate/synth.metadata | 16 ++++++++-------- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 2 +- .../test/gapic-translation_service-v3.ts | 2 +- .../test/gapic-translation_service-v3beta1.ts | 2 +- .../google-cloud-translate/webpack.config.js | 2 +- 12 files changed, 35 insertions(+), 23 deletions(-) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index 60061058cfa..907b80b0b1e 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/src/v3/index.ts b/packages/google-cloud-translate/src/v3/index.ts index 07f3c18ec18..698e0dbadfc 100644 --- a/packages/google-cloud-translate/src/v3/index.ts +++ b/packages/google-cloud-translate/src/v3/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index d0868ab5422..052a5fa3111 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -41,7 +41,12 @@ const version = require('../../../package.json').version; * @memberof v3 */ export class TranslationServiceClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; @@ -283,7 +288,8 @@ export class TranslationServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; diff --git a/packages/google-cloud-translate/src/v3beta1/index.ts b/packages/google-cloud-translate/src/v3beta1/index.ts index 07f3c18ec18..698e0dbadfc 100644 --- a/packages/google-cloud-translate/src/v3beta1/index.ts +++ b/packages/google-cloud-translate/src/v3beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 6cc33980c57..aa932dc0cfc 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -41,7 +41,12 @@ const version = require('../../../package.json').version; * @memberof v3beta1 */ export class TranslationServiceClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; @@ -284,7 +289,8 @@ export class TranslationServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 90b8486d757..d52836d472b 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,20 +1,20 @@ { - "updateTime": "2020-03-05T23:18:32.065314Z", + "updateTime": "2020-03-22T11:53:00.105404Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f0b581b5bdf803e45201ecdb3688b60e381628a8", - "internalRef": "299181282", - "log": "f0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\ne7d8a694f4559201e6913f6610069cb08b39274e\nDepend on the latest gapic-generator and resource names plugin.\n\nThis fixes the very old an very annoying bug: https://github.com/googleapis/gapic-generator/pull/3087\n\nPiperOrigin-RevId: 293903652\n\n806b2854a966d55374ee26bb0cef4e30eda17b58\nfix: correct capitalization of Ruby namespaces in SecurityCenter V1p1beta1\n\nPiperOrigin-RevId: 293903613\n\n1b83c92462b14d67a7644e2980f723112472e03a\nPublish annotations and grpc service config for Logging API.\n\nPiperOrigin-RevId: 293893514\n\n" + "sha": "0be7105dc52590fa9a24e784052298ae37ce53aa", + "internalRef": "302154871", + "log": "0be7105dc52590fa9a24e784052298ae37ce53aa\nAdd BUILD.bazel file to asset/v1p1beta1\n\nPiperOrigin-RevId: 302154871\n\n6c248fd13e8543f8d22cbf118d978301a9fbe2a8\nAdd missing resource annotations and additional_bindings to dialogflow v2 API.\n\nPiperOrigin-RevId: 302063117\n\n9a3a7f33be9eeacf7b3e98435816b7022d206bd7\nChange the service name from \"chromeos-moblab.googleapis.com\" to \"chromeosmoblab.googleapis.com\"\n\nPiperOrigin-RevId: 302060989\n\n98a339237577e3de26cb4921f75fb5c57cc7a19f\nfeat: devtools/build/v1 publish client library config annotations\n\n* add details field to some of the BuildEvents\n* add final_invocation_id and build_tool_exit_code fields to BuildStatus\n\nPiperOrigin-RevId: 302044087\n\ncfabc98c6bbbb22d1aeaf7612179c0be193b3a13\nfeat: home/graph/v1 publish client library config annotations & comment updates\n\nThis change includes adding the client library configuration annotations, updated proto comments, and some client library configuration files.\n\nPiperOrigin-RevId: 302042647\n\nc8c8c0bd15d082db9546253dbaad1087c7a9782c\nchore: use latest gapic-generator in bazel WORKSPACE.\nincluding the following commits from gapic-generator:\n- feat: take source protos in all sub-packages (#3144)\n\nPiperOrigin-RevId: 301843591\n\ne4daf5202ea31cb2cb6916fdbfa9d6bd771aeb4c\nAdd bazel file for v1 client lib generation\n\nPiperOrigin-RevId: 301802926\n\n275fbcce2c900278d487c33293a3c7e1fbcd3a34\nfeat: pubsub/v1 add an experimental filter field to Subscription\n\nPiperOrigin-RevId: 301661567\n\nf2b18cec51d27c999ad30011dba17f3965677e9c\nFix: UpdateBackupRequest.backup is a resource, not a resource reference - remove annotation.\n\nPiperOrigin-RevId: 301636171\n\n800384063ac93a0cac3a510d41726fa4b2cd4a83\nCloud Billing Budget API v1beta1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301634389\n\n0cc6c146b660db21f04056c3d58a4b752ee445e3\nCloud Billing Budget API v1alpha1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301630018\n\nff2ea00f69065585c3ac0993c8b582af3b6fc215\nFix: Add resource definition for a parent of InspectTemplate which was otherwise missing.\n\nPiperOrigin-RevId: 301623052\n\n55fa441c9daf03173910760191646399338f2b7c\nAdd proto definition for AccessLevel, AccessPolicy, and ServicePerimeter.\n\nPiperOrigin-RevId: 301620844\n\ne7b10591c5408a67cf14ffafa267556f3290e262\nCloud Bigtable Managed Backup service and message proto files.\n\nPiperOrigin-RevId: 301585144\n\nd8e226f702f8ddf92915128c9f4693b63fb8685d\nfeat: Add time-to-live in a queue for builds\n\nPiperOrigin-RevId: 301579876\n\n430375af011f8c7a5174884f0d0e539c6ffa7675\ndocs: add missing closing backtick\n\nPiperOrigin-RevId: 301538851\n\n0e9f1f60ded9ad1c2e725e37719112f5b487ab65\nbazel: Use latest release of gax_java\n\nPiperOrigin-RevId: 301480457\n\n5058c1c96d0ece7f5301a154cf5a07b2ad03a571\nUpdate GAPIC v2 with batching parameters for Logging API\n\nPiperOrigin-RevId: 301443847\n\n64ab9744073de81fec1b3a6a931befc8a90edf90\nFix: Introduce location-based organization/folder/billing-account resources\nChore: Update copyright years\n\nPiperOrigin-RevId: 301373760\n\n23d5f09e670ebb0c1b36214acf78704e2ecfc2ac\nUpdate field_behavior annotations in V1 and V2.\n\nPiperOrigin-RevId: 301337970\n\nb2cf37e7fd62383a811aa4d54d013ecae638851d\nData Catalog V1 API\n\nPiperOrigin-RevId: 301282503\n\n1976b9981e2900c8172b7d34b4220bdb18c5db42\nCloud DLP api update. Adds missing fields to Finding and adds support for hybrid jobs.\n\nPiperOrigin-RevId: 301205325\n\nae78682c05e864d71223ce22532219813b0245ac\nfix: several sample code blocks in comments are now properly indented for markdown\n\nPiperOrigin-RevId: 301185150\n\ndcd171d04bda5b67db13049320f97eca3ace3731\nPublish Media Translation API V1Beta1\n\nPiperOrigin-RevId: 301180096\n\nff1713453b0fbc5a7544a1ef6828c26ad21a370e\nAdd protos and BUILD rules for v1 API.\n\nPiperOrigin-RevId: 301179394\n\n8386761d09819b665b6a6e1e6d6ff884bc8ff781\nfeat: chromeos/modlab publish protos and config for Chrome OS Moblab API.\n\nPiperOrigin-RevId: 300843960\n\nb2e2bc62fab90e6829e62d3d189906d9b79899e4\nUpdates to GCS gRPC API spec:\n\n1. Changed GetIamPolicy and TestBucketIamPermissions to use wrapper messages around google.iam.v1 IAM requests messages, and added CommonRequestParams. This lets us support RequesterPays buckets.\n2. Added a metadata field to GetObjectMediaResponse, to support resuming an object media read safely (by extracting the generation of the object being read, and using it in the resumed read request).\n\nPiperOrigin-RevId: 300817706\n\n7fd916ce12335cc9e784bb9452a8602d00b2516c\nAdd deprecated_collections field for backward-compatiblity in PHP and monolith-generated Python and Ruby clients.\n\nGenerate TopicName class in Java which covers the functionality of both ProjectTopicName and DeletedTopicName. Introduce breaking changes to be fixed by synth.py.\n\nDelete default retry parameters.\n\nRetry codes defs can be deleted once # https://github.com/googleapis/gapic-generator/issues/3137 is fixed.\n\nPiperOrigin-RevId: 300813135\n\n047d3a8ac7f75383855df0166144f891d7af08d9\nfix!: google/rpc refactor ErrorInfo.type to ErrorInfo.reason and comment updates.\n\nPiperOrigin-RevId: 300773211\n\nfae4bb6d5aac52aabe5f0bb4396466c2304ea6f6\nAdding RetryPolicy to pubsub.proto\n\nPiperOrigin-RevId: 300769420\n\n7d569be2928dbd72b4e261bf9e468f23afd2b950\nAdding additional protocol buffer annotations to v3.\n\nPiperOrigin-RevId: 300718800\n\n13942d1a85a337515040a03c5108993087dc0e4f\nAdd logging protos for Recommender v1.\n\nPiperOrigin-RevId: 300689896\n\na1a573c3eecfe2c404892bfa61a32dd0c9fb22b6\nfix: change go package to use cloud.google.com/go/maps\n\nPiperOrigin-RevId: 300661825\n\nc6fbac11afa0c7ab2972d9df181493875c566f77\nfeat: publish documentai/v1beta2 protos\n\nPiperOrigin-RevId: 300656808\n\n5202a9e0d9903f49e900f20fe5c7f4e42dd6588f\nProtos for v1beta1 release of Cloud Security Center Settings API\n\nPiperOrigin-RevId: 300580858\n\n83518e18655d9d4ac044acbda063cc6ecdb63ef8\nAdds gapic.yaml file and BUILD.bazel file.\n\nPiperOrigin-RevId: 300554200\n\n836c196dc8ef8354bbfb5f30696bd3477e8db5e2\nRegenerate recommender v1beta1 gRPC ServiceConfig file for Insights methods.\n\nPiperOrigin-RevId: 300549302\n\n34a5450c591b6be3d6566f25ac31caa5211b2f3f\nIncreases the default timeout from 20s to 30s for MetricService\n\nPiperOrigin-RevId: 300474272\n\n5d8bffe87cd01ba390c32f1714230e5a95d5991d\nfeat: use the latest gapic-generator in WORKSPACE for bazel build.\n\nPiperOrigin-RevId: 300461878\n\nd631c651e3bcfac5d371e8560c27648f7b3e2364\nUpdated the GAPIC configs to include parameters for Backups APIs.\n\nPiperOrigin-RevId: 300443402\n\n678afc7055c1adea9b7b54519f3bdb228013f918\nAdding Game Servers v1beta API.\n\nPiperOrigin-RevId: 300433218\n\n80d2bd2c652a5e213302041b0620aff423132589\nEnable proto annotation and gapic v2 for talent API.\n\nPiperOrigin-RevId: 300393997\n\n85e454be7a353f7fe1bf2b0affb753305785b872\ndocs(google/maps/roads): remove mention of nonexported api\n\nPiperOrigin-RevId: 300367734\n\nbf839ae632e0f263a729569e44be4b38b1c85f9c\nAdding protocol buffer annotations and updated config info for v1 and v2.\n\nPiperOrigin-RevId: 300276913\n\n309b899ca18a4c604bce63882a161d44854da549\nPublish `Backup` APIs and protos.\n\nPiperOrigin-RevId: 300246038\n\neced64c3f122421350b4aca68a28e89121d20db8\nadd PHP client libraries\n\nPiperOrigin-RevId: 300193634\n\n7727af0e39df1ae9ad715895c8576d7b65cf6c6d\nfeat: use the latest gapic-generator and protoc-java-resource-name-plugin in googleapis/WORKSPACE.\n\nPiperOrigin-RevId: 300188410\n\n2a25aa351dd5b5fe14895266aff5824d90ce757b\nBreaking change: remove the ProjectOrTenant resource and its references.\n\nPiperOrigin-RevId: 300182152\n\na499dbb28546379415f51803505cfb6123477e71\nUpdate web risk v1 gapic config and BUILD file.\n\nPiperOrigin-RevId: 300152177\n\n52701da10fec2a5f9796e8d12518c0fe574488fe\nFix: apply appropriate namespace/package options for C#, PHP and Ruby.\n\nPiperOrigin-RevId: 300123508\n\n365c029b8cdb63f7751b92ab490f1976e616105c\nAdd CC targets to the kms protos.\n\nThese are needed by go/tink.\n\nPiperOrigin-RevId: 300038469\n\n4ba9aa8a4a1413b88dca5a8fa931824ee9c284e6\nExpose logo recognition API proto for GA.\n\nPiperOrigin-RevId: 299971671\n\n1c9fc2c9e03dadf15f16b1c4f570955bdcebe00e\nAdding ruby_package option to accessapproval.proto for the Ruby client libraries generation.\n\nPiperOrigin-RevId: 299955924\n\n1cc6f0a7bfb147e6f2ede911d9b01e7a9923b719\nbuild(google/maps/routes): generate api clients\n\nPiperOrigin-RevId: 299955905\n\n29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n91e1fb5ef9829c0c7a64bfa5bde330e6ed594378\nchore: update protobuf (protoc) version to 3.11.2\n\nPiperOrigin-RevId: 299404145\n\n30e36b4bee6749c4799f4fc1a51cc8f058ba167d\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 299399890\n\nffbb493674099f265693872ae250711b2238090c\nfeat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields.\n\nPiperOrigin-RevId: 299397780\n\nbc973a15818e00c19e121959832676e9b7607456\nbazel: Fix broken common dependency\n\nPiperOrigin-RevId: 299397431\n\n71094a343e3b962e744aa49eb9338219537474e4\nchore: bigtable/admin/v2 publish retry config\n\nPiperOrigin-RevId: 299391875\n\n8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\n" } }, { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2020.2.4" + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" } } ], diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js index 4a53d1c41ee..e994918631d 100644 --- a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts index 299f64d2334..9cb255e6b0a 100644 --- a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/system-test/install.ts b/packages/google-cloud-translate/system-test/install.ts index c9aa74ec221..c4d80e9c0c8 100644 --- a/packages/google-cloud-translate/system-test/install.ts +++ b/packages/google-cloud-translate/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts index 52bf06f8d4e..7e7033565ef 100644 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts index d939dc5a979..fc38ef83982 100644 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/webpack.config.js b/packages/google-cloud-translate/webpack.config.js index a2bfa96a714..87404681b50 100644 --- a/packages/google-cloud-translate/webpack.config.js +++ b/packages/google-cloud-translate/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 5c689cafc449e7d35cafde33cbe159a37f1ba505 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 31 Mar 2020 15:58:10 -0700 Subject: [PATCH 346/513] feat!: drop node8 support, support for async iterators (#482) BREAKING CHANGE: The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. New feature: methods with pagination now support async iteration. --- .../google-cloud-translate/.eslintrc.json | 3 + packages/google-cloud-translate/.eslintrc.yml | 15 - packages/google-cloud-translate/.prettierrc | 8 - .../google-cloud-translate/.prettierrc.js | 17 + packages/google-cloud-translate/package.json | 10 +- .../google-cloud-translate/src/v2/index.ts | 2 + .../src/v3/translation_service_client.ts | 560 +++--- .../src/v3beta1/translation_service_client.ts | 568 +++--- .../google-cloud-translate/synth.metadata | 20 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/translate.ts | 5 + .../test/gapic-translation_service-v3.ts | 595 ------ .../test/gapic-translation_service-v3beta1.ts | 633 ------- .../test/gapic_translation_service_v3.ts | 1598 ++++++++++++++++ .../test/gapic_translation_service_v3beta1.ts | 1674 +++++++++++++++++ packages/google-cloud-translate/test/index.ts | 4 +- 16 files changed, 4004 insertions(+), 1710 deletions(-) create mode 100644 packages/google-cloud-translate/.eslintrc.json delete mode 100644 packages/google-cloud-translate/.eslintrc.yml delete mode 100644 packages/google-cloud-translate/.prettierrc create mode 100644 packages/google-cloud-translate/.prettierrc.js delete mode 100644 packages/google-cloud-translate/test/gapic-translation_service-v3.ts delete mode 100644 packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts create mode 100644 packages/google-cloud-translate/test/gapic_translation_service_v3.ts create mode 100644 packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts diff --git a/packages/google-cloud-translate/.eslintrc.json b/packages/google-cloud-translate/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-translate/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-translate/.eslintrc.yml b/packages/google-cloud-translate/.eslintrc.yml deleted file mode 100644 index 73eeec27612..00000000000 --- a/packages/google-cloud-translate/.eslintrc.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -extends: - - 'eslint:recommended' - - 'plugin:node/recommended' - - prettier -plugins: - - node - - prettier -rules: - prettier/prettier: error - block-scoped-var: error - eqeqeq: error - no-warning-comments: warn - no-var: error - prefer-const: error diff --git a/packages/google-cloud-translate/.prettierrc b/packages/google-cloud-translate/.prettierrc deleted file mode 100644 index df6eac07446..00000000000 --- a/packages/google-cloud-translate/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ ---- -bracketSpacing: false -printWidth: 80 -semi: true -singleQuote: true -tabWidth: 2 -trailingComma: es5 -useTabs: false diff --git a/packages/google-cloud-translate/.prettierrc.js b/packages/google-cloud-translate/.prettierrc.js new file mode 100644 index 00000000000..08cba3775be --- /dev/null +++ b/packages/google-cloud-translate/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index b3d7baa8d82..53d677dfd97 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "author": "Google Inc.", "engines": { - "node": ">=8.10.0" + "node": ">=10" }, "repository": "googleapis/nodejs-translate", "main": "build/src/index.js", @@ -48,7 +48,7 @@ "@google-cloud/promisify": "^1.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^1.11.1", + "google-gax": "^2.0.1", "is-html": "^2.0.0", "protobufjs": "^6.8.8" }, @@ -58,6 +58,7 @@ "@types/node": "^10.5.7", "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", + "@types/sinon": "^7.5.2", "c8": "^7.0.0", "codecov": "^3.0.2", "eslint": "^6.0.0", @@ -65,7 +66,7 @@ "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", "google-auth-library": "^5.7.0", - "gts": "^1.0.0", + "gts": "2.0.0-alpha.9", "http2spy": "^1.1.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", @@ -75,6 +76,7 @@ "pack-n-play": "^1.0.0-2", "prettier": "^1.13.5", "proxyquire": "^2.0.1", - "typescript": "3.6.4" + "sinon": "^9.0.1", + "typescript": "^3.8.3" } } diff --git a/packages/google-cloud-translate/src/v2/index.ts b/packages/google-cloud-translate/src/v2/index.ts index 4b6a2e92d2e..76daff2c61d 100644 --- a/packages/google-cloud-translate/src/v2/index.ts +++ b/packages/google-cloud-translate/src/v2/index.ts @@ -18,12 +18,14 @@ import arrify = require('arrify'); import * as extend from 'extend'; import {GoogleAuthOptions} from 'google-auth-library'; +// eslint-disable-next-line @typescript-eslint/no-var-requires const isHtml = require('is-html'); import { DecorateRequestOptions, BodyResponseCallback, } from '@google-cloud/common/build/src/util'; +// eslint-disable-next-line @typescript-eslint/no-var-requires const PKG = require('../../../package.json'); export interface TranslateRequest { diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 052a5fa3111..0acb7f8f4c2 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -18,19 +18,19 @@ import * as gax from 'google-gax'; import { - APICallback, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, - PaginationResponse, + GaxCall, } from 'google-gax'; import * as path from 'path'; import {Transform} from 'stream'; -import * as protosTypes from '../../protos/protos'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './translation_service_client_config.json'; const version = require('../../../package.json').version; @@ -41,14 +41,6 @@ const version = require('../../../package.json').version; * @memberof v3 */ export class TranslationServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -56,6 +48,14 @@ export class TranslationServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; translationServiceStub?: Promise<{[name: string]: Function}>; @@ -148,13 +148,16 @@ export class TranslationServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. - this._pathTemplates = { + this.pathTemplates = { glossaryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/glossaries/{glossary}' ), @@ -166,7 +169,7 @@ export class TranslationServiceClient { // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. - this._descriptors.page = { + this.descriptors.page = { listGlossaries: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -179,6 +182,7 @@ export class TranslationServiceClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -208,7 +212,7 @@ export class TranslationServiceClient { '.google.cloud.translation.v3.DeleteGlossaryMetadata' ) as gax.protobuf.Type; - this._descriptors.longrunning = { + this.descriptors.longrunning = { batchTranslateText: new this._gaxModule.LongrunningDescriptor( this.operationsClient, batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), @@ -237,7 +241,7 @@ export class TranslationServiceClient { // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. - this._innerApiCalls = {}; + this.innerApiCalls = {}; } /** @@ -264,7 +268,7 @@ export class TranslationServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.translation.v3.TranslationService' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.translation.v3.TranslationService, this._opts ) as Promise<{[method: string]: Function}>; @@ -281,9 +285,8 @@ export class TranslationServiceClient { 'getGlossary', 'deleteGlossary', ]; - for (const methodName of translationServiceStubMethods) { - const innerCallPromise = this.translationServiceStub.then( + const callPromise = this.translationServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -297,20 +300,14 @@ export class TranslationServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.translationServiceStub; @@ -370,22 +367,34 @@ export class TranslationServiceClient { // -- Service calls -- // ------------------- translateText( - request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest, + request: protos.google.cloud.translation.v3.ITranslateTextRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.translation.v3.ITranslateTextResponse, - protosTypes.google.cloud.translation.v3.ITranslateTextRequest | undefined, + protos.google.cloud.translation.v3.ITranslateTextResponse, + protos.google.cloud.translation.v3.ITranslateTextRequest | undefined, {} | undefined ] >; translateText( - request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest, + request: protos.google.cloud.translation.v3.ITranslateTextRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.translation.v3.ITranslateTextResponse, - protosTypes.google.cloud.translation.v3.ITranslateTextRequest | undefined, - {} | undefined + protos.google.cloud.translation.v3.ITranslateTextResponse, + | protos.google.cloud.translation.v3.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + translateText( + request: protos.google.cloud.translation.v3.ITranslateTextRequest, + callback: Callback< + protos.google.cloud.translation.v3.ITranslateTextResponse, + | protos.google.cloud.translation.v3.ITranslateTextRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -462,24 +471,27 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ translateText( - request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest, + request: protos.google.cloud.translation.v3.ITranslateTextRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.translation.v3.ITranslateTextResponse, - | protosTypes.google.cloud.translation.v3.ITranslateTextRequest + protos.google.cloud.translation.v3.ITranslateTextResponse, + | protos.google.cloud.translation.v3.ITranslateTextRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.translation.v3.ITranslateTextResponse, - protosTypes.google.cloud.translation.v3.ITranslateTextRequest | undefined, - {} | undefined + protos.google.cloud.translation.v3.ITranslateTextResponse, + | protos.google.cloud.translation.v3.ITranslateTextRequest + | null + | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.translation.v3.ITranslateTextResponse, - protosTypes.google.cloud.translation.v3.ITranslateTextRequest | undefined, + protos.google.cloud.translation.v3.ITranslateTextResponse, + protos.google.cloud.translation.v3.ITranslateTextRequest | undefined, {} | undefined ] > | void { @@ -500,29 +512,37 @@ export class TranslationServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.translateText(request, options, callback); + return this.innerApiCalls.translateText(request, options, callback); } detectLanguage( - request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest, + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, - ( - | protosTypes.google.cloud.translation.v3.IDetectLanguageRequest - | undefined - ), + protos.google.cloud.translation.v3.IDetectLanguageResponse, + protos.google.cloud.translation.v3.IDetectLanguageRequest | undefined, {} | undefined ] >; detectLanguage( - request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest, + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, - | protosTypes.google.cloud.translation.v3.IDetectLanguageRequest + protos.google.cloud.translation.v3.IDetectLanguageResponse, + | protos.google.cloud.translation.v3.IDetectLanguageRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + detectLanguage( + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + callback: Callback< + protos.google.cloud.translation.v3.IDetectLanguageResponse, + | protos.google.cloud.translation.v3.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -573,28 +593,27 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ detectLanguage( - request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest, + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, - | protosTypes.google.cloud.translation.v3.IDetectLanguageRequest + protos.google.cloud.translation.v3.IDetectLanguageResponse, + | protos.google.cloud.translation.v3.IDetectLanguageRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, - | protosTypes.google.cloud.translation.v3.IDetectLanguageRequest + protos.google.cloud.translation.v3.IDetectLanguageResponse, + | protos.google.cloud.translation.v3.IDetectLanguageRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.translation.v3.IDetectLanguageResponse, - ( - | protosTypes.google.cloud.translation.v3.IDetectLanguageRequest - | undefined - ), + protos.google.cloud.translation.v3.IDetectLanguageResponse, + protos.google.cloud.translation.v3.IDetectLanguageRequest | undefined, {} | undefined ] > | void { @@ -615,29 +634,40 @@ export class TranslationServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.detectLanguage(request, options, callback); + return this.innerApiCalls.detectLanguage(request, options, callback); } getSupportedLanguages( - request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.translation.v3.ISupportedLanguages, + protos.google.cloud.translation.v3.ISupportedLanguages, ( - | protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest | undefined ), {} | undefined ] >; getSupportedLanguages( - request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.translation.v3.ISupportedLanguages, - | protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest + protos.google.cloud.translation.v3.ISupportedLanguages, + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + getSupportedLanguages( + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + callback: Callback< + protos.google.cloud.translation.v3.ISupportedLanguages, + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -685,26 +715,28 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getSupportedLanguages( - request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.translation.v3.ISupportedLanguages, - | protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest + protos.google.cloud.translation.v3.ISupportedLanguages, + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.translation.v3.ISupportedLanguages, - | protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest + protos.google.cloud.translation.v3.ISupportedLanguages, + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.translation.v3.ISupportedLanguages, + protos.google.cloud.translation.v3.ISupportedLanguages, ( - | protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest | undefined ), {} | undefined @@ -727,29 +759,33 @@ export class TranslationServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.getSupportedLanguages( - request, - options, - callback - ); + return this.innerApiCalls.getSupportedLanguages(request, options, callback); } getGlossary( - request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest, + request: protos.google.cloud.translation.v3.IGetGlossaryRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.IGetGlossaryRequest | undefined, + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest | undefined, {} | undefined ] >; getGlossary( - request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest, + request: protos.google.cloud.translation.v3.IGetGlossaryRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.IGetGlossaryRequest | undefined, - {} | undefined + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest | null | undefined, + {} | null | undefined + > + ): void; + getGlossary( + request: protos.google.cloud.translation.v3.IGetGlossaryRequest, + callback: Callback< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -767,24 +803,25 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getGlossary( - request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest, + request: protos.google.cloud.translation.v3.IGetGlossaryRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.translation.v3.IGlossary, - | protosTypes.google.cloud.translation.v3.IGetGlossaryRequest + protos.google.cloud.translation.v3.IGlossary, + | protos.google.cloud.translation.v3.IGetGlossaryRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.IGetGlossaryRequest | undefined, - {} | undefined + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.IGetGlossaryRequest | undefined, + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest | undefined, {} | undefined ] > | void { @@ -805,32 +842,43 @@ export class TranslationServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getGlossary(request, options, callback); + return this.innerApiCalls.getGlossary(request, options, callback); } batchTranslateText( - request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest, + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; batchTranslateText( - request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest, + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchTranslateText( + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -903,32 +951,32 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ batchTranslateText( - request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest, + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.translation.v3.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3.IBatchTranslateMetadata + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -949,31 +997,42 @@ export class TranslationServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.batchTranslateText(request, options, callback); + return this.innerApiCalls.batchTranslateText(request, options, callback); } createGlossary( - request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest, + request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; createGlossary( - request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest, + request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGlossary( + request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -993,32 +1052,32 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createGlossary( - request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest, + request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.translation.v3.IGlossary, - protosTypes.google.cloud.translation.v3.ICreateGlossaryMetadata + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1039,31 +1098,42 @@ export class TranslationServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createGlossary(request, options, callback); + return this.innerApiCalls.createGlossary(request, options, callback); } deleteGlossary( - request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest, + request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; deleteGlossary( - request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest, + request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGlossary( + request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -1082,32 +1152,32 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ deleteGlossary( - request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest, + request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.translation.v3.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3.IDeleteGlossaryMetadata + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1128,25 +1198,37 @@ export class TranslationServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.deleteGlossary(request, options, callback); + return this.innerApiCalls.deleteGlossary(request, options, callback); } listGlossaries( - request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, + request: protos.google.cloud.translation.v3.IListGlossariesRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.translation.v3.IGlossary[], - protosTypes.google.cloud.translation.v3.IListGlossariesRequest | null, - protosTypes.google.cloud.translation.v3.IListGlossariesResponse + protos.google.cloud.translation.v3.IGlossary[], + protos.google.cloud.translation.v3.IListGlossariesRequest | null, + protos.google.cloud.translation.v3.IListGlossariesResponse ] >; listGlossaries( - request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, + request: protos.google.cloud.translation.v3.IListGlossariesRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.translation.v3.IGlossary[], - protosTypes.google.cloud.translation.v3.IListGlossariesRequest | null, - protosTypes.google.cloud.translation.v3.IListGlossariesResponse + callback: PaginationCallback< + protos.google.cloud.translation.v3.IListGlossariesRequest, + | protos.google.cloud.translation.v3.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3.IGlossary + > + ): void; + listGlossaries( + request: protos.google.cloud.translation.v3.IListGlossariesRequest, + callback: PaginationCallback< + protos.google.cloud.translation.v3.IListGlossariesRequest, + | protos.google.cloud.translation.v3.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3.IGlossary > ): void; /** @@ -1188,24 +1270,28 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listGlossaries( - request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, + request: protos.google.cloud.translation.v3.IListGlossariesRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.translation.v3.IGlossary[], - protosTypes.google.cloud.translation.v3.IListGlossariesRequest | null, - protosTypes.google.cloud.translation.v3.IListGlossariesResponse + | PaginationCallback< + protos.google.cloud.translation.v3.IListGlossariesRequest, + | protos.google.cloud.translation.v3.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3.IGlossary >, - callback?: Callback< - protosTypes.google.cloud.translation.v3.IGlossary[], - protosTypes.google.cloud.translation.v3.IListGlossariesRequest | null, - protosTypes.google.cloud.translation.v3.IListGlossariesResponse + callback?: PaginationCallback< + protos.google.cloud.translation.v3.IListGlossariesRequest, + | protos.google.cloud.translation.v3.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3.IGlossary > ): Promise< [ - protosTypes.google.cloud.translation.v3.IGlossary[], - protosTypes.google.cloud.translation.v3.IListGlossariesRequest | null, - protosTypes.google.cloud.translation.v3.IListGlossariesResponse + protos.google.cloud.translation.v3.IGlossary[], + protos.google.cloud.translation.v3.IListGlossariesRequest | null, + protos.google.cloud.translation.v3.IListGlossariesResponse ] > | void { request = request || {}; @@ -1225,7 +1311,7 @@ export class TranslationServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listGlossaries(request, options, callback); + return this.innerApiCalls.listGlossaries(request, options, callback); } /** @@ -1263,7 +1349,7 @@ export class TranslationServiceClient { * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3.Glossary} on 'data' event. */ listGlossariesStream( - request?: protosTypes.google.cloud.translation.v3.IListGlossariesRequest, + request?: protos.google.cloud.translation.v3.IListGlossariesRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -1277,12 +1363,61 @@ export class TranslationServiceClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listGlossaries.createStream( - this._innerApiCalls.listGlossaries as gax.GaxCall, + return this.descriptors.page.listGlossaries.createStream( + this.innerApiCalls.listGlossaries as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listGlossaries}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listGlossariesAsync( + request?: protos.google.cloud.translation.v3.IListGlossariesRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGlossaries.asyncIterate( + this.innerApiCalls['listGlossaries'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -1296,10 +1431,10 @@ export class TranslationServiceClient { * @returns {string} Resource name string. */ glossaryPath(project: string, location: string, glossary: string) { - return this._pathTemplates.glossaryPathTemplate.render({ - project, - location, - glossary, + return this.pathTemplates.glossaryPathTemplate.render({ + project: project, + location: location, + glossary: glossary, }); } @@ -1311,7 +1446,7 @@ export class TranslationServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGlossaryName(glossaryName: string) { - return this._pathTemplates.glossaryPathTemplate.match(glossaryName).project; + return this.pathTemplates.glossaryPathTemplate.match(glossaryName).project; } /** @@ -1322,8 +1457,7 @@ export class TranslationServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGlossaryName(glossaryName: string) { - return this._pathTemplates.glossaryPathTemplate.match(glossaryName) - .location; + return this.pathTemplates.glossaryPathTemplate.match(glossaryName).location; } /** @@ -1334,8 +1468,7 @@ export class TranslationServiceClient { * @returns {string} A string representing the glossary. */ matchGlossaryFromGlossaryName(glossaryName: string) { - return this._pathTemplates.glossaryPathTemplate.match(glossaryName) - .glossary; + return this.pathTemplates.glossaryPathTemplate.match(glossaryName).glossary; } /** @@ -1346,9 +1479,9 @@ export class TranslationServiceClient { * @returns {string} Resource name string. */ locationPath(project: string, location: string) { - return this._pathTemplates.locationPathTemplate.render({ - project, - location, + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, }); } @@ -1360,7 +1493,7 @@ export class TranslationServiceClient { * @returns {string} A string representing the project. */ matchProjectFromLocationName(locationName: string) { - return this._pathTemplates.locationPathTemplate.match(locationName).project; + return this.pathTemplates.locationPathTemplate.match(locationName).project; } /** @@ -1371,8 +1504,7 @@ export class TranslationServiceClient { * @returns {string} A string representing the location. */ matchLocationFromLocationName(locationName: string) { - return this._pathTemplates.locationPathTemplate.match(locationName) - .location; + return this.pathTemplates.locationPathTemplate.match(locationName).location; } /** diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index aa932dc0cfc..bb21fdfe704 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -18,19 +18,19 @@ import * as gax from 'google-gax'; import { - APICallback, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, - PaginationResponse, + GaxCall, } from 'google-gax'; import * as path from 'path'; import {Transform} from 'stream'; -import * as protosTypes from '../../protos/protos'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './translation_service_client_config.json'; const version = require('../../../package.json').version; @@ -41,14 +41,6 @@ const version = require('../../../package.json').version; * @memberof v3beta1 */ export class TranslationServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -56,6 +48,14 @@ export class TranslationServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; translationServiceStub?: Promise<{[name: string]: Function}>; @@ -148,13 +148,16 @@ export class TranslationServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. - this._pathTemplates = { + this.pathTemplates = { glossaryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/glossaries/{glossary}' ), @@ -166,7 +169,7 @@ export class TranslationServiceClient { // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. - this._descriptors.page = { + this.descriptors.page = { listGlossaries: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -179,6 +182,7 @@ export class TranslationServiceClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -208,7 +212,7 @@ export class TranslationServiceClient { '.google.cloud.translation.v3beta1.DeleteGlossaryMetadata' ) as gax.protobuf.Type; - this._descriptors.longrunning = { + this.descriptors.longrunning = { batchTranslateText: new this._gaxModule.LongrunningDescriptor( this.operationsClient, batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), @@ -237,7 +241,7 @@ export class TranslationServiceClient { // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. - this._innerApiCalls = {}; + this.innerApiCalls = {}; } /** @@ -264,7 +268,7 @@ export class TranslationServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.translation.v3beta1.TranslationService' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.translation.v3beta1 .TranslationService, this._opts @@ -282,9 +286,8 @@ export class TranslationServiceClient { 'getGlossary', 'deleteGlossary', ]; - for (const methodName of translationServiceStubMethods) { - const innerCallPromise = this.translationServiceStub.then( + const callPromise = this.translationServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -298,20 +301,14 @@ export class TranslationServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.translationServiceStub; @@ -371,26 +368,34 @@ export class TranslationServiceClient { // -- Service calls -- // ------------------- translateText( - request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest, + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.translation.v3beta1.ITranslateTextResponse, - ( - | protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest - | undefined - ), + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + protos.google.cloud.translation.v3beta1.ITranslateTextRequest | undefined, {} | undefined ] >; translateText( - request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest, + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.translation.v3beta1.ITranslateTextResponse, - | protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + | protos.google.cloud.translation.v3beta1.ITranslateTextRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + translateText( + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + | protos.google.cloud.translation.v3beta1.ITranslateTextRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -467,28 +472,27 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ translateText( - request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest, + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.translation.v3beta1.ITranslateTextResponse, - | protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + | protos.google.cloud.translation.v3beta1.ITranslateTextRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.translation.v3beta1.ITranslateTextResponse, - | protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + | protos.google.cloud.translation.v3beta1.ITranslateTextRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.translation.v3beta1.ITranslateTextResponse, - ( - | protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest - | undefined - ), + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + protos.google.cloud.translation.v3beta1.ITranslateTextRequest | undefined, {} | undefined ] > | void { @@ -509,29 +513,40 @@ export class TranslationServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.translateText(request, options, callback); + return this.innerApiCalls.translateText(request, options, callback); } detectLanguage( - request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest, + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.translation.v3beta1.IDetectLanguageResponse, + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, ( - | protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest | undefined ), {} | undefined ] >; detectLanguage( - request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest, + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.translation.v3beta1.IDetectLanguageResponse, - | protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + detectLanguage( + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -582,26 +597,28 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ detectLanguage( - request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest, + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.translation.v3beta1.IDetectLanguageResponse, - | protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.translation.v3beta1.IDetectLanguageResponse, - | protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.translation.v3beta1.IDetectLanguageResponse, + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, ( - | protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest | undefined ), {} | undefined @@ -624,29 +641,40 @@ export class TranslationServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.detectLanguage(request, options, callback); + return this.innerApiCalls.detectLanguage(request, options, callback); } getSupportedLanguages( - request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.translation.v3beta1.ISupportedLanguages, + protos.google.cloud.translation.v3beta1.ISupportedLanguages, ( - | protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest | undefined ), {} | undefined ] >; getSupportedLanguages( - request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.translation.v3beta1.ISupportedLanguages, - | protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + getSupportedLanguages( + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -694,26 +722,28 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getSupportedLanguages( - request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.translation.v3beta1.ISupportedLanguages, - | protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.translation.v3beta1.ISupportedLanguages, - | protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.translation.v3beta1.ISupportedLanguages, + protos.google.cloud.translation.v3beta1.ISupportedLanguages, ( - | protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest | undefined ), {} | undefined @@ -736,33 +766,37 @@ export class TranslationServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.getSupportedLanguages( - request, - options, - callback - ); + return this.innerApiCalls.getSupportedLanguages(request, options, callback); } getGlossary( - request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest, + request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.translation.v3beta1.IGlossary, - ( - | protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest - | undefined - ), + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.IGetGlossaryRequest | undefined, {} | undefined ] >; getGlossary( - request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest, + request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.translation.v3beta1.IGlossary, - | protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest + protos.google.cloud.translation.v3beta1.IGlossary, + | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + getGlossary( + request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.IGlossary, + | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -780,28 +814,27 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getGlossary( - request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest, + request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.translation.v3beta1.IGlossary, - | protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest + protos.google.cloud.translation.v3beta1.IGlossary, + | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.translation.v3beta1.IGlossary, - | protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest + protos.google.cloud.translation.v3beta1.IGlossary, + | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.translation.v3beta1.IGlossary, - ( - | protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest - | undefined - ), + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.IGetGlossaryRequest | undefined, {} | undefined ] > | void { @@ -822,32 +855,43 @@ export class TranslationServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getGlossary(request, options, callback); + return this.innerApiCalls.getGlossary(request, options, callback); } batchTranslateText( - request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3beta1.IBatchTranslateMetadata + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; batchTranslateText( - request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3beta1.IBatchTranslateMetadata + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchTranslateText( + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -920,32 +964,32 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ batchTranslateText( - request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3beta1.IBatchTranslateMetadata + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3beta1.IBatchTranslateMetadata + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protosTypes.google.cloud.translation.v3beta1.IBatchTranslateMetadata + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -966,31 +1010,42 @@ export class TranslationServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.batchTranslateText(request, options, callback); + return this.innerApiCalls.batchTranslateText(request, options, callback); } createGlossary( - request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.translation.v3beta1.IGlossary, - protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; createGlossary( - request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.translation.v3beta1.IGlossary, - protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGlossary( + request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -1010,32 +1065,32 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createGlossary( - request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.translation.v3beta1.IGlossary, - protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.translation.v3beta1.IGlossary, - protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.translation.v3beta1.IGlossary, - protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1056,31 +1111,42 @@ export class TranslationServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createGlossary(request, options, callback); + return this.innerApiCalls.createGlossary(request, options, callback); } deleteGlossary( - request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; deleteGlossary( - request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGlossary( + request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -1099,32 +1165,32 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ deleteGlossary( - request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1145,25 +1211,37 @@ export class TranslationServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.deleteGlossary(request, options, callback); + return this.innerApiCalls.deleteGlossary(request, options, callback); } listGlossaries( - request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest, + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.translation.v3beta1.IGlossary[], - protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest | null, - protosTypes.google.cloud.translation.v3beta1.IListGlossariesResponse + protos.google.cloud.translation.v3beta1.IGlossary[], + protos.google.cloud.translation.v3beta1.IListGlossariesRequest | null, + protos.google.cloud.translation.v3beta1.IListGlossariesResponse ] >; listGlossaries( - request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest, + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.translation.v3beta1.IGlossary[], - protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest | null, - protosTypes.google.cloud.translation.v3beta1.IListGlossariesResponse + callback: PaginationCallback< + protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + | protos.google.cloud.translation.v3beta1.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3beta1.IGlossary + > + ): void; + listGlossaries( + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + callback: PaginationCallback< + protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + | protos.google.cloud.translation.v3beta1.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3beta1.IGlossary > ): void; /** @@ -1205,24 +1283,28 @@ export class TranslationServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listGlossaries( - request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest, + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.translation.v3beta1.IGlossary[], - protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest | null, - protosTypes.google.cloud.translation.v3beta1.IListGlossariesResponse + | PaginationCallback< + protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + | protos.google.cloud.translation.v3beta1.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3beta1.IGlossary >, - callback?: Callback< - protosTypes.google.cloud.translation.v3beta1.IGlossary[], - protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest | null, - protosTypes.google.cloud.translation.v3beta1.IListGlossariesResponse + callback?: PaginationCallback< + protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + | protos.google.cloud.translation.v3beta1.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3beta1.IGlossary > ): Promise< [ - protosTypes.google.cloud.translation.v3beta1.IGlossary[], - protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest | null, - protosTypes.google.cloud.translation.v3beta1.IListGlossariesResponse + protos.google.cloud.translation.v3beta1.IGlossary[], + protos.google.cloud.translation.v3beta1.IListGlossariesRequest | null, + protos.google.cloud.translation.v3beta1.IListGlossariesResponse ] > | void { request = request || {}; @@ -1242,7 +1324,7 @@ export class TranslationServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listGlossaries(request, options, callback); + return this.innerApiCalls.listGlossaries(request, options, callback); } /** @@ -1280,7 +1362,7 @@ export class TranslationServiceClient { * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary} on 'data' event. */ listGlossariesStream( - request?: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest, + request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -1294,12 +1376,61 @@ export class TranslationServiceClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listGlossaries.createStream( - this._innerApiCalls.listGlossaries as gax.GaxCall, + return this.descriptors.page.listGlossaries.createStream( + this.innerApiCalls.listGlossaries as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listGlossaries}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listGlossariesAsync( + request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGlossaries.asyncIterate( + this.innerApiCalls['listGlossaries'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -1313,10 +1444,10 @@ export class TranslationServiceClient { * @returns {string} Resource name string. */ glossaryPath(project: string, location: string, glossary: string) { - return this._pathTemplates.glossaryPathTemplate.render({ - project, - location, - glossary, + return this.pathTemplates.glossaryPathTemplate.render({ + project: project, + location: location, + glossary: glossary, }); } @@ -1328,7 +1459,7 @@ export class TranslationServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGlossaryName(glossaryName: string) { - return this._pathTemplates.glossaryPathTemplate.match(glossaryName).project; + return this.pathTemplates.glossaryPathTemplate.match(glossaryName).project; } /** @@ -1339,8 +1470,7 @@ export class TranslationServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGlossaryName(glossaryName: string) { - return this._pathTemplates.glossaryPathTemplate.match(glossaryName) - .location; + return this.pathTemplates.glossaryPathTemplate.match(glossaryName).location; } /** @@ -1351,8 +1481,7 @@ export class TranslationServiceClient { * @returns {string} A string representing the glossary. */ matchGlossaryFromGlossaryName(glossaryName: string) { - return this._pathTemplates.glossaryPathTemplate.match(glossaryName) - .glossary; + return this.pathTemplates.glossaryPathTemplate.match(glossaryName).glossary; } /** @@ -1363,9 +1492,9 @@ export class TranslationServiceClient { * @returns {string} Resource name string. */ locationPath(project: string, location: string) { - return this._pathTemplates.locationPathTemplate.render({ - project, - location, + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, }); } @@ -1377,7 +1506,7 @@ export class TranslationServiceClient { * @returns {string} A string representing the project. */ matchProjectFromLocationName(locationName: string) { - return this._pathTemplates.locationPathTemplate.match(locationName).project; + return this.pathTemplates.locationPathTemplate.match(locationName).project; } /** @@ -1388,8 +1517,7 @@ export class TranslationServiceClient { * @returns {string} A string representing the location. */ matchLocationFromLocationName(locationName: string) { - return this._pathTemplates.locationPathTemplate.match(locationName) - .location; + return this.pathTemplates.locationPathTemplate.match(locationName).location; } /** diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index d52836d472b..521701670a1 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,23 +1,5 @@ { - "updateTime": "2020-03-22T11:53:00.105404Z", - "sources": [ - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0be7105dc52590fa9a24e784052298ae37ce53aa", - "internalRef": "302154871", - "log": "0be7105dc52590fa9a24e784052298ae37ce53aa\nAdd BUILD.bazel file to asset/v1p1beta1\n\nPiperOrigin-RevId: 302154871\n\n6c248fd13e8543f8d22cbf118d978301a9fbe2a8\nAdd missing resource annotations and additional_bindings to dialogflow v2 API.\n\nPiperOrigin-RevId: 302063117\n\n9a3a7f33be9eeacf7b3e98435816b7022d206bd7\nChange the service name from \"chromeos-moblab.googleapis.com\" to \"chromeosmoblab.googleapis.com\"\n\nPiperOrigin-RevId: 302060989\n\n98a339237577e3de26cb4921f75fb5c57cc7a19f\nfeat: devtools/build/v1 publish client library config annotations\n\n* add details field to some of the BuildEvents\n* add final_invocation_id and build_tool_exit_code fields to BuildStatus\n\nPiperOrigin-RevId: 302044087\n\ncfabc98c6bbbb22d1aeaf7612179c0be193b3a13\nfeat: home/graph/v1 publish client library config annotations & comment updates\n\nThis change includes adding the client library configuration annotations, updated proto comments, and some client library configuration files.\n\nPiperOrigin-RevId: 302042647\n\nc8c8c0bd15d082db9546253dbaad1087c7a9782c\nchore: use latest gapic-generator in bazel WORKSPACE.\nincluding the following commits from gapic-generator:\n- feat: take source protos in all sub-packages (#3144)\n\nPiperOrigin-RevId: 301843591\n\ne4daf5202ea31cb2cb6916fdbfa9d6bd771aeb4c\nAdd bazel file for v1 client lib generation\n\nPiperOrigin-RevId: 301802926\n\n275fbcce2c900278d487c33293a3c7e1fbcd3a34\nfeat: pubsub/v1 add an experimental filter field to Subscription\n\nPiperOrigin-RevId: 301661567\n\nf2b18cec51d27c999ad30011dba17f3965677e9c\nFix: UpdateBackupRequest.backup is a resource, not a resource reference - remove annotation.\n\nPiperOrigin-RevId: 301636171\n\n800384063ac93a0cac3a510d41726fa4b2cd4a83\nCloud Billing Budget API v1beta1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301634389\n\n0cc6c146b660db21f04056c3d58a4b752ee445e3\nCloud Billing Budget API v1alpha1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301630018\n\nff2ea00f69065585c3ac0993c8b582af3b6fc215\nFix: Add resource definition for a parent of InspectTemplate which was otherwise missing.\n\nPiperOrigin-RevId: 301623052\n\n55fa441c9daf03173910760191646399338f2b7c\nAdd proto definition for AccessLevel, AccessPolicy, and ServicePerimeter.\n\nPiperOrigin-RevId: 301620844\n\ne7b10591c5408a67cf14ffafa267556f3290e262\nCloud Bigtable Managed Backup service and message proto files.\n\nPiperOrigin-RevId: 301585144\n\nd8e226f702f8ddf92915128c9f4693b63fb8685d\nfeat: Add time-to-live in a queue for builds\n\nPiperOrigin-RevId: 301579876\n\n430375af011f8c7a5174884f0d0e539c6ffa7675\ndocs: add missing closing backtick\n\nPiperOrigin-RevId: 301538851\n\n0e9f1f60ded9ad1c2e725e37719112f5b487ab65\nbazel: Use latest release of gax_java\n\nPiperOrigin-RevId: 301480457\n\n5058c1c96d0ece7f5301a154cf5a07b2ad03a571\nUpdate GAPIC v2 with batching parameters for Logging API\n\nPiperOrigin-RevId: 301443847\n\n64ab9744073de81fec1b3a6a931befc8a90edf90\nFix: Introduce location-based organization/folder/billing-account resources\nChore: Update copyright years\n\nPiperOrigin-RevId: 301373760\n\n23d5f09e670ebb0c1b36214acf78704e2ecfc2ac\nUpdate field_behavior annotations in V1 and V2.\n\nPiperOrigin-RevId: 301337970\n\nb2cf37e7fd62383a811aa4d54d013ecae638851d\nData Catalog V1 API\n\nPiperOrigin-RevId: 301282503\n\n1976b9981e2900c8172b7d34b4220bdb18c5db42\nCloud DLP api update. Adds missing fields to Finding and adds support for hybrid jobs.\n\nPiperOrigin-RevId: 301205325\n\nae78682c05e864d71223ce22532219813b0245ac\nfix: several sample code blocks in comments are now properly indented for markdown\n\nPiperOrigin-RevId: 301185150\n\ndcd171d04bda5b67db13049320f97eca3ace3731\nPublish Media Translation API V1Beta1\n\nPiperOrigin-RevId: 301180096\n\nff1713453b0fbc5a7544a1ef6828c26ad21a370e\nAdd protos and BUILD rules for v1 API.\n\nPiperOrigin-RevId: 301179394\n\n8386761d09819b665b6a6e1e6d6ff884bc8ff781\nfeat: chromeos/modlab publish protos and config for Chrome OS Moblab API.\n\nPiperOrigin-RevId: 300843960\n\nb2e2bc62fab90e6829e62d3d189906d9b79899e4\nUpdates to GCS gRPC API spec:\n\n1. Changed GetIamPolicy and TestBucketIamPermissions to use wrapper messages around google.iam.v1 IAM requests messages, and added CommonRequestParams. This lets us support RequesterPays buckets.\n2. Added a metadata field to GetObjectMediaResponse, to support resuming an object media read safely (by extracting the generation of the object being read, and using it in the resumed read request).\n\nPiperOrigin-RevId: 300817706\n\n7fd916ce12335cc9e784bb9452a8602d00b2516c\nAdd deprecated_collections field for backward-compatiblity in PHP and monolith-generated Python and Ruby clients.\n\nGenerate TopicName class in Java which covers the functionality of both ProjectTopicName and DeletedTopicName. Introduce breaking changes to be fixed by synth.py.\n\nDelete default retry parameters.\n\nRetry codes defs can be deleted once # https://github.com/googleapis/gapic-generator/issues/3137 is fixed.\n\nPiperOrigin-RevId: 300813135\n\n047d3a8ac7f75383855df0166144f891d7af08d9\nfix!: google/rpc refactor ErrorInfo.type to ErrorInfo.reason and comment updates.\n\nPiperOrigin-RevId: 300773211\n\nfae4bb6d5aac52aabe5f0bb4396466c2304ea6f6\nAdding RetryPolicy to pubsub.proto\n\nPiperOrigin-RevId: 300769420\n\n7d569be2928dbd72b4e261bf9e468f23afd2b950\nAdding additional protocol buffer annotations to v3.\n\nPiperOrigin-RevId: 300718800\n\n13942d1a85a337515040a03c5108993087dc0e4f\nAdd logging protos for Recommender v1.\n\nPiperOrigin-RevId: 300689896\n\na1a573c3eecfe2c404892bfa61a32dd0c9fb22b6\nfix: change go package to use cloud.google.com/go/maps\n\nPiperOrigin-RevId: 300661825\n\nc6fbac11afa0c7ab2972d9df181493875c566f77\nfeat: publish documentai/v1beta2 protos\n\nPiperOrigin-RevId: 300656808\n\n5202a9e0d9903f49e900f20fe5c7f4e42dd6588f\nProtos for v1beta1 release of Cloud Security Center Settings API\n\nPiperOrigin-RevId: 300580858\n\n83518e18655d9d4ac044acbda063cc6ecdb63ef8\nAdds gapic.yaml file and BUILD.bazel file.\n\nPiperOrigin-RevId: 300554200\n\n836c196dc8ef8354bbfb5f30696bd3477e8db5e2\nRegenerate recommender v1beta1 gRPC ServiceConfig file for Insights methods.\n\nPiperOrigin-RevId: 300549302\n\n34a5450c591b6be3d6566f25ac31caa5211b2f3f\nIncreases the default timeout from 20s to 30s for MetricService\n\nPiperOrigin-RevId: 300474272\n\n5d8bffe87cd01ba390c32f1714230e5a95d5991d\nfeat: use the latest gapic-generator in WORKSPACE for bazel build.\n\nPiperOrigin-RevId: 300461878\n\nd631c651e3bcfac5d371e8560c27648f7b3e2364\nUpdated the GAPIC configs to include parameters for Backups APIs.\n\nPiperOrigin-RevId: 300443402\n\n678afc7055c1adea9b7b54519f3bdb228013f918\nAdding Game Servers v1beta API.\n\nPiperOrigin-RevId: 300433218\n\n80d2bd2c652a5e213302041b0620aff423132589\nEnable proto annotation and gapic v2 for talent API.\n\nPiperOrigin-RevId: 300393997\n\n85e454be7a353f7fe1bf2b0affb753305785b872\ndocs(google/maps/roads): remove mention of nonexported api\n\nPiperOrigin-RevId: 300367734\n\nbf839ae632e0f263a729569e44be4b38b1c85f9c\nAdding protocol buffer annotations and updated config info for v1 and v2.\n\nPiperOrigin-RevId: 300276913\n\n309b899ca18a4c604bce63882a161d44854da549\nPublish `Backup` APIs and protos.\n\nPiperOrigin-RevId: 300246038\n\neced64c3f122421350b4aca68a28e89121d20db8\nadd PHP client libraries\n\nPiperOrigin-RevId: 300193634\n\n7727af0e39df1ae9ad715895c8576d7b65cf6c6d\nfeat: use the latest gapic-generator and protoc-java-resource-name-plugin in googleapis/WORKSPACE.\n\nPiperOrigin-RevId: 300188410\n\n2a25aa351dd5b5fe14895266aff5824d90ce757b\nBreaking change: remove the ProjectOrTenant resource and its references.\n\nPiperOrigin-RevId: 300182152\n\na499dbb28546379415f51803505cfb6123477e71\nUpdate web risk v1 gapic config and BUILD file.\n\nPiperOrigin-RevId: 300152177\n\n52701da10fec2a5f9796e8d12518c0fe574488fe\nFix: apply appropriate namespace/package options for C#, PHP and Ruby.\n\nPiperOrigin-RevId: 300123508\n\n365c029b8cdb63f7751b92ab490f1976e616105c\nAdd CC targets to the kms protos.\n\nThese are needed by go/tink.\n\nPiperOrigin-RevId: 300038469\n\n4ba9aa8a4a1413b88dca5a8fa931824ee9c284e6\nExpose logo recognition API proto for GA.\n\nPiperOrigin-RevId: 299971671\n\n1c9fc2c9e03dadf15f16b1c4f570955bdcebe00e\nAdding ruby_package option to accessapproval.proto for the Ruby client libraries generation.\n\nPiperOrigin-RevId: 299955924\n\n1cc6f0a7bfb147e6f2ede911d9b01e7a9923b719\nbuild(google/maps/routes): generate api clients\n\nPiperOrigin-RevId: 299955905\n\n29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n91e1fb5ef9829c0c7a64bfa5bde330e6ed594378\nchore: update protobuf (protoc) version to 3.11.2\n\nPiperOrigin-RevId: 299404145\n\n30e36b4bee6749c4799f4fc1a51cc8f058ba167d\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 299399890\n\nffbb493674099f265693872ae250711b2238090c\nfeat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields.\n\nPiperOrigin-RevId: 299397780\n\nbc973a15818e00c19e121959832676e9b7607456\nbazel: Fix broken common dependency\n\nPiperOrigin-RevId: 299397431\n\n71094a343e3b962e744aa49eb9338219537474e4\nchore: bigtable/admin/v2 publish retry config\n\nPiperOrigin-RevId: 299391875\n\n8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\n" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" - } - } - ], + "updateTime": "2020-03-31T20:14:27.117117Z", "destinations": [ { "client": { diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts index 9cb255e6b0a..8ef08d3c3da 100644 --- a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts @@ -19,7 +19,7 @@ import {TranslationServiceClient} from '@google-cloud/translate'; function main() { - const translationServiceClient = new TranslationServiceClient(); + new TranslationServiceClient(); } main(); diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index fbff71198f3..561112ba0ad 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -16,6 +16,7 @@ import * as assert from 'assert'; import {describe, it} from 'mocha'; import {TranslationServiceClient} from '../src'; +// eslint-disable-next-line @typescript-eslint/no-var-requires const http2spy = require('http2spy'); const API_KEY = process.env.TRANSLATE_API_KEY; @@ -137,9 +138,11 @@ describe('translate', () => { }); it('should populate x-goog-user-project header, and succeed if valid project', async () => { + // eslint-disable-next-line @typescript-eslint/no-var-requires const {GoogleAuth} = require('google-auth-library'); const auth = new GoogleAuth({ credentials: Object.assign( + // eslint-disable-next-line @typescript-eslint/no-var-requires require(process.env.GOOGLE_APPLICATION_CREDENTIALS || ''), { quota_project_id: process.env.GCLOUD_PROJECT, @@ -171,9 +174,11 @@ describe('translate', () => { }); it('should populate x-goog-user-project header, and fail if invalid project', async () => { + // eslint-disable-next-line @typescript-eslint/no-var-requires const {GoogleAuth} = require('google-auth-library'); const auth = new GoogleAuth({ credentials: Object.assign( + // eslint-disable-next-line @typescript-eslint/no-var-requires require(process.env.GOOGLE_APPLICATION_CREDENTIALS || ''), { quota_project_id: 'my-fake-billing-project', diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3.ts deleted file mode 100644 index 7e7033565ef..00000000000 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3.ts +++ /dev/null @@ -1,595 +0,0 @@ -// Copyright 2020 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const translationserviceModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockLongRunningGrpcMethod( - expectedRequest: {}, - response: {} | null, - error?: {} | null -) { - return (request: {}) => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} -describe('v3.TranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = - translationserviceModule.v3.TranslationServiceClient.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - translationserviceModule.v3.TranslationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = translationserviceModule.v3.TranslationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new translationserviceModule.v3.TranslationServiceClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - fallback: true, - }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.translationServiceStub, undefined); - await client.initialize(); - assert(client.translationServiceStub); - }); - it('has close method', () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - describe('translateText', () => { - it('invokes translateText without error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.translateText = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.translateText(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes translateText with error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.ITranslateTextRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.translateText = mockSimpleGrpcMethod( - request, - null, - error - ); - client.translateText(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('detectLanguage', () => { - it('invokes detectLanguage without error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.detectLanguage(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes detectLanguage with error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.IDetectLanguageRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( - request, - null, - error - ); - client.detectLanguage(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getSupportedLanguages', () => { - it('invokes getSupportedLanguages without error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getSupportedLanguages(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getSupportedLanguages with error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.IGetSupportedLanguagesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getSupportedLanguages(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getGlossary', () => { - it('invokes getGlossary without error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getGlossary = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getGlossary(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getGlossary with error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.IGetGlossaryRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getGlossary = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getGlossary(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('batchTranslateText', () => { - it('invokes batchTranslateText without error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.batchTranslateText = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .batchTranslateText(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes batchTranslateText with error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.IBatchTranslateTextRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.batchTranslateText = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .batchTranslateText(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('createGlossary', () => { - it('invokes createGlossary without error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createGlossary = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .createGlossary(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes createGlossary with error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.ICreateGlossaryRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createGlossary = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .createGlossary(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('deleteGlossary', () => { - it('invokes deleteGlossary without error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteGlossary = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .deleteGlossary(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes deleteGlossary with error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.IDeleteGlossaryRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteGlossary = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .deleteGlossary(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('listGlossaries', () => { - it('invokes listGlossaries without error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listGlossaries = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listGlossaries(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listGlossariesStream', () => { - it('invokes listGlossariesStream without error', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3.IListGlossariesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listGlossaries = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listGlossariesStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); -}); diff --git a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts b/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts deleted file mode 100644 index fc38ef83982..00000000000 --- a/packages/google-cloud-translate/test/gapic-translation_service-v3beta1.ts +++ /dev/null @@ -1,633 +0,0 @@ -// Copyright 2020 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const translationserviceModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockLongRunningGrpcMethod( - expectedRequest: {}, - response: {} | null, - error?: {} | null -) { - return (request: {}) => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} -describe('v3beta1.TranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = - translationserviceModule.v3beta1.TranslationServiceClient.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - translationserviceModule.v3beta1.TranslationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = translationserviceModule.v3beta1.TranslationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - fallback: true, - } - ); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.translationServiceStub, undefined); - await client.initialize(); - assert(client.translationServiceStub); - }); - it('has close method', () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.close(); - }); - describe('translateText', () => { - it('invokes translateText without error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.translateText = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.translateText(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes translateText with error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.ITranslateTextRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.translateText = mockSimpleGrpcMethod( - request, - null, - error - ); - client.translateText(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('detectLanguage', () => { - it('invokes detectLanguage without error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.detectLanguage(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes detectLanguage with error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.IDetectLanguageRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.detectLanguage = mockSimpleGrpcMethod( - request, - null, - error - ); - client.detectLanguage(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getSupportedLanguages', () => { - it('invokes getSupportedLanguages without error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getSupportedLanguages(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getSupportedLanguages with error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getSupportedLanguages = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getSupportedLanguages(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getGlossary', () => { - it('invokes getGlossary without error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getGlossary = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getGlossary(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getGlossary with error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.IGetGlossaryRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getGlossary = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getGlossary(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('batchTranslateText', () => { - it('invokes batchTranslateText without error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.batchTranslateText = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .batchTranslateText(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes batchTranslateText with error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.IBatchTranslateTextRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.batchTranslateText = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .batchTranslateText(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('createGlossary', () => { - it('invokes createGlossary without error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createGlossary = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .createGlossary(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes createGlossary with error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.ICreateGlossaryRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createGlossary = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .createGlossary(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('deleteGlossary', () => { - it('invokes deleteGlossary without error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteGlossary = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .deleteGlossary(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes deleteGlossary with error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.IDeleteGlossaryRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteGlossary = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .deleteGlossary(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('listGlossaries', () => { - it('invokes listGlossaries without error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listGlossaries = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listGlossaries(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listGlossariesStream', () => { - it('invokes listGlossariesStream without error', done => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.translation.v3beta1.IListGlossariesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listGlossaries = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listGlossariesStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); -}); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts new file mode 100644 index 00000000000..ac652102ace --- /dev/null +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -0,0 +1,1598 @@ +// Copyright 2020 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as translationserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v3.TranslationServiceClient', () => { + it('has servicePath', () => { + const servicePath = + translationserviceModule.v3.TranslationServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + translationserviceModule.v3.TranslationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = translationserviceModule.v3.TranslationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new translationserviceModule.v3.TranslationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.translationServiceStub, undefined); + await client.initialize(); + assert(client.translationServiceStub); + }); + + it('has close method', () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('translateText', () => { + it('invokes translateText without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateTextResponse() + ); + client.innerApiCalls.translateText = stubSimpleCall(expectedResponse); + const [response] = await client.translateText(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.translateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes translateText without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateTextResponse() + ); + client.innerApiCalls.translateText = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.translateText( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3.ITranslateTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.translateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes translateText with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.translateText = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.translateText(request); + }, expectedError); + assert( + (client.innerApiCalls.translateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('detectLanguage', () => { + it('invokes detectLanguage without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.DetectLanguageResponse() + ); + client.innerApiCalls.detectLanguage = stubSimpleCall(expectedResponse); + const [response] = await client.detectLanguage(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes detectLanguage without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.DetectLanguageResponse() + ); + client.innerApiCalls.detectLanguage = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.detectLanguage( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3.IDetectLanguageResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes detectLanguage with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.detectLanguage = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.detectLanguage(request); + }, expectedError); + assert( + (client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getSupportedLanguages', () => { + it('invokes getSupportedLanguages without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.SupportedLanguages() + ); + client.innerApiCalls.getSupportedLanguages = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getSupportedLanguages(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getSupportedLanguages without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.SupportedLanguages() + ); + client.innerApiCalls.getSupportedLanguages = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getSupportedLanguages( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3.ISupportedLanguages | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getSupportedLanguages with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSupportedLanguages = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getSupportedLanguages(request); + }, expectedError); + assert( + (client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getGlossary', () => { + it('invokes getGlossary without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ); + client.innerApiCalls.getGlossary = stubSimpleCall(expectedResponse); + const [response] = await client.getGlossary(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getGlossary without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ); + client.innerApiCalls.getGlossary = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getGlossary( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3.IGlossary | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getGlossary with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGlossary = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getGlossary(request); + }, expectedError); + assert( + (client.innerApiCalls.getGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('batchTranslateText', () => { + it('invokes batchTranslateText without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchTranslateText = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.batchTranslateText(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchTranslateText without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchTranslateText = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.batchTranslateText( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes batchTranslateText with call error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateText = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.batchTranslateText(request); + }, expectedError); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchTranslateText with LRO error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateText = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchTranslateText(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createGlossary', () => { + it('invokes createGlossary without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGlossary = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.createGlossary(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createGlossary without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGlossary = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createGlossary( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createGlossary with call error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGlossary = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createGlossary(request); + }, expectedError); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createGlossary with LRO error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGlossary = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGlossary(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteGlossary', () => { + it('invokes deleteGlossary without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGlossary = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.deleteGlossary(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteGlossary without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGlossary = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteGlossary( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteGlossary with call error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGlossary = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.deleteGlossary(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteGlossary with LRO error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGlossary = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGlossary(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listGlossaries', () => { + it('invokes listGlossaries without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + ]; + client.innerApiCalls.listGlossaries = stubSimpleCall(expectedResponse); + const [response] = await client.listGlossaries(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listGlossaries without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + ]; + client.innerApiCalls.listGlossaries = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listGlossaries( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3.IGlossary[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listGlossaries with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGlossaries = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listGlossaries(request); + }, expectedError); + assert( + (client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listGlossariesStream without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + ]; + client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listGlossariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.translation.v3.Glossary[] = []; + stream.on( + 'data', + (response: protos.google.cloud.translation.v3.Glossary) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGlossaries, request) + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listGlossariesStream with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listGlossariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.translation.v3.Glossary[] = []; + stream.on( + 'data', + (response: protos.google.cloud.translation.v3.Glossary) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGlossaries, request) + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listGlossaries without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + ]; + client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.translation.v3.IGlossary[] = []; + const iterable = client.listGlossariesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listGlossaries with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listGlossariesAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.translation.v3.IGlossary[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('glossary', () => { + const fakePath = '/rendered/path/glossary'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + glossary: 'glossaryValue', + }; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.glossaryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.glossaryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('glossaryPath', () => { + const result = client.glossaryPath( + 'projectValue', + 'locationValue', + 'glossaryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.glossaryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGlossaryName', () => { + const result = client.matchProjectFromGlossaryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGlossaryName', () => { + const result = client.matchLocationFromGlossaryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchGlossaryFromGlossaryName', () => { + const result = client.matchGlossaryFromGlossaryName(fakePath); + assert.strictEqual(result, 'glossaryValue'); + assert( + (client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts new file mode 100644 index 00000000000..03e054def8e --- /dev/null +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -0,0 +1,1674 @@ +// Copyright 2020 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as translationserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v3beta1.TranslationServiceClient', () => { + it('has servicePath', () => { + const servicePath = + translationserviceModule.v3beta1.TranslationServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + translationserviceModule.v3beta1.TranslationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = translationserviceModule.v3beta1.TranslationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.translationServiceStub, undefined); + await client.initialize(); + assert(client.translationServiceStub); + }); + + it('has close method', () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('translateText', () => { + it('invokes translateText without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateTextResponse() + ); + client.innerApiCalls.translateText = stubSimpleCall(expectedResponse); + const [response] = await client.translateText(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.translateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes translateText without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateTextResponse() + ); + client.innerApiCalls.translateText = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.translateText( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3beta1.ITranslateTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.translateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes translateText with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.translateText = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.translateText(request); + }, expectedError); + assert( + (client.innerApiCalls.translateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('detectLanguage', () => { + it('invokes detectLanguage without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DetectLanguageResponse() + ); + client.innerApiCalls.detectLanguage = stubSimpleCall(expectedResponse); + const [response] = await client.detectLanguage(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes detectLanguage without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DetectLanguageResponse() + ); + client.innerApiCalls.detectLanguage = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.detectLanguage( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3beta1.IDetectLanguageResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes detectLanguage with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.detectLanguage = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.detectLanguage(request); + }, expectedError); + assert( + (client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getSupportedLanguages', () => { + it('invokes getSupportedLanguages without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.SupportedLanguages() + ); + client.innerApiCalls.getSupportedLanguages = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getSupportedLanguages(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getSupportedLanguages without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.SupportedLanguages() + ); + client.innerApiCalls.getSupportedLanguages = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getSupportedLanguages( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3beta1.ISupportedLanguages | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getSupportedLanguages with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSupportedLanguages = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getSupportedLanguages(request); + }, expectedError); + assert( + (client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getGlossary', () => { + it('invokes getGlossary without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ); + client.innerApiCalls.getGlossary = stubSimpleCall(expectedResponse); + const [response] = await client.getGlossary(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getGlossary without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ); + client.innerApiCalls.getGlossary = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getGlossary( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3beta1.IGlossary | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getGlossary with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGlossary = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getGlossary(request); + }, expectedError); + assert( + (client.innerApiCalls.getGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('batchTranslateText', () => { + it('invokes batchTranslateText without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchTranslateText = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.batchTranslateText(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchTranslateText without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchTranslateText = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.batchTranslateText( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes batchTranslateText with call error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateText = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.batchTranslateText(request); + }, expectedError); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchTranslateText with LRO error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateText = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchTranslateText(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createGlossary', () => { + it('invokes createGlossary without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGlossary = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.createGlossary(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createGlossary without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGlossary = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createGlossary( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createGlossary with call error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGlossary = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createGlossary(request); + }, expectedError); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createGlossary with LRO error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGlossary = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGlossary(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteGlossary', () => { + it('invokes deleteGlossary without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGlossary = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.deleteGlossary(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteGlossary without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGlossary = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteGlossary( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteGlossary with call error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGlossary = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.deleteGlossary(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteGlossary with LRO error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGlossary = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGlossary(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listGlossaries', () => { + it('invokes listGlossaries without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + ]; + client.innerApiCalls.listGlossaries = stubSimpleCall(expectedResponse); + const [response] = await client.listGlossaries(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listGlossaries without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + ]; + client.innerApiCalls.listGlossaries = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listGlossaries( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3beta1.IGlossary[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listGlossaries with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGlossaries = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listGlossaries(request); + }, expectedError); + assert( + (client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listGlossariesStream without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + ]; + client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listGlossariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.translation.v3beta1.Glossary[] = []; + stream.on( + 'data', + (response: protos.google.cloud.translation.v3beta1.Glossary) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGlossaries, request) + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listGlossariesStream with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listGlossariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.translation.v3beta1.Glossary[] = []; + stream.on( + 'data', + (response: protos.google.cloud.translation.v3beta1.Glossary) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGlossaries, request) + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listGlossaries without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + ]; + client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; + const iterable = client.listGlossariesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listGlossaries with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listGlossariesAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('glossary', () => { + const fakePath = '/rendered/path/glossary'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + glossary: 'glossaryValue', + }; + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.glossaryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.glossaryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('glossaryPath', () => { + const result = client.glossaryPath( + 'projectValue', + 'locationValue', + 'glossaryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.glossaryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGlossaryName', () => { + const result = client.matchProjectFromGlossaryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGlossaryName', () => { + const result = client.matchLocationFromGlossaryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchGlossaryFromGlossaryName', () => { + const result = client.matchGlossaryFromGlossaryName(fakePath); + assert.strictEqual(result, 'glossaryValue'); + assert( + (client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index 964ba950770..194d209687e 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -19,13 +19,14 @@ import { } from '@google-cloud/common/build/src/util'; import * as pfy from '@google-cloud/promisify'; import * as assert from 'assert'; -import {describe, it} from 'mocha'; +import {after, afterEach, before, beforeEach, describe, it} from 'mocha'; import * as extend from 'extend'; import * as proxyquire from 'proxyquire'; import * as r from 'request'; import * as orig from '../src'; +// eslint-disable-next-line @typescript-eslint/no-var-requires const pkgJson = require('../../package.json'); // tslint:disable-next-line no-any @@ -57,6 +58,7 @@ class FakeService { calledWith_: IArguments; request?: Function; constructor() { + // eslint-disable-next-line prefer-rest-params this.calledWith_ = arguments; } } From c6f9d3228d9302c2a7d402a2b10c4d8556314907 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 31 Mar 2020 18:40:45 -0700 Subject: [PATCH 347/513] build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#487) --- packages/google-cloud-translate/synth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py index 8d6160bcc43..7fb8ac76325 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/synth.py @@ -36,6 +36,9 @@ s.copy(library, excludes=['README.md', 'package.json', 'src/index.ts']) logging.basicConfig(level=logging.DEBUG) + +AUTOSYNTH_MULTIPLE_COMMITS = True + common_templates = gcp.CommonTemplates() templates = common_templates.node_library(source_location='build/src') s.copy(templates, excludes=[]) From a11c3262111abc9c2c43469f229c407f03500e0a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 1 Apr 2020 23:38:36 +0200 Subject: [PATCH 348/513] chore(deps): update dependency @types/sinon to v9 (#488) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.5.2` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/7.5.2/9.0.0) | --- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 53d677dfd97..fe9b0446bfe 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -58,7 +58,7 @@ "@types/node": "^10.5.7", "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", - "@types/sinon": "^7.5.2", + "@types/sinon": "^9.0.0", "c8": "^7.0.0", "codecov": "^3.0.2", "eslint": "^6.0.0", From dbbfc6fae533457204bbbac466ee70994847aee7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 2 Apr 2020 00:14:15 +0200 Subject: [PATCH 349/513] fix(deps): update dependency @google-cloud/common to v3 (#481) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@google-cloud/common](https://togithub.com/googleapis/nodejs-common) | dependencies | major | [`^2.0.0` -> `^3.0.0`](https://renovatebot.com/diffs/npm/@google-cloud%2fcommon/2.4.0/3.0.0) | --- ### Release Notes
googleapis/nodejs-common ### [`v3.0.0`](https://togithub.com/googleapis/nodejs-common/blob/master/CHANGELOG.md#​300-httpswwwgithubcomgoogleapisnodejs-commoncomparev240v300-2020-03-26) [Compare Source](https://togithub.com/googleapis/nodejs-common/compare/v2.4.0...v3.0.0) ##### ⚠ BREAKING CHANGES - drop support for node.js 8 ([#​554](https://togithub.com/googleapis/nodejs-common/issues/554)) - remove support for custom promises ([#​541](https://togithub.com/googleapis/nodejs-common/issues/541)) ##### Features - add progress events ([#​540](https://www.github.com/googleapis/nodejs-common/issues/540)) ([1834059](https://www.github.com/googleapis/nodejs-common/commit/18340596ecb61018e5427371b9b5a120753ec003)) ##### Bug Fixes - remove support for custom promises ([#​541](https://www.github.com/googleapis/nodejs-common/issues/541)) ([ecf1c16](https://www.github.com/googleapis/nodejs-common/commit/ecf1c167927b609f13dc4fbec1954ff3a2765344)) - **deps:** update dependency [@​google-cloud/projectify](https://togithub.com/google-cloud/projectify) to v2 ([#​553](https://www.github.com/googleapis/nodejs-common/issues/553)) ([23030a2](https://www.github.com/googleapis/nodejs-common/commit/23030a25783cd091f4720c25a15416c91e7bd0a0)) - **deps:** update dependency [@​google-cloud/promisify](https://togithub.com/google-cloud/promisify) to v2 ([#​552](https://www.github.com/googleapis/nodejs-common/issues/552)) ([63175e0](https://www.github.com/googleapis/nodejs-common/commit/63175e0c4504020466a95e92c2449bdb8ac47546)) ##### Miscellaneous Chores - drop support for node.js 8 ([#​554](https://www.github.com/googleapis/nodejs-common/issues/554)) ([9f41047](https://www.github.com/googleapis/nodejs-common/commit/9f410477432893f68e57b5eeb31a068a3d8ef52f))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index fe9b0446bfe..73ba21617e3 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -44,7 +44,7 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "@google-cloud/common": "^2.0.0", + "@google-cloud/common": "^3.0.0", "@google-cloud/promisify": "^1.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", From 83981baed9b232e191615ca00fccbcdda0524ce4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 2 Apr 2020 00:30:18 +0200 Subject: [PATCH 350/513] fix(deps): update dependency @google-cloud/promisify to v2 (#476) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@google-cloud/promisify](https://togithub.com/googleapis/nodejs-promisify) | dependencies | major | [`^1.0.0` -> `^2.0.0`](https://renovatebot.com/diffs/npm/@google-cloud%2fpromisify/1.0.4/2.0.0) | --- ### Release Notes
googleapis/nodejs-promisify ### [`v2.0.0`](https://togithub.com/googleapis/nodejs-promisify/blob/master/CHANGELOG.md#​200-httpswwwgithubcomgoogleapisnodejs-promisifycomparev104v200-2020-03-23) [Compare Source](https://togithub.com/googleapis/nodejs-promisify/compare/v1.0.4...v2.0.0) ##### ⚠ BREAKING CHANGES - update to latest version of gts/typescript ([#​183](https://togithub.com/googleapis/nodejs-promisify/issues/183)) - drop Node 8 from engines field ([#​184](https://togithub.com/googleapis/nodejs-promisify/issues/184)) ##### Features - drop Node 8 from engines field ([#​184](https://www.github.com/googleapis/nodejs-promisify/issues/184)) ([7e6d3c5](https://www.github.com/googleapis/nodejs-promisify/commit/7e6d3c54066d89530ed25c7f9722efd252f43fb8)) ##### Build System - update to latest version of gts/typescript ([#​183](https://www.github.com/googleapis/nodejs-promisify/issues/183)) ([9c3ed12](https://www.github.com/googleapis/nodejs-promisify/commit/9c3ed12c12f4bb1e17af7440c6371c4cefddcd59)) ##### [1.0.4](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.3...v1.0.4) (2019-12-05) ##### Bug Fixes - **deps:** pin TypeScript below 3.7.0 ([e48750e](https://www.github.com/googleapis/nodejs-promisify/commit/e48750ef96aa20eb3a2b73fe2f062d04430468a7)) ##### [1.0.3](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.2...v1.0.3) (2019-11-13) ##### Bug Fixes - **docs:** add jsdoc-region-tag plugin ([#​146](https://www.github.com/googleapis/nodejs-promisify/issues/146)) ([ff0ee74](https://www.github.com/googleapis/nodejs-promisify/commit/ff0ee7408f50e8f7147b8ccf7e10337aa5920076)) ##### [1.0.2](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.1...v1.0.2) (2019-06-26) ##### Bug Fixes - **docs:** link to reference docs section on googleapis.dev ([#​128](https://www.github.com/googleapis/nodejs-promisify/issues/128)) ([5a8bd90](https://www.github.com/googleapis/nodejs-promisify/commit/5a8bd90)) ##### [1.0.1](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.0...v1.0.1) (2019-06-14) ##### Bug Fixes - **docs:** move to new client docs URL ([#​124](https://www.github.com/googleapis/nodejs-promisify/issues/124)) ([34d18cd](https://www.github.com/googleapis/nodejs-promisify/commit/34d18cd))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 73ba21617e3..54889254bae 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -45,7 +45,7 @@ }, "dependencies": { "@google-cloud/common": "^3.0.0", - "@google-cloud/promisify": "^1.0.0", + "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", "google-gax": "^2.0.1", From f74333ad5cc0743c6c2a4bab99f325e9b0f69227 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 3 Apr 2020 00:56:15 +0200 Subject: [PATCH 351/513] chore(deps): update dependency google-auth-library to v6 (#479) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [google-auth-library](https://togithub.com/googleapis/google-auth-library-nodejs) | devDependencies | major | [`^5.7.0` -> `^6.0.0`](https://renovatebot.com/diffs/npm/google-auth-library/5.10.1/6.0.0) | --- ### Release Notes
googleapis/google-auth-library-nodejs ### [`v6.0.0`](https://togithub.com/googleapis/google-auth-library-nodejs/blob/master/CHANGELOG.md#​600-httpswwwgithubcomgoogleapisgoogle-auth-library-nodejscomparev5101v600-2020-03-26) [Compare Source](https://togithub.com/googleapis/google-auth-library-nodejs/compare/v5.10.1...v6.0.0) ##### ⚠ BREAKING CHANGES - typescript@3.7.x introduced some breaking changes in generated code. - require node 10 in engines field ([#​926](https://togithub.com/googleapis/google-auth-library-nodejs/issues/926)) - remove deprecated methods ([#​906](https://togithub.com/googleapis/google-auth-library-nodejs/issues/906)) ##### Features - require node 10 in engines field ([#​926](https://www.github.com/googleapis/google-auth-library-nodejs/issues/926)) ([d89c59a](https://www.github.com/googleapis/google-auth-library-nodejs/commit/d89c59a316e9ca5b8c351128ee3e2d91e9729d5c)) ##### Bug Fixes - do not warn for SDK creds ([#​905](https://www.github.com/googleapis/google-auth-library-nodejs/issues/905)) ([9536840](https://www.github.com/googleapis/google-auth-library-nodejs/commit/9536840f88e77f747bbbc2c1b5b4289018fc23c9)) - use iamcredentials API to sign blobs ([#​908](https://www.github.com/googleapis/google-auth-library-nodejs/issues/908)) ([7b8e4c5](https://www.github.com/googleapis/google-auth-library-nodejs/commit/7b8e4c52e31bb3d448c3ff8c05002188900eaa04)) - **deps:** update dependency gaxios to v3 ([#​917](https://www.github.com/googleapis/google-auth-library-nodejs/issues/917)) ([1f4bf61](https://www.github.com/googleapis/google-auth-library-nodejs/commit/1f4bf6128a0dcf22cfe1ec492b2192f513836cb2)) - **deps:** update dependency gcp-metadata to v4 ([#​918](https://www.github.com/googleapis/google-auth-library-nodejs/issues/918)) ([d337131](https://www.github.com/googleapis/google-auth-library-nodejs/commit/d337131d009cc1f8182f7a1f8a9034433ee3fbf7)) - **types:** add additional fields to TokenInfo ([#​907](https://www.github.com/googleapis/google-auth-library-nodejs/issues/907)) ([5b48eb8](https://www.github.com/googleapis/google-auth-library-nodejs/commit/5b48eb86c108c47d317a0eb96b47c0cae86f98cb)) ##### Build System - update to latest gts and TypeScript ([#​927](https://www.github.com/googleapis/google-auth-library-nodejs/issues/927)) ([e11e18c](https://www.github.com/googleapis/google-auth-library-nodejs/commit/e11e18cb33eb60a666980d061c54bb8891cdd242)) ##### Miscellaneous Chores - remove deprecated methods ([#​906](https://www.github.com/googleapis/google-auth-library-nodejs/issues/906)) ([f453fb7](https://www.github.com/googleapis/google-auth-library-nodejs/commit/f453fb7d8355e6dc74800b18d6f43c4e91d4acc9)) ##### [5.10.1](https://www.github.com/googleapis/google-auth-library-nodejs/compare/v5.10.0...v5.10.1) (2020-02-25) ##### Bug Fixes - if GCF environment detected, increase library timeout ([#​899](https://www.github.com/googleapis/google-auth-library-nodejs/issues/899)) ([2577ff2](https://www.github.com/googleapis/google-auth-library-nodejs/commit/2577ff28bf22dfc58bd09e7365471c16f359f109))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 54889254bae..45dce5d2078 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -65,7 +65,7 @@ "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", - "google-auth-library": "^5.7.0", + "google-auth-library": "^6.0.0", "gts": "2.0.0-alpha.9", "http2spy": "^1.1.0", "jsdoc": "^3.6.2", From 9d60ccda23a252180e9dba9b32eb6bd775988e3f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 5 Apr 2020 12:50:14 -0700 Subject: [PATCH 352/513] chore: remove duplicate mocha config (#501) --- packages/google-cloud-translate/.mocharc.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 packages/google-cloud-translate/.mocharc.json diff --git a/packages/google-cloud-translate/.mocharc.json b/packages/google-cloud-translate/.mocharc.json deleted file mode 100644 index 670c5e2c24b..00000000000 --- a/packages/google-cloud-translate/.mocharc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} From 7ba746f15e89cf503644c260336570dac9841f4a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 6 Apr 2020 20:13:47 -0700 Subject: [PATCH 353/513] fix: ensure scoped protobuf (#500) --- .../google-cloud-translate/protos/protos.js | 2 +- .../google-cloud-translate/synth.metadata | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index 5999f8bfd7f..ada34854095 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + var $root = $protobuf.roots._google_cloud_translate_5_3_0_protos || ($protobuf.roots._google_cloud_translate_5_3_0_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 521701670a1..99f1e93b671 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,5 +1,22 @@ { - "updateTime": "2020-03-31T20:14:27.117117Z", + "updateTime": "2020-04-03T12:20:41.545746Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "5378173a889f9c7d83e36e52d38a6267190de692", + "internalRef": "304594381" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + } + } + ], "destinations": [ { "client": { From e87d9da097f9b0a37a6c836e44c0484d857f7780 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 10 Apr 2020 18:50:51 -0700 Subject: [PATCH 354/513] fix: remove eslint, update gax, fix generated protos, run the generator (#507) Run the latest version of the generator, update google-gax, update gts, and remove direct dependencies on eslint. --- packages/google-cloud-translate/.jsdoc.js | 2 +- .../google-cloud-translate/.prettierrc.js | 2 +- packages/google-cloud-translate/package.json | 14 ++++------ .../google-cloud-translate/protos/protos.json | 16 +++++++++--- .../google-cloud-translate/src/v2/index.ts | 4 +-- .../google-cloud-translate/synth.metadata | 13 +++------- packages/google-cloud-translate/synth.py | 2 +- .../system-test/translate.ts | 1 - .../test/gapic_translation_service_v3.ts | 26 +++++++++---------- .../test/gapic_translation_service_v3beta1.ts | 26 +++++++++---------- 10 files changed, 51 insertions(+), 55 deletions(-) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index 907b80b0b1e..a9fe77d5096 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2019 Google, LLC.', + copyright: 'Copyright 2020 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/translate', diff --git a/packages/google-cloud-translate/.prettierrc.js b/packages/google-cloud-translate/.prettierrc.js index 08cba3775be..d1b95106f4c 100644 --- a/packages/google-cloud-translate/.prettierrc.js +++ b/packages/google-cloud-translate/.prettierrc.js @@ -4,7 +4,7 @@ // 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 +// https://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, diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 45dce5d2078..5ba1b505e3b 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -30,25 +30,25 @@ "scripts": { "docs": "jsdoc -c .jsdoc.js", "predocs": "npm run compile", - "lint": "gts check && eslint '**/*.js'", + "lint": "gts fix", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha build/system-test --timeout 600000", "test": "c8 mocha build/test", "compile": "tsc -p . && cp -r protos build/", - "fix": "gts fix && eslint --fix '**/*.js'", + "fix": "gts fix", "prepare": "npm run compile", "pretest": "npm run compile", "presystem-test": "npm run compile", "docs-test": "linkinator docs", "predocs-test": "npm run docs", - "prelint": "cd samples; npm link ../; npm i" + "prelint": "cd samples; npm link ../; npm install" }, "dependencies": { "@google-cloud/common": "^3.0.0", "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^2.0.1", + "google-gax": "^2.1.0", "is-html": "^2.0.0", "protobufjs": "^6.8.8" }, @@ -61,12 +61,8 @@ "@types/sinon": "^9.0.0", "c8": "^7.0.0", "codecov": "^3.0.2", - "eslint": "^6.0.0", - "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^11.0.0", - "eslint-plugin-prettier": "^3.0.0", "google-auth-library": "^6.0.0", - "gts": "2.0.0-alpha.9", + "gts": "^2.0.0", "http2spy": "^1.1.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index f4f8d5076a9..4208aec51ea 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -2695,26 +2695,32 @@ "extend": "google.protobuf.MethodOptions" }, "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, "methods": { "ListOperations": { "requestType": "ListOperationsRequest", "responseType": "ListOperationsResponse", "options": { - "(google.api.http).get": "/v1/{name=operations}" + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" } }, "GetOperation": { "requestType": "GetOperationRequest", "responseType": "Operation", "options": { - "(google.api.http).get": "/v1/{name=operations/**}" + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" } }, "DeleteOperation": { "requestType": "DeleteOperationRequest", "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).delete": "/v1/{name=operations/**}" + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" } }, "CancelOperation": { @@ -2722,7 +2728,8 @@ "responseType": "google.protobuf.Empty", "options": { "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" } }, "WaitOperation": { @@ -2848,6 +2855,7 @@ }, "rpc": { "options": { + "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", "java_multiple_files": true, "java_outer_classname": "StatusProto", diff --git a/packages/google-cloud-translate/src/v2/index.ts b/packages/google-cloud-translate/src/v2/index.ts index 76daff2c61d..3b4e0aaf718 100644 --- a/packages/google-cloud-translate/src/v2/index.ts +++ b/packages/google-cloud-translate/src/v2/index.ts @@ -271,7 +271,7 @@ export class Translate extends Service { }); // Deprecated. - // tslint:disable-next-line no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any delete (result as any).isReliable; return result; @@ -511,7 +511,7 @@ export class Translate extends Service { options = {to: optionsOrTo}; } - // tslint:disable-next-line no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const body: any = { q: input, format: options.format || (isHtml(input[0]) ? 'html' : 'text'), diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 99f1e93b671..2061cd076f2 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,19 +1,12 @@ { - "updateTime": "2020-04-03T12:20:41.545746Z", + "updateTime": "2020-04-11T01:04:33.653333Z", "sources": [ - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5378173a889f9c7d83e36e52d38a6267190de692", - "internalRef": "304594381" - } - }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5", + "log": "6f32150677c9784f3c3a7e1949472bd29c9d72c5\nfix: installs test_utils from its common repo (#480)\n\n\n74ce986d3b5431eb66985e9a00c4eb45295a4020\nfix: stop recording update_time in synth.metadata (#478)\n\n\n7f8e62aa3edd225f76347a16f92e400661fdfb52\nchore(java): release-please only updates non maven versions in README (#476)\n\nPrevent release-please and synthtool from fighting over the released library version. Synthtool updates the install snippets from the samples pom.xml files so the bots fight if they are temporarily out of sync after a release.\nc7e0e517d7f46f77bebd27da2e5afcaa6eee7e25\nbuild(java): fix nightly integration test config to run integrations (#465)\n\nThis was only running the units.\nbd69a2aa7b70875f3c988e269706b22fefbef40e\nbuild(java): fix retry_with_backoff when -e option set (#475)\n\n\nd9b173c427bfa0c6cca818233562e7e8841a357c\nfix: record version of working repo in synth.metadata (#473)\n\nPartial revert of b37cf74d12e9a42b9de9e61a4f26133d7cd9c168.\nf73a541770d95a609e5be6bf6b3b220d17cefcbe\nfeat(discogapic): allow local discovery-artifact-manager (#474)\n\n\n8cf0f5d93a70c3dcb0b4999d3152c46d4d9264bf\ndoc: describe the Autosynth & Synthtool protocol (#472)\n\n* doc: describe the Autosynth & Synthtool protocol\n\n* Accommodate review comments.\n980baaa738a1ad8fa02b4fdbd56be075ee77ece5\nfix: pin sphinx to <3.0.0 as new version causes new error (#471)\n\nThe error `toctree contains reference to document changlelog that doesn't have a title: no link will be generated` occurs as of 3.0.0. Pinning to 2.x until we address the docs build issue.\n\nTowards #470\n\nI did this manually for python-datastore https://github.com/googleapis/python-datastore/pull/22\n928b2998ac5023e7c7e254ab935f9ef022455aad\nchore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.15 (#466)\n\nCo-authored-by: Jeffrey Rennie \n188f1b1d53181f739b98f8aa5d40cfe99eb90c47\nfix: allow local and external deps to be specified (#469)\n\nModify noxfile.py to allow local and external dependencies for\nsystem tests to be specified.\n1df68ed6735ddce6797d0f83641a731c3c3f75b4\nfix: apache license URL (#468)\n\n\nf4a59efa54808c4b958263de87bc666ce41e415f\nfeat: Add discogapic support for GAPICBazel generation (#459)\n\n* feat: Add discogapic support for GAPICBazel generation\n\n* reformat with black\n\n* Rename source repository variable\n\nCo-authored-by: Jeffrey Rennie \n" } } ], diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py index 7fb8ac76325..819ff17da00 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/synth.py @@ -45,5 +45,5 @@ # Node.js specific cleanup subprocess.run(["npm", "install"]) -subprocess.run(["npm", "run", "fix"]) +subprocess.run(["npm", "run", "lint"]) subprocess.run(["npx", "compileProtos", "src"]) diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 561112ba0ad..a68415ee1ae 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -18,7 +18,6 @@ import {TranslationServiceClient} from '../src'; // eslint-disable-next-line @typescript-eslint/no-var-requires const http2spy = require('http2spy'); -const API_KEY = process.env.TRANSLATE_API_KEY; describe('translate', () => { const translate = new TranslationServiceClient(); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts index ac652102ace..1febe1880f1 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -331,7 +331,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.translateText(request); }, expectedError); assert( @@ -445,7 +445,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.detectLanguage(request); }, expectedError); assert( @@ -561,7 +561,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getSupportedLanguages(request); }, expectedError); assert( @@ -675,7 +675,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getGlossary(request); }, expectedError); assert( @@ -799,7 +799,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.batchTranslateText(request); }, expectedError); assert( @@ -834,7 +834,7 @@ describe('v3.TranslationServiceClient', () => { expectedError ); const [operation] = await client.batchTranslateText(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -958,7 +958,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createGlossary(request); }, expectedError); assert( @@ -993,7 +993,7 @@ describe('v3.TranslationServiceClient', () => { expectedError ); const [operation] = await client.createGlossary(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1117,7 +1117,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteGlossary(request); }, expectedError); assert( @@ -1152,7 +1152,7 @@ describe('v3.TranslationServiceClient', () => { expectedError ); const [operation] = await client.deleteGlossary(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1282,7 +1282,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listGlossaries(request); }, expectedError); assert( @@ -1381,7 +1381,7 @@ describe('v3.TranslationServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -1460,7 +1460,7 @@ describe('v3.TranslationServiceClient', () => { expectedError ); const iterable = client.listGlossariesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.translation.v3.IGlossary[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts index 03e054def8e..ee05fbaad51 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -347,7 +347,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.translateText(request); }, expectedError); assert( @@ -467,7 +467,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.detectLanguage(request); }, expectedError); assert( @@ -589,7 +589,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getSupportedLanguages(request); }, expectedError); assert( @@ -709,7 +709,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getGlossary(request); }, expectedError); assert( @@ -839,7 +839,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.batchTranslateText(request); }, expectedError); assert( @@ -876,7 +876,7 @@ describe('v3beta1.TranslationServiceClient', () => { expectedError ); const [operation] = await client.batchTranslateText(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1006,7 +1006,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createGlossary(request); }, expectedError); assert( @@ -1043,7 +1043,7 @@ describe('v3beta1.TranslationServiceClient', () => { expectedError ); const [operation] = await client.createGlossary(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1173,7 +1173,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteGlossary(request); }, expectedError); assert( @@ -1210,7 +1210,7 @@ describe('v3beta1.TranslationServiceClient', () => { expectedError ); const [operation] = await client.deleteGlossary(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1346,7 +1346,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listGlossaries(request); }, expectedError); assert( @@ -1449,7 +1449,7 @@ describe('v3beta1.TranslationServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -1532,7 +1532,7 @@ describe('v3beta1.TranslationServiceClient', () => { expectedError ); const iterable = client.listGlossariesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; for await (const resource of iterable) { responses.push(resource!); From 5d8a902fb4ef65318bf28530d216b2e88c43982e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 12 Apr 2020 05:33:59 +0200 Subject: [PATCH 355/513] fix(deps): update dependency @google-cloud/automl to v2 (#503) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 35251e379c3..7b49b651d2c 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -14,7 +14,7 @@ "test": "mocha --recursive --timeout 150000" }, "dependencies": { - "@google-cloud/automl": "^1.0.0", + "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^1.1.4", "@google-cloud/translate": "^5.3.0", "@google-cloud/vision": "^1.2.0", From c860422c4d44708eddcbc8264b19ca4b6fcd996c Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 13 Apr 2020 09:34:50 -0700 Subject: [PATCH 356/513] test: translation of text added comma (#510) --- packages/google-cloud-translate/samples/test/quickstart.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/test/quickstart.test.js b/packages/google-cloud-translate/samples/test/quickstart.test.js index b9e9ea11b9e..f1ed0c72fe0 100644 --- a/packages/google-cloud-translate/samples/test/quickstart.test.js +++ b/packages/google-cloud-translate/samples/test/quickstart.test.js @@ -27,6 +27,6 @@ const projectId = process.env.GCLOUD_PROJECT; describe('quickstart sample tests', () => { it('should translate a string', async () => { const stdout = execSync(`node quickstart ${projectId}`, {cwd}); - assert.match(stdout, new RegExp('Translation: Привет, мир!')); + assert.include(stdout, 'Translation: Привет'); }); }); From e2e46113a209cfe8d5e270d73594ff1532f74bca Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 10:08:10 -0700 Subject: [PATCH 357/513] build: remove unused codecov config (#508) --- packages/google-cloud-translate/codecov.yaml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 packages/google-cloud-translate/codecov.yaml diff --git a/packages/google-cloud-translate/codecov.yaml b/packages/google-cloud-translate/codecov.yaml deleted file mode 100644 index 5724ea9478d..00000000000 --- a/packages/google-cloud-translate/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com From cf08f4183119a7965a848ec3f41d908c01e20f1a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 15:05:14 -0700 Subject: [PATCH 358/513] chore: update lint ignore files (#511) --- packages/google-cloud-translate/.eslintignore | 3 ++- packages/google-cloud-translate/.prettierignore | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/.eslintignore b/packages/google-cloud-translate/.eslintignore index 09b31fe735a..9340ad9b86d 100644 --- a/packages/google-cloud-translate/.eslintignore +++ b/packages/google-cloud-translate/.eslintignore @@ -1,5 +1,6 @@ **/node_modules -src/**/doc/* +**/coverage +test/fixtures build/ docs/ protos/ diff --git a/packages/google-cloud-translate/.prettierignore b/packages/google-cloud-translate/.prettierignore index f6fac98b0a8..9340ad9b86d 100644 --- a/packages/google-cloud-translate/.prettierignore +++ b/packages/google-cloud-translate/.prettierignore @@ -1,3 +1,6 @@ -node_modules/* -samples/node_modules/* -src/**/doc/* +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ From acdd4711e6bb2d06a9e00c7f2efc1d166612ed68 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 19:42:13 -0700 Subject: [PATCH 359/513] chore: remove tslint.json (#512) --- packages/google-cloud-translate/tslint.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 packages/google-cloud-translate/tslint.json diff --git a/packages/google-cloud-translate/tslint.json b/packages/google-cloud-translate/tslint.json deleted file mode 100644 index 617dc975bae..00000000000 --- a/packages/google-cloud-translate/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "gts/tslint.json" -} From 2479ead3db5b4a788a6c250ab81d96d805d026e2 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 14 Apr 2020 09:55:08 -0700 Subject: [PATCH 360/513] chore: remove unused dev packages (#513) --- packages/google-cloud-translate/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 5ba1b505e3b..3575cad03b6 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -70,7 +70,6 @@ "linkinator": "^2.0.0", "mocha": "^7.0.0", "pack-n-play": "^1.0.0-2", - "prettier": "^1.13.5", "proxyquire": "^2.0.1", "sinon": "^9.0.1", "typescript": "^3.8.3" From eb3f3c39d5e92bd5ea3afc088ce4030663202b52 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Thu, 16 Apr 2020 20:24:51 -0700 Subject: [PATCH 361/513] chore: apply new linting rules. (#523) --- .../src/v3/translation_service_client.ts | 1651 +++++------ .../src/v3beta1/translation_service_client.ts | 1666 +++++------ .../google-cloud-translate/synth.metadata | 19 +- .../system-test/fixtures/sample/src/index.js | 1 + .../system-test/install.ts | 28 +- .../test/gapic_translation_service_v3.ts | 2534 +++++++--------- .../test/gapic_translation_service_v3beta1.ts | 2618 +++++++---------- .../google-cloud-translate/webpack.config.js | 12 +- 8 files changed, 3547 insertions(+), 4982 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 0acb7f8f4c2..39e935b516d 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -17,19 +17,11 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; -import { - Callback, - CallOptions, - Descriptors, - ClientOptions, - LROperation, - PaginationCallback, - GaxCall, -} from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; import * as path from 'path'; -import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './translation_service_client_config.json'; @@ -48,12 +40,7 @@ export class TranslationServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; + descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}, batching: {}}; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -88,12 +75,10 @@ export class TranslationServiceClient { constructor(opts?: ClientOptions) { // Ensure that options include the service address and port. const staticMembers = this.constructor as typeof TranslationServiceClient; - const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; + const servicePath = opts && opts.servicePath ? + opts.servicePath : + ((opts && opts.apiEndpoint) ? opts.apiEndpoint : + staticMembers.servicePath); const port = opts && opts.port ? opts.port : staticMembers.port; if (!opts) { @@ -103,8 +88,8 @@ export class TranslationServiceClient { opts.port = opts.port || port; opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { + const isBrowser = (typeof window !== 'undefined'); + if (isBrowser){ opts.fallback = true; } // If we are in browser, we are already using fallback because of the @@ -121,10 +106,13 @@ export class TranslationServiceClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); // Determine the client header string. - const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -140,18 +128,12 @@ export class TranslationServiceClient { // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); + const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath + opts.fallback ? + // eslint-disable-next-line @typescript-eslint/no-var-requires + require("../../protos/protos.json") : + nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated @@ -170,73 +152,55 @@ export class TranslationServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listGlossaries: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'glossaries' - ), + listGlossaries: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'glossaries') }; // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - const protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + const protoFilesRoot = opts.fallback ? + this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require("../../protos/protos.json")) : + this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) - .operationsClient(opts); + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); const batchTranslateTextResponse = protoFilesRoot.lookup( - '.google.cloud.translation.v3.BatchTranslateResponse' - ) as gax.protobuf.Type; + '.google.cloud.translation.v3.BatchTranslateResponse') as gax.protobuf.Type; const batchTranslateTextMetadata = protoFilesRoot.lookup( - '.google.cloud.translation.v3.BatchTranslateMetadata' - ) as gax.protobuf.Type; + '.google.cloud.translation.v3.BatchTranslateMetadata') as gax.protobuf.Type; const createGlossaryResponse = protoFilesRoot.lookup( - '.google.cloud.translation.v3.Glossary' - ) as gax.protobuf.Type; + '.google.cloud.translation.v3.Glossary') as gax.protobuf.Type; const createGlossaryMetadata = protoFilesRoot.lookup( - '.google.cloud.translation.v3.CreateGlossaryMetadata' - ) as gax.protobuf.Type; + '.google.cloud.translation.v3.CreateGlossaryMetadata') as gax.protobuf.Type; const deleteGlossaryResponse = protoFilesRoot.lookup( - '.google.cloud.translation.v3.DeleteGlossaryResponse' - ) as gax.protobuf.Type; + '.google.cloud.translation.v3.DeleteGlossaryResponse') as gax.protobuf.Type; const deleteGlossaryMetadata = protoFilesRoot.lookup( - '.google.cloud.translation.v3.DeleteGlossaryMetadata' - ) as gax.protobuf.Type; + '.google.cloud.translation.v3.DeleteGlossaryMetadata') as gax.protobuf.Type; this.descriptors.longrunning = { batchTranslateText: new this._gaxModule.LongrunningDescriptor( this.operationsClient, batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), - batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) - ), + batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata)), createGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGlossaryResponse.decode.bind(createGlossaryResponse), - createGlossaryMetadata.decode.bind(createGlossaryMetadata) - ), + createGlossaryMetadata.decode.bind(createGlossaryMetadata)), deleteGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), - deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata) - ), + deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata)) }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.translation.v3.TranslationService', - gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, - {'x-goog-api-client': clientHeader.join(' ')} - ); + 'google.cloud.translation.v3.TranslationService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code @@ -264,27 +228,16 @@ export class TranslationServiceClient { // Put together the "service stub" for // google.cloud.translation.v3.TranslationService. this.translationServiceStub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.cloud.translation.v3.TranslationService' - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.translation.v3.TranslationService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.translation.v3.TranslationService, - this._opts - ) as Promise<{[method: string]: Function}>; + this._opts) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides // and create an API call method for each. - const translationServiceStubMethods = [ - 'translateText', - 'detectLanguage', - 'getSupportedLanguages', - 'batchTranslateText', - 'createGlossary', - 'listGlossaries', - 'getGlossary', - 'deleteGlossary', - ]; + const translationServiceStubMethods = + ['translateText', 'detectLanguage', 'getSupportedLanguages', 'batchTranslateText', 'createGlossary', 'listGlossaries', 'getGlossary', 'deleteGlossary']; for (const methodName of translationServiceStubMethods) { const callPromise = this.translationServiceStub.then( stub => (...args: Array<{}>) => { @@ -294,17 +247,16 @@ export class TranslationServiceClient { const func = stub[methodName]; return func.apply(stub, args); }, - (err: Error | null | undefined) => () => { + (err: Error|null|undefined) => () => { throw err; - } - ); + }); const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); this.innerApiCalls[methodName] = apiCall; @@ -342,7 +294,7 @@ export class TranslationServiceClient { static get scopes() { return [ 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-translation', + 'https://www.googleapis.com/auth/cloud-translation' ]; } @@ -353,9 +305,8 @@ export class TranslationServiceClient { * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId( - callback?: Callback - ): Promise | void { + getProjectId(callback?: Callback): + Promise|void { if (callback) { this.auth.getProjectId(callback); return; @@ -367,140 +318,119 @@ export class TranslationServiceClient { // -- Service calls -- // ------------------- translateText( - request: protos.google.cloud.translation.v3.ITranslateTextRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3.ITranslateTextResponse, - protos.google.cloud.translation.v3.ITranslateTextRequest | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3.ITranslateTextRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.translation.v3.ITranslateTextResponse, + protos.google.cloud.translation.v3.ITranslateTextRequest|undefined, {}|undefined + ]>; translateText( - request: protos.google.cloud.translation.v3.ITranslateTextRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3.ITranslateTextResponse, - | protos.google.cloud.translation.v3.ITranslateTextRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3.ITranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.ITranslateTextResponse, + protos.google.cloud.translation.v3.ITranslateTextRequest|null|undefined, + {}|null|undefined>): void; translateText( - request: protos.google.cloud.translation.v3.ITranslateTextRequest, - callback: Callback< - protos.google.cloud.translation.v3.ITranslateTextResponse, - | protos.google.cloud.translation.v3.ITranslateTextRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Translates input text and returns translated text. - * - * @param {Object} request - * The request object that will be sent. - * @param {string[]} request.contents - * Required. The content of the input in string format. - * We recommend the total content be less than 30k codepoints. - * Use BatchTranslateText for larger text. - * @param {string} [request.mimeType] - * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {string} [request.sourceLanguageCode] - * Optional. The BCP-47 language code of the input text if - * known, for example, "en-US" or "sr-Latn". Supported language codes are - * listed in Language Support. If the source language isn't specified, the API - * attempts to identify the source language automatically and returns the - * source language within the response. - * @param {string} request.targetLanguageCode - * Required. The BCP-47 language code to use for translation of the input - * text, set to one of the language codes listed in Language Support. - * @param {string} request.parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-number-or-id}` or - * `projects/{project-number-or-id}/locations/{location-id}`. - * - * For global calls, use `projects/{project-number-or-id}/locations/global` or - * `projects/{project-number-or-id}`. - * - * Non-global location is required for requests using AutoML models or - * custom glossaries. - * - * Models and glossaries must be within the same region (have same - * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.model] - * Optional. The `model` type requested for this translation. - * - * The format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` - * - * - * For global (non-regionalized) requests, use `location-id` `global`. - * For example, - * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - * - * If missing, the system decides which google base model to use. - * @param {google.cloud.translation.v3.TranslateTextGlossaryConfig} [request.glossaryConfig] - * Optional. Glossary to be applied. The glossary must be - * within the same region (have the same location-id) as the model, otherwise - * an INVALID_ARGUMENT (400) error is returned. - * @param {number[]} [request.labels] - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3.TranslateTextResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.ITranslateTextRequest, + callback: Callback< + protos.google.cloud.translation.v3.ITranslateTextResponse, + protos.google.cloud.translation.v3.ITranslateTextRequest|null|undefined, + {}|null|undefined>): void; +/** + * Translates input text and returns translated text. + * + * @param {Object} request + * The request object that will be sent. + * @param {string[]} request.contents + * Required. The content of the input in string format. + * We recommend the total content be less than 30k codepoints. + * Use BatchTranslateText for larger text. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + * @param {string} [request.sourceLanguageCode] + * Optional. The BCP-47 language code of the input text if + * known, for example, "en-US" or "sr-Latn". Supported language codes are + * listed in Language Support. If the source language isn't specified, the API + * attempts to identify the source language automatically and returns the + * source language within the response. + * @param {string} request.targetLanguageCode + * Required. The BCP-47 language code to use for translation of the input + * text, set to one of the language codes listed in Language Support. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * + * Non-global location is required for requests using AutoML models or + * custom glossaries. + * + * Models and glossaries must be within the same region (have same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.model] + * Optional. The `model` type requested for this translation. + * + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * + * + * For global (non-regionalized) requests, use `location-id` `global`. + * For example, + * `projects/{project-number-or-id}/locations/global/models/general/nmt`. + * + * If missing, the system decides which google base model to use. + * @param {google.cloud.translation.v3.TranslateTextGlossaryConfig} [request.glossaryConfig] + * Optional. Glossary to be applied. The glossary must be + * within the same region (have the same location-id) as the model, otherwise + * an INVALID_ARGUMENT (400) error is returned. + * @param {number[]} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3.TranslateTextResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ translateText( - request: protos.google.cloud.translation.v3.ITranslateTextRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.translation.v3.ITranslateTextRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.translation.v3.ITranslateTextResponse, - | protos.google.cloud.translation.v3.ITranslateTextRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.translation.v3.ITranslateTextResponse, - | protos.google.cloud.translation.v3.ITranslateTextRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.translation.v3.ITranslateTextResponse, - protos.google.cloud.translation.v3.ITranslateTextRequest | undefined, - {} | undefined - ] - > | void { + protos.google.cloud.translation.v3.ITranslateTextRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.translation.v3.ITranslateTextResponse, + protos.google.cloud.translation.v3.ITranslateTextRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.translation.v3.ITranslateTextResponse, + protos.google.cloud.translation.v3.ITranslateTextRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -509,120 +439,99 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.translateText(request, options, callback); } detectLanguage( - request: protos.google.cloud.translation.v3.IDetectLanguageRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3.IDetectLanguageResponse, - protos.google.cloud.translation.v3.IDetectLanguageRequest | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.translation.v3.IDetectLanguageResponse, + protos.google.cloud.translation.v3.IDetectLanguageRequest|undefined, {}|undefined + ]>; detectLanguage( - request: protos.google.cloud.translation.v3.IDetectLanguageRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3.IDetectLanguageResponse, - | protos.google.cloud.translation.v3.IDetectLanguageRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.IDetectLanguageResponse, + protos.google.cloud.translation.v3.IDetectLanguageRequest|null|undefined, + {}|null|undefined>): void; detectLanguage( - request: protos.google.cloud.translation.v3.IDetectLanguageRequest, - callback: Callback< - protos.google.cloud.translation.v3.IDetectLanguageResponse, - | protos.google.cloud.translation.v3.IDetectLanguageRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Detects the language of text within a request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-number-or-id}/locations/{location-id}` or - * `projects/{project-number-or-id}`. - * - * For global calls, use `projects/{project-number-or-id}/locations/global` or - * `projects/{project-number-or-id}`. - * - * Only models within the same region (has same location-id) can be used. - * Otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.model] - * Optional. The language detection model to be used. - * - * Format: - * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` - * - * Only one language detection model is currently supported: - * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. - * - * If not specified, the default model is used. - * @param {string} request.content - * The content of the input stored as a string. - * @param {string} [request.mimeType] - * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {number[]} [request.labels] - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3.DetectLanguageResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + callback: Callback< + protos.google.cloud.translation.v3.IDetectLanguageResponse, + protos.google.cloud.translation.v3.IDetectLanguageRequest|null|undefined, + {}|null|undefined>): void; +/** + * Detects the language of text within a request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-number-or-id}/locations/{location-id}` or + * `projects/{project-number-or-id}`. + * + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * + * Only models within the same region (has same location-id) can be used. + * Otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.model] + * Optional. The language detection model to be used. + * + * Format: + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` + * + * Only one language detection model is currently supported: + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. + * + * If not specified, the default model is used. + * @param {string} request.content + * The content of the input stored as a string. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + * @param {number[]} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3.DetectLanguageResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ detectLanguage( - request: protos.google.cloud.translation.v3.IDetectLanguageRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.translation.v3.IDetectLanguageResponse, - | protos.google.cloud.translation.v3.IDetectLanguageRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.translation.v3.IDetectLanguageResponse, - | protos.google.cloud.translation.v3.IDetectLanguageRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.translation.v3.IDetectLanguageResponse, - protos.google.cloud.translation.v3.IDetectLanguageRequest | undefined, - {} | undefined - ] - > | void { + protos.google.cloud.translation.v3.IDetectLanguageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.translation.v3.IDetectLanguageResponse, + protos.google.cloud.translation.v3.IDetectLanguageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.translation.v3.IDetectLanguageResponse, + protos.google.cloud.translation.v3.IDetectLanguageRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -631,123 +540,96 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.detectLanguage(request, options, callback); } getSupportedLanguages( - request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3.ISupportedLanguages, - ( - | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest - | undefined - ), - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.translation.v3.ISupportedLanguages, + protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest|undefined, {}|undefined + ]>; getSupportedLanguages( - request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3.ISupportedLanguages, - | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.ISupportedLanguages, + protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest|null|undefined, + {}|null|undefined>): void; getSupportedLanguages( - request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - callback: Callback< - protos.google.cloud.translation.v3.ISupportedLanguages, - | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Returns a list of supported languages for translation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-number-or-id}` or - * `projects/{project-number-or-id}/locations/{location-id}`. - * - * For global calls, use `projects/{project-number-or-id}/locations/global` or - * `projects/{project-number-or-id}`. - * - * Non-global location is required for AutoML models. - * - * Only models within the same region (have same location-id) can be used, - * otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.displayLanguageCode] - * Optional. The language to use to return localized, human readable names - * of supported languages. If missing, then display names are not returned - * in a response. - * @param {string} [request.model] - * Optional. Get supported languages of this model. - * - * The format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` - * - * - * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3.SupportedLanguages}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + callback: Callback< + protos.google.cloud.translation.v3.ISupportedLanguages, + protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest|null|undefined, + {}|null|undefined>): void; +/** + * Returns a list of supported languages for translation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * + * Non-global location is required for AutoML models. + * + * Only models within the same region (have same location-id) can be used, + * otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.displayLanguageCode] + * Optional. The language to use to return localized, human readable names + * of supported languages. If missing, then display names are not returned + * in a response. + * @param {string} [request.model] + * Optional. Get supported languages of this model. + * + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * + * + * Returns languages supported by the specified model. + * If missing, we get supported languages of Google general base (PBMT) model. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3.SupportedLanguages}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getSupportedLanguages( - request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.translation.v3.ISupportedLanguages, - | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.translation.v3.ISupportedLanguages, - | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.translation.v3.ISupportedLanguages, - ( - | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest - | undefined - ), - {} | undefined - ] - > | void { + protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.translation.v3.ISupportedLanguages, + protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.translation.v3.ISupportedLanguages, + protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -756,81 +638,66 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.getSupportedLanguages(request, options, callback); } getGlossary( - request: protos.google.cloud.translation.v3.IGetGlossaryRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.IGetGlossaryRequest | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3.IGetGlossaryRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest|undefined, {}|undefined + ]>; getGlossary( - request: protos.google.cloud.translation.v3.IGetGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.IGetGlossaryRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3.IGetGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest|null|undefined, + {}|null|undefined>): void; getGlossary( - request: protos.google.cloud.translation.v3.IGetGlossaryRequest, - callback: Callback< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.IGetGlossaryRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3.Glossary}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.IGetGlossaryRequest, + callback: Callback< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest|null|undefined, + {}|null|undefined>): void; +/** + * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3.Glossary}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getGlossary( - request: protos.google.cloud.translation.v3.IGetGlossaryRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.translation.v3.IGetGlossaryRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.translation.v3.IGlossary, - | protos.google.cloud.translation.v3.IGetGlossaryRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.IGetGlossaryRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.IGetGlossaryRequest | undefined, - {} | undefined - ] - > | void { + protos.google.cloud.translation.v3.IGetGlossaryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -839,153 +706,122 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - name: request.name || '', + 'name': request.name || '', }); this.initialize(); return this.innerApiCalls.getGlossary(request, options, callback); } batchTranslateText( - request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - options?: gax.CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3.IBatchTranslateResponse, - protos.google.cloud.translation.v3.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + options?: gax.CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; batchTranslateText( - request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - options: gax.CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3.IBatchTranslateResponse, - protos.google.cloud.translation.v3.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; batchTranslateText( - request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3.IBatchTranslateResponse, - protos.google.cloud.translation.v3.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Translates a large volume of text in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * - * This call returns immediately and you can - * use google.longrunning.Operation.name to poll the status of the call. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Location to make a call. Must refer to a caller's project. - * - * Format: `projects/{project-number-or-id}/locations/{location-id}`. - * - * The `global` location is not supported for batch translation. - * - * Only AutoML Translation models or glossaries within the same region (have - * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - * error is returned. - * @param {string} request.sourceLanguageCode - * Required. Source language code. - * @param {string[]} request.targetLanguageCodes - * Required. Specify up to 10 language codes here. - * @param {number[]} [request.models] - * Optional. The models to use for translation. Map's key is target language - * code. Map's value is model name. Value can be a built-in general model, - * or an AutoML Translation model. - * - * The value format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` - * - * - * If the map is empty or a specific model is - * not requested for a language pair, then default google model (nmt) is used. - * @param {number[]} request.inputConfigs - * Required. Input configurations. - * The total number of files matched should be <= 1000. - * The total content size should be <= 100M Unicode codepoints. - * The files must use UTF-8 encoding. - * @param {google.cloud.translation.v3.OutputConfig} request.outputConfig - * Required. Output configuration. - * If 2 input configs match to the same file (that is, same input path), - * we don't generate output for duplicate inputs. - * @param {number[]} [request.glossaries] - * Optional. Glossaries to be applied for translation. - * It's keyed by target language code. - * @param {number[]} [request.labels] - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Translates a large volume of text in asynchronous batch mode. + * This function provides real-time output as the inputs are being processed. + * If caller cancels a request, the partial results (for an input file, it's + * all or nothing) may still be available on the specified output location. + * + * This call returns immediately and you can + * use google.longrunning.Operation.name to poll the status of the call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Location to make a call. Must refer to a caller's project. + * + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * + * The `global` location is not supported for batch translation. + * + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. + * @param {string} request.sourceLanguageCode + * Required. Source language code. + * @param {string[]} request.targetLanguageCodes + * Required. Specify up to 10 language codes here. + * @param {number[]} [request.models] + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is model name. Value can be a built-in general model, + * or an AutoML Translation model. + * + * The value format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * + * + * If the map is empty or a specific model is + * not requested for a language pair, then default google model (nmt) is used. + * @param {number[]} request.inputConfigs + * Required. Input configurations. + * The total number of files matched should be <= 1000. + * The total content size should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + * @param {google.cloud.translation.v3.OutputConfig} request.outputConfig + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + * @param {number[]} [request.glossaries] + * Optional. Glossaries to be applied for translation. + * It's keyed by target language code. + * @param {number[]} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ batchTranslateText( - request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - LROperation< - protos.google.cloud.translation.v3.IBatchTranslateResponse, - protos.google.cloud.translation.v3.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.translation.v3.IBatchTranslateResponse, - protos.google.cloud.translation.v3.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3.IBatchTranslateResponse, - protos.google.cloud.translation.v3.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - > | void { + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + optionsOrCallback?: gax.CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -994,99 +830,68 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.batchTranslateText(request, options, callback); } createGlossary( - request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, - options?: gax.CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.ICreateGlossaryMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, + options?: gax.CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; createGlossary( - request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.ICreateGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; createGlossary( - request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.ICreateGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project name. - * @param {google.cloud.translation.v3.Glossary} request.glossary - * Required. The glossary to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Creates a glossary and returns the long-running operation. Returns + * NOT_FOUND, if the project doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project name. + * @param {google.cloud.translation.v3.Glossary} request.glossary + * Required. The glossary to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createGlossary( - request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - LROperation< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.ICreateGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.ICreateGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.ICreateGlossaryMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - > | void { + request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, + optionsOrCallback?: gax.CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -1095,98 +900,67 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.createGlossary(request, options, callback); } deleteGlossary( - request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, - options?: gax.CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3.IDeleteGlossaryMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, + options?: gax.CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; deleteGlossary( - request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3.IDeleteGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; deleteGlossary( - request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3.IDeleteGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Deletes a glossary, or cancels glossary construction + * if the glossary isn't created yet. + * Returns NOT_FOUND, if the glossary doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ deleteGlossary( - request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - LROperation< - protos.google.cloud.translation.v3.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3.IDeleteGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.translation.v3.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3.IDeleteGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3.IDeleteGlossaryMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - > | void { + request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, + optionsOrCallback?: gax.CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -1195,111 +969,92 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - name: request.name || '', + 'name': request.name || '', }); this.initialize(); return this.innerApiCalls.deleteGlossary(request, options, callback); } listGlossaries( - request: protos.google.cloud.translation.v3.IListGlossariesRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3.IGlossary[], - protos.google.cloud.translation.v3.IListGlossariesRequest | null, - protos.google.cloud.translation.v3.IListGlossariesResponse - ] - >; + request: protos.google.cloud.translation.v3.IListGlossariesRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.translation.v3.IGlossary[], + protos.google.cloud.translation.v3.IListGlossariesRequest|null, + protos.google.cloud.translation.v3.IListGlossariesResponse + ]>; listGlossaries( - request: protos.google.cloud.translation.v3.IListGlossariesRequest, - options: gax.CallOptions, - callback: PaginationCallback< - protos.google.cloud.translation.v3.IListGlossariesRequest, - | protos.google.cloud.translation.v3.IListGlossariesResponse - | null - | undefined, - protos.google.cloud.translation.v3.IGlossary - > - ): void; + request: protos.google.cloud.translation.v3.IListGlossariesRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.translation.v3.IListGlossariesRequest, + protos.google.cloud.translation.v3.IListGlossariesResponse|null|undefined, + protos.google.cloud.translation.v3.IGlossary>): void; listGlossaries( - request: protos.google.cloud.translation.v3.IListGlossariesRequest, - callback: PaginationCallback< - protos.google.cloud.translation.v3.IListGlossariesRequest, - | protos.google.cloud.translation.v3.IListGlossariesResponse - | null - | undefined, - protos.google.cloud.translation.v3.IGlossary - > - ): void; - /** - * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - * exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project from which to list all of the glossaries. - * @param {number} [request.pageSize] - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * @param {string} [request.filter] - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3.Glossary}. - * The client library support auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Glossary]{@link google.cloud.translation.v3.Glossary} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListGlossariesRequest]{@link google.cloud.translation.v3.ListGlossariesRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListGlossariesResponse]{@link google.cloud.translation.v3.ListGlossariesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.IListGlossariesRequest, + callback: PaginationCallback< + protos.google.cloud.translation.v3.IListGlossariesRequest, + protos.google.cloud.translation.v3.IListGlossariesResponse|null|undefined, + protos.google.cloud.translation.v3.IGlossary>): void; +/** + * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3.Glossary}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Glossary]{@link google.cloud.translation.v3.Glossary} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGlossariesRequest]{@link google.cloud.translation.v3.ListGlossariesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGlossariesResponse]{@link google.cloud.translation.v3.ListGlossariesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ listGlossaries( - request: protos.google.cloud.translation.v3.IListGlossariesRequest, - optionsOrCallback?: - | gax.CallOptions - | PaginationCallback< + request: protos.google.cloud.translation.v3.IListGlossariesRequest, + optionsOrCallback?: gax.CallOptions|PaginationCallback< protos.google.cloud.translation.v3.IListGlossariesRequest, - | protos.google.cloud.translation.v3.IListGlossariesResponse - | null - | undefined, - protos.google.cloud.translation.v3.IGlossary - >, - callback?: PaginationCallback< - protos.google.cloud.translation.v3.IListGlossariesRequest, - | protos.google.cloud.translation.v3.IListGlossariesResponse - | null - | undefined, - protos.google.cloud.translation.v3.IGlossary - > - ): Promise< - [ - protos.google.cloud.translation.v3.IGlossary[], - protos.google.cloud.translation.v3.IListGlossariesRequest | null, - protos.google.cloud.translation.v3.IListGlossariesResponse - ] - > | void { + protos.google.cloud.translation.v3.IListGlossariesResponse|null|undefined, + protos.google.cloud.translation.v3.IGlossary>, + callback?: PaginationCallback< + protos.google.cloud.translation.v3.IListGlossariesRequest, + protos.google.cloud.translation.v3.IListGlossariesResponse|null|undefined, + protos.google.cloud.translation.v3.IGlossary>): + Promise<[ + protos.google.cloud.translation.v3.IGlossary[], + protos.google.cloud.translation.v3.IListGlossariesRequest|null, + protos.google.cloud.translation.v3.IListGlossariesResponse + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -1308,50 +1063,50 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.listGlossaries(request, options, callback); } - /** - * Equivalent to {@link listGlossaries}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGlossaries} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project from which to list all of the glossaries. - * @param {number} [request.pageSize] - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * @param {string} [request.filter] - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3.Glossary} on 'data' event. - */ +/** + * Equivalent to {@link listGlossaries}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGlossaries} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3.Glossary} on 'data' event. + */ listGlossariesStream( - request?: protos.google.cloud.translation.v3.IListGlossariesRequest, - options?: gax.CallOptions - ): Transform { + request?: protos.google.cloud.translation.v3.IListGlossariesRequest, + options?: gax.CallOptions): + Transform{ request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1359,7 +1114,7 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); const callSettings = new gax.CallSettings(options); this.initialize(); @@ -1370,36 +1125,36 @@ export class TranslationServiceClient { ); } - /** - * Equivalent to {@link listGlossaries}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project from which to list all of the glossaries. - * @param {number} [request.pageSize] - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * @param {string} [request.filter] - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - */ +/** + * Equivalent to {@link listGlossaries}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ listGlossariesAsync( - request?: protos.google.cloud.translation.v3.IListGlossariesRequest, - options?: gax.CallOptions - ): AsyncIterable { + request?: protos.google.cloud.translation.v3.IListGlossariesRequest, + options?: gax.CallOptions): + AsyncIterable{ request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1407,14 +1162,14 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGlossaries.asyncIterate( this.innerApiCalls['listGlossaries'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1430,7 +1185,7 @@ export class TranslationServiceClient { * @param {string} glossary * @returns {string} Resource name string. */ - glossaryPath(project: string, location: string, glossary: string) { + glossaryPath(project:string,location:string,glossary:string) { return this.pathTemplates.glossaryPathTemplate.render({ project: project, location: location, @@ -1478,7 +1233,7 @@ export class TranslationServiceClient { * @param {string} location * @returns {string} Resource name string. */ - locationPath(project: string, location: string) { + locationPath(project:string,location:string) { return this.pathTemplates.locationPathTemplate.render({ project: project, location: location, diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index bb21fdfe704..2f026d20001 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -17,19 +17,11 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; -import { - Callback, - CallOptions, - Descriptors, - ClientOptions, - LROperation, - PaginationCallback, - GaxCall, -} from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; import * as path from 'path'; -import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './translation_service_client_config.json'; @@ -48,12 +40,7 @@ export class TranslationServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; + descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}, batching: {}}; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -88,12 +75,10 @@ export class TranslationServiceClient { constructor(opts?: ClientOptions) { // Ensure that options include the service address and port. const staticMembers = this.constructor as typeof TranslationServiceClient; - const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; + const servicePath = opts && opts.servicePath ? + opts.servicePath : + ((opts && opts.apiEndpoint) ? opts.apiEndpoint : + staticMembers.servicePath); const port = opts && opts.port ? opts.port : staticMembers.port; if (!opts) { @@ -103,8 +88,8 @@ export class TranslationServiceClient { opts.port = opts.port || port; opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { + const isBrowser = (typeof window !== 'undefined'); + if (isBrowser){ opts.fallback = true; } // If we are in browser, we are already using fallback because of the @@ -121,10 +106,13 @@ export class TranslationServiceClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); // Determine the client header string. - const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -140,18 +128,12 @@ export class TranslationServiceClient { // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); + const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath + opts.fallback ? + // eslint-disable-next-line @typescript-eslint/no-var-requires + require("../../protos/protos.json") : + nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated @@ -170,73 +152,55 @@ export class TranslationServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listGlossaries: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'glossaries' - ), + listGlossaries: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'glossaries') }; // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - const protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + const protoFilesRoot = opts.fallback ? + this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require("../../protos/protos.json")) : + this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) - .operationsClient(opts); + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); const batchTranslateTextResponse = protoFilesRoot.lookup( - '.google.cloud.translation.v3beta1.BatchTranslateResponse' - ) as gax.protobuf.Type; + '.google.cloud.translation.v3beta1.BatchTranslateResponse') as gax.protobuf.Type; const batchTranslateTextMetadata = protoFilesRoot.lookup( - '.google.cloud.translation.v3beta1.BatchTranslateMetadata' - ) as gax.protobuf.Type; + '.google.cloud.translation.v3beta1.BatchTranslateMetadata') as gax.protobuf.Type; const createGlossaryResponse = protoFilesRoot.lookup( - '.google.cloud.translation.v3beta1.Glossary' - ) as gax.protobuf.Type; + '.google.cloud.translation.v3beta1.Glossary') as gax.protobuf.Type; const createGlossaryMetadata = protoFilesRoot.lookup( - '.google.cloud.translation.v3beta1.CreateGlossaryMetadata' - ) as gax.protobuf.Type; + '.google.cloud.translation.v3beta1.CreateGlossaryMetadata') as gax.protobuf.Type; const deleteGlossaryResponse = protoFilesRoot.lookup( - '.google.cloud.translation.v3beta1.DeleteGlossaryResponse' - ) as gax.protobuf.Type; + '.google.cloud.translation.v3beta1.DeleteGlossaryResponse') as gax.protobuf.Type; const deleteGlossaryMetadata = protoFilesRoot.lookup( - '.google.cloud.translation.v3beta1.DeleteGlossaryMetadata' - ) as gax.protobuf.Type; + '.google.cloud.translation.v3beta1.DeleteGlossaryMetadata') as gax.protobuf.Type; this.descriptors.longrunning = { batchTranslateText: new this._gaxModule.LongrunningDescriptor( this.operationsClient, batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), - batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) - ), + batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata)), createGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGlossaryResponse.decode.bind(createGlossaryResponse), - createGlossaryMetadata.decode.bind(createGlossaryMetadata) - ), + createGlossaryMetadata.decode.bind(createGlossaryMetadata)), deleteGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), - deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata) - ), + deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata)) }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.translation.v3beta1.TranslationService', - gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, - {'x-goog-api-client': clientHeader.join(' ')} - ); + 'google.cloud.translation.v3beta1.TranslationService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code @@ -264,28 +228,16 @@ export class TranslationServiceClient { // Put together the "service stub" for // google.cloud.translation.v3beta1.TranslationService. this.translationServiceStub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.cloud.translation.v3beta1.TranslationService' - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.translation.v3beta1 - .TranslationService, - this._opts - ) as Promise<{[method: string]: Function}>; + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.translation.v3beta1.TranslationService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.translation.v3beta1.TranslationService, + this._opts) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides // and create an API call method for each. - const translationServiceStubMethods = [ - 'translateText', - 'detectLanguage', - 'getSupportedLanguages', - 'batchTranslateText', - 'createGlossary', - 'listGlossaries', - 'getGlossary', - 'deleteGlossary', - ]; + const translationServiceStubMethods = + ['translateText', 'detectLanguage', 'getSupportedLanguages', 'batchTranslateText', 'createGlossary', 'listGlossaries', 'getGlossary', 'deleteGlossary']; for (const methodName of translationServiceStubMethods) { const callPromise = this.translationServiceStub.then( stub => (...args: Array<{}>) => { @@ -295,17 +247,16 @@ export class TranslationServiceClient { const func = stub[methodName]; return func.apply(stub, args); }, - (err: Error | null | undefined) => () => { + (err: Error|null|undefined) => () => { throw err; - } - ); + }); const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); this.innerApiCalls[methodName] = apiCall; @@ -343,7 +294,7 @@ export class TranslationServiceClient { static get scopes() { return [ 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-translation', + 'https://www.googleapis.com/auth/cloud-translation' ]; } @@ -354,9 +305,8 @@ export class TranslationServiceClient { * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId( - callback?: Callback - ): Promise | void { + getProjectId(callback?: Callback): + Promise|void { if (callback) { this.auth.getProjectId(callback); return; @@ -368,140 +318,119 @@ export class TranslationServiceClient { // -- Service calls -- // ------------------- translateText( - request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - protos.google.cloud.translation.v3beta1.ITranslateTextRequest | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + protos.google.cloud.translation.v3beta1.ITranslateTextRequest|undefined, {}|undefined + ]>; translateText( - request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - | protos.google.cloud.translation.v3beta1.ITranslateTextRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + protos.google.cloud.translation.v3beta1.ITranslateTextRequest|null|undefined, + {}|null|undefined>): void; translateText( - request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - callback: Callback< - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - | protos.google.cloud.translation.v3beta1.ITranslateTextRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Translates input text and returns translated text. - * - * @param {Object} request - * The request object that will be sent. - * @param {string[]} request.contents - * Required. The content of the input in string format. - * We recommend the total content be less than 30k codepoints. - * Use BatchTranslateText for larger text. - * @param {string} [request.mimeType] - * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {string} [request.sourceLanguageCode] - * Optional. The BCP-47 language code of the input text if - * known, for example, "en-US" or "sr-Latn". Supported language codes are - * listed in Language Support. If the source language isn't specified, the API - * attempts to identify the source language automatically and returns the - * source language within the response. - * @param {string} request.targetLanguageCode - * Required. The BCP-47 language code to use for translation of the input - * text, set to one of the language codes listed in Language Support. - * @param {string} request.parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-id}` or - * `projects/{project-id}/locations/{location-id}`. - * - * For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. - * - * Non-global location is required for requests using AutoML models or - * custom glossaries. - * - * Models and glossaries must be within the same region (have same - * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.model] - * Optional. The `model` type requested for this translation. - * - * The format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` - * - * - * For global (non-regionalized) requests, use `location-id` `global`. - * For example, - * `projects/{project-id}/locations/global/models/general/nmt`. - * - * If missing, the system decides which google base model to use. - * @param {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} [request.glossaryConfig] - * Optional. Glossary to be applied. The glossary must be - * within the same region (have the same location-id) as the model, otherwise - * an INVALID_ARGUMENT (400) error is returned. - * @param {number[]} [request.labels] - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3beta1.TranslateTextResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + protos.google.cloud.translation.v3beta1.ITranslateTextRequest|null|undefined, + {}|null|undefined>): void; +/** + * Translates input text and returns translated text. + * + * @param {Object} request + * The request object that will be sent. + * @param {string[]} request.contents + * Required. The content of the input in string format. + * We recommend the total content be less than 30k codepoints. + * Use BatchTranslateText for larger text. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + * @param {string} [request.sourceLanguageCode] + * Optional. The BCP-47 language code of the input text if + * known, for example, "en-US" or "sr-Latn". Supported language codes are + * listed in Language Support. If the source language isn't specified, the API + * attempts to identify the source language automatically and returns the + * source language within the response. + * @param {string} request.targetLanguageCode + * Required. The BCP-47 language code to use for translation of the input + * text, set to one of the language codes listed in Language Support. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-id}` or + * `projects/{project-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-id}/locations/global` or + * `projects/{project-id}`. + * + * Non-global location is required for requests using AutoML models or + * custom glossaries. + * + * Models and glossaries must be within the same region (have same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.model] + * Optional. The `model` type requested for this translation. + * + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-id}/locations/{location-id}/models/general/base` + * + * + * For global (non-regionalized) requests, use `location-id` `global`. + * For example, + * `projects/{project-id}/locations/global/models/general/nmt`. + * + * If missing, the system decides which google base model to use. + * @param {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} [request.glossaryConfig] + * Optional. Glossary to be applied. The glossary must be + * within the same region (have the same location-id) as the model, otherwise + * an INVALID_ARGUMENT (400) error is returned. + * @param {number[]} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3beta1.TranslateTextResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ translateText( - request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - | protos.google.cloud.translation.v3beta1.ITranslateTextRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - | protos.google.cloud.translation.v3beta1.ITranslateTextRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - protos.google.cloud.translation.v3beta1.ITranslateTextRequest | undefined, - {} | undefined - ] - > | void { + protos.google.cloud.translation.v3beta1.ITranslateTextRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + protos.google.cloud.translation.v3beta1.ITranslateTextRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + protos.google.cloud.translation.v3beta1.ITranslateTextRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -510,126 +439,99 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.translateText(request, options, callback); } detectLanguage( - request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - ( - | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest - | undefined - ), - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + protos.google.cloud.translation.v3beta1.IDetectLanguageRequest|undefined, {}|undefined + ]>; detectLanguage( - request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + protos.google.cloud.translation.v3beta1.IDetectLanguageRequest|null|undefined, + {}|null|undefined>): void; detectLanguage( - request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - callback: Callback< - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Detects the language of text within a request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-id}/locations/{location-id}` or - * `projects/{project-id}`. - * - * For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. - * - * Only models within the same region (has same location-id) can be used. - * Otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.model] - * Optional. The language detection model to be used. - * - * Format: - * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` - * - * Only one language detection model is currently supported: - * `projects/{project-id}/locations/{location-id}/models/language-detection/default`. - * - * If not specified, the default model is used. - * @param {string} request.content - * The content of the input stored as a string. - * @param {string} [request.mimeType] - * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {number[]} request.labels - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3beta1.DetectLanguageResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + protos.google.cloud.translation.v3beta1.IDetectLanguageRequest|null|undefined, + {}|null|undefined>): void; +/** + * Detects the language of text within a request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-id}/locations/{location-id}` or + * `projects/{project-id}`. + * + * For global calls, use `projects/{project-id}/locations/global` or + * `projects/{project-id}`. + * + * Only models within the same region (has same location-id) can be used. + * Otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.model] + * Optional. The language detection model to be used. + * + * Format: + * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` + * + * Only one language detection model is currently supported: + * `projects/{project-id}/locations/{location-id}/models/language-detection/default`. + * + * If not specified, the default model is used. + * @param {string} request.content + * The content of the input stored as a string. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + * @param {number[]} request.labels + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3beta1.DetectLanguageResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ detectLanguage( - request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - ( - | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest - | undefined - ), - {} | undefined - ] - > | void { + protos.google.cloud.translation.v3beta1.IDetectLanguageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + protos.google.cloud.translation.v3beta1.IDetectLanguageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + protos.google.cloud.translation.v3beta1.IDetectLanguageRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -638,123 +540,96 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.detectLanguage(request, options, callback); } getSupportedLanguages( - request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - ( - | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest - | undefined - ), - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest|undefined, {}|undefined + ]>; getSupportedLanguages( - request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest|null|undefined, + {}|null|undefined>): void; getSupportedLanguages( - request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - callback: Callback< - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Returns a list of supported languages for translation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-id}` or - * `projects/{project-id}/locations/{location-id}`. - * - * For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. - * - * Non-global location is required for AutoML models. - * - * Only models within the same region (have same location-id) can be used, - * otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.displayLanguageCode] - * Optional. The language to use to return localized, human readable names - * of supported languages. If missing, then display names are not returned - * in a response. - * @param {string} [request.model] - * Optional. Get supported languages of this model. - * - * The format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` - * - * - * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3beta1.SupportedLanguages}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest|null|undefined, + {}|null|undefined>): void; +/** + * Returns a list of supported languages for translation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-id}` or + * `projects/{project-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-id}/locations/global` or + * `projects/{project-id}`. + * + * Non-global location is required for AutoML models. + * + * Only models within the same region (have same location-id) can be used, + * otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.displayLanguageCode] + * Optional. The language to use to return localized, human readable names + * of supported languages. If missing, then display names are not returned + * in a response. + * @param {string} [request.model] + * Optional. Get supported languages of this model. + * + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-id}/locations/{location-id}/models/general/base` + * + * + * Returns languages supported by the specified model. + * If missing, we get supported languages of Google general base (PBMT) model. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3beta1.SupportedLanguages}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getSupportedLanguages( - request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.translation.v3beta1.ISupportedLanguages, - | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - ( - | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest - | undefined - ), - {} | undefined - ] - > | void { + protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -763,87 +638,66 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.getSupportedLanguages(request, options, callback); } getGlossary( - request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.IGetGlossaryRequest | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.IGetGlossaryRequest|undefined, {}|undefined + ]>; getGlossary( - request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3beta1.IGlossary, - | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.IGetGlossaryRequest|null|undefined, + {}|null|undefined>): void; getGlossary( - request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, - callback: Callback< - protos.google.cloud.translation.v3beta1.IGlossary, - | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.IGetGlossaryRequest|null|undefined, + {}|null|undefined>): void; +/** + * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getGlossary( - request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, + optionsOrCallback?: gax.CallOptions|Callback< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.IGetGlossaryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< protos.google.cloud.translation.v3beta1.IGlossary, - | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.translation.v3beta1.IGlossary, - | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.IGetGlossaryRequest | undefined, - {} | undefined - ] - > | void { + protos.google.cloud.translation.v3beta1.IGetGlossaryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.IGetGlossaryRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -852,153 +706,122 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - name: request.name || '', + 'name': request.name || '', }); this.initialize(); return this.innerApiCalls.getGlossary(request, options, callback); } batchTranslateText( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - options?: gax.CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + options?: gax.CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; batchTranslateText( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - options: gax.CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; batchTranslateText( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Translates a large volume of text in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * - * This call returns immediately and you can - * use google.longrunning.Operation.name to poll the status of the call. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Location to make a call. Must refer to a caller's project. - * - * Format: `projects/{project-id}/locations/{location-id}`. - * - * The `global` location is not supported for batch translation. - * - * Only AutoML Translation models or glossaries within the same region (have - * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - * error is returned. - * @param {string} request.sourceLanguageCode - * Required. Source language code. - * @param {string[]} request.targetLanguageCodes - * Required. Specify up to 10 language codes here. - * @param {number[]} [request.models] - * Optional. The models to use for translation. Map's key is target language - * code. Map's value is model name. Value can be a built-in general model, - * or an AutoML Translation model. - * - * The value format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` - * - * - * If the map is empty or a specific model is - * not requested for a language pair, then default google model (nmt) is used. - * @param {number[]} request.inputConfigs - * Required. Input configurations. - * The total number of files matched should be <= 1000. - * The total content size should be <= 100M Unicode codepoints. - * The files must use UTF-8 encoding. - * @param {google.cloud.translation.v3beta1.OutputConfig} request.outputConfig - * Required. Output configuration. - * If 2 input configs match to the same file (that is, same input path), - * we don't generate output for duplicate inputs. - * @param {number[]} [request.glossaries] - * Optional. Glossaries to be applied for translation. - * It's keyed by target language code. - * @param {number[]} [request.labels] - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Translates a large volume of text in asynchronous batch mode. + * This function provides real-time output as the inputs are being processed. + * If caller cancels a request, the partial results (for an input file, it's + * all or nothing) may still be available on the specified output location. + * + * This call returns immediately and you can + * use google.longrunning.Operation.name to poll the status of the call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Location to make a call. Must refer to a caller's project. + * + * Format: `projects/{project-id}/locations/{location-id}`. + * + * The `global` location is not supported for batch translation. + * + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. + * @param {string} request.sourceLanguageCode + * Required. Source language code. + * @param {string[]} request.targetLanguageCodes + * Required. Specify up to 10 language codes here. + * @param {number[]} [request.models] + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is model name. Value can be a built-in general model, + * or an AutoML Translation model. + * + * The value format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-id}/locations/{location-id}/models/general/base` + * + * + * If the map is empty or a specific model is + * not requested for a language pair, then default google model (nmt) is used. + * @param {number[]} request.inputConfigs + * Required. Input configurations. + * The total number of files matched should be <= 1000. + * The total content size should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + * @param {google.cloud.translation.v3beta1.OutputConfig} request.outputConfig + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + * @param {number[]} [request.glossaries] + * Optional. Glossaries to be applied for translation. + * It's keyed by target language code. + * @param {number[]} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ batchTranslateText( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - > | void { + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + optionsOrCallback?: gax.CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -1007,99 +830,68 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.batchTranslateText(request, options, callback); } createGlossary( - request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, - options?: gax.CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + options?: gax.CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; createGlossary( - request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; createGlossary( - request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project name. - * @param {google.cloud.translation.v3beta1.Glossary} request.glossary - * Required. The glossary to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Creates a glossary and returns the long-running operation. Returns + * NOT_FOUND, if the project doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project name. + * @param {google.cloud.translation.v3beta1.Glossary} request.glossary + * Required. The glossary to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createGlossary( - request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - > | void { + request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + optionsOrCallback?: gax.CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -1108,98 +900,67 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.createGlossary(request, options, callback); } deleteGlossary( - request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, - options?: gax.CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + options?: gax.CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; deleteGlossary( - request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; deleteGlossary( - request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Deletes a glossary, or cancels glossary construction + * if the glossary isn't created yet. + * Returns NOT_FOUND, if the glossary doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ deleteGlossary( - request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - > | void { + request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + optionsOrCallback?: gax.CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -1208,111 +969,92 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - name: request.name || '', + 'name': request.name || '', }); this.initialize(); return this.innerApiCalls.deleteGlossary(request, options, callback); } listGlossaries( - request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3beta1.IGlossary[], - protos.google.cloud.translation.v3beta1.IListGlossariesRequest | null, - protos.google.cloud.translation.v3beta1.IListGlossariesResponse - ] - >; + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.translation.v3beta1.IGlossary[], + protos.google.cloud.translation.v3beta1.IListGlossariesRequest|null, + protos.google.cloud.translation.v3beta1.IListGlossariesResponse + ]>; listGlossaries( - request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options: gax.CallOptions, - callback: PaginationCallback< - protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - | protos.google.cloud.translation.v3beta1.IListGlossariesResponse - | null - | undefined, - protos.google.cloud.translation.v3beta1.IGlossary - > - ): void; + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + protos.google.cloud.translation.v3beta1.IListGlossariesResponse|null|undefined, + protos.google.cloud.translation.v3beta1.IGlossary>): void; listGlossaries( - request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - callback: PaginationCallback< - protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - | protos.google.cloud.translation.v3beta1.IListGlossariesResponse - | null - | undefined, - protos.google.cloud.translation.v3beta1.IGlossary - > - ): void; - /** - * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - * exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project from which to list all of the glossaries. - * @param {number} [request.pageSize] - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * @param {string} [request.filter] - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. - * The client library support auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListGlossariesRequest]{@link google.cloud.translation.v3beta1.ListGlossariesRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + callback: PaginationCallback< + protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + protos.google.cloud.translation.v3beta1.IListGlossariesResponse|null|undefined, + protos.google.cloud.translation.v3beta1.IGlossary>): void; +/** + * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGlossariesRequest]{@link google.cloud.translation.v3beta1.ListGlossariesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ listGlossaries( - request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - optionsOrCallback?: - | gax.CallOptions - | PaginationCallback< + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + optionsOrCallback?: gax.CallOptions|PaginationCallback< protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - | protos.google.cloud.translation.v3beta1.IListGlossariesResponse - | null - | undefined, - protos.google.cloud.translation.v3beta1.IGlossary - >, - callback?: PaginationCallback< - protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - | protos.google.cloud.translation.v3beta1.IListGlossariesResponse - | null - | undefined, - protos.google.cloud.translation.v3beta1.IGlossary - > - ): Promise< - [ - protos.google.cloud.translation.v3beta1.IGlossary[], - protos.google.cloud.translation.v3beta1.IListGlossariesRequest | null, - protos.google.cloud.translation.v3beta1.IListGlossariesResponse - ] - > | void { + protos.google.cloud.translation.v3beta1.IListGlossariesResponse|null|undefined, + protos.google.cloud.translation.v3beta1.IGlossary>, + callback?: PaginationCallback< + protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + protos.google.cloud.translation.v3beta1.IListGlossariesResponse|null|undefined, + protos.google.cloud.translation.v3beta1.IGlossary>): + Promise<[ + protos.google.cloud.translation.v3beta1.IGlossary[], + protos.google.cloud.translation.v3beta1.IListGlossariesRequest|null, + protos.google.cloud.translation.v3beta1.IListGlossariesResponse + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -1321,50 +1063,50 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.listGlossaries(request, options, callback); } - /** - * Equivalent to {@link listGlossaries}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGlossaries} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project from which to list all of the glossaries. - * @param {number} [request.pageSize] - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * @param {string} [request.filter] - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary} on 'data' event. - */ +/** + * Equivalent to {@link listGlossaries}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGlossaries} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary} on 'data' event. + */ listGlossariesStream( - request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options?: gax.CallOptions - ): Transform { + request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + options?: gax.CallOptions): + Transform{ request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1372,7 +1114,7 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); const callSettings = new gax.CallSettings(options); this.initialize(); @@ -1383,36 +1125,36 @@ export class TranslationServiceClient { ); } - /** - * Equivalent to {@link listGlossaries}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project from which to list all of the glossaries. - * @param {number} [request.pageSize] - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * @param {string} [request.filter] - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - */ +/** + * Equivalent to {@link listGlossaries}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ listGlossariesAsync( - request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options?: gax.CallOptions - ): AsyncIterable { + request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + options?: gax.CallOptions): + AsyncIterable{ request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1420,14 +1162,14 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGlossaries.asyncIterate( this.innerApiCalls['listGlossaries'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1443,7 +1185,7 @@ export class TranslationServiceClient { * @param {string} glossary * @returns {string} Resource name string. */ - glossaryPath(project: string, location: string, glossary: string) { + glossaryPath(project:string,location:string,glossary:string) { return this.pathTemplates.glossaryPathTemplate.render({ project: project, location: location, @@ -1491,7 +1233,7 @@ export class TranslationServiceClient { * @param {string} location * @returns {string} Resource name string. */ - locationPath(project: string, location: string) { + locationPath(project:string,location:string) { return this.pathTemplates.locationPathTemplate.render({ project: project, location: location, diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 2061cd076f2..f8d17559add 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -1,12 +1,25 @@ { - "updateTime": "2020-04-11T01:04:33.653333Z", "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/nodejs-translate.git", + "sha": "23f6b4bdf50ce033d268f7ac96633875540ab6b1" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "101d31acd73076c52d78e18322be01f3debe8cb5", + "internalRef": "306855444" + } + }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5", - "log": "6f32150677c9784f3c3a7e1949472bd29c9d72c5\nfix: installs test_utils from its common repo (#480)\n\n\n74ce986d3b5431eb66985e9a00c4eb45295a4020\nfix: stop recording update_time in synth.metadata (#478)\n\n\n7f8e62aa3edd225f76347a16f92e400661fdfb52\nchore(java): release-please only updates non maven versions in README (#476)\n\nPrevent release-please and synthtool from fighting over the released library version. Synthtool updates the install snippets from the samples pom.xml files so the bots fight if they are temporarily out of sync after a release.\nc7e0e517d7f46f77bebd27da2e5afcaa6eee7e25\nbuild(java): fix nightly integration test config to run integrations (#465)\n\nThis was only running the units.\nbd69a2aa7b70875f3c988e269706b22fefbef40e\nbuild(java): fix retry_with_backoff when -e option set (#475)\n\n\nd9b173c427bfa0c6cca818233562e7e8841a357c\nfix: record version of working repo in synth.metadata (#473)\n\nPartial revert of b37cf74d12e9a42b9de9e61a4f26133d7cd9c168.\nf73a541770d95a609e5be6bf6b3b220d17cefcbe\nfeat(discogapic): allow local discovery-artifact-manager (#474)\n\n\n8cf0f5d93a70c3dcb0b4999d3152c46d4d9264bf\ndoc: describe the Autosynth & Synthtool protocol (#472)\n\n* doc: describe the Autosynth & Synthtool protocol\n\n* Accommodate review comments.\n980baaa738a1ad8fa02b4fdbd56be075ee77ece5\nfix: pin sphinx to <3.0.0 as new version causes new error (#471)\n\nThe error `toctree contains reference to document changlelog that doesn't have a title: no link will be generated` occurs as of 3.0.0. Pinning to 2.x until we address the docs build issue.\n\nTowards #470\n\nI did this manually for python-datastore https://github.com/googleapis/python-datastore/pull/22\n928b2998ac5023e7c7e254ab935f9ef022455aad\nchore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.15 (#466)\n\nCo-authored-by: Jeffrey Rennie \n188f1b1d53181f739b98f8aa5d40cfe99eb90c47\nfix: allow local and external deps to be specified (#469)\n\nModify noxfile.py to allow local and external dependencies for\nsystem tests to be specified.\n1df68ed6735ddce6797d0f83641a731c3c3f75b4\nfix: apache license URL (#468)\n\n\nf4a59efa54808c4b958263de87bc666ce41e415f\nfeat: Add discogapic support for GAPICBazel generation (#459)\n\n* feat: Add discogapic support for GAPICBazel generation\n\n* reformat with black\n\n* Rename source repository variable\n\nCo-authored-by: Jeffrey Rennie \n" + "sha": "682c0c37d1054966ca662a44259e96cc7aea4413" } } ], diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js index e994918631d..cc2e18cd214 100644 --- a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** + /* eslint-disable node/no-missing-require, no-unused-vars */ const translation = require('@google-cloud/translate'); diff --git a/packages/google-cloud-translate/system-test/install.ts b/packages/google-cloud-translate/system-test/install.ts index c4d80e9c0c8..5e4ed636481 100644 --- a/packages/google-cloud-translate/system-test/install.ts +++ b/packages/google-cloud-translate/system-test/install.ts @@ -16,36 +16,34 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; describe('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function() { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), // path to your module. sample: { description: 'typescript based user can use the type definitions', - ts: readFileSync( - './system-test/fixtures/sample/src/index.ts' - ).toString(), - }, + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } }; - await packNTest(options); // will throw upon error. + await packNTest(options); // will throw upon error. }); it('should have correct type signature for javascript users', async function() { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), // path to your module. sample: { description: 'typescript based user can use the type definitions', - ts: readFileSync( - './system-test/fixtures/sample/src/index.js' - ).toString(), - }, + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } }; - await packNTest(options); // will throw upon error. + await packNTest(options); // will throw upon error. }); + }); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts index 1febe1880f1..f1979206522 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -20,7 +20,7 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import { describe, it } from 'mocha'; import * as translationserviceModule from '../src'; import {PassThrough} from 'stream'; @@ -28,1571 +28,1137 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); - return (instance.constructor as typeof protobuf.Message).fromObject( - filledObject - ) as T; + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; } function stubSimpleCall(response?: ResponseType, error?: Error) { - return error - ? sinon.stub().rejects(error) - : sinon.stub().resolves([response]); + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); } -function stubSimpleCallWithCallback( - response?: ResponseType, - error?: Error -) { - return error - ? sinon.stub().callsArgWith(2, error) - : sinon.stub().callsArgWith(2, null, response); +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); } -function stubLongRunningCall( - response?: ResponseType, - callError?: Error, - lroError?: Error -) { - const innerStub = lroError - ? sinon.stub().rejects(lroError) - : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError - ? sinon.stub().rejects(callError) - : sinon.stub().resolves([mockOperation]); +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); } -function stubLongRunningCallWithCallback( - response?: ResponseType, - callError?: Error, - lroError?: Error -) { - const innerStub = lroError - ? sinon.stub().rejects(lroError) - : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError - ? sinon.stub().callsArgWith(2, callError) - : sinon.stub().callsArgWith(2, null, mockOperation); +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); } -function stubPageStreamingCall( - responses?: ResponseType[], - error?: Error -) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error - ? sinon.stub().callsArgWith(2, error) - : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { - mockStream.write({}); - }); +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } } - setImmediate(() => { - mockStream.end(); - }); - } else { - setImmediate(() => { - mockStream.write({}); + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, }); - setImmediate(() => { - mockStream.end(); - }); - } - return sinon.stub().returns(mockStream); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); } -function stubAsyncIterationCall( - responses?: ResponseType[], - error?: Error -) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - }, - }; - }, - }; - return sinon.stub().returns(asyncIterable); +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); } describe('v3.TranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = - translationserviceModule.v3.TranslationServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - translationserviceModule.v3.TranslationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = translationserviceModule.v3.TranslationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new translationserviceModule.v3.TranslationServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - fallback: true, + it('has servicePath', () => { + const servicePath = translationserviceModule.v3.TranslationServiceClient.servicePath; + assert(servicePath); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has apiEndpoint', () => { + const apiEndpoint = translationserviceModule.v3.TranslationServiceClient.apiEndpoint; + assert(apiEndpoint); }); - assert.strictEqual(client.translationServiceStub, undefined); - await client.initialize(); - assert(client.translationServiceStub); - }); - it('has close method', () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = translationserviceModule.v3.TranslationServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - client.close(); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new translationserviceModule.v3.TranslationServiceClient(); + assert(client); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); + it('should create a client with gRPC fallback', () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + fallback: true, + }); + assert(client); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - describe('translateText', () => { - it('invokes translateText without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.TranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3.TranslateTextResponse() - ); - client.innerApiCalls.translateText = stubSimpleCall(expectedResponse); - const [response] = await client.translateText(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.translateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has initialize method and supports deferred initialization', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.translationServiceStub, undefined); + await client.initialize(); + assert(client.translationServiceStub); }); - it('invokes translateText without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.TranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3.TranslateTextResponse() - ); - client.innerApiCalls.translateText = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.translateText( - request, - ( - err?: Error | null, - result?: protos.google.cloud.translation.v3.ITranslateTextResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.translateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('has close method', () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.close(); }); - it('invokes translateText with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.TranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.translateText = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.translateText(request); - }, expectedError); - assert( - (client.innerApiCalls.translateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - }); - describe('detectLanguage', () => { - it('invokes detectLanguage without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.DetectLanguageRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3.DetectLanguageResponse() - ); - client.innerApiCalls.detectLanguage = stubSimpleCall(expectedResponse); - const [response] = await client.detectLanguage(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - it('invokes detectLanguage without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.DetectLanguageRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3.DetectLanguageResponse() - ); - client.innerApiCalls.detectLanguage = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.detectLanguage( - request, - ( - err?: Error | null, - result?: protos.google.cloud.translation.v3.IDetectLanguageResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); + describe('translateText', () => { + it('invokes translateText without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.TranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.TranslateTextResponse()); + client.innerApiCalls.translateText = stubSimpleCall(expectedResponse); + const [response] = await client.translateText(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.translateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes detectLanguage with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.DetectLanguageRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.detectLanguage = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.detectLanguage(request); - }, expectedError); - assert( - (client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + it('invokes translateText without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.TranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.TranslateTextResponse()); + client.innerApiCalls.translateText = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.translateText( + request, + (err?: Error|null, result?: protos.google.cloud.translation.v3.ITranslateTextResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.translateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - describe('getSupportedLanguages', () => { - it('invokes getSupportedLanguages without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3.SupportedLanguages() - ); - client.innerApiCalls.getSupportedLanguages = stubSimpleCall( - expectedResponse - ); - const [response] = await client.getSupportedLanguages(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('invokes translateText with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.TranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.translateText = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.translateText(request); }, expectedError); + assert((client.innerApiCalls.translateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes getSupportedLanguages without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3.SupportedLanguages() - ); - client.innerApiCalls.getSupportedLanguages = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.getSupportedLanguages( - request, - ( - err?: Error | null, - result?: protos.google.cloud.translation.v3.ISupportedLanguages | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); + describe('detectLanguage', () => { + it('invokes detectLanguage without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.DetectLanguageRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.DetectLanguageResponse()); + client.innerApiCalls.detectLanguage = stubSimpleCall(expectedResponse); + const [response] = await client.detectLanguage(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes getSupportedLanguages with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getSupportedLanguages = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.getSupportedLanguages(request); - }, expectedError); - assert( - (client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + it('invokes detectLanguage without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.DetectLanguageRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.DetectLanguageResponse()); + client.innerApiCalls.detectLanguage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.detectLanguage( + request, + (err?: Error|null, result?: protos.google.cloud.translation.v3.IDetectLanguageResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - describe('getGlossary', () => { - it('invokes getGlossary without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.GetGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ); - client.innerApiCalls.getGlossary = stubSimpleCall(expectedResponse); - const [response] = await client.getGlossary(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('invokes detectLanguage with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.DetectLanguageRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.detectLanguage = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.detectLanguage(request); }, expectedError); + assert((client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes getGlossary without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.GetGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ); - client.innerApiCalls.getGlossary = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.getGlossary( - request, - ( - err?: Error | null, - result?: protos.google.cloud.translation.v3.IGlossary | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); + describe('getSupportedLanguages', () => { + it('invokes getSupportedLanguages without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.SupportedLanguages()); + client.innerApiCalls.getSupportedLanguages = stubSimpleCall(expectedResponse); + const [response] = await client.getSupportedLanguages(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes getGlossary with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.GetGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getGlossary = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.getGlossary(request); - }, expectedError); - assert( - (client.innerApiCalls.getGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + it('invokes getSupportedLanguages without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.SupportedLanguages()); + client.innerApiCalls.getSupportedLanguages = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSupportedLanguages( + request, + (err?: Error|null, result?: protos.google.cloud.translation.v3.ISupportedLanguages|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - describe('batchTranslateText', () => { - it('invokes batchTranslateText without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.BatchTranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchTranslateText = stubLongRunningCall( - expectedResponse - ); - const [operation] = await client.batchTranslateText(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('invokes getSupportedLanguages with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSupportedLanguages = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.getSupportedLanguages(request); }, expectedError); + assert((client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes batchTranslateText without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.BatchTranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchTranslateText = stubLongRunningCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.batchTranslateText( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.translation.v3.IBatchTranslateResponse, - protos.google.cloud.translation.v3.IBatchTranslateMetadata - > | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.translation.v3.IBatchTranslateResponse, - protos.google.cloud.translation.v3.IBatchTranslateMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); + describe('getGlossary', () => { + it('invokes getGlossary without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.GetGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()); + client.innerApiCalls.getGlossary = stubSimpleCall(expectedResponse); + const [response] = await client.getGlossary(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes batchTranslateText with call error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.BatchTranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchTranslateText = stubLongRunningCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.batchTranslateText(request); - }, expectedError); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes getGlossary without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.GetGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()); + client.innerApiCalls.getGlossary = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGlossary( + request, + (err?: Error|null, result?: protos.google.cloud.translation.v3.IGlossary|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes batchTranslateText with LRO error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.BatchTranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchTranslateText = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.batchTranslateText(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('invokes getGlossary with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.GetGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGlossary = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.getGlossary(request); }, expectedError); + assert((client.innerApiCalls.getGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - }); - describe('createGlossary', () => { - it('invokes createGlossary without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.CreateGlossaryRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createGlossary = stubLongRunningCall( - expectedResponse - ); - const [operation] = await client.createGlossary(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + describe('batchTranslateText', () => { + it('invokes batchTranslateText without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.BatchTranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchTranslateText = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchTranslateText(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes createGlossary without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.CreateGlossaryRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createGlossary = stubLongRunningCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.createGlossary( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.ICreateGlossaryMetadata - > | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.ICreateGlossaryMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); + it('invokes batchTranslateText without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.BatchTranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchTranslateText = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchTranslateText( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes createGlossary with call error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.CreateGlossaryRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createGlossary = stubLongRunningCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.createGlossary(request); - }, expectedError); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes batchTranslateText with call error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.BatchTranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateText = stubLongRunningCall(undefined, expectedError); + await assert.rejects(async () => { await client.batchTranslateText(request); }, expectedError); + assert((client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes createGlossary with LRO error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.CreateGlossaryRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createGlossary = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.createGlossary(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('invokes batchTranslateText with LRO error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.BatchTranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateText = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchTranslateText(request); + await assert.rejects(async () => { await operation.promise(); }, expectedError); + assert((client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - }); - describe('deleteGlossary', () => { - it('invokes deleteGlossary without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.DeleteGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteGlossary = stubLongRunningCall( - expectedResponse - ); - const [operation] = await client.deleteGlossary(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + describe('createGlossary', () => { + it('invokes createGlossary without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.CreateGlossaryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createGlossary = stubLongRunningCall(expectedResponse); + const [operation] = await client.createGlossary(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes deleteGlossary without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.DeleteGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteGlossary = stubLongRunningCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.deleteGlossary( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.translation.v3.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3.IDeleteGlossaryMetadata - > | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.translation.v3.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3.IDeleteGlossaryMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); + it('invokes createGlossary without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.CreateGlossaryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createGlossary = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGlossary( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes deleteGlossary with call error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.DeleteGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteGlossary = stubLongRunningCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.deleteGlossary(request); - }, expectedError); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes createGlossary with call error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.CreateGlossaryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGlossary = stubLongRunningCall(undefined, expectedError); + await assert.rejects(async () => { await client.createGlossary(request); }, expectedError); + assert((client.innerApiCalls.createGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes deleteGlossary with LRO error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.DeleteGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteGlossary = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.deleteGlossary(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('invokes createGlossary with LRO error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.CreateGlossaryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGlossary = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createGlossary(request); + await assert.rejects(async () => { await operation.promise(); }, expectedError); + assert((client.innerApiCalls.createGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - }); - describe('listGlossaries', () => { - it('invokes listGlossaries without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ), - ]; - client.innerApiCalls.listGlossaries = stubSimpleCall(expectedResponse); - const [response] = await client.listGlossaries(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + describe('deleteGlossary', () => { + it('invokes deleteGlossary without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.DeleteGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteGlossary = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGlossary(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes listGlossaries without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ), - ]; - client.innerApiCalls.listGlossaries = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.listGlossaries( - request, - ( - err?: Error | null, - result?: protos.google.cloud.translation.v3.IGlossary[] | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); + it('invokes deleteGlossary without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.DeleteGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteGlossary = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGlossary( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes listGlossaries with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listGlossaries = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.listGlossaries(request); - }, expectedError); - assert( - (client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('invokes deleteGlossary with call error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.DeleteGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGlossary = stubLongRunningCall(undefined, expectedError); + await assert.rejects(async () => { await client.deleteGlossary(request); }, expectedError); + assert((client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteGlossary with LRO error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.DeleteGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGlossary = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteGlossary(request); + await assert.rejects(async () => { await operation.promise(); }, expectedError); + assert((client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes listGlossariesStream without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ), - ]; - client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( - expectedResponse - ); - const stream = client.listGlossariesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.translation.v3.Glossary[] = []; - stream.on( - 'data', - (response: protos.google.cloud.translation.v3.Glossary) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); + describe('listGlossaries', () => { + it('invokes listGlossaries without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), + ]; + client.innerApiCalls.listGlossaries = stubSimpleCall(expectedResponse); + const [response] = await client.listGlossaries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); }); - stream.on('error', (err: Error) => { - reject(err); + + it('invokes listGlossaries without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), + ]; + client.innerApiCalls.listGlossaries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGlossaries( + request, + (err?: Error|null, result?: protos.google.cloud.translation.v3.IGlossary[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - (client.descriptors.page.listGlossaries.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listGlossaries, request) - ); - assert.strictEqual( - (client.descriptors.page.listGlossaries - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], - expectedHeaderRequestParams - ); - }); - it('invokes listGlossariesStream with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedError = new Error('expected'); - client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listGlossariesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.translation.v3.Glossary[] = []; - stream.on( - 'data', - (response: protos.google.cloud.translation.v3.Glossary) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); + it('invokes listGlossaries with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGlossaries = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.listGlossaries(request); }, expectedError); + assert((client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); }); - stream.on('error', (err: Error) => { - reject(err); + + it('invokes listGlossariesStream without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), + ]; + client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listGlossariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.translation.v3.Glossary[] = []; + stream.on('data', (response: protos.google.cloud.translation.v3.Glossary) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGlossaries, request)); + assert.strictEqual( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); }); - }); - await assert.rejects(async () => { - await promise; - }, expectedError); - assert( - (client.descriptors.page.listGlossaries.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listGlossaries, request) - ); - assert.strictEqual( - (client.descriptors.page.listGlossaries - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], - expectedHeaderRequestParams - ); - }); - it('uses async iteration with listGlossaries without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3.Glossary() - ), - ]; - client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.translation.v3.IGlossary[] = []; - const iterable = client.listGlossariesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[1], - request - ); - assert.strictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], - expectedHeaderRequestParams - ); - }); + it('invokes listGlossariesStream with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listGlossariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.translation.v3.Glossary[] = []; + stream.on('data', (response: protos.google.cloud.translation.v3.Glossary) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(async () => { await promise; }, expectedError); + assert((client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGlossaries, request)); + assert.strictEqual( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('uses async iteration with listGlossaries with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedError = new Error('expected'); - client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listGlossariesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.translation.v3.IGlossary[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[1], - request - ); - assert.strictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], - expectedHeaderRequestParams - ); + it('uses async iteration with listGlossaries without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), + ]; + client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.translation.v3.IGlossary[] = []; + const iterable = client.listGlossariesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listGlossaries with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGlossariesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.translation.v3.IGlossary[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); }); - }); - describe('Path templates', () => { - describe('glossary', () => { - const fakePath = '/rendered/path/glossary'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - glossary: 'glossaryValue', - }; - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.glossaryPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.glossaryPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + describe('Path templates', () => { - it('glossaryPath', () => { - const result = client.glossaryPath( - 'projectValue', - 'locationValue', - 'glossaryValue' - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.glossaryPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); + describe('glossary', () => { + const fakePath = "/rendered/path/glossary"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + glossary: "glossaryValue", + }; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.glossaryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.glossaryPathTemplate.match = + sinon.stub().returns(expectedParameters); - it('matchProjectFromGlossaryName', () => { - const result = client.matchProjectFromGlossaryName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.glossaryPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('glossaryPath', () => { + const result = client.glossaryPath("projectValue", "locationValue", "glossaryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.glossaryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); - it('matchLocationFromGlossaryName', () => { - const result = client.matchLocationFromGlossaryName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.glossaryPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('matchProjectFromGlossaryName', () => { + const result = client.matchProjectFromGlossaryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); - it('matchGlossaryFromGlossaryName', () => { - const result = client.matchGlossaryFromGlossaryName(fakePath); - assert.strictEqual(result, 'glossaryValue'); - assert( - (client.pathTemplates.glossaryPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); + it('matchLocationFromGlossaryName', () => { + const result = client.matchLocationFromGlossaryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); - describe('location', () => { - const fakePath = '/rendered/path/location'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - }; - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.locationPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + it('matchGlossaryFromGlossaryName', () => { + const result = client.matchGlossaryFromGlossaryName(fakePath); + assert.strictEqual(result, "glossaryValue"); + assert((client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); - it('locationPath', () => { - const result = client.locationPath('projectValue', 'locationValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); - }); }); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts index ee05fbaad51..f8003dae5cf 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -20,7 +20,7 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import { describe, it } from 'mocha'; import * as translationserviceModule from '../src'; import {PassThrough} from 'stream'; @@ -28,1647 +28,1137 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); - return (instance.constructor as typeof protobuf.Message).fromObject( - filledObject - ) as T; + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; } function stubSimpleCall(response?: ResponseType, error?: Error) { - return error - ? sinon.stub().rejects(error) - : sinon.stub().resolves([response]); + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); } -function stubSimpleCallWithCallback( - response?: ResponseType, - error?: Error -) { - return error - ? sinon.stub().callsArgWith(2, error) - : sinon.stub().callsArgWith(2, null, response); +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); } -function stubLongRunningCall( - response?: ResponseType, - callError?: Error, - lroError?: Error -) { - const innerStub = lroError - ? sinon.stub().rejects(lroError) - : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError - ? sinon.stub().rejects(callError) - : sinon.stub().resolves([mockOperation]); +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); } -function stubLongRunningCallWithCallback( - response?: ResponseType, - callError?: Error, - lroError?: Error -) { - const innerStub = lroError - ? sinon.stub().rejects(lroError) - : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError - ? sinon.stub().callsArgWith(2, callError) - : sinon.stub().callsArgWith(2, null, mockOperation); +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); } -function stubPageStreamingCall( - responses?: ResponseType[], - error?: Error -) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error - ? sinon.stub().callsArgWith(2, error) - : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { - mockStream.write({}); - }); +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } } - setImmediate(() => { - mockStream.end(); - }); - } else { - setImmediate(() => { - mockStream.write({}); - }); - setImmediate(() => { - mockStream.end(); + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, }); - } - return sinon.stub().returns(mockStream); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); } -function stubAsyncIterationCall( - responses?: ResponseType[], - error?: Error -) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - }, - }; - }, - }; - return sinon.stub().returns(asyncIterable); +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); } describe('v3beta1.TranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = - translationserviceModule.v3beta1.TranslationServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - translationserviceModule.v3beta1.TranslationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = translationserviceModule.v3beta1.TranslationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - fallback: true, - } - ); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.translationServiceStub, undefined); - await client.initialize(); - assert(client.translationServiceStub); - }); - - it('has close method', () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.close(); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); + it('has servicePath', () => { + const servicePath = translationserviceModule.v3beta1.TranslationServiceClient.servicePath; + assert(servicePath); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - describe('translateText', () => { - it('invokes translateText without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.TranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.TranslateTextResponse() - ); - client.innerApiCalls.translateText = stubSimpleCall(expectedResponse); - const [response] = await client.translateText(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.translateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has apiEndpoint', () => { + const apiEndpoint = translationserviceModule.v3beta1.TranslationServiceClient.apiEndpoint; + assert(apiEndpoint); }); - it('invokes translateText without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.TranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.TranslateTextResponse() - ); - client.innerApiCalls.translateText = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.translateText( - request, - ( - err?: Error | null, - result?: protos.google.cloud.translation.v3beta1.ITranslateTextResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.translateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('has port', () => { + const port = translationserviceModule.v3beta1.TranslationServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - it('invokes translateText with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.TranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.translateText = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.translateText(request); - }, expectedError); - assert( - (client.innerApiCalls.translateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('should create a client with no option', () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient(); + assert(client); }); - }); - describe('detectLanguage', () => { - it('invokes detectLanguage without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.DetectLanguageResponse() - ); - client.innerApiCalls.detectLanguage = stubSimpleCall(expectedResponse); - const [response] = await client.detectLanguage(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('should create a client with gRPC fallback', () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + fallback: true, + }); + assert(client); }); - it('invokes detectLanguage without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.DetectLanguageResponse() - ); - client.innerApiCalls.detectLanguage = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.detectLanguage( - request, - ( - err?: Error | null, - result?: protos.google.cloud.translation.v3beta1.IDetectLanguageResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('has initialize method and supports deferred initialization', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.translationServiceStub, undefined); + await client.initialize(); + assert(client.translationServiceStub); }); - it('invokes detectLanguage with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.detectLanguage = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.detectLanguage(request); - }, expectedError); - assert( - (client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has close method', () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.close(); }); - }); - describe('getSupportedLanguages', () => { - it('invokes getSupportedLanguages without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.SupportedLanguages() - ); - client.innerApiCalls.getSupportedLanguages = stubSimpleCall( - expectedResponse - ); - const [response] = await client.getSupportedLanguages(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - it('invokes getSupportedLanguages without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.SupportedLanguages() - ); - client.innerApiCalls.getSupportedLanguages = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.getSupportedLanguages( - request, - ( - err?: Error | null, - result?: protos.google.cloud.translation.v3beta1.ISupportedLanguages | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - it('invokes getSupportedLanguages with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getSupportedLanguages = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.getSupportedLanguages(request); - }, expectedError); - assert( - (client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + describe('translateText', () => { + it('invokes translateText without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.TranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.TranslateTextResponse()); + client.innerApiCalls.translateText = stubSimpleCall(expectedResponse); + const [response] = await client.translateText(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.translateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - describe('getGlossary', () => { - it('invokes getGlossary without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ); - client.innerApiCalls.getGlossary = stubSimpleCall(expectedResponse); - const [response] = await client.getGlossary(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes translateText without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.TranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.TranslateTextResponse()); + client.innerApiCalls.translateText = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.translateText( + request, + (err?: Error|null, result?: protos.google.cloud.translation.v3beta1.ITranslateTextResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.translateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes getGlossary without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ); - client.innerApiCalls.getGlossary = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.getGlossary( - request, - ( - err?: Error | null, - result?: protos.google.cloud.translation.v3beta1.IGlossary | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('invokes translateText with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.TranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.translateText = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.translateText(request); }, expectedError); + assert((client.innerApiCalls.translateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes getGlossary with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getGlossary = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.getGlossary(request); - }, expectedError); - assert( - (client.innerApiCalls.getGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + describe('detectLanguage', () => { + it('invokes detectLanguage without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DetectLanguageRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DetectLanguageResponse()); + client.innerApiCalls.detectLanguage = stubSimpleCall(expectedResponse); + const [response] = await client.detectLanguage(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - describe('batchTranslateText', () => { - it('invokes batchTranslateText without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchTranslateText = stubLongRunningCall( - expectedResponse - ); - const [operation] = await client.batchTranslateText(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes detectLanguage without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DetectLanguageRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DetectLanguageResponse()); + client.innerApiCalls.detectLanguage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.detectLanguage( + request, + (err?: Error|null, result?: protos.google.cloud.translation.v3beta1.IDetectLanguageResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes batchTranslateText without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchTranslateText = stubLongRunningCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.batchTranslateText( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata - > | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('invokes detectLanguage with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DetectLanguageRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.detectLanguage = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.detectLanguage(request); }, expectedError); + assert((client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes batchTranslateText with call error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchTranslateText = stubLongRunningCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.batchTranslateText(request); - }, expectedError); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + describe('getSupportedLanguages', () => { + it('invokes getSupportedLanguages without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.SupportedLanguages()); + client.innerApiCalls.getSupportedLanguages = stubSimpleCall(expectedResponse); + const [response] = await client.getSupportedLanguages(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes batchTranslateText with LRO error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchTranslateText = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.batchTranslateText(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + it('invokes getSupportedLanguages without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.SupportedLanguages()); + client.innerApiCalls.getSupportedLanguages = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSupportedLanguages( + request, + (err?: Error|null, result?: protos.google.cloud.translation.v3beta1.ISupportedLanguages|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - describe('createGlossary', () => { - it('invokes createGlossary without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createGlossary = stubLongRunningCall( - expectedResponse - ); - const [operation] = await client.createGlossary(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('invokes getSupportedLanguages with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSupportedLanguages = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.getSupportedLanguages(request); }, expectedError); + assert((client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes createGlossary without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createGlossary = stubLongRunningCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.createGlossary( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata - > | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); + describe('getGlossary', () => { + it('invokes getGlossary without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.GetGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()); + client.innerApiCalls.getGlossary = stubSimpleCall(expectedResponse); + const [response] = await client.getGlossary(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes createGlossary with call error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createGlossary = stubLongRunningCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.createGlossary(request); - }, expectedError); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes getGlossary without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.GetGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()); + client.innerApiCalls.getGlossary = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGlossary( + request, + (err?: Error|null, result?: protos.google.cloud.translation.v3beta1.IGlossary|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes createGlossary with LRO error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createGlossary = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.createGlossary(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('invokes getGlossary with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.GetGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGlossary = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.getGlossary(request); }, expectedError); + assert((client.innerApiCalls.getGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - }); - describe('deleteGlossary', () => { - it('invokes deleteGlossary without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteGlossary = stubLongRunningCall( - expectedResponse - ); - const [operation] = await client.deleteGlossary(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + describe('batchTranslateText', () => { + it('invokes batchTranslateText without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchTranslateText = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchTranslateText(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes deleteGlossary without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteGlossary = stubLongRunningCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.deleteGlossary( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata - > | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, - protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); + it('invokes batchTranslateText without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchTranslateText = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchTranslateText( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes deleteGlossary with call error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteGlossary = stubLongRunningCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.deleteGlossary(request); - }, expectedError); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes batchTranslateText with call error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateText = stubLongRunningCall(undefined, expectedError); + await assert.rejects(async () => { await client.batchTranslateText(request); }, expectedError); + assert((client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes deleteGlossary with LRO error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteGlossary = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.deleteGlossary(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('invokes batchTranslateText with LRO error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateText = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchTranslateText(request); + await assert.rejects(async () => { await operation.promise(); }, expectedError); + assert((client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - }); - describe('listGlossaries', () => { - it('invokes listGlossaries without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ), - ]; - client.innerApiCalls.listGlossaries = stubSimpleCall(expectedResponse); - const [response] = await client.listGlossaries(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + describe('createGlossary', () => { + it('invokes createGlossary without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createGlossary = stubLongRunningCall(expectedResponse); + const [operation] = await client.createGlossary(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes listGlossaries without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ), - ]; - client.innerApiCalls.listGlossaries = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.listGlossaries( - request, - ( - err?: Error | null, - result?: protos.google.cloud.translation.v3beta1.IGlossary[] | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); + it('invokes createGlossary without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createGlossary = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGlossary( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes listGlossaries with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listGlossaries = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.listGlossaries(request); - }, expectedError); - assert( - (client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('invokes createGlossary with call error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGlossary = stubLongRunningCall(undefined, expectedError); + await assert.rejects(async () => { await client.createGlossary(request); }, expectedError); + assert((client.innerApiCalls.createGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createGlossary with LRO error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGlossary = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createGlossary(request); + await assert.rejects(async () => { await operation.promise(); }, expectedError); + assert((client.innerApiCalls.createGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes listGlossariesStream without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ), - ]; - client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( - expectedResponse - ); - const stream = client.listGlossariesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.translation.v3beta1.Glossary[] = []; - stream.on( - 'data', - (response: protos.google.cloud.translation.v3beta1.Glossary) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); + describe('deleteGlossary', () => { + it('invokes deleteGlossary without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteGlossary = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGlossary(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); }); - stream.on('error', (err: Error) => { - reject(err); + + it('invokes deleteGlossary without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteGlossary = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGlossary( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - (client.descriptors.page.listGlossaries.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listGlossaries, request) - ); - assert.strictEqual( - (client.descriptors.page.listGlossaries - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], - expectedHeaderRequestParams - ); - }); - it('invokes listGlossariesStream with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedError = new Error('expected'); - client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listGlossariesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.translation.v3beta1.Glossary[] = []; - stream.on( - 'data', - (response: protos.google.cloud.translation.v3beta1.Glossary) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); + it('invokes deleteGlossary with call error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGlossary = stubLongRunningCall(undefined, expectedError); + await assert.rejects(async () => { await client.deleteGlossary(request); }, expectedError); + assert((client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); }); - stream.on('error', (err: Error) => { - reject(err); + + it('invokes deleteGlossary with LRO error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGlossary = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteGlossary(request); + await assert.rejects(async () => { await operation.promise(); }, expectedError); + assert((client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); }); - }); - await assert.rejects(async () => { - await promise; - }, expectedError); - assert( - (client.descriptors.page.listGlossaries.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listGlossaries, request) - ); - assert.strictEqual( - (client.descriptors.page.listGlossaries - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], - expectedHeaderRequestParams - ); }); - it('uses async iteration with listGlossaries without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ), - generateSampleMessage( - new protos.google.cloud.translation.v3beta1.Glossary() - ), - ]; - client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; - const iterable = client.listGlossariesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[1], - request - ); - assert.strictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], - expectedHeaderRequestParams - ); - }); + describe('listGlossaries', () => { + it('invokes listGlossaries without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), + ]; + client.innerApiCalls.listGlossaries = stubSimpleCall(expectedResponse); + const [response] = await client.listGlossaries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('uses async iteration with listGlossaries with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedError = new Error('expected'); - client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listGlossariesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[1], - request - ); - assert.strictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], - expectedHeaderRequestParams - ); - }); - }); + it('invokes listGlossaries without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), + ]; + client.innerApiCalls.listGlossaries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGlossaries( + request, + (err?: Error|null, result?: protos.google.cloud.translation.v3beta1.IGlossary[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - describe('Path templates', () => { - describe('glossary', () => { - const fakePath = '/rendered/path/glossary'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - glossary: 'glossaryValue', - }; - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - client.pathTemplates.glossaryPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.glossaryPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + it('invokes listGlossaries with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGlossaries = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.listGlossaries(request); }, expectedError); + assert((client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('glossaryPath', () => { - const result = client.glossaryPath( - 'projectValue', - 'locationValue', - 'glossaryValue' - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.glossaryPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); + it('invokes listGlossariesStream without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), + ]; + client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listGlossariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.translation.v3beta1.Glossary[] = []; + stream.on('data', (response: protos.google.cloud.translation.v3beta1.Glossary) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGlossaries, request)); + assert.strictEqual( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('matchProjectFromGlossaryName', () => { - const result = client.matchProjectFromGlossaryName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.glossaryPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('invokes listGlossariesStream with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listGlossariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.translation.v3beta1.Glossary[] = []; + stream.on('data', (response: protos.google.cloud.translation.v3beta1.Glossary) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(async () => { await promise; }, expectedError); + assert((client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGlossaries, request)); + assert.strictEqual( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('matchLocationFromGlossaryName', () => { - const result = client.matchLocationFromGlossaryName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.glossaryPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('uses async iteration with listGlossaries without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), + generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), + ]; + client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; + const iterable = client.listGlossariesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('matchGlossaryFromGlossaryName', () => { - const result = client.matchGlossaryFromGlossaryName(fakePath); - assert.strictEqual(result, 'glossaryValue'); - assert( - (client.pathTemplates.glossaryPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('uses async iteration with listGlossaries with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGlossariesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); }); - describe('location', () => { - const fakePath = '/rendered/path/location'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - }; - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.locationPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + describe('Path templates', () => { + + describe('glossary', () => { + const fakePath = "/rendered/path/glossary"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + glossary: "glossaryValue", + }; + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.glossaryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.glossaryPathTemplate.match = + sinon.stub().returns(expectedParameters); - it('locationPath', () => { - const result = client.locationPath('projectValue', 'locationValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); + it('glossaryPath', () => { + const result = client.glossaryPath("projectValue", "locationValue", "glossaryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.glossaryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('matchProjectFromGlossaryName', () => { + const result = client.matchProjectFromGlossaryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('matchLocationFromGlossaryName', () => { + const result = client.matchLocationFromGlossaryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGlossaryFromGlossaryName', () => { + const result = client.matchGlossaryFromGlossaryName(fakePath); + assert.strictEqual(result, "glossaryValue"); + assert((client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); - }); }); diff --git a/packages/google-cloud-translate/webpack.config.js b/packages/google-cloud-translate/webpack.config.js index 87404681b50..ae59feffb0f 100644 --- a/packages/google-cloud-translate/webpack.config.js +++ b/packages/google-cloud-translate/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/, + exclude: /node_modules/ }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]grpc/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader', + use: 'null-loader' }, ], }, From a0f65510ac3693010e8131f9d3f20d3bb63af41c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 17 Apr 2020 15:49:06 -0700 Subject: [PATCH 362/513] chore: linting --- .../src/v3/translation_service_client.ts | 1651 ++++++----- .../src/v3beta1/translation_service_client.ts | 1666 ++++++----- .../google-cloud-translate/synth.metadata | 2 +- .../system-test/fixtures/sample/src/index.js | 1 - .../system-test/install.ts | 32 +- .../test/gapic_translation_service_v3.ts | 2534 +++++++++------- .../test/gapic_translation_service_v3beta1.ts | 2618 ++++++++++------- .../google-cloud-translate/webpack.config.js | 12 +- 8 files changed, 4982 insertions(+), 3534 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 39e935b516d..0acb7f8f4c2 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -17,11 +17,19 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; import * as path from 'path'; -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './translation_service_client_config.json'; @@ -40,7 +48,12 @@ export class TranslationServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; - descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}, batching: {}}; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -75,10 +88,12 @@ export class TranslationServiceClient { constructor(opts?: ClientOptions) { // Ensure that options include the service address and port. const staticMembers = this.constructor as typeof TranslationServiceClient; - const servicePath = opts && opts.servicePath ? - opts.servicePath : - ((opts && opts.apiEndpoint) ? opts.apiEndpoint : - staticMembers.servicePath); + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; const port = opts && opts.port ? opts.port : staticMembers.port; if (!opts) { @@ -88,8 +103,8 @@ export class TranslationServiceClient { opts.port = opts.port || port; opts.clientConfig = opts.clientConfig || {}; - const isBrowser = (typeof window !== 'undefined'); - if (isBrowser){ + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { opts.fallback = true; } // If we are in browser, we are already using fallback because of the @@ -106,13 +121,10 @@ export class TranslationServiceClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -128,12 +140,18 @@ export class TranslationServiceClient { // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. - const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? - // eslint-disable-next-line @typescript-eslint/no-var-requires - require("../../protos/protos.json") : - nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated @@ -152,55 +170,73 @@ export class TranslationServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listGlossaries: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'glossaries') + listGlossaries: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'glossaries' + ), }; // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - const protoFilesRoot = opts.fallback ? - this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require("../../protos/protos.json")) : - this._gaxModule.protobuf.loadSync(nodejsProtoPath); + const protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); const batchTranslateTextResponse = protoFilesRoot.lookup( - '.google.cloud.translation.v3.BatchTranslateResponse') as gax.protobuf.Type; + '.google.cloud.translation.v3.BatchTranslateResponse' + ) as gax.protobuf.Type; const batchTranslateTextMetadata = protoFilesRoot.lookup( - '.google.cloud.translation.v3.BatchTranslateMetadata') as gax.protobuf.Type; + '.google.cloud.translation.v3.BatchTranslateMetadata' + ) as gax.protobuf.Type; const createGlossaryResponse = protoFilesRoot.lookup( - '.google.cloud.translation.v3.Glossary') as gax.protobuf.Type; + '.google.cloud.translation.v3.Glossary' + ) as gax.protobuf.Type; const createGlossaryMetadata = protoFilesRoot.lookup( - '.google.cloud.translation.v3.CreateGlossaryMetadata') as gax.protobuf.Type; + '.google.cloud.translation.v3.CreateGlossaryMetadata' + ) as gax.protobuf.Type; const deleteGlossaryResponse = protoFilesRoot.lookup( - '.google.cloud.translation.v3.DeleteGlossaryResponse') as gax.protobuf.Type; + '.google.cloud.translation.v3.DeleteGlossaryResponse' + ) as gax.protobuf.Type; const deleteGlossaryMetadata = protoFilesRoot.lookup( - '.google.cloud.translation.v3.DeleteGlossaryMetadata') as gax.protobuf.Type; + '.google.cloud.translation.v3.DeleteGlossaryMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { batchTranslateText: new this._gaxModule.LongrunningDescriptor( this.operationsClient, batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), - batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata)), + batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) + ), createGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGlossaryResponse.decode.bind(createGlossaryResponse), - createGlossaryMetadata.decode.bind(createGlossaryMetadata)), + createGlossaryMetadata.decode.bind(createGlossaryMetadata) + ), deleteGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), - deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata)) + deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata) + ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.translation.v3.TranslationService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.translation.v3.TranslationService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code @@ -228,16 +264,27 @@ export class TranslationServiceClient { // Put together the "service stub" for // google.cloud.translation.v3.TranslationService. this.translationServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.translation.v3.TranslationService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.translation.v3.TranslationService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.translation.v3.TranslationService, - this._opts) as Promise<{[method: string]: Function}>; + this._opts + ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides // and create an API call method for each. - const translationServiceStubMethods = - ['translateText', 'detectLanguage', 'getSupportedLanguages', 'batchTranslateText', 'createGlossary', 'listGlossaries', 'getGlossary', 'deleteGlossary']; + const translationServiceStubMethods = [ + 'translateText', + 'detectLanguage', + 'getSupportedLanguages', + 'batchTranslateText', + 'createGlossary', + 'listGlossaries', + 'getGlossary', + 'deleteGlossary', + ]; for (const methodName of translationServiceStubMethods) { const callPromise = this.translationServiceStub.then( stub => (...args: Array<{}>) => { @@ -247,16 +294,17 @@ export class TranslationServiceClient { const func = stub[methodName]; return func.apply(stub, args); }, - (err: Error|null|undefined) => () => { + (err: Error | null | undefined) => () => { throw err; - }); + } + ); const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); this.innerApiCalls[methodName] = apiCall; @@ -294,7 +342,7 @@ export class TranslationServiceClient { static get scopes() { return [ 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-translation' + 'https://www.googleapis.com/auth/cloud-translation', ]; } @@ -305,8 +353,9 @@ export class TranslationServiceClient { * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId(callback?: Callback): - Promise|void { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -318,119 +367,140 @@ export class TranslationServiceClient { // -- Service calls -- // ------------------- translateText( - request: protos.google.cloud.translation.v3.ITranslateTextRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.translation.v3.ITranslateTextResponse, - protos.google.cloud.translation.v3.ITranslateTextRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3.ITranslateTextRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3.ITranslateTextResponse, + protos.google.cloud.translation.v3.ITranslateTextRequest | undefined, + {} | undefined + ] + >; translateText( - request: protos.google.cloud.translation.v3.ITranslateTextRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3.ITranslateTextResponse, - protos.google.cloud.translation.v3.ITranslateTextRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3.ITranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.ITranslateTextResponse, + | protos.google.cloud.translation.v3.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; translateText( - request: protos.google.cloud.translation.v3.ITranslateTextRequest, - callback: Callback< - protos.google.cloud.translation.v3.ITranslateTextResponse, - protos.google.cloud.translation.v3.ITranslateTextRequest|null|undefined, - {}|null|undefined>): void; -/** - * Translates input text and returns translated text. - * - * @param {Object} request - * The request object that will be sent. - * @param {string[]} request.contents - * Required. The content of the input in string format. - * We recommend the total content be less than 30k codepoints. - * Use BatchTranslateText for larger text. - * @param {string} [request.mimeType] - * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {string} [request.sourceLanguageCode] - * Optional. The BCP-47 language code of the input text if - * known, for example, "en-US" or "sr-Latn". Supported language codes are - * listed in Language Support. If the source language isn't specified, the API - * attempts to identify the source language automatically and returns the - * source language within the response. - * @param {string} request.targetLanguageCode - * Required. The BCP-47 language code to use for translation of the input - * text, set to one of the language codes listed in Language Support. - * @param {string} request.parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-number-or-id}` or - * `projects/{project-number-or-id}/locations/{location-id}`. - * - * For global calls, use `projects/{project-number-or-id}/locations/global` or - * `projects/{project-number-or-id}`. - * - * Non-global location is required for requests using AutoML models or - * custom glossaries. - * - * Models and glossaries must be within the same region (have same - * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.model] - * Optional. The `model` type requested for this translation. - * - * The format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` - * - * - * For global (non-regionalized) requests, use `location-id` `global`. - * For example, - * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - * - * If missing, the system decides which google base model to use. - * @param {google.cloud.translation.v3.TranslateTextGlossaryConfig} [request.glossaryConfig] - * Optional. Glossary to be applied. The glossary must be - * within the same region (have the same location-id) as the model, otherwise - * an INVALID_ARGUMENT (400) error is returned. - * @param {number[]} [request.labels] - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3.TranslateTextResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.ITranslateTextRequest, + callback: Callback< + protos.google.cloud.translation.v3.ITranslateTextResponse, + | protos.google.cloud.translation.v3.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Translates input text and returns translated text. + * + * @param {Object} request + * The request object that will be sent. + * @param {string[]} request.contents + * Required. The content of the input in string format. + * We recommend the total content be less than 30k codepoints. + * Use BatchTranslateText for larger text. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + * @param {string} [request.sourceLanguageCode] + * Optional. The BCP-47 language code of the input text if + * known, for example, "en-US" or "sr-Latn". Supported language codes are + * listed in Language Support. If the source language isn't specified, the API + * attempts to identify the source language automatically and returns the + * source language within the response. + * @param {string} request.targetLanguageCode + * Required. The BCP-47 language code to use for translation of the input + * text, set to one of the language codes listed in Language Support. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * + * Non-global location is required for requests using AutoML models or + * custom glossaries. + * + * Models and glossaries must be within the same region (have same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.model] + * Optional. The `model` type requested for this translation. + * + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * + * + * For global (non-regionalized) requests, use `location-id` `global`. + * For example, + * `projects/{project-number-or-id}/locations/global/models/general/nmt`. + * + * If missing, the system decides which google base model to use. + * @param {google.cloud.translation.v3.TranslateTextGlossaryConfig} [request.glossaryConfig] + * Optional. Glossary to be applied. The glossary must be + * within the same region (have the same location-id) as the model, otherwise + * an INVALID_ARGUMENT (400) error is returned. + * @param {number[]} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3.TranslateTextResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ translateText( - request: protos.google.cloud.translation.v3.ITranslateTextRequest, - optionsOrCallback?: gax.CallOptions|Callback< + request: protos.google.cloud.translation.v3.ITranslateTextRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.translation.v3.ITranslateTextResponse, - protos.google.cloud.translation.v3.ITranslateTextRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.translation.v3.ITranslateTextResponse, - protos.google.cloud.translation.v3.ITranslateTextRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.translation.v3.ITranslateTextResponse, - protos.google.cloud.translation.v3.ITranslateTextRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.translation.v3.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.translation.v3.ITranslateTextResponse, + | protos.google.cloud.translation.v3.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.translation.v3.ITranslateTextResponse, + protos.google.cloud.translation.v3.ITranslateTextRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -439,99 +509,120 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.translateText(request, options, callback); } detectLanguage( - request: protos.google.cloud.translation.v3.IDetectLanguageRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.translation.v3.IDetectLanguageResponse, - protos.google.cloud.translation.v3.IDetectLanguageRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3.IDetectLanguageResponse, + protos.google.cloud.translation.v3.IDetectLanguageRequest | undefined, + {} | undefined + ] + >; detectLanguage( - request: protos.google.cloud.translation.v3.IDetectLanguageRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3.IDetectLanguageResponse, - protos.google.cloud.translation.v3.IDetectLanguageRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.IDetectLanguageResponse, + | protos.google.cloud.translation.v3.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined + > + ): void; detectLanguage( - request: protos.google.cloud.translation.v3.IDetectLanguageRequest, - callback: Callback< - protos.google.cloud.translation.v3.IDetectLanguageResponse, - protos.google.cloud.translation.v3.IDetectLanguageRequest|null|undefined, - {}|null|undefined>): void; -/** - * Detects the language of text within a request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-number-or-id}/locations/{location-id}` or - * `projects/{project-number-or-id}`. - * - * For global calls, use `projects/{project-number-or-id}/locations/global` or - * `projects/{project-number-or-id}`. - * - * Only models within the same region (has same location-id) can be used. - * Otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.model] - * Optional. The language detection model to be used. - * - * Format: - * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` - * - * Only one language detection model is currently supported: - * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. - * - * If not specified, the default model is used. - * @param {string} request.content - * The content of the input stored as a string. - * @param {string} [request.mimeType] - * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {number[]} [request.labels] - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3.DetectLanguageResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + callback: Callback< + protos.google.cloud.translation.v3.IDetectLanguageResponse, + | protos.google.cloud.translation.v3.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Detects the language of text within a request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-number-or-id}/locations/{location-id}` or + * `projects/{project-number-or-id}`. + * + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * + * Only models within the same region (has same location-id) can be used. + * Otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.model] + * Optional. The language detection model to be used. + * + * Format: + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` + * + * Only one language detection model is currently supported: + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. + * + * If not specified, the default model is used. + * @param {string} request.content + * The content of the input stored as a string. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + * @param {number[]} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3.DetectLanguageResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ detectLanguage( - request: protos.google.cloud.translation.v3.IDetectLanguageRequest, - optionsOrCallback?: gax.CallOptions|Callback< + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.translation.v3.IDetectLanguageResponse, - protos.google.cloud.translation.v3.IDetectLanguageRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.translation.v3.IDetectLanguageResponse, - protos.google.cloud.translation.v3.IDetectLanguageRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.translation.v3.IDetectLanguageResponse, - protos.google.cloud.translation.v3.IDetectLanguageRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.translation.v3.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.translation.v3.IDetectLanguageResponse, + | protos.google.cloud.translation.v3.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.translation.v3.IDetectLanguageResponse, + protos.google.cloud.translation.v3.IDetectLanguageRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -540,96 +631,123 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.detectLanguage(request, options, callback); } getSupportedLanguages( - request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.translation.v3.ISupportedLanguages, - protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3.ISupportedLanguages, + ( + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | undefined + ), + {} | undefined + ] + >; getSupportedLanguages( - request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3.ISupportedLanguages, - protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.ISupportedLanguages, + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined + > + ): void; getSupportedLanguages( - request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - callback: Callback< - protos.google.cloud.translation.v3.ISupportedLanguages, - protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest|null|undefined, - {}|null|undefined>): void; -/** - * Returns a list of supported languages for translation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-number-or-id}` or - * `projects/{project-number-or-id}/locations/{location-id}`. - * - * For global calls, use `projects/{project-number-or-id}/locations/global` or - * `projects/{project-number-or-id}`. - * - * Non-global location is required for AutoML models. - * - * Only models within the same region (have same location-id) can be used, - * otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.displayLanguageCode] - * Optional. The language to use to return localized, human readable names - * of supported languages. If missing, then display names are not returned - * in a response. - * @param {string} [request.model] - * Optional. Get supported languages of this model. - * - * The format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` - * - * - * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3.SupportedLanguages}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + callback: Callback< + protos.google.cloud.translation.v3.ISupportedLanguages, + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns a list of supported languages for translation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * + * Non-global location is required for AutoML models. + * + * Only models within the same region (have same location-id) can be used, + * otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.displayLanguageCode] + * Optional. The language to use to return localized, human readable names + * of supported languages. If missing, then display names are not returned + * in a response. + * @param {string} [request.model] + * Optional. Get supported languages of this model. + * + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * + * + * Returns languages supported by the specified model. + * If missing, we get supported languages of Google general base (PBMT) model. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3.SupportedLanguages}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getSupportedLanguages( - request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protos.google.cloud.translation.v3.ISupportedLanguages, - protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.translation.v3.ISupportedLanguages, - protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.translation.v3.ISupportedLanguages, - protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.translation.v3.ISupportedLanguages, + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.translation.v3.ISupportedLanguages, + ( + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -638,66 +756,81 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.getSupportedLanguages(request, options, callback); } getGlossary( - request: protos.google.cloud.translation.v3.IGetGlossaryRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.IGetGlossaryRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3.IGetGlossaryRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest | undefined, + {} | undefined + ] + >; getGlossary( - request: protos.google.cloud.translation.v3.IGetGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.IGetGlossaryRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3.IGetGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest | null | undefined, + {} | null | undefined + > + ): void; getGlossary( - request: protos.google.cloud.translation.v3.IGetGlossaryRequest, - callback: Callback< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.IGetGlossaryRequest|null|undefined, - {}|null|undefined>): void; -/** - * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3.Glossary}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.IGetGlossaryRequest, + callback: Callback< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3.Glossary}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getGlossary( - request: protos.google.cloud.translation.v3.IGetGlossaryRequest, - optionsOrCallback?: gax.CallOptions|Callback< + request: protos.google.cloud.translation.v3.IGetGlossaryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.IGetGlossaryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.IGetGlossaryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.translation.v3.IGlossary, - protos.google.cloud.translation.v3.IGetGlossaryRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.translation.v3.IGetGlossaryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.IGetGlossaryRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -706,122 +839,153 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'name': request.name || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.getGlossary(request, options, callback); } batchTranslateText( - request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - options?: gax.CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; batchTranslateText( - request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - options: gax.CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchTranslateText( - request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Translates a large volume of text in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * - * This call returns immediately and you can - * use google.longrunning.Operation.name to poll the status of the call. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Location to make a call. Must refer to a caller's project. - * - * Format: `projects/{project-number-or-id}/locations/{location-id}`. - * - * The `global` location is not supported for batch translation. - * - * Only AutoML Translation models or glossaries within the same region (have - * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - * error is returned. - * @param {string} request.sourceLanguageCode - * Required. Source language code. - * @param {string[]} request.targetLanguageCodes - * Required. Specify up to 10 language codes here. - * @param {number[]} [request.models] - * Optional. The models to use for translation. Map's key is target language - * code. Map's value is model name. Value can be a built-in general model, - * or an AutoML Translation model. - * - * The value format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` - * - * - * If the map is empty or a specific model is - * not requested for a language pair, then default google model (nmt) is used. - * @param {number[]} request.inputConfigs - * Required. Input configurations. - * The total number of files matched should be <= 1000. - * The total content size should be <= 100M Unicode codepoints. - * The files must use UTF-8 encoding. - * @param {google.cloud.translation.v3.OutputConfig} request.outputConfig - * Required. Output configuration. - * If 2 input configs match to the same file (that is, same input path), - * we don't generate output for duplicate inputs. - * @param {number[]} [request.glossaries] - * Optional. Glossaries to be applied for translation. - * It's keyed by target language code. - * @param {number[]} [request.labels] - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Translates a large volume of text in asynchronous batch mode. + * This function provides real-time output as the inputs are being processed. + * If caller cancels a request, the partial results (for an input file, it's + * all or nothing) may still be available on the specified output location. + * + * This call returns immediately and you can + * use google.longrunning.Operation.name to poll the status of the call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Location to make a call. Must refer to a caller's project. + * + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * + * The `global` location is not supported for batch translation. + * + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. + * @param {string} request.sourceLanguageCode + * Required. Source language code. + * @param {string[]} request.targetLanguageCodes + * Required. Specify up to 10 language codes here. + * @param {number[]} [request.models] + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is model name. Value can be a built-in general model, + * or an AutoML Translation model. + * + * The value format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * + * + * If the map is empty or a specific model is + * not requested for a language pair, then default google model (nmt) is used. + * @param {number[]} request.inputConfigs + * Required. Input configurations. + * The total number of files matched should be <= 1000. + * The total content size should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + * @param {google.cloud.translation.v3.OutputConfig} request.outputConfig + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + * @param {number[]} [request.glossaries] + * Optional. Glossaries to be applied for translation. + * It's keyed by target language code. + * @param {number[]} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ batchTranslateText( - request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - optionsOrCallback?: gax.CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -830,68 +994,99 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.batchTranslateText(request, options, callback); } createGlossary( - request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, - options?: gax.CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; createGlossary( - request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; createGlossary( - request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project name. - * @param {google.cloud.translation.v3.Glossary} request.glossary - * Required. The glossary to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a glossary and returns the long-running operation. Returns + * NOT_FOUND, if the project doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project name. + * @param {google.cloud.translation.v3.Glossary} request.glossary + * Required. The glossary to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createGlossary( - request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, - optionsOrCallback?: gax.CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -900,67 +1095,98 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.createGlossary(request, options, callback); } deleteGlossary( - request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, - options?: gax.CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; deleteGlossary( - request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; deleteGlossary( - request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a glossary, or cancels glossary construction + * if the glossary isn't created yet. + * Returns NOT_FOUND, if the glossary doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ deleteGlossary( - request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, - optionsOrCallback?: gax.CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -969,92 +1195,111 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'name': request.name || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.deleteGlossary(request, options, callback); } listGlossaries( - request: protos.google.cloud.translation.v3.IListGlossariesRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.translation.v3.IGlossary[], - protos.google.cloud.translation.v3.IListGlossariesRequest|null, - protos.google.cloud.translation.v3.IListGlossariesResponse - ]>; + request: protos.google.cloud.translation.v3.IListGlossariesRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3.IGlossary[], + protos.google.cloud.translation.v3.IListGlossariesRequest | null, + protos.google.cloud.translation.v3.IListGlossariesResponse + ] + >; listGlossaries( - request: protos.google.cloud.translation.v3.IListGlossariesRequest, - options: gax.CallOptions, - callback: PaginationCallback< - protos.google.cloud.translation.v3.IListGlossariesRequest, - protos.google.cloud.translation.v3.IListGlossariesResponse|null|undefined, - protos.google.cloud.translation.v3.IGlossary>): void; + request: protos.google.cloud.translation.v3.IListGlossariesRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.translation.v3.IListGlossariesRequest, + | protos.google.cloud.translation.v3.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3.IGlossary + > + ): void; listGlossaries( - request: protos.google.cloud.translation.v3.IListGlossariesRequest, - callback: PaginationCallback< - protos.google.cloud.translation.v3.IListGlossariesRequest, - protos.google.cloud.translation.v3.IListGlossariesResponse|null|undefined, - protos.google.cloud.translation.v3.IGlossary>): void; -/** - * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - * exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project from which to list all of the glossaries. - * @param {number} [request.pageSize] - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * @param {string} [request.filter] - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3.Glossary}. - * The client library support auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Glossary]{@link google.cloud.translation.v3.Glossary} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListGlossariesRequest]{@link google.cloud.translation.v3.ListGlossariesRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListGlossariesResponse]{@link google.cloud.translation.v3.ListGlossariesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3.IListGlossariesRequest, + callback: PaginationCallback< + protos.google.cloud.translation.v3.IListGlossariesRequest, + | protos.google.cloud.translation.v3.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3.IGlossary + > + ): void; + /** + * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3.Glossary}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Glossary]{@link google.cloud.translation.v3.Glossary} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGlossariesRequest]{@link google.cloud.translation.v3.ListGlossariesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGlossariesResponse]{@link google.cloud.translation.v3.ListGlossariesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ listGlossaries( - request: protos.google.cloud.translation.v3.IListGlossariesRequest, - optionsOrCallback?: gax.CallOptions|PaginationCallback< + request: protos.google.cloud.translation.v3.IListGlossariesRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< protos.google.cloud.translation.v3.IListGlossariesRequest, - protos.google.cloud.translation.v3.IListGlossariesResponse|null|undefined, - protos.google.cloud.translation.v3.IGlossary>, - callback?: PaginationCallback< - protos.google.cloud.translation.v3.IListGlossariesRequest, - protos.google.cloud.translation.v3.IListGlossariesResponse|null|undefined, - protos.google.cloud.translation.v3.IGlossary>): - Promise<[ - protos.google.cloud.translation.v3.IGlossary[], - protos.google.cloud.translation.v3.IListGlossariesRequest|null, - protos.google.cloud.translation.v3.IListGlossariesResponse - ]>|void { + | protos.google.cloud.translation.v3.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3.IGlossary + >, + callback?: PaginationCallback< + protos.google.cloud.translation.v3.IListGlossariesRequest, + | protos.google.cloud.translation.v3.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3.IGlossary + > + ): Promise< + [ + protos.google.cloud.translation.v3.IGlossary[], + protos.google.cloud.translation.v3.IListGlossariesRequest | null, + protos.google.cloud.translation.v3.IListGlossariesResponse + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -1063,50 +1308,50 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.listGlossaries(request, options, callback); } -/** - * Equivalent to {@link listGlossaries}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGlossaries} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project from which to list all of the glossaries. - * @param {number} [request.pageSize] - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * @param {string} [request.filter] - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3.Glossary} on 'data' event. - */ + /** + * Equivalent to {@link listGlossaries}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGlossaries} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3.Glossary} on 'data' event. + */ listGlossariesStream( - request?: protos.google.cloud.translation.v3.IListGlossariesRequest, - options?: gax.CallOptions): - Transform{ + request?: protos.google.cloud.translation.v3.IListGlossariesRequest, + options?: gax.CallOptions + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1114,7 +1359,7 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); this.initialize(); @@ -1125,36 +1370,36 @@ export class TranslationServiceClient { ); } -/** - * Equivalent to {@link listGlossaries}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project from which to list all of the glossaries. - * @param {number} [request.pageSize] - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * @param {string} [request.filter] - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - */ + /** + * Equivalent to {@link listGlossaries}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ listGlossariesAsync( - request?: protos.google.cloud.translation.v3.IListGlossariesRequest, - options?: gax.CallOptions): - AsyncIterable{ + request?: protos.google.cloud.translation.v3.IListGlossariesRequest, + options?: gax.CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1162,14 +1407,14 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGlossaries.asyncIterate( this.innerApiCalls['listGlossaries'] as GaxCall, - request as unknown as RequestType, + (request as unknown) as RequestType, callSettings ) as AsyncIterable; } @@ -1185,7 +1430,7 @@ export class TranslationServiceClient { * @param {string} glossary * @returns {string} Resource name string. */ - glossaryPath(project:string,location:string,glossary:string) { + glossaryPath(project: string, location: string, glossary: string) { return this.pathTemplates.glossaryPathTemplate.render({ project: project, location: location, @@ -1233,7 +1478,7 @@ export class TranslationServiceClient { * @param {string} location * @returns {string} Resource name string. */ - locationPath(project:string,location:string) { + locationPath(project: string, location: string) { return this.pathTemplates.locationPathTemplate.render({ project: project, location: location, diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 2f026d20001..bb21fdfe704 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -17,11 +17,19 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; import * as path from 'path'; -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './translation_service_client_config.json'; @@ -40,7 +48,12 @@ export class TranslationServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; - descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}, batching: {}}; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -75,10 +88,12 @@ export class TranslationServiceClient { constructor(opts?: ClientOptions) { // Ensure that options include the service address and port. const staticMembers = this.constructor as typeof TranslationServiceClient; - const servicePath = opts && opts.servicePath ? - opts.servicePath : - ((opts && opts.apiEndpoint) ? opts.apiEndpoint : - staticMembers.servicePath); + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; const port = opts && opts.port ? opts.port : staticMembers.port; if (!opts) { @@ -88,8 +103,8 @@ export class TranslationServiceClient { opts.port = opts.port || port; opts.clientConfig = opts.clientConfig || {}; - const isBrowser = (typeof window !== 'undefined'); - if (isBrowser){ + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { opts.fallback = true; } // If we are in browser, we are already using fallback because of the @@ -106,13 +121,10 @@ export class TranslationServiceClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -128,12 +140,18 @@ export class TranslationServiceClient { // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. - const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? - // eslint-disable-next-line @typescript-eslint/no-var-requires - require("../../protos/protos.json") : - nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated @@ -152,55 +170,73 @@ export class TranslationServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listGlossaries: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'glossaries') + listGlossaries: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'glossaries' + ), }; // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - const protoFilesRoot = opts.fallback ? - this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require("../../protos/protos.json")) : - this._gaxModule.protobuf.loadSync(nodejsProtoPath); + const protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); const batchTranslateTextResponse = protoFilesRoot.lookup( - '.google.cloud.translation.v3beta1.BatchTranslateResponse') as gax.protobuf.Type; + '.google.cloud.translation.v3beta1.BatchTranslateResponse' + ) as gax.protobuf.Type; const batchTranslateTextMetadata = protoFilesRoot.lookup( - '.google.cloud.translation.v3beta1.BatchTranslateMetadata') as gax.protobuf.Type; + '.google.cloud.translation.v3beta1.BatchTranslateMetadata' + ) as gax.protobuf.Type; const createGlossaryResponse = protoFilesRoot.lookup( - '.google.cloud.translation.v3beta1.Glossary') as gax.protobuf.Type; + '.google.cloud.translation.v3beta1.Glossary' + ) as gax.protobuf.Type; const createGlossaryMetadata = protoFilesRoot.lookup( - '.google.cloud.translation.v3beta1.CreateGlossaryMetadata') as gax.protobuf.Type; + '.google.cloud.translation.v3beta1.CreateGlossaryMetadata' + ) as gax.protobuf.Type; const deleteGlossaryResponse = protoFilesRoot.lookup( - '.google.cloud.translation.v3beta1.DeleteGlossaryResponse') as gax.protobuf.Type; + '.google.cloud.translation.v3beta1.DeleteGlossaryResponse' + ) as gax.protobuf.Type; const deleteGlossaryMetadata = protoFilesRoot.lookup( - '.google.cloud.translation.v3beta1.DeleteGlossaryMetadata') as gax.protobuf.Type; + '.google.cloud.translation.v3beta1.DeleteGlossaryMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { batchTranslateText: new this._gaxModule.LongrunningDescriptor( this.operationsClient, batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), - batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata)), + batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) + ), createGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGlossaryResponse.decode.bind(createGlossaryResponse), - createGlossaryMetadata.decode.bind(createGlossaryMetadata)), + createGlossaryMetadata.decode.bind(createGlossaryMetadata) + ), deleteGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteGlossaryResponse.decode.bind(deleteGlossaryResponse), - deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata)) + deleteGlossaryMetadata.decode.bind(deleteGlossaryMetadata) + ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.translation.v3beta1.TranslationService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.translation.v3beta1.TranslationService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code @@ -228,16 +264,28 @@ export class TranslationServiceClient { // Put together the "service stub" for // google.cloud.translation.v3beta1.TranslationService. this.translationServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.translation.v3beta1.TranslationService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.translation.v3beta1.TranslationService, - this._opts) as Promise<{[method: string]: Function}>; + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.translation.v3beta1.TranslationService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.translation.v3beta1 + .TranslationService, + this._opts + ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides // and create an API call method for each. - const translationServiceStubMethods = - ['translateText', 'detectLanguage', 'getSupportedLanguages', 'batchTranslateText', 'createGlossary', 'listGlossaries', 'getGlossary', 'deleteGlossary']; + const translationServiceStubMethods = [ + 'translateText', + 'detectLanguage', + 'getSupportedLanguages', + 'batchTranslateText', + 'createGlossary', + 'listGlossaries', + 'getGlossary', + 'deleteGlossary', + ]; for (const methodName of translationServiceStubMethods) { const callPromise = this.translationServiceStub.then( stub => (...args: Array<{}>) => { @@ -247,16 +295,17 @@ export class TranslationServiceClient { const func = stub[methodName]; return func.apply(stub, args); }, - (err: Error|null|undefined) => () => { + (err: Error | null | undefined) => () => { throw err; - }); + } + ); const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); this.innerApiCalls[methodName] = apiCall; @@ -294,7 +343,7 @@ export class TranslationServiceClient { static get scopes() { return [ 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-translation' + 'https://www.googleapis.com/auth/cloud-translation', ]; } @@ -305,8 +354,9 @@ export class TranslationServiceClient { * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId(callback?: Callback): - Promise|void { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -318,119 +368,140 @@ export class TranslationServiceClient { // -- Service calls -- // ------------------- translateText( - request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - protos.google.cloud.translation.v3beta1.ITranslateTextRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + protos.google.cloud.translation.v3beta1.ITranslateTextRequest | undefined, + {} | undefined + ] + >; translateText( - request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - protos.google.cloud.translation.v3beta1.ITranslateTextRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + | protos.google.cloud.translation.v3beta1.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; translateText( - request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - callback: Callback< - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - protos.google.cloud.translation.v3beta1.ITranslateTextRequest|null|undefined, - {}|null|undefined>): void; -/** - * Translates input text and returns translated text. - * - * @param {Object} request - * The request object that will be sent. - * @param {string[]} request.contents - * Required. The content of the input in string format. - * We recommend the total content be less than 30k codepoints. - * Use BatchTranslateText for larger text. - * @param {string} [request.mimeType] - * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {string} [request.sourceLanguageCode] - * Optional. The BCP-47 language code of the input text if - * known, for example, "en-US" or "sr-Latn". Supported language codes are - * listed in Language Support. If the source language isn't specified, the API - * attempts to identify the source language automatically and returns the - * source language within the response. - * @param {string} request.targetLanguageCode - * Required. The BCP-47 language code to use for translation of the input - * text, set to one of the language codes listed in Language Support. - * @param {string} request.parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-id}` or - * `projects/{project-id}/locations/{location-id}`. - * - * For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. - * - * Non-global location is required for requests using AutoML models or - * custom glossaries. - * - * Models and glossaries must be within the same region (have same - * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.model] - * Optional. The `model` type requested for this translation. - * - * The format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` - * - * - * For global (non-regionalized) requests, use `location-id` `global`. - * For example, - * `projects/{project-id}/locations/global/models/general/nmt`. - * - * If missing, the system decides which google base model to use. - * @param {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} [request.glossaryConfig] - * Optional. Glossary to be applied. The glossary must be - * within the same region (have the same location-id) as the model, otherwise - * an INVALID_ARGUMENT (400) error is returned. - * @param {number[]} [request.labels] - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3beta1.TranslateTextResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + | protos.google.cloud.translation.v3beta1.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Translates input text and returns translated text. + * + * @param {Object} request + * The request object that will be sent. + * @param {string[]} request.contents + * Required. The content of the input in string format. + * We recommend the total content be less than 30k codepoints. + * Use BatchTranslateText for larger text. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + * @param {string} [request.sourceLanguageCode] + * Optional. The BCP-47 language code of the input text if + * known, for example, "en-US" or "sr-Latn". Supported language codes are + * listed in Language Support. If the source language isn't specified, the API + * attempts to identify the source language automatically and returns the + * source language within the response. + * @param {string} request.targetLanguageCode + * Required. The BCP-47 language code to use for translation of the input + * text, set to one of the language codes listed in Language Support. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-id}` or + * `projects/{project-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-id}/locations/global` or + * `projects/{project-id}`. + * + * Non-global location is required for requests using AutoML models or + * custom glossaries. + * + * Models and glossaries must be within the same region (have same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.model] + * Optional. The `model` type requested for this translation. + * + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-id}/locations/{location-id}/models/general/base` + * + * + * For global (non-regionalized) requests, use `location-id` `global`. + * For example, + * `projects/{project-id}/locations/global/models/general/nmt`. + * + * If missing, the system decides which google base model to use. + * @param {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} [request.glossaryConfig] + * Optional. Glossary to be applied. The glossary must be + * within the same region (have the same location-id) as the model, otherwise + * an INVALID_ARGUMENT (400) error is returned. + * @param {number[]} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3beta1.TranslateTextResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ translateText( - request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - optionsOrCallback?: gax.CallOptions|Callback< + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - protos.google.cloud.translation.v3beta1.ITranslateTextRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - protos.google.cloud.translation.v3beta1.ITranslateTextRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - protos.google.cloud.translation.v3beta1.ITranslateTextRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.translation.v3beta1.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + | protos.google.cloud.translation.v3beta1.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + protos.google.cloud.translation.v3beta1.ITranslateTextRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -439,99 +510,126 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.translateText(request, options, callback); } detectLanguage( - request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - protos.google.cloud.translation.v3beta1.IDetectLanguageRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + ( + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | undefined + ), + {} | undefined + ] + >; detectLanguage( - request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - protos.google.cloud.translation.v3beta1.IDetectLanguageRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined + > + ): void; detectLanguage( - request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - callback: Callback< - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - protos.google.cloud.translation.v3beta1.IDetectLanguageRequest|null|undefined, - {}|null|undefined>): void; -/** - * Detects the language of text within a request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-id}/locations/{location-id}` or - * `projects/{project-id}`. - * - * For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. - * - * Only models within the same region (has same location-id) can be used. - * Otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.model] - * Optional. The language detection model to be used. - * - * Format: - * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` - * - * Only one language detection model is currently supported: - * `projects/{project-id}/locations/{location-id}/models/language-detection/default`. - * - * If not specified, the default model is used. - * @param {string} request.content - * The content of the input stored as a string. - * @param {string} [request.mimeType] - * Optional. The format of the source text, for example, "text/html", - * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {number[]} request.labels - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3beta1.DetectLanguageResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Detects the language of text within a request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-id}/locations/{location-id}` or + * `projects/{project-id}`. + * + * For global calls, use `projects/{project-id}/locations/global` or + * `projects/{project-id}`. + * + * Only models within the same region (has same location-id) can be used. + * Otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.model] + * Optional. The language detection model to be used. + * + * Format: + * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` + * + * Only one language detection model is currently supported: + * `projects/{project-id}/locations/{location-id}/models/language-detection/default`. + * + * If not specified, the default model is used. + * @param {string} request.content + * The content of the input stored as a string. + * @param {string} [request.mimeType] + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + * @param {number[]} request.labels + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3beta1.DetectLanguageResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ detectLanguage( - request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - optionsOrCallback?: gax.CallOptions|Callback< + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - protos.google.cloud.translation.v3beta1.IDetectLanguageRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - protos.google.cloud.translation.v3beta1.IDetectLanguageRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - protos.google.cloud.translation.v3beta1.IDetectLanguageRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + ( + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -540,96 +638,123 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.detectLanguage(request, options, callback); } getSupportedLanguages( - request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + ( + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | undefined + ), + {} | undefined + ] + >; getSupportedLanguages( - request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined + > + ): void; getSupportedLanguages( - request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - callback: Callback< - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest|null|undefined, - {}|null|undefined>): void; -/** - * Returns a list of supported languages for translation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Project or location to make a call. Must refer to a caller's - * project. - * - * Format: `projects/{project-id}` or - * `projects/{project-id}/locations/{location-id}`. - * - * For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. - * - * Non-global location is required for AutoML models. - * - * Only models within the same region (have same location-id) can be used, - * otherwise an INVALID_ARGUMENT (400) error is returned. - * @param {string} [request.displayLanguageCode] - * Optional. The language to use to return localized, human readable names - * of supported languages. If missing, then display names are not returned - * in a response. - * @param {string} [request.model] - * Optional. Get supported languages of this model. - * - * The format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` - * - * - * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3beta1.SupportedLanguages}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns a list of supported languages for translation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project or location to make a call. Must refer to a caller's + * project. + * + * Format: `projects/{project-id}` or + * `projects/{project-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-id}/locations/global` or + * `projects/{project-id}`. + * + * Non-global location is required for AutoML models. + * + * Only models within the same region (have same location-id) can be used, + * otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.displayLanguageCode] + * Optional. The language to use to return localized, human readable names + * of supported languages. If missing, then display names are not returned + * in a response. + * @param {string} [request.model] + * Optional. Get supported languages of this model. + * + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-id}/locations/{location-id}/models/general/base` + * + * + * Returns languages supported by the specified model. + * If missing, we get supported languages of Google general base (PBMT) model. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3beta1.SupportedLanguages}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getSupportedLanguages( - request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - optionsOrCallback?: gax.CallOptions|Callback< + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.translation.v3beta1.ISupportedLanguages, - protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + ( + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -638,66 +763,87 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.getSupportedLanguages(request, options, callback); } getGlossary( - request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.IGetGlossaryRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.IGetGlossaryRequest | undefined, + {} | undefined + ] + >; getGlossary( - request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.IGetGlossaryRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.IGlossary, + | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest + | null + | undefined, + {} | null | undefined + > + ): void; getGlossary( - request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, - callback: Callback< - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.IGetGlossaryRequest|null|undefined, - {}|null|undefined>): void; -/** - * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.IGlossary, + | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getGlossary( - request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.IGetGlossaryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.IGetGlossaryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.translation.v3beta1.IGlossary, - protos.google.cloud.translation.v3beta1.IGetGlossaryRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.translation.v3beta1.IGlossary, + | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.IGetGlossaryRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -706,122 +852,153 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'name': request.name || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.getGlossary(request, options, callback); } batchTranslateText( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - options?: gax.CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; batchTranslateText( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - options: gax.CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchTranslateText( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Translates a large volume of text in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * - * This call returns immediately and you can - * use google.longrunning.Operation.name to poll the status of the call. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Location to make a call. Must refer to a caller's project. - * - * Format: `projects/{project-id}/locations/{location-id}`. - * - * The `global` location is not supported for batch translation. - * - * Only AutoML Translation models or glossaries within the same region (have - * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - * error is returned. - * @param {string} request.sourceLanguageCode - * Required. Source language code. - * @param {string[]} request.targetLanguageCodes - * Required. Specify up to 10 language codes here. - * @param {number[]} [request.models] - * Optional. The models to use for translation. Map's key is target language - * code. Map's value is model name. Value can be a built-in general model, - * or an AutoML Translation model. - * - * The value format depends on model type: - * - * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` - * - * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` - * - * - * If the map is empty or a specific model is - * not requested for a language pair, then default google model (nmt) is used. - * @param {number[]} request.inputConfigs - * Required. Input configurations. - * The total number of files matched should be <= 1000. - * The total content size should be <= 100M Unicode codepoints. - * The files must use UTF-8 encoding. - * @param {google.cloud.translation.v3beta1.OutputConfig} request.outputConfig - * Required. Output configuration. - * If 2 input configs match to the same file (that is, same input path), - * we don't generate output for duplicate inputs. - * @param {number[]} [request.glossaries] - * Optional. Glossaries to be applied for translation. - * It's keyed by target language code. - * @param {number[]} [request.labels] - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints), can only contain lowercase letters, numeric - * characters, underscores and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * See https://cloud.google.com/translate/docs/labels for more information. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Translates a large volume of text in asynchronous batch mode. + * This function provides real-time output as the inputs are being processed. + * If caller cancels a request, the partial results (for an input file, it's + * all or nothing) may still be available on the specified output location. + * + * This call returns immediately and you can + * use google.longrunning.Operation.name to poll the status of the call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Location to make a call. Must refer to a caller's project. + * + * Format: `projects/{project-id}/locations/{location-id}`. + * + * The `global` location is not supported for batch translation. + * + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. + * @param {string} request.sourceLanguageCode + * Required. Source language code. + * @param {string[]} request.targetLanguageCodes + * Required. Specify up to 10 language codes here. + * @param {number[]} [request.models] + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is model name. Value can be a built-in general model, + * or an AutoML Translation model. + * + * The value format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-id}/locations/{location-id}/models/general/base` + * + * + * If the map is empty or a specific model is + * not requested for a language pair, then default google model (nmt) is used. + * @param {number[]} request.inputConfigs + * Required. Input configurations. + * The total number of files matched should be <= 1000. + * The total content size should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + * @param {google.cloud.translation.v3beta1.OutputConfig} request.outputConfig + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + * @param {number[]} [request.glossaries] + * Optional. Glossaries to be applied for translation. + * It's keyed by target language code. + * @param {number[]} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/labels for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ batchTranslateText( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - optionsOrCallback?: gax.CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -830,68 +1007,99 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.batchTranslateText(request, options, callback); } createGlossary( - request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, - options?: gax.CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; createGlossary( - request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; createGlossary( - request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project name. - * @param {google.cloud.translation.v3beta1.Glossary} request.glossary - * Required. The glossary to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a glossary and returns the long-running operation. Returns + * NOT_FOUND, if the project doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project name. + * @param {google.cloud.translation.v3beta1.Glossary} request.glossary + * Required. The glossary to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createGlossary( - request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, - optionsOrCallback?: gax.CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -900,67 +1108,98 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.createGlossary(request, options, callback); } deleteGlossary( - request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, - options?: gax.CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; deleteGlossary( - request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, - options: gax.CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; deleteGlossary( - request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a glossary, or cancels glossary construction + * if the glossary isn't created yet. + * Returns NOT_FOUND, if the glossary doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ deleteGlossary( - request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, - optionsOrCallback?: gax.CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -969,92 +1208,111 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'name': request.name || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.deleteGlossary(request, options, callback); } listGlossaries( - request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.translation.v3beta1.IGlossary[], - protos.google.cloud.translation.v3beta1.IListGlossariesRequest|null, - protos.google.cloud.translation.v3beta1.IListGlossariesResponse - ]>; + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3beta1.IGlossary[], + protos.google.cloud.translation.v3beta1.IListGlossariesRequest | null, + protos.google.cloud.translation.v3beta1.IListGlossariesResponse + ] + >; listGlossaries( - request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options: gax.CallOptions, - callback: PaginationCallback< - protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - protos.google.cloud.translation.v3beta1.IListGlossariesResponse|null|undefined, - protos.google.cloud.translation.v3beta1.IGlossary>): void; + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + | protos.google.cloud.translation.v3beta1.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3beta1.IGlossary + > + ): void; listGlossaries( - request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - callback: PaginationCallback< - protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - protos.google.cloud.translation.v3beta1.IListGlossariesResponse|null|undefined, - protos.google.cloud.translation.v3beta1.IGlossary>): void; -/** - * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - * exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project from which to list all of the glossaries. - * @param {number} [request.pageSize] - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * @param {string} [request.filter] - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. - * The client library support auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListGlossariesRequest]{@link google.cloud.translation.v3beta1.ListGlossariesRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + callback: PaginationCallback< + protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + | protos.google.cloud.translation.v3beta1.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3beta1.IGlossary + > + ): void; + /** + * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGlossariesRequest]{@link google.cloud.translation.v3beta1.ListGlossariesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ listGlossaries( - request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - optionsOrCallback?: gax.CallOptions|PaginationCallback< + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - protos.google.cloud.translation.v3beta1.IListGlossariesResponse|null|undefined, - protos.google.cloud.translation.v3beta1.IGlossary>, - callback?: PaginationCallback< - protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - protos.google.cloud.translation.v3beta1.IListGlossariesResponse|null|undefined, - protos.google.cloud.translation.v3beta1.IGlossary>): - Promise<[ - protos.google.cloud.translation.v3beta1.IGlossary[], - protos.google.cloud.translation.v3beta1.IListGlossariesRequest|null, - protos.google.cloud.translation.v3beta1.IListGlossariesResponse - ]>|void { + | protos.google.cloud.translation.v3beta1.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3beta1.IGlossary + >, + callback?: PaginationCallback< + protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + | protos.google.cloud.translation.v3beta1.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3beta1.IGlossary + > + ): Promise< + [ + protos.google.cloud.translation.v3beta1.IGlossary[], + protos.google.cloud.translation.v3beta1.IListGlossariesRequest | null, + protos.google.cloud.translation.v3beta1.IListGlossariesResponse + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -1063,50 +1321,50 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.listGlossaries(request, options, callback); } -/** - * Equivalent to {@link listGlossaries}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGlossaries} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project from which to list all of the glossaries. - * @param {number} [request.pageSize] - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * @param {string} [request.filter] - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary} on 'data' event. - */ + /** + * Equivalent to {@link listGlossaries}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGlossaries} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary} on 'data' event. + */ listGlossariesStream( - request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options?: gax.CallOptions): - Transform{ + request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + options?: gax.CallOptions + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1114,7 +1372,7 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); this.initialize(); @@ -1125,36 +1383,36 @@ export class TranslationServiceClient { ); } -/** - * Equivalent to {@link listGlossaries}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project from which to list all of the glossaries. - * @param {number} [request.pageSize] - * Optional. Requested page size. The server may return fewer glossaries than - * requested. If unspecified, the server picks an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] - * returned from the previous call to `ListGlossaries` method. - * The first page is returned if `page_token`is empty or missing. - * @param {string} [request.filter] - * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. - * If missing, no filtering is performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - */ + /** + * Equivalent to {@link listGlossaries}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project from which to list all of the glossaries. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + * @param {string} [request.filter] + * Optional. Filter specifying constraints of a list operation. + * Filtering is not supported yet, and the parameter currently has no effect. + * If missing, no filtering is performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ listGlossariesAsync( - request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options?: gax.CallOptions): - AsyncIterable{ + request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + options?: gax.CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1162,14 +1420,14 @@ export class TranslationServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGlossaries.asyncIterate( this.innerApiCalls['listGlossaries'] as GaxCall, - request as unknown as RequestType, + (request as unknown) as RequestType, callSettings ) as AsyncIterable; } @@ -1185,7 +1443,7 @@ export class TranslationServiceClient { * @param {string} glossary * @returns {string} Resource name string. */ - glossaryPath(project:string,location:string,glossary:string) { + glossaryPath(project: string, location: string, glossary: string) { return this.pathTemplates.glossaryPathTemplate.render({ project: project, location: location, @@ -1233,7 +1491,7 @@ export class TranslationServiceClient { * @param {string} location * @returns {string} Resource name string. */ - locationPath(project:string,location:string) { + locationPath(project: string, location: string) { return this.pathTemplates.locationPathTemplate.render({ project: project, location: location, diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index f8d17559add..e378e68963c 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "23f6b4bdf50ce033d268f7ac96633875540ab6b1" + "sha": "3f5d2b14ead6fa62a8a9879ac46e9acb2eba3ecf" } }, { diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js index cc2e18cd214..e994918631d 100644 --- a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js @@ -16,7 +16,6 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** - /* eslint-disable node/no-missing-require, no-unused-vars */ const translation = require('@google-cloud/translate'); diff --git a/packages/google-cloud-translate/system-test/install.ts b/packages/google-cloud-translate/system-test/install.ts index 5e4ed636481..4c1ba3eb79a 100644 --- a/packages/google-cloud-translate/system-test/install.ts +++ b/packages/google-cloud-translate/system-test/install.ts @@ -16,34 +16,36 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import { packNTest } from 'pack-n-play'; -import { readFileSync } from 'fs'; -import { describe, it } from 'mocha'; +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; describe('typescript consumer tests', () => { - - it('should have correct type signature for typescript users', async function() { + it('should have correct type signature for typescript users', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), // path to your module. sample: { description: 'typescript based user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); // will throw upon error. }); - it('should have correct type signature for javascript users', async function() { + it('should have correct type signature for javascript users', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), // path to your module. sample: { description: 'typescript based user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); // will throw upon error. }); - }); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts index f1979206522..1febe1880f1 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -20,7 +20,7 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; +import {describe, it} from 'mocha'; import * as translationserviceModule from '../src'; import {PassThrough} from 'stream'; @@ -28,1137 +28,1571 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; } function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); } -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); } -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); } -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); } -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); } - return sinon.stub().returns(mockStream); + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); } -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); } describe('v3.TranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = translationserviceModule.v3.TranslationServiceClient.servicePath; - assert(servicePath); - }); + it('has servicePath', () => { + const servicePath = + translationserviceModule.v3.TranslationServiceClient.servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = translationserviceModule.v3.TranslationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + translationserviceModule.v3.TranslationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = translationserviceModule.v3.TranslationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = translationserviceModule.v3.TranslationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new translationserviceModule.v3.TranslationServiceClient(); + assert(client); + }); - it('should create a client with no option', () => { - const client = new translationserviceModule.v3.TranslationServiceClient(); - assert(client); + it('should create a client with gRPC fallback', () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + fallback: true, }); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - fallback: true, - }); - assert(client); + it('has initialize method and supports deferred initialization', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); + assert.strictEqual(client.translationServiceStub, undefined); + await client.initialize(); + assert(client.translationServiceStub); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - assert.strictEqual(client.translationServiceStub, undefined); - await client.initialize(); - assert(client.translationServiceStub); + it('has close method', () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); + client.close(); + }); - it('has close method', () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.close(); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); + describe('translateText', () => { + it('invokes translateText without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateTextResponse() + ); + client.innerApiCalls.translateText = stubSimpleCall(expectedResponse); + const [response] = await client.translateText(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.translateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('translateText', () => { - it('invokes translateText without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.TranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.TranslateTextResponse()); - client.innerApiCalls.translateText = stubSimpleCall(expectedResponse); - const [response] = await client.translateText(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.translateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes translateText without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateTextResponse() + ); + client.innerApiCalls.translateText = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.translateText( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3.ITranslateTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.translateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes translateText without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.TranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.TranslateTextResponse()); - client.innerApiCalls.translateText = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.translateText( - request, - (err?: Error|null, result?: protos.google.cloud.translation.v3.ITranslateTextResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.translateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes translateText with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.translateText = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.translateText(request); + }, expectedError); + assert( + (client.innerApiCalls.translateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes translateText with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.TranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.translateText = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.translateText(request); }, expectedError); - assert((client.innerApiCalls.translateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('detectLanguage', () => { + it('invokes detectLanguage without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.DetectLanguageResponse() + ); + client.innerApiCalls.detectLanguage = stubSimpleCall(expectedResponse); + const [response] = await client.detectLanguage(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('detectLanguage', () => { - it('invokes detectLanguage without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.DetectLanguageRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.DetectLanguageResponse()); - client.innerApiCalls.detectLanguage = stubSimpleCall(expectedResponse); - const [response] = await client.detectLanguage(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes detectLanguage without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.DetectLanguageResponse() + ); + client.innerApiCalls.detectLanguage = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.detectLanguage( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3.IDetectLanguageResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes detectLanguage without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.DetectLanguageRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.DetectLanguageResponse()); - client.innerApiCalls.detectLanguage = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.detectLanguage( - request, - (err?: Error|null, result?: protos.google.cloud.translation.v3.IDetectLanguageResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes detectLanguage with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.detectLanguage = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.detectLanguage(request); + }, expectedError); + assert( + (client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes detectLanguage with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.DetectLanguageRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.detectLanguage = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.detectLanguage(request); }, expectedError); - assert((client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('getSupportedLanguages', () => { + it('invokes getSupportedLanguages without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.SupportedLanguages() + ); + client.innerApiCalls.getSupportedLanguages = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getSupportedLanguages(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('getSupportedLanguages', () => { - it('invokes getSupportedLanguages without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.SupportedLanguages()); - client.innerApiCalls.getSupportedLanguages = stubSimpleCall(expectedResponse); - const [response] = await client.getSupportedLanguages(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes getSupportedLanguages without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.SupportedLanguages() + ); + client.innerApiCalls.getSupportedLanguages = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getSupportedLanguages( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3.ISupportedLanguages | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes getSupportedLanguages without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.SupportedLanguages()); - client.innerApiCalls.getSupportedLanguages = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSupportedLanguages( - request, - (err?: Error|null, result?: protos.google.cloud.translation.v3.ISupportedLanguages|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes getSupportedLanguages with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSupportedLanguages = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getSupportedLanguages(request); + }, expectedError); + assert( + (client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes getSupportedLanguages with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getSupportedLanguages = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.getSupportedLanguages(request); }, expectedError); - assert((client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('getGlossary', () => { + it('invokes getGlossary without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ); + client.innerApiCalls.getGlossary = stubSimpleCall(expectedResponse); + const [response] = await client.getGlossary(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('getGlossary', () => { - it('invokes getGlossary without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.GetGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()); - client.innerApiCalls.getGlossary = stubSimpleCall(expectedResponse); - const [response] = await client.getGlossary(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes getGlossary without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ); + client.innerApiCalls.getGlossary = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getGlossary( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3.IGlossary | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes getGlossary without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.GetGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()); - client.innerApiCalls.getGlossary = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getGlossary( - request, - (err?: Error|null, result?: protos.google.cloud.translation.v3.IGlossary|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes getGlossary with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGlossary = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getGlossary(request); + }, expectedError); + assert( + (client.innerApiCalls.getGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes getGlossary with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.GetGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getGlossary = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.getGlossary(request); }, expectedError); - assert((client.innerApiCalls.getGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('batchTranslateText', () => { + it('invokes batchTranslateText without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchTranslateText = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.batchTranslateText(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('batchTranslateText', () => { - it('invokes batchTranslateText without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.BatchTranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchTranslateText = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchTranslateText(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes batchTranslateText without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchTranslateText = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.batchTranslateText( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes batchTranslateText without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.BatchTranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchTranslateText = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchTranslateText( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes batchTranslateText with call error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateText = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.batchTranslateText(request); + }, expectedError); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes batchTranslateText with call error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.BatchTranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchTranslateText = stubLongRunningCall(undefined, expectedError); - await assert.rejects(async () => { await client.batchTranslateText(request); }, expectedError); - assert((client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes batchTranslateText with LRO error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateText = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchTranslateText(request); + await assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes batchTranslateText with LRO error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.BatchTranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchTranslateText = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchTranslateText(request); - await assert.rejects(async () => { await operation.promise(); }, expectedError); - assert((client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('createGlossary', () => { + it('invokes createGlossary without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGlossary = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.createGlossary(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('createGlossary', () => { - it('invokes createGlossary without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.CreateGlossaryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createGlossary = stubLongRunningCall(expectedResponse); - const [operation] = await client.createGlossary(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes createGlossary without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGlossary = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createGlossary( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3.IGlossary, + protos.google.cloud.translation.v3.ICreateGlossaryMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes createGlossary without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.CreateGlossaryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createGlossary = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createGlossary( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes createGlossary with call error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGlossary = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.createGlossary(request); + }, expectedError); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes createGlossary with call error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.CreateGlossaryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createGlossary = stubLongRunningCall(undefined, expectedError); - await assert.rejects(async () => { await client.createGlossary(request); }, expectedError); - assert((client.innerApiCalls.createGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes createGlossary with LRO error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGlossary = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGlossary(request); + await assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes createGlossary with LRO error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.CreateGlossaryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createGlossary = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createGlossary(request); - await assert.rejects(async () => { await operation.promise(); }, expectedError); - assert((client.innerApiCalls.createGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('deleteGlossary', () => { + it('invokes deleteGlossary without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGlossary = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.deleteGlossary(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('deleteGlossary', () => { - it('invokes deleteGlossary without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.DeleteGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteGlossary = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteGlossary(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes deleteGlossary without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGlossary = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteGlossary( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3.IDeleteGlossaryMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes deleteGlossary without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.DeleteGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteGlossary = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteGlossary( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes deleteGlossary with call error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGlossary = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteGlossary(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes deleteGlossary with call error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.DeleteGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteGlossary = stubLongRunningCall(undefined, expectedError); - await assert.rejects(async () => { await client.deleteGlossary(request); }, expectedError); - assert((client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes deleteGlossary with LRO error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGlossary = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGlossary(request); + await assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes deleteGlossary with LRO error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.DeleteGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteGlossary = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteGlossary(request); - await assert.rejects(async () => { await operation.promise(); }, expectedError); - assert((client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('listGlossaries', () => { + it('invokes listGlossaries without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + ]; + client.innerApiCalls.listGlossaries = stubSimpleCall(expectedResponse); + const [response] = await client.listGlossaries(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('listGlossaries', () => { - it('invokes listGlossaries without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), - ]; - client.innerApiCalls.listGlossaries = stubSimpleCall(expectedResponse); - const [response] = await client.listGlossaries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes listGlossaries without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + ]; + client.innerApiCalls.listGlossaries = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listGlossaries( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3.IGlossary[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes listGlossaries without error using callback', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), - ]; - client.innerApiCalls.listGlossaries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listGlossaries( - request, - (err?: Error|null, result?: protos.google.cloud.translation.v3.IGlossary[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes listGlossaries with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGlossaries = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.listGlossaries(request); + }, expectedError); + assert( + (client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes listGlossaries with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listGlossaries = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.listGlossaries(request); }, expectedError); - assert((client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + it('invokes listGlossariesStream without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + ]; + client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listGlossariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.translation.v3.Glossary[] = []; + stream.on( + 'data', + (response: protos.google.cloud.translation.v3.Glossary) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); }); - - it('invokes listGlossariesStream without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), - ]; - client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listGlossariesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.translation.v3.Glossary[] = []; - stream.on('data', (response: protos.google.cloud.translation.v3.Glossary) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listGlossaries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listGlossaries, request)); - assert.strictEqual( - (client.descriptors.page.listGlossaries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); + stream.on('error', (err: Error) => { + reject(err); }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGlossaries, request) + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); - it('invokes listGlossariesStream with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listGlossariesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.translation.v3.Glossary[] = []; - stream.on('data', (response: protos.google.cloud.translation.v3.Glossary) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(async () => { await promise; }, expectedError); - assert((client.descriptors.page.listGlossaries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listGlossaries, request)); - assert.strictEqual( - (client.descriptors.page.listGlossaries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); + it('invokes listGlossariesStream with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listGlossariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.translation.v3.Glossary[] = []; + stream.on( + 'data', + (response: protos.google.cloud.translation.v3.Glossary) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); }); - - it('uses async iteration with listGlossaries without error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3.Glossary()), - ]; - client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.translation.v3.IGlossary[] = []; - const iterable = client.listGlossariesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); + stream.on('error', (err: Error) => { + reject(err); }); + }); + await assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGlossaries, request) + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); - it('uses async iteration with listGlossaries with error', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listGlossariesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.translation.v3.IGlossary[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('uses async iteration with listGlossaries without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3.Glossary() + ), + ]; + client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.translation.v3.IGlossary[] = []; + const iterable = client.listGlossariesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); }); - describe('Path templates', () => { + it('uses async iteration with listGlossaries with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listGlossariesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.translation.v3.IGlossary[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); - describe('glossary', () => { - const fakePath = "/rendered/path/glossary"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - glossary: "glossaryValue", - }; - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.glossaryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.glossaryPathTemplate.match = - sinon.stub().returns(expectedParameters); + describe('Path templates', () => { + describe('glossary', () => { + const fakePath = '/rendered/path/glossary'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + glossary: 'glossaryValue', + }; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.glossaryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.glossaryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); - it('glossaryPath', () => { - const result = client.glossaryPath("projectValue", "locationValue", "glossaryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.glossaryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); + it('glossaryPath', () => { + const result = client.glossaryPath( + 'projectValue', + 'locationValue', + 'glossaryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.glossaryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); - it('matchProjectFromGlossaryName', () => { - const result = client.matchProjectFromGlossaryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.glossaryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + it('matchProjectFromGlossaryName', () => { + const result = client.matchProjectFromGlossaryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); - it('matchLocationFromGlossaryName', () => { - const result = client.matchLocationFromGlossaryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.glossaryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + it('matchLocationFromGlossaryName', () => { + const result = client.matchLocationFromGlossaryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); - it('matchGlossaryFromGlossaryName', () => { - const result = client.matchGlossaryFromGlossaryName(fakePath); - assert.strictEqual(result, "glossaryValue"); - assert((client.pathTemplates.glossaryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + it('matchGlossaryFromGlossaryName', () => { + const result = client.matchGlossaryFromGlossaryName(fakePath); + assert.strictEqual(result, 'glossaryValue'); + assert( + (client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); }); + }); }); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts index f8003dae5cf..ee05fbaad51 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -20,7 +20,7 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; +import {describe, it} from 'mocha'; import * as translationserviceModule from '../src'; import {PassThrough} from 'stream'; @@ -28,1137 +28,1647 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; } function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); } -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); } -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); } -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); } -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); } - return sinon.stub().returns(mockStream); + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); } -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); } describe('v3beta1.TranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = translationserviceModule.v3beta1.TranslationServiceClient.servicePath; - assert(servicePath); - }); + it('has servicePath', () => { + const servicePath = + translationserviceModule.v3beta1.TranslationServiceClient.servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = translationserviceModule.v3beta1.TranslationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + translationserviceModule.v3beta1.TranslationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = translationserviceModule.v3beta1.TranslationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = translationserviceModule.v3beta1.TranslationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + fallback: true, + } + ); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - assert.strictEqual(client.translationServiceStub, undefined); - await client.initialize(); - assert(client.translationServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.translationServiceStub, undefined); + await client.initialize(); + assert(client.translationServiceStub); + }); - it('has close method', () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.close(); - }); + it('has close method', () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); + describe('translateText', () => { + it('invokes translateText without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateTextResponse() + ); + client.innerApiCalls.translateText = stubSimpleCall(expectedResponse); + const [response] = await client.translateText(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.translateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('translateText', () => { - it('invokes translateText without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.TranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.TranslateTextResponse()); - client.innerApiCalls.translateText = stubSimpleCall(expectedResponse); - const [response] = await client.translateText(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.translateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes translateText without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateTextResponse() + ); + client.innerApiCalls.translateText = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.translateText( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3beta1.ITranslateTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.translateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes translateText without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.TranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.TranslateTextResponse()); - client.innerApiCalls.translateText = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.translateText( - request, - (err?: Error|null, result?: protos.google.cloud.translation.v3beta1.ITranslateTextResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.translateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes translateText with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.translateText = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.translateText(request); + }, expectedError); + assert( + (client.innerApiCalls.translateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes translateText with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.TranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.translateText = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.translateText(request); }, expectedError); - assert((client.innerApiCalls.translateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('detectLanguage', () => { + it('invokes detectLanguage without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DetectLanguageResponse() + ); + client.innerApiCalls.detectLanguage = stubSimpleCall(expectedResponse); + const [response] = await client.detectLanguage(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('detectLanguage', () => { - it('invokes detectLanguage without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DetectLanguageRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DetectLanguageResponse()); - client.innerApiCalls.detectLanguage = stubSimpleCall(expectedResponse); - const [response] = await client.detectLanguage(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes detectLanguage without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DetectLanguageResponse() + ); + client.innerApiCalls.detectLanguage = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.detectLanguage( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3beta1.IDetectLanguageResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes detectLanguage without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DetectLanguageRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DetectLanguageResponse()); - client.innerApiCalls.detectLanguage = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.detectLanguage( - request, - (err?: Error|null, result?: protos.google.cloud.translation.v3beta1.IDetectLanguageResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes detectLanguage with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.detectLanguage = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.detectLanguage(request); + }, expectedError); + assert( + (client.innerApiCalls.detectLanguage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes detectLanguage with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DetectLanguageRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.detectLanguage = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.detectLanguage(request); }, expectedError); - assert((client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('getSupportedLanguages', () => { + it('invokes getSupportedLanguages without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.SupportedLanguages() + ); + client.innerApiCalls.getSupportedLanguages = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getSupportedLanguages(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('getSupportedLanguages', () => { - it('invokes getSupportedLanguages without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.SupportedLanguages()); - client.innerApiCalls.getSupportedLanguages = stubSimpleCall(expectedResponse); - const [response] = await client.getSupportedLanguages(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes getSupportedLanguages without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.SupportedLanguages() + ); + client.innerApiCalls.getSupportedLanguages = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getSupportedLanguages( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3beta1.ISupportedLanguages | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes getSupportedLanguages without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.SupportedLanguages()); - client.innerApiCalls.getSupportedLanguages = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSupportedLanguages( - request, - (err?: Error|null, result?: protos.google.cloud.translation.v3beta1.ISupportedLanguages|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes getSupportedLanguages with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSupportedLanguages = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getSupportedLanguages(request); + }, expectedError); + assert( + (client.innerApiCalls.getSupportedLanguages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes getSupportedLanguages with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getSupportedLanguages = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.getSupportedLanguages(request); }, expectedError); - assert((client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('getGlossary', () => { + it('invokes getGlossary without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ); + client.innerApiCalls.getGlossary = stubSimpleCall(expectedResponse); + const [response] = await client.getGlossary(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('getGlossary', () => { - it('invokes getGlossary without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.GetGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()); - client.innerApiCalls.getGlossary = stubSimpleCall(expectedResponse); - const [response] = await client.getGlossary(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes getGlossary without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ); + client.innerApiCalls.getGlossary = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getGlossary( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3beta1.IGlossary | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes getGlossary without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.GetGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()); - client.innerApiCalls.getGlossary = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getGlossary( - request, - (err?: Error|null, result?: protos.google.cloud.translation.v3beta1.IGlossary|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes getGlossary with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGlossary = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getGlossary(request); + }, expectedError); + assert( + (client.innerApiCalls.getGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes getGlossary with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.GetGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getGlossary = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.getGlossary(request); }, expectedError); - assert((client.innerApiCalls.getGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('batchTranslateText', () => { + it('invokes batchTranslateText without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchTranslateText = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.batchTranslateText(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('batchTranslateText', () => { - it('invokes batchTranslateText without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchTranslateText = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchTranslateText(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes batchTranslateText without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchTranslateText = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.batchTranslateText( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes batchTranslateText without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchTranslateText = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchTranslateText( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes batchTranslateText with call error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateText = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.batchTranslateText(request); + }, expectedError); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes batchTranslateText with call error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchTranslateText = stubLongRunningCall(undefined, expectedError); - await assert.rejects(async () => { await client.batchTranslateText(request); }, expectedError); - assert((client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes batchTranslateText with LRO error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateText = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchTranslateText(request); + await assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.batchTranslateText as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes batchTranslateText with LRO error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchTranslateText = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchTranslateText(request); - await assert.rejects(async () => { await operation.promise(); }, expectedError); - assert((client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('createGlossary', () => { + it('invokes createGlossary without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGlossary = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.createGlossary(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('createGlossary', () => { - it('invokes createGlossary without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createGlossary = stubLongRunningCall(expectedResponse); - const [operation] = await client.createGlossary(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes createGlossary without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGlossary = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createGlossary( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3beta1.IGlossary, + protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes createGlossary without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createGlossary = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createGlossary( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes createGlossary with call error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGlossary = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.createGlossary(request); + }, expectedError); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes createGlossary with call error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createGlossary = stubLongRunningCall(undefined, expectedError); - await assert.rejects(async () => { await client.createGlossary(request); }, expectedError); - assert((client.innerApiCalls.createGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes createGlossary with LRO error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGlossary = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGlossary(request); + await assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.createGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes createGlossary with LRO error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createGlossary = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createGlossary(request); - await assert.rejects(async () => { await operation.promise(); }, expectedError); - assert((client.innerApiCalls.createGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('deleteGlossary', () => { + it('invokes deleteGlossary without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGlossary = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.deleteGlossary(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('deleteGlossary', () => { - it('invokes deleteGlossary without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteGlossary = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteGlossary(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes deleteGlossary without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGlossary = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteGlossary( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes deleteGlossary without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteGlossary = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteGlossary( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes deleteGlossary with call error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGlossary = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteGlossary(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes deleteGlossary with call error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteGlossary = stubLongRunningCall(undefined, expectedError); - await assert.rejects(async () => { await client.deleteGlossary(request); }, expectedError); - assert((client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes deleteGlossary with LRO error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGlossary = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGlossary(request); + await assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.deleteGlossary as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes deleteGlossary with LRO error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteGlossary = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteGlossary(request); - await assert.rejects(async () => { await operation.promise(); }, expectedError); - assert((client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('listGlossaries', () => { + it('invokes listGlossaries without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + ]; + client.innerApiCalls.listGlossaries = stubSimpleCall(expectedResponse); + const [response] = await client.listGlossaries(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('listGlossaries', () => { - it('invokes listGlossaries without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), - ]; - client.innerApiCalls.listGlossaries = stubSimpleCall(expectedResponse); - const [response] = await client.listGlossaries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes listGlossaries without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + ]; + client.innerApiCalls.listGlossaries = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listGlossaries( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3beta1.IGlossary[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes listGlossaries without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), - ]; - client.innerApiCalls.listGlossaries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listGlossaries( - request, - (err?: Error|null, result?: protos.google.cloud.translation.v3beta1.IGlossary[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes listGlossaries with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGlossaries = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.listGlossaries(request); + }, expectedError); + assert( + (client.innerApiCalls.listGlossaries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes listGlossaries with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listGlossaries = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.listGlossaries(request); }, expectedError); - assert((client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + it('invokes listGlossariesStream without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + ]; + client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listGlossariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.translation.v3beta1.Glossary[] = []; + stream.on( + 'data', + (response: protos.google.cloud.translation.v3beta1.Glossary) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); }); - - it('invokes listGlossariesStream without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), - ]; - client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listGlossariesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.translation.v3beta1.Glossary[] = []; - stream.on('data', (response: protos.google.cloud.translation.v3beta1.Glossary) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listGlossaries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listGlossaries, request)); - assert.strictEqual( - (client.descriptors.page.listGlossaries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); + stream.on('error', (err: Error) => { + reject(err); }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGlossaries, request) + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); - it('invokes listGlossariesStream with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listGlossariesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.translation.v3beta1.Glossary[] = []; - stream.on('data', (response: protos.google.cloud.translation.v3beta1.Glossary) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(async () => { await promise; }, expectedError); - assert((client.descriptors.page.listGlossaries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listGlossaries, request)); - assert.strictEqual( - (client.descriptors.page.listGlossaries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); + it('invokes listGlossariesStream with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listGlossariesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.translation.v3beta1.Glossary[] = []; + stream.on( + 'data', + (response: protos.google.cloud.translation.v3beta1.Glossary) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); }); - - it('uses async iteration with listGlossaries without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), - generateSampleMessage(new protos.google.cloud.translation.v3beta1.Glossary()), - ]; - client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; - const iterable = client.listGlossariesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); + stream.on('error', (err: Error) => { + reject(err); }); + }); + await assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGlossaries, request) + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); - it('uses async iteration with listGlossaries with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.translation.v3beta1.ListGlossariesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listGlossariesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('uses async iteration with listGlossaries without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + generateSampleMessage( + new protos.google.cloud.translation.v3beta1.Glossary() + ), + ]; + client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; + const iterable = client.listGlossariesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); }); - describe('Path templates', () => { + it('uses async iteration with listGlossaries with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listGlossariesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listGlossaries + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); - describe('glossary', () => { - const fakePath = "/rendered/path/glossary"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - glossary: "glossaryValue", - }; - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.glossaryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.glossaryPathTemplate.match = - sinon.stub().returns(expectedParameters); + describe('Path templates', () => { + describe('glossary', () => { + const fakePath = '/rendered/path/glossary'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + glossary: 'glossaryValue', + }; + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.glossaryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.glossaryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); - it('glossaryPath', () => { - const result = client.glossaryPath("projectValue", "locationValue", "glossaryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.glossaryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); + it('glossaryPath', () => { + const result = client.glossaryPath( + 'projectValue', + 'locationValue', + 'glossaryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.glossaryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); - it('matchProjectFromGlossaryName', () => { - const result = client.matchProjectFromGlossaryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.glossaryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + it('matchProjectFromGlossaryName', () => { + const result = client.matchProjectFromGlossaryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); - it('matchLocationFromGlossaryName', () => { - const result = client.matchLocationFromGlossaryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.glossaryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + it('matchLocationFromGlossaryName', () => { + const result = client.matchLocationFromGlossaryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); - it('matchGlossaryFromGlossaryName', () => { - const result = client.matchGlossaryFromGlossaryName(fakePath); - assert.strictEqual(result, "glossaryValue"); - assert((client.pathTemplates.glossaryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + it('matchGlossaryFromGlossaryName', () => { + const result = client.matchGlossaryFromGlossaryName(fakePath); + assert.strictEqual(result, 'glossaryValue'); + assert( + (client.pathTemplates.glossaryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); }); + }); }); diff --git a/packages/google-cloud-translate/webpack.config.js b/packages/google-cloud-translate/webpack.config.js index ae59feffb0f..87404681b50 100644 --- a/packages/google-cloud-translate/webpack.config.js +++ b/packages/google-cloud-translate/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]grpc/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader' + use: 'null-loader', }, ], }, From 58d9519f199d8050ed2f56f76d9f90ff32c45bd8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 20 Apr 2020 14:43:49 -0700 Subject: [PATCH 363/513] build: use codecov's action, now that it's authless (#499) (#527) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/73563d93-aea4-4354-9013-d19800d55cda/targets --- packages/google-cloud-translate/synth.metadata | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index e378e68963c..95165d91d59 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "3f5d2b14ead6fa62a8a9879ac46e9acb2eba3ecf" + "sha": "28179f07516b9d8301f711e877ea79dd0c8f6b23" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "101d31acd73076c52d78e18322be01f3debe8cb5", - "internalRef": "306855444" + "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", + "internalRef": "307114445" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "682c0c37d1054966ca662a44259e96cc7aea4413" + "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" } } ], From d619acdff57518fa1a74bf1ebcd692f855e1ea8e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 21 Apr 2020 20:38:28 -0700 Subject: [PATCH 364/513] build: adopt changes to generator formatting (#528) --- .../google-cloud-translate/protos/protos.js | 604 +++++++++--------- .../google-cloud-translate/synth.metadata | 2 +- 2 files changed, 303 insertions(+), 303 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index ada34854095..29c842c39a3 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -430,9 +430,9 @@ TranslateTextGlossaryConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.glossary != null && message.hasOwnProperty("glossary")) + if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.glossary); - if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + if (message.ignoreCase != null && Object.hasOwnProperty.call(message, "ignoreCase")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignoreCase); return writer; }; @@ -699,19 +699,19 @@ if (message.contents != null && message.contents.length) for (var i = 0; i < message.contents.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.contents[i]); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetLanguageCode); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.model); - if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.parent); - if (message.labels != null && message.hasOwnProperty("labels")) + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -1296,13 +1296,13 @@ Translation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.translatedText != null && message.hasOwnProperty("translatedText")) + if (message.translatedText != null && Object.hasOwnProperty.call(message, "translatedText")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.translatedText); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + if (message.detectedLanguageCode != null && Object.hasOwnProperty.call(message, "detectedLanguageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.detectedLanguageCode); return writer; }; @@ -1579,15 +1579,15 @@ DetectLanguageRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.content != null && message.hasOwnProperty("content")) + if (message.content != null && Object.hasOwnProperty.call(message, "content")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.model); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.labels != null && message.hasOwnProperty("labels")) + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -1854,9 +1854,9 @@ DetectedLanguage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); - if (message.confidence != null && message.hasOwnProperty("confidence")) + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); return writer; }; @@ -2281,11 +2281,11 @@ GetSupportedLanguagesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayLanguageCode != null && message.hasOwnProperty("displayLanguageCode")) + if (message.displayLanguageCode != null && Object.hasOwnProperty.call(message, "displayLanguageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayLanguageCode); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); return writer; }; @@ -2730,13 +2730,13 @@ SupportedLanguage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.supportSource != null && message.hasOwnProperty("supportSource")) + if (message.supportSource != null && Object.hasOwnProperty.call(message, "supportSource")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.supportSource); - if (message.supportTarget != null && message.hasOwnProperty("supportTarget")) + if (message.supportTarget != null && Object.hasOwnProperty.call(message, "supportTarget")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.supportTarget); return writer; }; @@ -2957,7 +2957,7 @@ GcsSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); return writer; }; @@ -3167,9 +3167,9 @@ InputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) $root.google.cloud.translation.v3.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -3378,7 +3378,7 @@ GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + if (message.outputUriPrefix != null && Object.hasOwnProperty.call(message, "outputUriPrefix")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); return writer; }; @@ -3579,7 +3579,7 @@ OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) $root.google.cloud.translation.v3.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -3844,27 +3844,27 @@ BatchTranslateTextRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) for (var i = 0; i < message.targetLanguageCodes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); - if (message.models != null && message.hasOwnProperty("models")) + if (message.models != null && Object.hasOwnProperty.call(message, "models")) for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); if (message.inputConfigs != null && message.inputConfigs.length) for (var i = 0; i < message.inputConfigs.length; ++i) $root.google.cloud.translation.v3.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.translation.v3.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.glossaries != null && message.hasOwnProperty("glossaries")) + if (message.glossaries != null && Object.hasOwnProperty.call(message, "glossaries")) for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.labels != null && message.hasOwnProperty("labels")) + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -4268,15 +4268,15 @@ BatchTranslateMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalCharacters); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -4532,7 +4532,7 @@ /** * State enum. * @name google.cloud.translation.v3.BatchTranslateMetadata.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -4646,15 +4646,15 @@ BatchTranslateResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalCharacters); - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -4952,7 +4952,7 @@ GlossaryInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) $root.google.cloud.translation.v3.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -5217,19 +5217,19 @@ Glossary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.languagePair != null && message.hasOwnProperty("languagePair")) + if (message.languagePair != null && Object.hasOwnProperty.call(message, "languagePair")) $root.google.cloud.translation.v3.Glossary.LanguageCodePair.encode(message.languagePair, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) + if (message.languageCodesSet != null && Object.hasOwnProperty.call(message, "languageCodesSet")) $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.encode(message.languageCodesSet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) $root.google.cloud.translation.v3.GlossaryInputConfig.encode(message.inputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.entryCount != null && message.hasOwnProperty("entryCount")) + if (message.entryCount != null && Object.hasOwnProperty.call(message, "entryCount")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.entryCount); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -5527,9 +5527,9 @@ LanguageCodePair.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); return writer; }; @@ -5943,9 +5943,9 @@ CreateGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.glossary != null && message.hasOwnProperty("glossary")) + if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) $root.google.cloud.translation.v3.Glossary.encode(message.glossary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -6149,7 +6149,7 @@ GetGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -6336,7 +6336,7 @@ DeleteGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -6550,13 +6550,13 @@ ListGlossariesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); return writer; }; @@ -6790,7 +6790,7 @@ if (message.glossaries != null && message.glossaries.length) for (var i = 0; i < message.glossaries.length; ++i) $root.google.cloud.translation.v3.Glossary.encode(message.glossaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -7026,11 +7026,11 @@ CreateGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -7222,7 +7222,7 @@ /** * State enum. * @name google.cloud.translation.v3.CreateGlossaryMetadata.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -7318,11 +7318,11 @@ DeleteGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -7514,7 +7514,7 @@ /** * State enum. * @name google.cloud.translation.v3.DeleteGlossaryMetadata.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -7610,11 +7610,11 @@ DeleteGlossaryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -8154,9 +8154,9 @@ TranslateTextGlossaryConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.glossary != null && message.hasOwnProperty("glossary")) + if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.glossary); - if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + if (message.ignoreCase != null && Object.hasOwnProperty.call(message, "ignoreCase")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignoreCase); return writer; }; @@ -8423,19 +8423,19 @@ if (message.contents != null && message.contents.length) for (var i = 0; i < message.contents.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.contents[i]); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetLanguageCode); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.model); - if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.parent); - if (message.labels != null && message.hasOwnProperty("labels")) + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -9020,13 +9020,13 @@ Translation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.translatedText != null && message.hasOwnProperty("translatedText")) + if (message.translatedText != null && Object.hasOwnProperty.call(message, "translatedText")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.translatedText); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + if (message.detectedLanguageCode != null && Object.hasOwnProperty.call(message, "detectedLanguageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.detectedLanguageCode); return writer; }; @@ -9303,15 +9303,15 @@ DetectLanguageRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.content != null && message.hasOwnProperty("content")) + if (message.content != null && Object.hasOwnProperty.call(message, "content")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.model); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.labels != null && message.hasOwnProperty("labels")) + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -9578,9 +9578,9 @@ DetectedLanguage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); - if (message.confidence != null && message.hasOwnProperty("confidence")) + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); return writer; }; @@ -10005,11 +10005,11 @@ GetSupportedLanguagesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayLanguageCode != null && message.hasOwnProperty("displayLanguageCode")) + if (message.displayLanguageCode != null && Object.hasOwnProperty.call(message, "displayLanguageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayLanguageCode); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); return writer; }; @@ -10454,13 +10454,13 @@ SupportedLanguage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.supportSource != null && message.hasOwnProperty("supportSource")) + if (message.supportSource != null && Object.hasOwnProperty.call(message, "supportSource")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.supportSource); - if (message.supportTarget != null && message.hasOwnProperty("supportTarget")) + if (message.supportTarget != null && Object.hasOwnProperty.call(message, "supportTarget")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.supportTarget); return writer; }; @@ -10681,7 +10681,7 @@ GcsSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); return writer; }; @@ -10891,9 +10891,9 @@ InputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) $root.google.cloud.translation.v3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -11102,7 +11102,7 @@ GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + if (message.outputUriPrefix != null && Object.hasOwnProperty.call(message, "outputUriPrefix")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); return writer; }; @@ -11303,7 +11303,7 @@ OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) $root.google.cloud.translation.v3beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -11568,27 +11568,27 @@ BatchTranslateTextRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) for (var i = 0; i < message.targetLanguageCodes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); - if (message.models != null && message.hasOwnProperty("models")) + if (message.models != null && Object.hasOwnProperty.call(message, "models")) for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); if (message.inputConfigs != null && message.inputConfigs.length) for (var i = 0; i < message.inputConfigs.length; ++i) $root.google.cloud.translation.v3beta1.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.translation.v3beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.glossaries != null && message.hasOwnProperty("glossaries")) + if (message.glossaries != null && Object.hasOwnProperty.call(message, "glossaries")) for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.labels != null && message.hasOwnProperty("labels")) + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -11992,15 +11992,15 @@ BatchTranslateMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalCharacters); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -12256,7 +12256,7 @@ /** * State enum. * @name google.cloud.translation.v3beta1.BatchTranslateMetadata.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -12370,15 +12370,15 @@ BatchTranslateResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalCharacters); - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -12676,7 +12676,7 @@ GlossaryInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) $root.google.cloud.translation.v3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -12941,19 +12941,19 @@ Glossary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.languagePair != null && message.hasOwnProperty("languagePair")) + if (message.languagePair != null && Object.hasOwnProperty.call(message, "languagePair")) $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.encode(message.languagePair, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) + if (message.languageCodesSet != null && Object.hasOwnProperty.call(message, "languageCodesSet")) $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.encode(message.languageCodesSet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) $root.google.cloud.translation.v3beta1.GlossaryInputConfig.encode(message.inputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.entryCount != null && message.hasOwnProperty("entryCount")) + if (message.entryCount != null && Object.hasOwnProperty.call(message, "entryCount")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.entryCount); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -13251,9 +13251,9 @@ LanguageCodePair.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); return writer; }; @@ -13667,9 +13667,9 @@ CreateGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.glossary != null && message.hasOwnProperty("glossary")) + if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) $root.google.cloud.translation.v3beta1.Glossary.encode(message.glossary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -13873,7 +13873,7 @@ GetGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -14060,7 +14060,7 @@ DeleteGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -14274,13 +14274,13 @@ ListGlossariesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); return writer; }; @@ -14514,7 +14514,7 @@ if (message.glossaries != null && message.glossaries.length) for (var i = 0; i < message.glossaries.length; ++i) $root.google.cloud.translation.v3beta1.Glossary.encode(message.glossaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -14750,11 +14750,11 @@ CreateGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -14946,7 +14946,7 @@ /** * State enum. * @name google.cloud.translation.v3beta1.CreateGlossaryMetadata.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -15042,11 +15042,11 @@ DeleteGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -15238,7 +15238,7 @@ /** * State enum. * @name google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -15334,11 +15334,11 @@ DeleteGlossaryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -15589,7 +15589,7 @@ if (message.rules != null && message.rules.length) for (var i = 0; i < message.rules.length; ++i) $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; @@ -15903,26 +15903,26 @@ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) + if (message.get != null && Object.hasOwnProperty.call(message, "get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) + if (message.put != null && Object.hasOwnProperty.call(message, "put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) + if (message.post != null && Object.hasOwnProperty.call(message, "post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) + if (message.body != null && Object.hasOwnProperty.call(message, "body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.additionalBindings != null && message.additionalBindings.length) for (var i = 0; i < message.additionalBindings.length; ++i) $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; @@ -16279,9 +16279,9 @@ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) + if (message.path != null && Object.hasOwnProperty.call(message, "path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; @@ -16427,7 +16427,7 @@ /** * FieldBehavior enum. * @name google.api.FieldBehavior - * @enum {string} + * @enum {number} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value @@ -16548,18 +16548,18 @@ ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); if (message.pattern != null && message.pattern.length) for (var i = 0; i < message.pattern.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && message.hasOwnProperty("nameField")) + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) + if (message.history != null && Object.hasOwnProperty.call(message, "history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; @@ -16779,7 +16779,7 @@ /** * History enum. * @name google.api.ResourceDescriptor.History - * @enum {string} + * @enum {number} * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value @@ -16860,9 +16860,9 @@ ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; @@ -17387,9 +17387,9 @@ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && message.hasOwnProperty("package")) + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); if (message.dependency != null && message.dependency.length) for (var i = 0; i < message.dependency.length; ++i) @@ -17406,9 +17406,9 @@ if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.publicDependency != null && message.publicDependency.length) for (var i = 0; i < message.publicDependency.length; ++i) @@ -17416,7 +17416,7 @@ if (message.weakDependency != null && message.weakDependency.length) for (var i = 0; i < message.weakDependency.length; ++i) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && message.hasOwnProperty("syntax")) + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; @@ -17954,7 +17954,7 @@ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.field != null && message.field.length) for (var i = 0; i < message.field.length; ++i) @@ -17971,7 +17971,7 @@ if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.oneofDecl != null && message.oneofDecl.length) for (var i = 0; i < message.oneofDecl.length; ++i) @@ -18436,11 +18436,11 @@ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -18664,9 +18664,9 @@ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -19157,25 +19157,25 @@ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && message.hasOwnProperty("extendee")) + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && message.hasOwnProperty("label")) + if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && message.hasOwnProperty("typeName")) + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); return writer; }; @@ -19522,7 +19522,7 @@ /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} + * @enum {number} * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value * @property {number} TYPE_INT64=3 TYPE_INT64 value @@ -19568,7 +19568,7 @@ /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label - * @enum {string} + * @enum {number} * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value @@ -19649,9 +19649,9 @@ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -19894,12 +19894,12 @@ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.value != null && message.value.length) for (var i = 0; i < message.value.length; ++i) $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) @@ -20202,9 +20202,9 @@ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -20424,11 +20424,11 @@ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -20662,12 +20662,12 @@ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.method != null && message.method.length) for (var i = 0; i < message.method.length; ++i) $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -20947,17 +20947,17 @@ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && message.hasOwnProperty("inputType")) + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && message.hasOwnProperty("outputType")) + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; @@ -21396,45 +21396,45 @@ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -21861,7 +21861,7 @@ /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} + * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value @@ -21979,18 +21979,18 @@ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -22332,17 +22332,17 @@ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype != null && message.hasOwnProperty("ctype")) + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && message.hasOwnProperty("packed")) + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && message.hasOwnProperty("lazy")) + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && message.hasOwnProperty("jstype")) + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && message.hasOwnProperty("weak")) + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -22353,7 +22353,7 @@ writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; @@ -22689,7 +22689,7 @@ /** * CType enum. * @name google.protobuf.FieldOptions.CType - * @enum {string} + * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value @@ -22705,7 +22705,7 @@ /** * JSType enum. * @name google.protobuf.FieldOptions.JSType - * @enum {string} + * @enum {number} * @property {number} JS_NORMAL=0 JS_NORMAL value * @property {number} JS_STRING=1 JS_STRING value * @property {number} JS_NUMBER=2 JS_NUMBER value @@ -23004,9 +23004,9 @@ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -23249,7 +23249,7 @@ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -23498,14 +23498,14 @@ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; @@ -23793,19 +23793,19 @@ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; @@ -24055,7 +24055,7 @@ /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {string} + * @enum {number} * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value * @property {number} IDEMPOTENT=2 IDEMPOTENT value @@ -24185,17 +24185,17 @@ if (message.name != null && message.name.length) for (var i = 0; i < message.name.length; ++i) $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; @@ -24972,9 +24972,9 @@ writer.int32(message.span[i]); writer.ldelim(); } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) for (var i = 0; i < message.leadingDetachedComments.length; ++i) @@ -25505,11 +25505,11 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && message.hasOwnProperty("begin")) + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; @@ -25762,9 +25762,9 @@ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && message.hasOwnProperty("type_url")) + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; @@ -25981,9 +25981,9 @@ Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -26365,9 +26365,9 @@ Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -26842,15 +26842,15 @@ Operation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && message.hasOwnProperty("metadata")) + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && message.hasOwnProperty("done")) + if (message.done != null && Object.hasOwnProperty.call(message, "done")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && message.hasOwnProperty("error")) + if (message.error != null && Object.hasOwnProperty.call(message, "error")) $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && message.hasOwnProperty("response")) + if (message.response != null && Object.hasOwnProperty.call(message, "response")) $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -27110,7 +27110,7 @@ GetOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -27324,13 +27324,13 @@ ListOperationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; @@ -27564,7 +27564,7 @@ if (message.operations != null && message.operations.length) for (var i = 0; i < message.operations.length; ++i) $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -27782,7 +27782,7 @@ CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -27969,7 +27969,7 @@ DeleteOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -28165,9 +28165,9 @@ WaitOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && message.hasOwnProperty("timeout")) + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -28380,9 +28380,9 @@ OperationInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.responseType != null && message.hasOwnProperty("responseType")) + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); return writer; }; @@ -28612,9 +28612,9 @@ Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); if (message.details != null && message.details.length) for (var i = 0; i < message.details.length; ++i) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 95165d91d59..d7af132f34e 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "28179f07516b9d8301f711e877ea79dd0c8f6b23" + "sha": "3f593aab5d8d9ff16350b203d4b8ec315b0c8ad7" } }, { From eba3f1053b7d19fbf209243f3e75e32c7a2b9b66 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 23 Apr 2020 19:32:29 -0700 Subject: [PATCH 365/513] chore: update npm scripts and synth.py (#529) Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool. --- packages/google-cloud-translate/package.json | 6 ++++-- packages/google-cloud-translate/synth.py | 7 ++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 3575cad03b6..c79a1eb4ce2 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -30,7 +30,7 @@ "scripts": { "docs": "jsdoc -c .jsdoc.js", "predocs": "npm run compile", - "lint": "gts fix", + "lint": "gts check", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha build/system-test --timeout 600000", "test": "c8 mocha build/test", @@ -41,7 +41,9 @@ "presystem-test": "npm run compile", "docs-test": "linkinator docs", "predocs-test": "npm run docs", - "prelint": "cd samples; npm link ../; npm install" + "prelint": "cd samples; npm link ../; npm install", + "clean": "gts clean", + "precompile": "gts clean" }, "dependencies": { "@google-cloud/common": "^3.0.0", diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py index 819ff17da00..507cf84973d 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/synth.py @@ -16,8 +16,8 @@ import synthtool as s import synthtool.gcp as gcp +import synthtool.languages.node as node import logging -import subprocess # Run the gapic generator gapic = gcp.GAPICMicrogenerator() @@ -43,7 +43,4 @@ templates = common_templates.node_library(source_location='build/src') s.copy(templates, excludes=[]) -# Node.js specific cleanup -subprocess.run(["npm", "install"]) -subprocess.run(["npm", "run", "lint"]) -subprocess.run(["npx", "compileProtos", "src"]) +node.postprocess_gapic_library() From 8519e77750a4ead7fd3ca2f2f8d085e52ad18535 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 1 May 2020 06:55:29 +0200 Subject: [PATCH 366/513] chore(deps): update dependency uuid to v8 (#530) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [uuid](https://togithub.com/uuidjs/uuid) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/uuid/7.0.3/8.0.0) | --- ### Release Notes
uuidjs/uuid ### [`v8.0.0`](https://togithub.com/uuidjs/uuid/blob/master/CHANGELOG.md#​800-httpsgithubcomuuidjsuuidcomparev703v800-2020-04-29) [Compare Source](https://togithub.com/uuidjs/uuid/compare/v7.0.3...v8.0.0) ##### ⚠ BREAKING CHANGES - For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export. ```diff -import uuid from 'uuid'; -console.log(uuid.v4()); // -> 'cd6c3b08-0adc-4f4b-a6ef-36087a1c9869' +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' ``` - Deep requiring specific algorithms of this library like `require('uuid/v4')`, which has been deprecated in `uuid@7`, is no longer supported. Instead use the named exports that this module exports. For ECMAScript Modules (ESM): ```diff -import uuidv4 from 'uuid/v4'; +import { v4 as uuidv4 } from 'uuid'; uuidv4(); ``` For CommonJS: ```diff -const uuidv4 = require('uuid/v4'); +const { v4: uuidv4 } = require('uuid'); uuidv4(); ``` ##### Features - native Node.js ES Modules (wrapper approach) ([#​423](https://togithub.com/uuidjs/uuid/issues/423)) ([2d9f590](https://togithub.com/uuidjs/uuid/commit/2d9f590ad9701d692625c07ed62f0a0f91227991)), closes [#​245](https://togithub.com/uuidjs/uuid/issues/245) [#​419](https://togithub.com/uuidjs/uuid/issues/419) [#​342](https://togithub.com/uuidjs/uuid/issues/342) - remove deep requires ([#​426](https://togithub.com/uuidjs/uuid/issues/426)) ([daf72b8](https://togithub.com/uuidjs/uuid/commit/daf72b84ceb20272a81bb5fbddb05dd95922cbba)) ##### Bug Fixes - add CommonJS syntax example to README quickstart section ([#​417](https://togithub.com/uuidjs/uuid/issues/417)) ([e0ec840](https://togithub.com/uuidjs/uuid/commit/e0ec8402c7ad44b7ef0453036c612f5db513fda0)) ##### [7.0.3](https://togithub.com/uuidjs/uuid/compare/v7.0.2...v7.0.3) (2020-03-31) ##### Bug Fixes - make deep require deprecation warning work in browsers ([#​409](https://togithub.com/uuidjs/uuid/issues/409)) ([4b71107](https://togithub.com/uuidjs/uuid/commit/4b71107d8c0d2ef56861ede6403fc9dc35a1e6bf)), closes [#​408](https://togithub.com/uuidjs/uuid/issues/408) ##### [7.0.2](https://togithub.com/uuidjs/uuid/compare/v7.0.1...v7.0.2) (2020-03-04) ##### Bug Fixes - make access to msCrypto consistent ([#​393](https://togithub.com/uuidjs/uuid/issues/393)) ([8bf2a20](https://togithub.com/uuidjs/uuid/commit/8bf2a20f3565df743da7215eebdbada9d2df118c)) - simplify link in deprecation warning ([#​391](https://togithub.com/uuidjs/uuid/issues/391)) ([bb2c8e4](https://togithub.com/uuidjs/uuid/commit/bb2c8e4e9f4c5f9c1eaaf3ea59710c633cd90cb7)) - update links to match content in readme ([#​386](https://togithub.com/uuidjs/uuid/issues/386)) ([44f2f86](https://togithub.com/uuidjs/uuid/commit/44f2f86e9d2bbf14ee5f0f00f72a3db1292666d4)) ##### [7.0.1](https://togithub.com/uuidjs/uuid/compare/v7.0.0...v7.0.1) (2020-02-25) ##### Bug Fixes - clean up esm builds for node and browser ([#​383](https://togithub.com/uuidjs/uuid/issues/383)) ([59e6a49](https://togithub.com/uuidjs/uuid/commit/59e6a49e7ce7b3e8fb0f3ee52b9daae72af467dc)) - provide browser versions independent from module system ([#​380](https://togithub.com/uuidjs/uuid/issues/380)) ([4344a22](https://togithub.com/uuidjs/uuid/commit/4344a22e7aed33be8627eeaaf05360f256a21753)), closes [#​378](https://togithub.com/uuidjs/uuid/issues/378)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-translate). --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 7b49b651d2c..7ddd1fb8814 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -24,6 +24,6 @@ "@google-cloud/storage": "^4.0.0", "chai": "^4.2.0", "mocha": "^7.0.0", - "uuid": "^7.0.0" + "uuid": "^8.0.0" } } From 0646ba6e37704d3a2a3d6701b377f432965d658c Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 5 May 2020 20:08:07 -0700 Subject: [PATCH 367/513] feat: check status of long running operation by its name; fix linting (#531) For each client method returning a long running operation, a separate method to check its status is added. Added methods: `checkBatchTranslateTextProgress`, `checkCreateGlossaryProgress`, `checkDeleteGlossaryProgress`. --- .../google-cloud-translate/protos/protos.js | 604 +++++++++--------- .../src/v3/translation_service_client.ts | 110 +++- .../src/v3beta1/translation_service_client.ts | 110 +++- .../google-cloud-translate/synth.metadata | 14 +- .../system-test/translate.ts | 2 +- .../test/gapic_translation_service_v3.ts | 176 +++-- .../test/gapic_translation_service_v3beta1.ts | 188 ++++-- packages/google-cloud-translate/test/index.ts | 10 +- 8 files changed, 819 insertions(+), 395 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index 29c842c39a3..ada34854095 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -430,9 +430,9 @@ TranslateTextGlossaryConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) + if (message.glossary != null && message.hasOwnProperty("glossary")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.glossary); - if (message.ignoreCase != null && Object.hasOwnProperty.call(message, "ignoreCase")) + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignoreCase); return writer; }; @@ -699,19 +699,19 @@ if (message.contents != null && message.contents.length) for (var i = 0; i < message.contents.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.contents[i]); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + if (message.mimeType != null && message.hasOwnProperty("mimeType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetLanguageCode); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) + if (message.model != null && message.hasOwnProperty("model")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.model); - if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.parent); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + if (message.labels != null && message.hasOwnProperty("labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -1296,13 +1296,13 @@ Translation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.translatedText != null && Object.hasOwnProperty.call(message, "translatedText")) + if (message.translatedText != null && message.hasOwnProperty("translatedText")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.translatedText); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) + if (message.model != null && message.hasOwnProperty("model")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.detectedLanguageCode != null && Object.hasOwnProperty.call(message, "detectedLanguageCode")) + if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.detectedLanguageCode); return writer; }; @@ -1579,15 +1579,15 @@ DetectLanguageRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) + if (message.content != null && message.hasOwnProperty("content")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + if (message.mimeType != null && message.hasOwnProperty("mimeType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) + if (message.model != null && message.hasOwnProperty("model")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.model); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + if (message.labels != null && message.hasOwnProperty("labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -1854,9 +1854,9 @@ DetectedLanguage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + if (message.languageCode != null && message.hasOwnProperty("languageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); - if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + if (message.confidence != null && message.hasOwnProperty("confidence")) writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); return writer; }; @@ -2281,11 +2281,11 @@ GetSupportedLanguagesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayLanguageCode != null && Object.hasOwnProperty.call(message, "displayLanguageCode")) + if (message.displayLanguageCode != null && message.hasOwnProperty("displayLanguageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayLanguageCode); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) + if (message.model != null && message.hasOwnProperty("model")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); return writer; }; @@ -2730,13 +2730,13 @@ SupportedLanguage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + if (message.languageCode != null && message.hasOwnProperty("languageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + if (message.displayName != null && message.hasOwnProperty("displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.supportSource != null && Object.hasOwnProperty.call(message, "supportSource")) + if (message.supportSource != null && message.hasOwnProperty("supportSource")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.supportSource); - if (message.supportTarget != null && Object.hasOwnProperty.call(message, "supportTarget")) + if (message.supportTarget != null && message.hasOwnProperty("supportTarget")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.supportTarget); return writer; }; @@ -2957,7 +2957,7 @@ GcsSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + if (message.inputUri != null && message.hasOwnProperty("inputUri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); return writer; }; @@ -3167,9 +3167,9 @@ InputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + if (message.mimeType != null && message.hasOwnProperty("mimeType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) $root.google.cloud.translation.v3.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -3378,7 +3378,7 @@ GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.outputUriPrefix != null && Object.hasOwnProperty.call(message, "outputUriPrefix")) + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); return writer; }; @@ -3579,7 +3579,7 @@ OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) $root.google.cloud.translation.v3.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -3844,27 +3844,27 @@ BatchTranslateTextRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) for (var i = 0; i < message.targetLanguageCodes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); - if (message.models != null && Object.hasOwnProperty.call(message, "models")) + if (message.models != null && message.hasOwnProperty("models")) for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); if (message.inputConfigs != null && message.inputConfigs.length) for (var i = 0; i < message.inputConfigs.length; ++i) $root.google.cloud.translation.v3.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) $root.google.cloud.translation.v3.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.glossaries != null && Object.hasOwnProperty.call(message, "glossaries")) + if (message.glossaries != null && message.hasOwnProperty("glossaries")) for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + if (message.labels != null && message.hasOwnProperty("labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -4268,15 +4268,15 @@ BatchTranslateMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) + if (message.state != null && message.hasOwnProperty("state")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalCharacters); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + if (message.submitTime != null && message.hasOwnProperty("submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -4532,7 +4532,7 @@ /** * State enum. * @name google.cloud.translation.v3.BatchTranslateMetadata.State - * @enum {number} + * @enum {string} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -4646,15 +4646,15 @@ BatchTranslateResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalCharacters); - if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + if (message.submitTime != null && message.hasOwnProperty("submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + if (message.endTime != null && message.hasOwnProperty("endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -4952,7 +4952,7 @@ GlossaryInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) $root.google.cloud.translation.v3.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -5217,19 +5217,19 @@ Glossary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.languagePair != null && Object.hasOwnProperty.call(message, "languagePair")) + if (message.languagePair != null && message.hasOwnProperty("languagePair")) $root.google.cloud.translation.v3.Glossary.LanguageCodePair.encode(message.languagePair, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.languageCodesSet != null && Object.hasOwnProperty.call(message, "languageCodesSet")) + if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.encode(message.languageCodesSet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) $root.google.cloud.translation.v3.GlossaryInputConfig.encode(message.inputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.entryCount != null && Object.hasOwnProperty.call(message, "entryCount")) + if (message.entryCount != null && message.hasOwnProperty("entryCount")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.entryCount); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + if (message.submitTime != null && message.hasOwnProperty("submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + if (message.endTime != null && message.hasOwnProperty("endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -5527,9 +5527,9 @@ LanguageCodePair.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); return writer; }; @@ -5943,9 +5943,9 @@ CreateGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) + if (message.glossary != null && message.hasOwnProperty("glossary")) $root.google.cloud.translation.v3.Glossary.encode(message.glossary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -6149,7 +6149,7 @@ GetGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -6336,7 +6336,7 @@ DeleteGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -6550,13 +6550,13 @@ ListGlossariesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); return writer; }; @@ -6790,7 +6790,7 @@ if (message.glossaries != null && message.glossaries.length) for (var i = 0; i < message.glossaries.length; ++i) $root.google.cloud.translation.v3.Glossary.encode(message.glossaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -7026,11 +7026,11 @@ CreateGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) + if (message.state != null && message.hasOwnProperty("state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + if (message.submitTime != null && message.hasOwnProperty("submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -7222,7 +7222,7 @@ /** * State enum. * @name google.cloud.translation.v3.CreateGlossaryMetadata.State - * @enum {number} + * @enum {string} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -7318,11 +7318,11 @@ DeleteGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) + if (message.state != null && message.hasOwnProperty("state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + if (message.submitTime != null && message.hasOwnProperty("submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -7514,7 +7514,7 @@ /** * State enum. * @name google.cloud.translation.v3.DeleteGlossaryMetadata.State - * @enum {number} + * @enum {string} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -7610,11 +7610,11 @@ DeleteGlossaryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + if (message.submitTime != null && message.hasOwnProperty("submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + if (message.endTime != null && message.hasOwnProperty("endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -8154,9 +8154,9 @@ TranslateTextGlossaryConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) + if (message.glossary != null && message.hasOwnProperty("glossary")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.glossary); - if (message.ignoreCase != null && Object.hasOwnProperty.call(message, "ignoreCase")) + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignoreCase); return writer; }; @@ -8423,19 +8423,19 @@ if (message.contents != null && message.contents.length) for (var i = 0; i < message.contents.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.contents[i]); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + if (message.mimeType != null && message.hasOwnProperty("mimeType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetLanguageCode); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) + if (message.model != null && message.hasOwnProperty("model")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.model); - if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.parent); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + if (message.labels != null && message.hasOwnProperty("labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -9020,13 +9020,13 @@ Translation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.translatedText != null && Object.hasOwnProperty.call(message, "translatedText")) + if (message.translatedText != null && message.hasOwnProperty("translatedText")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.translatedText); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) + if (message.model != null && message.hasOwnProperty("model")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.detectedLanguageCode != null && Object.hasOwnProperty.call(message, "detectedLanguageCode")) + if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.detectedLanguageCode); return writer; }; @@ -9303,15 +9303,15 @@ DetectLanguageRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) + if (message.content != null && message.hasOwnProperty("content")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + if (message.mimeType != null && message.hasOwnProperty("mimeType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) + if (message.model != null && message.hasOwnProperty("model")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.model); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + if (message.labels != null && message.hasOwnProperty("labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -9578,9 +9578,9 @@ DetectedLanguage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + if (message.languageCode != null && message.hasOwnProperty("languageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); - if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + if (message.confidence != null && message.hasOwnProperty("confidence")) writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); return writer; }; @@ -10005,11 +10005,11 @@ GetSupportedLanguagesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayLanguageCode != null && Object.hasOwnProperty.call(message, "displayLanguageCode")) + if (message.displayLanguageCode != null && message.hasOwnProperty("displayLanguageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayLanguageCode); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) + if (message.model != null && message.hasOwnProperty("model")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); return writer; }; @@ -10454,13 +10454,13 @@ SupportedLanguage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + if (message.languageCode != null && message.hasOwnProperty("languageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + if (message.displayName != null && message.hasOwnProperty("displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.supportSource != null && Object.hasOwnProperty.call(message, "supportSource")) + if (message.supportSource != null && message.hasOwnProperty("supportSource")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.supportSource); - if (message.supportTarget != null && Object.hasOwnProperty.call(message, "supportTarget")) + if (message.supportTarget != null && message.hasOwnProperty("supportTarget")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.supportTarget); return writer; }; @@ -10681,7 +10681,7 @@ GcsSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + if (message.inputUri != null && message.hasOwnProperty("inputUri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); return writer; }; @@ -10891,9 +10891,9 @@ InputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + if (message.mimeType != null && message.hasOwnProperty("mimeType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) $root.google.cloud.translation.v3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -11102,7 +11102,7 @@ GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.outputUriPrefix != null && Object.hasOwnProperty.call(message, "outputUriPrefix")) + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); return writer; }; @@ -11303,7 +11303,7 @@ OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) $root.google.cloud.translation.v3beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -11568,27 +11568,27 @@ BatchTranslateTextRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) for (var i = 0; i < message.targetLanguageCodes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); - if (message.models != null && Object.hasOwnProperty.call(message, "models")) + if (message.models != null && message.hasOwnProperty("models")) for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); if (message.inputConfigs != null && message.inputConfigs.length) for (var i = 0; i < message.inputConfigs.length; ++i) $root.google.cloud.translation.v3beta1.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) $root.google.cloud.translation.v3beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.glossaries != null && Object.hasOwnProperty.call(message, "glossaries")) + if (message.glossaries != null && message.hasOwnProperty("glossaries")) for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + if (message.labels != null && message.hasOwnProperty("labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -11992,15 +11992,15 @@ BatchTranslateMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) + if (message.state != null && message.hasOwnProperty("state")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalCharacters); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + if (message.submitTime != null && message.hasOwnProperty("submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -12256,7 +12256,7 @@ /** * State enum. * @name google.cloud.translation.v3beta1.BatchTranslateMetadata.State - * @enum {number} + * @enum {string} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -12370,15 +12370,15 @@ BatchTranslateResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalCharacters); - if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + if (message.submitTime != null && message.hasOwnProperty("submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + if (message.endTime != null && message.hasOwnProperty("endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -12676,7 +12676,7 @@ GlossaryInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) $root.google.cloud.translation.v3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -12941,19 +12941,19 @@ Glossary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.languagePair != null && Object.hasOwnProperty.call(message, "languagePair")) + if (message.languagePair != null && message.hasOwnProperty("languagePair")) $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.encode(message.languagePair, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.languageCodesSet != null && Object.hasOwnProperty.call(message, "languageCodesSet")) + if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.encode(message.languageCodesSet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) $root.google.cloud.translation.v3beta1.GlossaryInputConfig.encode(message.inputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.entryCount != null && Object.hasOwnProperty.call(message, "entryCount")) + if (message.entryCount != null && message.hasOwnProperty("entryCount")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.entryCount); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + if (message.submitTime != null && message.hasOwnProperty("submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + if (message.endTime != null && message.hasOwnProperty("endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -13251,9 +13251,9 @@ LanguageCodePair.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); return writer; }; @@ -13667,9 +13667,9 @@ CreateGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) + if (message.glossary != null && message.hasOwnProperty("glossary")) $root.google.cloud.translation.v3beta1.Glossary.encode(message.glossary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -13873,7 +13873,7 @@ GetGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -14060,7 +14060,7 @@ DeleteGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -14274,13 +14274,13 @@ ListGlossariesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); return writer; }; @@ -14514,7 +14514,7 @@ if (message.glossaries != null && message.glossaries.length) for (var i = 0; i < message.glossaries.length; ++i) $root.google.cloud.translation.v3beta1.Glossary.encode(message.glossaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -14750,11 +14750,11 @@ CreateGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) + if (message.state != null && message.hasOwnProperty("state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + if (message.submitTime != null && message.hasOwnProperty("submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -14946,7 +14946,7 @@ /** * State enum. * @name google.cloud.translation.v3beta1.CreateGlossaryMetadata.State - * @enum {number} + * @enum {string} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -15042,11 +15042,11 @@ DeleteGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) + if (message.state != null && message.hasOwnProperty("state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + if (message.submitTime != null && message.hasOwnProperty("submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -15238,7 +15238,7 @@ /** * State enum. * @name google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State - * @enum {number} + * @enum {string} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -15334,11 +15334,11 @@ DeleteGlossaryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + if (message.submitTime != null && message.hasOwnProperty("submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + if (message.endTime != null && message.hasOwnProperty("endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -15589,7 +15589,7 @@ if (message.rules != null && message.rules.length) for (var i = 0; i < message.rules.length; ++i) $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; @@ -15903,26 +15903,26 @@ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + if (message.selector != null && message.hasOwnProperty("selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) + if (message.get != null && message.hasOwnProperty("get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) + if (message.put != null && message.hasOwnProperty("put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) + if (message.post != null && message.hasOwnProperty("post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + if (message["delete"] != null && message.hasOwnProperty("delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + if (message.patch != null && message.hasOwnProperty("patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) + if (message.body != null && message.hasOwnProperty("body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + if (message.custom != null && message.hasOwnProperty("custom")) $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.additionalBindings != null && message.additionalBindings.length) for (var i = 0; i < message.additionalBindings.length; ++i) $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + if (message.responseBody != null && message.hasOwnProperty("responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; @@ -16279,9 +16279,9 @@ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (message.kind != null && message.hasOwnProperty("kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) + if (message.path != null && message.hasOwnProperty("path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; @@ -16427,7 +16427,7 @@ /** * FieldBehavior enum. * @name google.api.FieldBehavior - * @enum {number} + * @enum {string} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value @@ -16548,18 +16548,18 @@ ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); if (message.pattern != null && message.pattern.length) for (var i = 0; i < message.pattern.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + if (message.nameField != null && message.hasOwnProperty("nameField")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) + if (message.history != null && message.hasOwnProperty("history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + if (message.plural != null && message.hasOwnProperty("plural")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + if (message.singular != null && message.hasOwnProperty("singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; @@ -16779,7 +16779,7 @@ /** * History enum. * @name google.api.ResourceDescriptor.History - * @enum {number} + * @enum {string} * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value @@ -16860,9 +16860,9 @@ ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + if (message.childType != null && message.hasOwnProperty("childType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; @@ -17387,9 +17387,9 @@ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + if (message["package"] != null && message.hasOwnProperty("package")) writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); if (message.dependency != null && message.dependency.length) for (var i = 0; i < message.dependency.length; ++i) @@ -17406,9 +17406,9 @@ if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.publicDependency != null && message.publicDependency.length) for (var i = 0; i < message.publicDependency.length; ++i) @@ -17416,7 +17416,7 @@ if (message.weakDependency != null && message.weakDependency.length) for (var i = 0; i < message.weakDependency.length; ++i) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + if (message.syntax != null && message.hasOwnProperty("syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; @@ -17954,7 +17954,7 @@ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.field != null && message.field.length) for (var i = 0; i < message.field.length; ++i) @@ -17971,7 +17971,7 @@ if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.oneofDecl != null && message.oneofDecl.length) for (var i = 0; i < message.oneofDecl.length; ++i) @@ -18436,11 +18436,11 @@ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (message.start != null && message.hasOwnProperty("start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -18664,9 +18664,9 @@ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (message.start != null && message.hasOwnProperty("start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -19157,25 +19157,25 @@ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + if (message.extendee != null && message.hasOwnProperty("extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (message.number != null && message.hasOwnProperty("number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) + if (message.label != null && message.hasOwnProperty("label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + if (message.typeName != null && message.hasOwnProperty("typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + if (message.jsonName != null && message.hasOwnProperty("jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); return writer; }; @@ -19522,7 +19522,7 @@ /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} + * @enum {string} * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value * @property {number} TYPE_INT64=3 TYPE_INT64 value @@ -19568,7 +19568,7 @@ /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} + * @enum {string} * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value @@ -19649,9 +19649,9 @@ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -19894,12 +19894,12 @@ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.value != null && message.value.length) for (var i = 0; i < message.value.length; ++i) $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) @@ -20202,9 +20202,9 @@ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (message.start != null && message.hasOwnProperty("start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -20424,11 +20424,11 @@ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (message.number != null && message.hasOwnProperty("number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -20662,12 +20662,12 @@ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.method != null && message.method.length) for (var i = 0; i < message.method.length; ++i) $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -20947,17 +20947,17 @@ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + if (message.inputType != null && message.hasOwnProperty("inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + if (message.outputType != null && message.hasOwnProperty("outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; @@ -21396,45 +21396,45 @@ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + if (message.goPackage != null && message.hasOwnProperty("goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -21861,7 +21861,7 @@ /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} + * @enum {string} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value @@ -21979,18 +21979,18 @@ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -22332,17 +22332,17 @@ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + if (message.ctype != null && message.hasOwnProperty("ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + if (message.packed != null && message.hasOwnProperty("packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + if (message.lazy != null && message.hasOwnProperty("lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + if (message.jstype != null && message.hasOwnProperty("jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + if (message.weak != null && message.hasOwnProperty("weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -22353,7 +22353,7 @@ writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; @@ -22689,7 +22689,7 @@ /** * CType enum. * @name google.protobuf.FieldOptions.CType - * @enum {number} + * @enum {string} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value @@ -22705,7 +22705,7 @@ /** * JSType enum. * @name google.protobuf.FieldOptions.JSType - * @enum {number} + * @enum {string} * @property {number} JS_NORMAL=0 JS_NORMAL value * @property {number} JS_STRING=1 JS_STRING value * @property {number} JS_NUMBER=2 JS_NUMBER value @@ -23004,9 +23004,9 @@ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -23249,7 +23249,7 @@ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -23498,14 +23498,14 @@ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; @@ -23793,19 +23793,19 @@ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; @@ -24055,7 +24055,7 @@ /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} + * @enum {string} * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value * @property {number} IDEMPOTENT=2 IDEMPOTENT value @@ -24185,17 +24185,17 @@ if (message.name != null && message.name.length) for (var i = 0; i < message.name.length; ++i) $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + if (message.stringValue != null && message.hasOwnProperty("stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; @@ -24972,9 +24972,9 @@ writer.int32(message.span[i]); writer.ldelim(); } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) for (var i = 0; i < message.leadingDetachedComments.length; ++i) @@ -25505,11 +25505,11 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + if (message.begin != null && message.hasOwnProperty("begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; @@ -25762,9 +25762,9 @@ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + if (message.type_url != null && message.hasOwnProperty("type_url")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (message.value != null && message.hasOwnProperty("value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; @@ -25981,9 +25981,9 @@ Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (message.seconds != null && message.hasOwnProperty("seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + if (message.nanos != null && message.hasOwnProperty("nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -26365,9 +26365,9 @@ Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (message.seconds != null && message.hasOwnProperty("seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + if (message.nanos != null && message.hasOwnProperty("nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -26842,15 +26842,15 @@ Operation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + if (message.metadata != null && message.hasOwnProperty("metadata")) $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) + if (message.done != null && message.hasOwnProperty("done")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) + if (message.error != null && message.hasOwnProperty("error")) $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) + if (message.response != null && message.hasOwnProperty("response")) $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -27110,7 +27110,7 @@ GetOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -27324,13 +27324,13 @@ ListOperationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; @@ -27564,7 +27564,7 @@ if (message.operations != null && message.operations.length) for (var i = 0; i < message.operations.length; ++i) $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -27782,7 +27782,7 @@ CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -27969,7 +27969,7 @@ DeleteOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -28165,9 +28165,9 @@ WaitOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + if (message.timeout != null && message.hasOwnProperty("timeout")) $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -28380,9 +28380,9 @@ OperationInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + if (message.responseType != null && message.hasOwnProperty("responseType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + if (message.metadataType != null && message.hasOwnProperty("metadataType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); return writer; }; @@ -28612,9 +28612,9 @@ Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) + if (message.code != null && message.hasOwnProperty("code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) + if (message.message != null && message.hasOwnProperty("message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); if (message.details != null && message.details.length) for (var i = 0; i < message.details.length; ++i) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 0acb7f8f4c2..26f0f93b5f2 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -32,7 +32,7 @@ import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './translation_service_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -999,6 +999,42 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.batchTranslateText(request, options, callback); } + /** + * Check the status of the long running operation returned by the batchTranslateText() method. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * + * @example: + * const decodedOperation = await checkBatchTranslateTextProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkBatchTranslateTextProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.translation.v3.BatchTranslateResponse, + protos.google.cloud.translation.v3.BatchTranslateMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.batchTranslateText, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.translation.v3.BatchTranslateResponse, + protos.google.cloud.translation.v3.BatchTranslateMetadata + >; + } createGlossary( request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, options?: gax.CallOptions @@ -1100,6 +1136,42 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.createGlossary(request, options, callback); } + /** + * Check the status of the long running operation returned by the createGlossary() method. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * + * @example: + * const decodedOperation = await checkCreateGlossaryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkCreateGlossaryProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.translation.v3.Glossary, + protos.google.cloud.translation.v3.CreateGlossaryMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createGlossary, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.translation.v3.Glossary, + protos.google.cloud.translation.v3.CreateGlossaryMetadata + >; + } deleteGlossary( request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, options?: gax.CallOptions @@ -1200,6 +1272,42 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.deleteGlossary(request, options, callback); } + /** + * Check the status of the long running operation returned by the deleteGlossary() method. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * + * @example: + * const decodedOperation = await checkDeleteGlossaryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkDeleteGlossaryProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.translation.v3.DeleteGlossaryResponse, + protos.google.cloud.translation.v3.DeleteGlossaryMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteGlossary, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.translation.v3.DeleteGlossaryResponse, + protos.google.cloud.translation.v3.DeleteGlossaryMetadata + >; + } listGlossaries( request: protos.google.cloud.translation.v3.IListGlossariesRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index bb21fdfe704..3b4579100e4 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -32,7 +32,7 @@ import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './translation_service_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -1012,6 +1012,42 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.batchTranslateText(request, options, callback); } + /** + * Check the status of the long running operation returned by the batchTranslateText() method. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * + * @example: + * const decodedOperation = await checkBatchTranslateTextProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkBatchTranslateTextProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.translation.v3beta1.BatchTranslateResponse, + protos.google.cloud.translation.v3beta1.BatchTranslateMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.batchTranslateText, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.translation.v3beta1.BatchTranslateResponse, + protos.google.cloud.translation.v3beta1.BatchTranslateMetadata + >; + } createGlossary( request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, options?: gax.CallOptions @@ -1113,6 +1149,42 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.createGlossary(request, options, callback); } + /** + * Check the status of the long running operation returned by the createGlossary() method. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * + * @example: + * const decodedOperation = await checkCreateGlossaryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkCreateGlossaryProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.translation.v3beta1.Glossary, + protos.google.cloud.translation.v3beta1.CreateGlossaryMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createGlossary, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.translation.v3beta1.Glossary, + protos.google.cloud.translation.v3beta1.CreateGlossaryMetadata + >; + } deleteGlossary( request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, options?: gax.CallOptions @@ -1213,6 +1285,42 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.deleteGlossary(request, options, callback); } + /** + * Check the status of the long running operation returned by the deleteGlossary() method. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * + * @example: + * const decodedOperation = await checkDeleteGlossaryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkDeleteGlossaryProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.translation.v3beta1.DeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.DeleteGlossaryMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteGlossary, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.translation.v3beta1.DeleteGlossaryResponse, + protos.google.cloud.translation.v3beta1.DeleteGlossaryMetadata + >; + } listGlossaries( request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index d7af132f34e..ca2fabf5dc8 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "3f593aab5d8d9ff16350b203d4b8ec315b0c8ad7" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", - "internalRef": "307114445" + "remote": "git@github.com:googleapis/nodejs-translate.git", + "sha": "87160cda48ff8a13e5891f24118b94162da0f6f7" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" + "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" } } ], diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index a68415ee1ae..550b8a1e8a2 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -196,7 +196,7 @@ describe('translate', () => { let err: Error | null = null; try { const projectId = await translate.getProjectId(); - const [result] = await translate.getSupportedLanguages({ + await translate.getSupportedLanguages({ parent: `projects/${projectId}`, }); } catch (_err) { diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts index 1febe1880f1..43d4da0e20d 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -25,7 +25,7 @@ import * as translationserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -331,9 +331,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.translateText(request); - }, expectedError); + await assert.rejects(client.translateText(request), expectedError); assert( (client.innerApiCalls.translateText as SinonStub) .getCall(0) @@ -445,9 +443,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.detectLanguage(request); - }, expectedError); + await assert.rejects(client.detectLanguage(request), expectedError); assert( (client.innerApiCalls.detectLanguage as SinonStub) .getCall(0) @@ -561,9 +557,10 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getSupportedLanguages(request); - }, expectedError); + await assert.rejects( + client.getSupportedLanguages(request), + expectedError + ); assert( (client.innerApiCalls.getSupportedLanguages as SinonStub) .getCall(0) @@ -675,9 +672,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getGlossary(request); - }, expectedError); + await assert.rejects(client.getGlossary(request), expectedError); assert( (client.innerApiCalls.getGlossary as SinonStub) .getCall(0) @@ -799,9 +794,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.batchTranslateText(request); - }, expectedError); + await assert.rejects(client.batchTranslateText(request), expectedError); assert( (client.innerApiCalls.batchTranslateText as SinonStub) .getCall(0) @@ -834,15 +827,54 @@ describe('v3.TranslationServiceClient', () => { expectedError ); const [operation] = await client.batchTranslateText(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.batchTranslateText as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkBatchTranslateTextProgress without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchTranslateTextProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchTranslateTextProgress with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkBatchTranslateTextProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('createGlossary', () => { @@ -958,9 +990,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createGlossary(request); - }, expectedError); + await assert.rejects(client.createGlossary(request), expectedError); assert( (client.innerApiCalls.createGlossary as SinonStub) .getCall(0) @@ -993,15 +1023,54 @@ describe('v3.TranslationServiceClient', () => { expectedError ); const [operation] = await client.createGlossary(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.createGlossary as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkCreateGlossaryProgress without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateGlossaryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateGlossaryProgress with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateGlossaryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('deleteGlossary', () => { @@ -1117,9 +1186,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.deleteGlossary(request); - }, expectedError); + await assert.rejects(client.deleteGlossary(request), expectedError); assert( (client.innerApiCalls.deleteGlossary as SinonStub) .getCall(0) @@ -1152,15 +1219,54 @@ describe('v3.TranslationServiceClient', () => { expectedError ); const [operation] = await client.deleteGlossary(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.deleteGlossary as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkDeleteGlossaryProgress without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteGlossaryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGlossaryProgress with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteGlossaryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('listGlossaries', () => { @@ -1282,9 +1388,7 @@ describe('v3.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listGlossaries(request); - }, expectedError); + await assert.rejects(client.listGlossaries(request), expectedError); assert( (client.innerApiCalls.listGlossaries as SinonStub) .getCall(0) @@ -1381,9 +1485,7 @@ describe('v3.TranslationServiceClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listGlossaries.createStream as SinonStub) .getCall(0) diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts index ee05fbaad51..4d65c273d52 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -25,7 +25,7 @@ import * as translationserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -347,9 +347,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.translateText(request); - }, expectedError); + await assert.rejects(client.translateText(request), expectedError); assert( (client.innerApiCalls.translateText as SinonStub) .getCall(0) @@ -467,9 +465,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.detectLanguage(request); - }, expectedError); + await assert.rejects(client.detectLanguage(request), expectedError); assert( (client.innerApiCalls.detectLanguage as SinonStub) .getCall(0) @@ -589,9 +585,10 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getSupportedLanguages(request); - }, expectedError); + await assert.rejects( + client.getSupportedLanguages(request), + expectedError + ); assert( (client.innerApiCalls.getSupportedLanguages as SinonStub) .getCall(0) @@ -709,9 +706,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getGlossary(request); - }, expectedError); + await assert.rejects(client.getGlossary(request), expectedError); assert( (client.innerApiCalls.getGlossary as SinonStub) .getCall(0) @@ -839,9 +834,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.batchTranslateText(request); - }, expectedError); + await assert.rejects(client.batchTranslateText(request), expectedError); assert( (client.innerApiCalls.batchTranslateText as SinonStub) .getCall(0) @@ -876,15 +869,58 @@ describe('v3beta1.TranslationServiceClient', () => { expectedError ); const [operation] = await client.batchTranslateText(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.batchTranslateText as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkBatchTranslateTextProgress without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchTranslateTextProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchTranslateTextProgress with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkBatchTranslateTextProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('createGlossary', () => { @@ -1006,9 +1042,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createGlossary(request); - }, expectedError); + await assert.rejects(client.createGlossary(request), expectedError); assert( (client.innerApiCalls.createGlossary as SinonStub) .getCall(0) @@ -1043,15 +1077,58 @@ describe('v3beta1.TranslationServiceClient', () => { expectedError ); const [operation] = await client.createGlossary(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.createGlossary as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkCreateGlossaryProgress without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateGlossaryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateGlossaryProgress with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateGlossaryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('deleteGlossary', () => { @@ -1173,9 +1250,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.deleteGlossary(request); - }, expectedError); + await assert.rejects(client.deleteGlossary(request), expectedError); assert( (client.innerApiCalls.deleteGlossary as SinonStub) .getCall(0) @@ -1210,15 +1285,58 @@ describe('v3beta1.TranslationServiceClient', () => { expectedError ); const [operation] = await client.deleteGlossary(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.deleteGlossary as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkDeleteGlossaryProgress without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteGlossaryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGlossaryProgress with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteGlossaryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('listGlossaries', () => { @@ -1346,9 +1464,7 @@ describe('v3beta1.TranslationServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listGlossaries(request); - }, expectedError); + await assert.rejects(client.listGlossaries(request), expectedError); assert( (client.innerApiCalls.listGlossaries as SinonStub) .getCall(0) @@ -1449,9 +1565,7 @@ describe('v3beta1.TranslationServiceClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listGlossaries.createStream as SinonStub) .getCall(0) diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index 194d209687e..24ebb33a826 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -29,7 +29,7 @@ import * as orig from '../src'; // eslint-disable-next-line @typescript-eslint/no-var-requires const pkgJson = require('../../package.json'); -// tslint:disable-next-line no-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any let makeRequestOverride: any; let promisified = false; const fakePromisify = extend({}, pfy, { @@ -70,7 +70,7 @@ describe('Translate v2', () => { // tslint:disable-next-line variable-name let Translate: typeof orig.v2.Translate; - // tslint:disable-next-line no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any let translate: any; before(() => { @@ -98,7 +98,7 @@ describe('Translate v2', () => { it('should inherit from Service', () => { assert(translate instanceof FakeService); - // tslint:disable-next-line no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const calledWith = (translate as any).calledWith_[0]; const baseUrl = 'https://translation.googleapis.com/language/translate/v2'; @@ -144,7 +144,7 @@ describe('Translate v2', () => { describe('GOOGLE_CLOUD_TRANSLATE_ENDPOINT', () => { const CUSTOM_ENDPOINT = '...'; - // tslint:disable-next-line no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any let translate: any; before(() => { @@ -167,7 +167,7 @@ describe('Translate v2', () => { process.env.GOOGLE_CLOUD_TRANSLATE_ENDPOINT = 'http://localhost:8080//'; - // tslint:disable-next-line no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any const translate: any = new Translate(OPTIONS); const baseUrl = translate.calledWith_[0].baseUrl; From 15f54b05b77036719913a0eb4f950b57027c87b3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 6 May 2020 11:56:17 -0700 Subject: [PATCH 368/513] chore: linting --- .../google-cloud-translate/protos/protos.js | 604 +++++++++--------- .../google-cloud-translate/synth.metadata | 12 +- 2 files changed, 312 insertions(+), 304 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index ada34854095..29c842c39a3 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -430,9 +430,9 @@ TranslateTextGlossaryConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.glossary != null && message.hasOwnProperty("glossary")) + if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.glossary); - if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + if (message.ignoreCase != null && Object.hasOwnProperty.call(message, "ignoreCase")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignoreCase); return writer; }; @@ -699,19 +699,19 @@ if (message.contents != null && message.contents.length) for (var i = 0; i < message.contents.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.contents[i]); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetLanguageCode); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.model); - if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.parent); - if (message.labels != null && message.hasOwnProperty("labels")) + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -1296,13 +1296,13 @@ Translation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.translatedText != null && message.hasOwnProperty("translatedText")) + if (message.translatedText != null && Object.hasOwnProperty.call(message, "translatedText")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.translatedText); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + if (message.detectedLanguageCode != null && Object.hasOwnProperty.call(message, "detectedLanguageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.detectedLanguageCode); return writer; }; @@ -1579,15 +1579,15 @@ DetectLanguageRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.content != null && message.hasOwnProperty("content")) + if (message.content != null && Object.hasOwnProperty.call(message, "content")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.model); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.labels != null && message.hasOwnProperty("labels")) + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -1854,9 +1854,9 @@ DetectedLanguage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); - if (message.confidence != null && message.hasOwnProperty("confidence")) + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); return writer; }; @@ -2281,11 +2281,11 @@ GetSupportedLanguagesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayLanguageCode != null && message.hasOwnProperty("displayLanguageCode")) + if (message.displayLanguageCode != null && Object.hasOwnProperty.call(message, "displayLanguageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayLanguageCode); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); return writer; }; @@ -2730,13 +2730,13 @@ SupportedLanguage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.supportSource != null && message.hasOwnProperty("supportSource")) + if (message.supportSource != null && Object.hasOwnProperty.call(message, "supportSource")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.supportSource); - if (message.supportTarget != null && message.hasOwnProperty("supportTarget")) + if (message.supportTarget != null && Object.hasOwnProperty.call(message, "supportTarget")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.supportTarget); return writer; }; @@ -2957,7 +2957,7 @@ GcsSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); return writer; }; @@ -3167,9 +3167,9 @@ InputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) $root.google.cloud.translation.v3.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -3378,7 +3378,7 @@ GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + if (message.outputUriPrefix != null && Object.hasOwnProperty.call(message, "outputUriPrefix")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); return writer; }; @@ -3579,7 +3579,7 @@ OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) $root.google.cloud.translation.v3.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -3844,27 +3844,27 @@ BatchTranslateTextRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) for (var i = 0; i < message.targetLanguageCodes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); - if (message.models != null && message.hasOwnProperty("models")) + if (message.models != null && Object.hasOwnProperty.call(message, "models")) for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); if (message.inputConfigs != null && message.inputConfigs.length) for (var i = 0; i < message.inputConfigs.length; ++i) $root.google.cloud.translation.v3.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.translation.v3.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.glossaries != null && message.hasOwnProperty("glossaries")) + if (message.glossaries != null && Object.hasOwnProperty.call(message, "glossaries")) for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.labels != null && message.hasOwnProperty("labels")) + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -4268,15 +4268,15 @@ BatchTranslateMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalCharacters); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -4532,7 +4532,7 @@ /** * State enum. * @name google.cloud.translation.v3.BatchTranslateMetadata.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -4646,15 +4646,15 @@ BatchTranslateResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalCharacters); - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -4952,7 +4952,7 @@ GlossaryInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) $root.google.cloud.translation.v3.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -5217,19 +5217,19 @@ Glossary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.languagePair != null && message.hasOwnProperty("languagePair")) + if (message.languagePair != null && Object.hasOwnProperty.call(message, "languagePair")) $root.google.cloud.translation.v3.Glossary.LanguageCodePair.encode(message.languagePair, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) + if (message.languageCodesSet != null && Object.hasOwnProperty.call(message, "languageCodesSet")) $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.encode(message.languageCodesSet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) $root.google.cloud.translation.v3.GlossaryInputConfig.encode(message.inputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.entryCount != null && message.hasOwnProperty("entryCount")) + if (message.entryCount != null && Object.hasOwnProperty.call(message, "entryCount")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.entryCount); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -5527,9 +5527,9 @@ LanguageCodePair.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); return writer; }; @@ -5943,9 +5943,9 @@ CreateGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.glossary != null && message.hasOwnProperty("glossary")) + if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) $root.google.cloud.translation.v3.Glossary.encode(message.glossary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -6149,7 +6149,7 @@ GetGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -6336,7 +6336,7 @@ DeleteGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -6550,13 +6550,13 @@ ListGlossariesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); return writer; }; @@ -6790,7 +6790,7 @@ if (message.glossaries != null && message.glossaries.length) for (var i = 0; i < message.glossaries.length; ++i) $root.google.cloud.translation.v3.Glossary.encode(message.glossaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -7026,11 +7026,11 @@ CreateGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -7222,7 +7222,7 @@ /** * State enum. * @name google.cloud.translation.v3.CreateGlossaryMetadata.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -7318,11 +7318,11 @@ DeleteGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -7514,7 +7514,7 @@ /** * State enum. * @name google.cloud.translation.v3.DeleteGlossaryMetadata.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -7610,11 +7610,11 @@ DeleteGlossaryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -8154,9 +8154,9 @@ TranslateTextGlossaryConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.glossary != null && message.hasOwnProperty("glossary")) + if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.glossary); - if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + if (message.ignoreCase != null && Object.hasOwnProperty.call(message, "ignoreCase")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignoreCase); return writer; }; @@ -8423,19 +8423,19 @@ if (message.contents != null && message.contents.length) for (var i = 0; i < message.contents.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.contents[i]); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetLanguageCode); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.model); - if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.parent); - if (message.labels != null && message.hasOwnProperty("labels")) + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -9020,13 +9020,13 @@ Translation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.translatedText != null && message.hasOwnProperty("translatedText")) + if (message.translatedText != null && Object.hasOwnProperty.call(message, "translatedText")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.translatedText); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + if (message.detectedLanguageCode != null && Object.hasOwnProperty.call(message, "detectedLanguageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.detectedLanguageCode); return writer; }; @@ -9303,15 +9303,15 @@ DetectLanguageRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.content != null && message.hasOwnProperty("content")) + if (message.content != null && Object.hasOwnProperty.call(message, "content")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.model); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.labels != null && message.hasOwnProperty("labels")) + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -9578,9 +9578,9 @@ DetectedLanguage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); - if (message.confidence != null && message.hasOwnProperty("confidence")) + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); return writer; }; @@ -10005,11 +10005,11 @@ GetSupportedLanguagesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayLanguageCode != null && message.hasOwnProperty("displayLanguageCode")) + if (message.displayLanguageCode != null && Object.hasOwnProperty.call(message, "displayLanguageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayLanguageCode); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); return writer; }; @@ -10454,13 +10454,13 @@ SupportedLanguage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.supportSource != null && message.hasOwnProperty("supportSource")) + if (message.supportSource != null && Object.hasOwnProperty.call(message, "supportSource")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.supportSource); - if (message.supportTarget != null && message.hasOwnProperty("supportTarget")) + if (message.supportTarget != null && Object.hasOwnProperty.call(message, "supportTarget")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.supportTarget); return writer; }; @@ -10681,7 +10681,7 @@ GcsSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); return writer; }; @@ -10891,9 +10891,9 @@ InputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) $root.google.cloud.translation.v3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -11102,7 +11102,7 @@ GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + if (message.outputUriPrefix != null && Object.hasOwnProperty.call(message, "outputUriPrefix")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); return writer; }; @@ -11303,7 +11303,7 @@ OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) $root.google.cloud.translation.v3beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -11568,27 +11568,27 @@ BatchTranslateTextRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) for (var i = 0; i < message.targetLanguageCodes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); - if (message.models != null && message.hasOwnProperty("models")) + if (message.models != null && Object.hasOwnProperty.call(message, "models")) for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); if (message.inputConfigs != null && message.inputConfigs.length) for (var i = 0; i < message.inputConfigs.length; ++i) $root.google.cloud.translation.v3beta1.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.translation.v3beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.glossaries != null && message.hasOwnProperty("glossaries")) + if (message.glossaries != null && Object.hasOwnProperty.call(message, "glossaries")) for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.labels != null && message.hasOwnProperty("labels")) + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; @@ -11992,15 +11992,15 @@ BatchTranslateMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalCharacters); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -12256,7 +12256,7 @@ /** * State enum. * @name google.cloud.translation.v3beta1.BatchTranslateMetadata.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -12370,15 +12370,15 @@ BatchTranslateResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalCharacters); - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -12676,7 +12676,7 @@ GlossaryInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) $root.google.cloud.translation.v3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -12941,19 +12941,19 @@ Glossary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.languagePair != null && message.hasOwnProperty("languagePair")) + if (message.languagePair != null && Object.hasOwnProperty.call(message, "languagePair")) $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.encode(message.languagePair, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) + if (message.languageCodesSet != null && Object.hasOwnProperty.call(message, "languageCodesSet")) $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.encode(message.languageCodesSet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) $root.google.cloud.translation.v3beta1.GlossaryInputConfig.encode(message.inputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.entryCount != null && message.hasOwnProperty("entryCount")) + if (message.entryCount != null && Object.hasOwnProperty.call(message, "entryCount")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.entryCount); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -13251,9 +13251,9 @@ LanguageCodePair.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); return writer; }; @@ -13667,9 +13667,9 @@ CreateGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.glossary != null && message.hasOwnProperty("glossary")) + if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) $root.google.cloud.translation.v3beta1.Glossary.encode(message.glossary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -13873,7 +13873,7 @@ GetGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -14060,7 +14060,7 @@ DeleteGlossaryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -14274,13 +14274,13 @@ ListGlossariesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); return writer; }; @@ -14514,7 +14514,7 @@ if (message.glossaries != null && message.glossaries.length) for (var i = 0; i < message.glossaries.length; ++i) $root.google.cloud.translation.v3beta1.Glossary.encode(message.glossaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -14750,11 +14750,11 @@ CreateGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -14946,7 +14946,7 @@ /** * State enum. * @name google.cloud.translation.v3beta1.CreateGlossaryMetadata.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -15042,11 +15042,11 @@ DeleteGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -15238,7 +15238,7 @@ /** * State enum. * @name google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} RUNNING=1 RUNNING value * @property {number} SUCCEEDED=2 SUCCEEDED value @@ -15334,11 +15334,11 @@ DeleteGlossaryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.submitTime != null && message.hasOwnProperty("submitTime")) + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -15589,7 +15589,7 @@ if (message.rules != null && message.rules.length) for (var i = 0; i < message.rules.length; ++i) $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; @@ -15903,26 +15903,26 @@ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) + if (message.get != null && Object.hasOwnProperty.call(message, "get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) + if (message.put != null && Object.hasOwnProperty.call(message, "put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) + if (message.post != null && Object.hasOwnProperty.call(message, "post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) + if (message.body != null && Object.hasOwnProperty.call(message, "body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.additionalBindings != null && message.additionalBindings.length) for (var i = 0; i < message.additionalBindings.length; ++i) $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; @@ -16279,9 +16279,9 @@ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) + if (message.path != null && Object.hasOwnProperty.call(message, "path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; @@ -16427,7 +16427,7 @@ /** * FieldBehavior enum. * @name google.api.FieldBehavior - * @enum {string} + * @enum {number} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value @@ -16548,18 +16548,18 @@ ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); if (message.pattern != null && message.pattern.length) for (var i = 0; i < message.pattern.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && message.hasOwnProperty("nameField")) + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) + if (message.history != null && Object.hasOwnProperty.call(message, "history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; @@ -16779,7 +16779,7 @@ /** * History enum. * @name google.api.ResourceDescriptor.History - * @enum {string} + * @enum {number} * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value @@ -16860,9 +16860,9 @@ ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; @@ -17387,9 +17387,9 @@ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && message.hasOwnProperty("package")) + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); if (message.dependency != null && message.dependency.length) for (var i = 0; i < message.dependency.length; ++i) @@ -17406,9 +17406,9 @@ if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.publicDependency != null && message.publicDependency.length) for (var i = 0; i < message.publicDependency.length; ++i) @@ -17416,7 +17416,7 @@ if (message.weakDependency != null && message.weakDependency.length) for (var i = 0; i < message.weakDependency.length; ++i) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && message.hasOwnProperty("syntax")) + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; @@ -17954,7 +17954,7 @@ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.field != null && message.field.length) for (var i = 0; i < message.field.length; ++i) @@ -17971,7 +17971,7 @@ if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.oneofDecl != null && message.oneofDecl.length) for (var i = 0; i < message.oneofDecl.length; ++i) @@ -18436,11 +18436,11 @@ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -18664,9 +18664,9 @@ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -19157,25 +19157,25 @@ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && message.hasOwnProperty("extendee")) + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && message.hasOwnProperty("label")) + if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && message.hasOwnProperty("typeName")) + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); return writer; }; @@ -19522,7 +19522,7 @@ /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} + * @enum {number} * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value * @property {number} TYPE_INT64=3 TYPE_INT64 value @@ -19568,7 +19568,7 @@ /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label - * @enum {string} + * @enum {number} * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value @@ -19649,9 +19649,9 @@ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -19894,12 +19894,12 @@ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.value != null && message.value.length) for (var i = 0; i < message.value.length; ++i) $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) @@ -20202,9 +20202,9 @@ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -20424,11 +20424,11 @@ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -20662,12 +20662,12 @@ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.method != null && message.method.length) for (var i = 0; i < message.method.length; ++i) $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -20947,17 +20947,17 @@ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && message.hasOwnProperty("inputType")) + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && message.hasOwnProperty("outputType")) + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; @@ -21396,45 +21396,45 @@ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -21861,7 +21861,7 @@ /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} + * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value @@ -21979,18 +21979,18 @@ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -22332,17 +22332,17 @@ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype != null && message.hasOwnProperty("ctype")) + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && message.hasOwnProperty("packed")) + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && message.hasOwnProperty("lazy")) + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && message.hasOwnProperty("jstype")) + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && message.hasOwnProperty("weak")) + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -22353,7 +22353,7 @@ writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; @@ -22689,7 +22689,7 @@ /** * CType enum. * @name google.protobuf.FieldOptions.CType - * @enum {string} + * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value @@ -22705,7 +22705,7 @@ /** * JSType enum. * @name google.protobuf.FieldOptions.JSType - * @enum {string} + * @enum {number} * @property {number} JS_NORMAL=0 JS_NORMAL value * @property {number} JS_STRING=1 JS_STRING value * @property {number} JS_NUMBER=2 JS_NUMBER value @@ -23004,9 +23004,9 @@ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -23249,7 +23249,7 @@ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -23498,14 +23498,14 @@ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; @@ -23793,19 +23793,19 @@ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; @@ -24055,7 +24055,7 @@ /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {string} + * @enum {number} * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value * @property {number} IDEMPOTENT=2 IDEMPOTENT value @@ -24185,17 +24185,17 @@ if (message.name != null && message.name.length) for (var i = 0; i < message.name.length; ++i) $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; @@ -24972,9 +24972,9 @@ writer.int32(message.span[i]); writer.ldelim(); } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) for (var i = 0; i < message.leadingDetachedComments.length; ++i) @@ -25505,11 +25505,11 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && message.hasOwnProperty("begin")) + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; @@ -25762,9 +25762,9 @@ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && message.hasOwnProperty("type_url")) + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; @@ -25981,9 +25981,9 @@ Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -26365,9 +26365,9 @@ Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -26842,15 +26842,15 @@ Operation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && message.hasOwnProperty("metadata")) + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && message.hasOwnProperty("done")) + if (message.done != null && Object.hasOwnProperty.call(message, "done")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && message.hasOwnProperty("error")) + if (message.error != null && Object.hasOwnProperty.call(message, "error")) $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && message.hasOwnProperty("response")) + if (message.response != null && Object.hasOwnProperty.call(message, "response")) $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -27110,7 +27110,7 @@ GetOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -27324,13 +27324,13 @@ ListOperationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; @@ -27564,7 +27564,7 @@ if (message.operations != null && message.operations.length) for (var i = 0; i < message.operations.length; ++i) $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -27782,7 +27782,7 @@ CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -27969,7 +27969,7 @@ DeleteOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -28165,9 +28165,9 @@ WaitOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && message.hasOwnProperty("timeout")) + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -28380,9 +28380,9 @@ OperationInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.responseType != null && message.hasOwnProperty("responseType")) + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); return writer; }; @@ -28612,9 +28612,9 @@ Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); if (message.details != null && message.details.length) for (var i = 0; i < message.details.length; ++i) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index ca2fabf5dc8..665ed676b6a 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -3,8 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-translate.git", - "sha": "87160cda48ff8a13e5891f24118b94162da0f6f7" + "remote": "https://github.com/googleapis/nodejs-translate.git", + "sha": "6e6907da0187d05797967b80d2d75c25125658aa" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "a3a0bf0f6291d69f2ff3df7fcd63d28ee20ac727", + "internalRef": "310060413" } }, { From 8bb2ebb6fad4b3bf88fdb940bbfad7250bae3274 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 May 2020 11:29:26 -0700 Subject: [PATCH 369/513] build: do not fail builds on codecov errors (#528) (#533) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/2f68300a-9812-4342-86c6-33ab267ece4f/targets Source-Link: https://github.com/googleapis/synthtool/commit/be74d3e532faa47eb59f1a0eaebde0860d1d8ab4 --- packages/google-cloud-translate/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 665ed676b6a..78ef8d72909 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "6e6907da0187d05797967b80d2d75c25125658aa" + "sha": "4bfc40b5de827409ec1d57a38bb4f35b01017c64" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" + "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" } } ], From a21a7474f76949318bb11dec64d4cb10c64beadd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 15 May 2020 20:04:18 +0200 Subject: [PATCH 370/513] chore(deps): update dependency @google-cloud/storage to v5 (#534) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@google-cloud/storage](https://togithub.com/googleapis/nodejs-storage) | devDependencies | major | [`^4.0.0` -> `^5.0.0`](https://renovatebot.com/diffs/npm/@google-cloud%2fstorage/4.7.0/5.0.0) | --- ### Release Notes
googleapis/nodejs-storage ### [`v5.0.0`](https://togithub.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md#​500-httpswwwgithubcomgoogleapisnodejs-storagecomparev470v500-2020-05-13) [Compare Source](https://togithub.com/googleapis/nodejs-storage/compare/v4.7.0...v5.0.0) ##### ⚠ BREAKING CHANGES - automatically detect contentType if not provided ([#​1190](https://togithub.com/googleapis/nodejs-storage/issues/1190)) - drop keepAcl parameter in file copy ([#​1166](https://togithub.com/googleapis/nodejs-storage/issues/1166)) - drop support for node.js 8.x ##### Features - automatically detect contentType if not provided ([#​1190](https://www.github.com/googleapis/nodejs-storage/issues/1190)) ([b31ba4a](https://www.github.com/googleapis/nodejs-storage/commit/b31ba4a11399b57538ddf0d6ca2e10b2aa3fbc3a)) - enable bytes read tracking ([#​1074](https://www.github.com/googleapis/nodejs-storage/issues/1074)) ([0776a04](https://www.github.com/googleapis/nodejs-storage/commit/0776a044f3b2149b485e114369e952688df75645)) ##### Bug Fixes - **bucket:** Only disable resumable uploads for bucket.upload (fixes [#​1133](https://www.github.com/googleapis/nodejs-storage/issues/1133)) ([#​1135](https://www.github.com/googleapis/nodejs-storage/issues/1135)) ([2c20148](https://www.github.com/googleapis/nodejs-storage/commit/2c201486b7b2d3146846ac96c877a904c4a674b0)), closes [/github.com/googleapis/nodejs-storage/pull/1135#issuecomment-620070038](https://www.github.com/googleapis//github.com/googleapis/nodejs-storage/pull/1135/issues/issuecomment-620070038) - add whitespace to generateV4SignedPolicy ([#​1136](https://www.github.com/googleapis/nodejs-storage/issues/1136)) ([dcee78b](https://www.github.com/googleapis/nodejs-storage/commit/dcee78b98da23b02fe7d2f13a9270546bc07bba8)) - apache license URL ([#​468](https://www.github.com/googleapis/nodejs-storage/issues/468)) ([#​1151](https://www.github.com/googleapis/nodejs-storage/issues/1151)) ([e8116d3](https://www.github.com/googleapis/nodejs-storage/commit/e8116d3c6fa7412858692e67745b514eef78850e)) - Point to team in correct org ([#​1185](https://www.github.com/googleapis/nodejs-storage/issues/1185)) ([0bb1909](https://www.github.com/googleapis/nodejs-storage/commit/0bb19098013acf71cc3842f78ff333a8e356331a)) - **deps:** update dependency [@​google-cloud/common](https://togithub.com/google-cloud/common) to v3 ([#​1134](https://www.github.com/googleapis/nodejs-storage/issues/1134)) ([774ac5c](https://www.github.com/googleapis/nodejs-storage/commit/774ac5c75f02238418cc8ed7242297ea573ca9cb)) - **deps:** update dependency [@​google-cloud/paginator](https://togithub.com/google-cloud/paginator) to v3 ([#​1131](https://www.github.com/googleapis/nodejs-storage/issues/1131)) ([c1614d9](https://www.github.com/googleapis/nodejs-storage/commit/c1614d98e3047db379e09299b1014e80d73ed52f)) - **deps:** update dependency [@​google-cloud/promisify](https://togithub.com/google-cloud/promisify) to v2 ([#​1127](https://www.github.com/googleapis/nodejs-storage/issues/1127)) ([06624a5](https://www.github.com/googleapis/nodejs-storage/commit/06624a534cd1fdbc38455eee8d89f9f60ba75758)) - **deps:** update dependency uuid to v8 ([#​1170](https://www.github.com/googleapis/nodejs-storage/issues/1170)) ([6a98d64](https://www.github.com/googleapis/nodejs-storage/commit/6a98d64831baf1ca1ec2f03ecc4914745cba1c86)) - **deps:** update gcs-resumable-upload, remove gitnpm usage ([#​1186](https://www.github.com/googleapis/nodejs-storage/issues/1186)) ([c78c9cd](https://www.github.com/googleapis/nodejs-storage/commit/c78c9cde49dccb2fcd4ce10e4e9f8299d65f6838)) - **v4-policy:** encode special characters ([#​1169](https://www.github.com/googleapis/nodejs-storage/issues/1169)) ([6e48539](https://www.github.com/googleapis/nodejs-storage/commit/6e48539d76ca27e6f4c6cf2ac0872970f7391fed)) - sync to [googleapis/conformance-tests@`fa559a1`](https://togithub.com/googleapis/conformance-tests/commit/fa559a1) ([#​1167](https://www.github.com/googleapis/nodejs-storage/issues/1167)) ([5500446](https://www.github.com/googleapis/nodejs-storage/commit/550044619d2f17a1977c83bce5df915c6dc9578c)), closes [#​1168](https://www.github.com/googleapis/nodejs-storage/issues/1168) ##### Miscellaneous Chores - drop keepAcl parameter in file copy ([#​1166](https://www.github.com/googleapis/nodejs-storage/issues/1166)) ([5a4044a](https://www.github.com/googleapis/nodejs-storage/commit/5a4044a8ba13f248fc4f791248f797eb0f1f3c16)) ##### Build System - drop support for node.js 8.x ([b80c025](https://www.github.com/googleapis/nodejs-storage/commit/b80c025f106052fd25554c64314b3b3520e829b5))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-translate). --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 7ddd1fb8814..36e7986f8f0 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -21,7 +21,7 @@ "yargs": "^15.0.0" }, "devDependencies": { - "@google-cloud/storage": "^4.0.0", + "@google-cloud/storage": "^5.0.0", "chai": "^4.2.0", "mocha": "^7.0.0", "uuid": "^8.0.0" From 762e1ed8ae9ae455e3fce7e23926662d2e524b55 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Jun 2020 16:26:34 -0700 Subject: [PATCH 371/513] chore: updates to protos.js --- .../google-cloud-translate/protos/protos.d.ts | 6 +++++ .../google-cloud-translate/protos/protos.js | 26 +++++++++++++++++-- .../google-cloud-translate/protos/protos.json | 6 ++++- .../google-cloud-translate/synth.metadata | 2 +- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index cd698846872..a9b8988b123 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -7718,6 +7718,9 @@ export namespace google { /** FieldDescriptorProto options */ options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); } /** Represents a FieldDescriptorProto. */ @@ -7759,6 +7762,9 @@ export namespace google { /** FieldDescriptorProto options. */ public options?: (google.protobuf.IFieldOptions|null); + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + /** * Creates a new FieldDescriptorProto instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index 29c842c39a3..cf889b8d7b0 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -19036,6 +19036,7 @@ * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex * @property {string|null} [jsonName] FieldDescriptorProto jsonName * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional */ /** @@ -19133,6 +19134,14 @@ */ FieldDescriptorProto.prototype.options = null; + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + /** * Creates a new FieldDescriptorProto instance using the specified properties. * @function create @@ -19177,6 +19186,8 @@ writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); return writer; }; @@ -19241,6 +19252,9 @@ case 8: message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); break; + case 17: + message.proto3Optional = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -19335,6 +19349,9 @@ if (error) return "options." + error; } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; return null; }; @@ -19457,6 +19474,8 @@ throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); return message; }; @@ -19484,6 +19503,7 @@ object.options = null; object.oneofIndex = 0; object.jsonName = ""; + object.proto3Optional = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -19505,6 +19525,8 @@ object.oneofIndex = message.oneofIndex; if (message.jsonName != null && message.hasOwnProperty("jsonName")) object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; return object; }; @@ -21298,7 +21320,7 @@ * @memberof google.protobuf.FileOptions * @instance */ - FileOptions.prototype.ccEnableArenas = false; + FileOptions.prototype.ccEnableArenas = true; /** * FileOptions objcClassPrefix. @@ -21784,7 +21806,7 @@ object.javaGenerateEqualsAndHash = false; object.deprecated = false; object.javaStringCheckUtf8 = false; - object.ccEnableArenas = false; + object.ccEnableArenas = true; object.objcClassPrefix = ""; object.csharpNamespace = ""; object.swiftPrefix = ""; diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index 4208aec51ea..d4b117ee9d9 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -1969,6 +1969,10 @@ "options": { "type": "FieldOptions", "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 } }, "nested": { @@ -2204,7 +2208,7 @@ "type": "bool", "id": 31, "options": { - "default": false + "default": true } }, "objcClassPrefix": { diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 78ef8d72909..d5e50da99a8 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "4bfc40b5de827409ec1d57a38bb4f35b01017c64" + "sha": "d0f5679b2e74c06e19feb0ff6935afc7bfa4ca10" } }, { From ee2fc304f39b12ad6870a33288ef86229f1a85ac Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2020 11:06:53 -0700 Subject: [PATCH 372/513] chore: release 6.0.0 (#483) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-translate/CHANGELOG.md | 21 +++++++++++++++++++ packages/google-cloud-translate/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index fde6c8476a6..fa858d491c9 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,27 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [6.0.0](https://www.github.com/googleapis/nodejs-translate/compare/v5.3.0...v6.0.0) (2020-06-03) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* check status of long running operation by its name; fix linting ([#531](https://www.github.com/googleapis/nodejs-translate/issues/531)) ([6e6907d](https://www.github.com/googleapis/nodejs-translate/commit/6e6907da0187d05797967b80d2d75c25125658aa)) +* drop node8 support, support for async iterators ([#482](https://www.github.com/googleapis/nodejs-translate/issues/482)) ([4a5f047](https://www.github.com/googleapis/nodejs-translate/commit/4a5f047f141dbe5dd0d6979351a36d9c2232f22e)) + + +### Bug Fixes + +* ensure scoped protobuf ([#500](https://www.github.com/googleapis/nodejs-translate/issues/500)) ([5793c23](https://www.github.com/googleapis/nodejs-translate/commit/5793c2306f7c028be093465a08d41824e48ed492)) +* remove eslint, update gax, fix generated protos, run the generator ([#507](https://www.github.com/googleapis/nodejs-translate/issues/507)) ([8f43605](https://www.github.com/googleapis/nodejs-translate/commit/8f4360505e4b86fe6729f96f34488aec84a5a1b6)) +* **deps:** update dependency @google-cloud/automl to v2 ([#503](https://www.github.com/googleapis/nodejs-translate/issues/503)) ([8ba77fe](https://www.github.com/googleapis/nodejs-translate/commit/8ba77fe702fef017b9f59678f9503705d16efe75)) +* **deps:** update dependency @google-cloud/common to v3 ([#481](https://www.github.com/googleapis/nodejs-translate/issues/481)) ([fc719f0](https://www.github.com/googleapis/nodejs-translate/commit/fc719f08804299a3c8086a3eff393fbf8f1fde80)) +* **deps:** update dependency @google-cloud/promisify to v2 ([#476](https://www.github.com/googleapis/nodejs-translate/issues/476)) ([bbbfa9f](https://www.github.com/googleapis/nodejs-translate/commit/bbbfa9f3223d39b5b78b9972d61eb8fb77bddafa)) + ## [5.3.0](https://www.github.com/googleapis/nodejs-translate/compare/v5.2.0...v5.3.0) (2020-03-06) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c79a1eb4ce2..36d41827b75 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "5.3.0", + "version": "6.0.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 36e7986f8f0..2ace4bdb27f 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^1.1.4", - "@google-cloud/translate": "^5.3.0", + "@google-cloud/translate": "^6.0.0", "@google-cloud/vision": "^1.2.0", "yargs": "^15.0.0" }, From 5ec053aa8c1107decbd0cb61522c7d70196eeeb6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 5 Jun 2020 17:56:26 +0200 Subject: [PATCH 373/513] fix(deps): update dependency @google-cloud/vision to v2 (#539) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 2ace4bdb27f..f85d28a9b82 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -17,7 +17,7 @@ "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^1.1.4", "@google-cloud/translate": "^6.0.0", - "@google-cloud/vision": "^1.2.0", + "@google-cloud/vision": "^2.0.0", "yargs": "^15.0.0" }, "devDependencies": { From 097f8c91330557ef9bb1cdfe4b15c3026fdc2e5f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 11 Jun 2020 22:38:01 +0200 Subject: [PATCH 374/513] chore(deps): update dependency mocha to v8 (#545) --- packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 36d41827b75..c76b4ad81bf 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -70,7 +70,7 @@ "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.0", - "mocha": "^7.0.0", + "mocha": "^8.0.0", "pack-n-play": "^1.0.0-2", "proxyquire": "^2.0.1", "sinon": "^9.0.1", diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index f85d28a9b82..528b088fd69 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -23,7 +23,7 @@ "devDependencies": { "@google-cloud/storage": "^5.0.0", "chai": "^4.2.0", - "mocha": "^7.0.0", + "mocha": "^8.0.0", "uuid": "^8.0.0" } } From 3d1e8e72efdbed0625978eed80672197930f190f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 11 Jun 2020 17:52:54 -0700 Subject: [PATCH 375/513] build(secrets): begin migration to secret manager from keystore (#543) * changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * feat(secrets): begin migration to secret manager from keystore Source-Author: Benjamin E. Coe Source-Date: Mon Jun 8 09:51:11 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 1c92077459db3dc50741e878f98b08c6261181e0 Source-Link: https://github.com/googleapis/synthtool/commit/1c92077459db3dc50741e878f98b08c6261181e0 Co-authored-by: Benjamin E. Coe Co-authored-by: Alexander Fenster --- packages/google-cloud-translate/protos/protos.js | 2 +- .../src/v3/translation_service_client.ts | 7 +++++++ .../src/v3beta1/translation_service_client.ts | 7 +++++++ packages/google-cloud-translate/synth.metadata | 4 ++-- packages/google-cloud-translate/tsconfig.json | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index cf889b8d7b0..b1c1ec7df7a 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_translate_5_3_0_protos || ($protobuf.roots._google_cloud_translate_5_3_0_protos = {}); + var $root = $protobuf.roots._google_cloud_translate_protos || ($protobuf.roots._google_cloud_translate_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 26f0f93b5f2..71769fafbaa 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -101,6 +101,13 @@ export class TranslationServiceClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 3b4579100e4..dc0920d4fb3 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -101,6 +101,13 @@ export class TranslationServiceClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index d5e50da99a8..d97690497ba 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "d0f5679b2e74c06e19feb0ff6935afc7bfa4ca10" + "sha": "5dbeac4e9a3133a6008cd8fb882046fe4a9946bc" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" + "sha": "1c92077459db3dc50741e878f98b08c6261181e0" } } ], diff --git a/packages/google-cloud-translate/tsconfig.json b/packages/google-cloud-translate/tsconfig.json index 613d35597b5..c78f1c884ef 100644 --- a/packages/google-cloud-translate/tsconfig.json +++ b/packages/google-cloud-translate/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "build", "resolveJsonModule": true, "lib": [ - "es2016", + "es2018", "dom" ] }, From e00705000d34e01249d11f7d1edfb9b46778c81d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 12 Jun 2020 11:03:02 -0700 Subject: [PATCH 376/513] fix: handle fallback option properly (#547) * changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * chore(nodejs_templates): add script logging to node_library populate-secrets.sh Co-authored-by: Benjamin E. Coe Source-Author: BenWhitehead Source-Date: Wed Jun 10 22:24:28 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: e7034945fbdc0e79d3c57f6e299e5c90b0f11469 Source-Link: https://github.com/googleapis/synthtool/commit/e7034945fbdc0e79d3c57f6e299e5c90b0f11469 --- .../src/v3/translation_service_client.ts | 13 +++++-------- .../src/v3beta1/translation_service_client.ts | 13 +++++-------- packages/google-cloud-translate/synth.metadata | 4 ++-- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 71769fafbaa..f99587697e0 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -110,14 +110,11 @@ export class TranslationServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the TranslationServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index dc0920d4fb3..12a02a3db78 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -110,14 +110,11 @@ export class TranslationServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the TranslationServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index d97690497ba..1216a3ee482 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "5dbeac4e9a3133a6008cd8fb882046fe4a9946bc" + "sha": "bcdef0f990d660857121d9d2f2dbe64c4c0da7d8" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1c92077459db3dc50741e878f98b08c6261181e0" + "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" } } ], From c02646135445b0117cb03a8829a635ab249bda77 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Jun 2020 19:24:07 +0200 Subject: [PATCH 377/513] fix(deps): update dependency @google-cloud/text-to-speech to v3 (#538) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@google-cloud/text-to-speech](https://togithub.com/googleapis/nodejs-text-to-speech) | dependencies | major | [`^1.1.4` -> `^3.0.0`](https://renovatebot.com/diffs/npm/@google-cloud%2ftext-to-speech/1.4.1/3.0.0) | --- ### Release Notes
googleapis/nodejs-text-to-speech ### [`v3.0.0`](https://togithub.com/googleapis/nodejs-text-to-speech/blob/master/CHANGELOG.md#​300-httpswwwgithubcomgoogleapisnodejs-text-to-speechcomparev230v300-2020-06-04) [Compare Source](https://togithub.com/googleapis/nodejs-text-to-speech/compare/v2.3.0...v3.0.0) ##### ⚠ BREAKING CHANGES - The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. ##### Features - drop node8 support ([#​373](https://www.github.com/googleapis/nodejs-text-to-speech/issues/373)) ([21e3598](https://www.github.com/googleapis/nodejs-text-to-speech/commit/21e359885c39d4dfc6ed0a231fd66d35628fa0cb)) ##### Bug Fixes - regen protos and tests, formatting ([#​401](https://www.github.com/googleapis/nodejs-text-to-speech/issues/401)) ([6c7d38a](https://www.github.com/googleapis/nodejs-text-to-speech/commit/6c7d38a0a217d6d7a7d77dcde3756b10e47fb220)) - remove eslint, update gax, fix generated protos, run the generator ([#​385](https://www.github.com/googleapis/nodejs-text-to-speech/issues/385)) ([f035747](https://www.github.com/googleapis/nodejs-text-to-speech/commit/f0357470f152c97a8203edeff2a8385068e3e316)) - remove unused files in package ([#​389](https://www.github.com/googleapis/nodejs-text-to-speech/issues/389)) ([7b1e5e4](https://www.github.com/googleapis/nodejs-text-to-speech/commit/7b1e5e4abe442e54219b53a7e17ab20c0c277995)) - synth.py clean up for multiple version ([#​403](https://www.github.com/googleapis/nodejs-text-to-speech/issues/403)) ([1b36546](https://www.github.com/googleapis/nodejs-text-to-speech/commit/1b36546437ec40e882d771c238a2926a5c18eee9)) ### [`v2.3.0`](https://togithub.com/googleapis/nodejs-text-to-speech/blob/master/CHANGELOG.md#​230-httpswwwgithubcomgoogleapisnodejs-text-to-speechcomparev220v230-2020-03-06) [Compare Source](https://togithub.com/googleapis/nodejs-text-to-speech/compare/v2.2.0...v2.3.0) ##### Features - deferred client initialization ([#​359](https://www.github.com/googleapis/nodejs-text-to-speech/issues/359)) ([547fb77](https://www.github.com/googleapis/nodejs-text-to-speech/commit/547fb77d625a6c25ef288e8bdad19d448113271e)) - export protos in src/index.ts ([b6ca82f](https://www.github.com/googleapis/nodejs-text-to-speech/commit/b6ca82f901d4791d3d4994a5782c7f19d449becf)) ### [`v2.2.0`](https://togithub.com/googleapis/nodejs-text-to-speech/blob/master/CHANGELOG.md#​220-httpswwwgithubcomgoogleapisnodejs-text-to-speechcomparev213v220-2020-02-12) [Compare Source](https://togithub.com/googleapis/nodejs-text-to-speech/compare/v2.1.3...v2.2.0) ##### Features - bump release level to ga ([#​342](https://www.github.com/googleapis/nodejs-text-to-speech/issues/342)) ([eca7bfa](https://www.github.com/googleapis/nodejs-text-to-speech/commit/eca7bfabbab2fc169e77922bbda3d7b79e34e1c4)) ##### [2.1.3](https://www.github.com/googleapis/nodejs-text-to-speech/compare/v2.1.2...v2.1.3) (2020-02-01) ##### Bug Fixes - enum, bytes, and Long types now accept strings ([3839359](https://www.github.com/googleapis/nodejs-text-to-speech/commit/3839359a2cc8397f93fdb656a9b4c3a04b0ef488)) ##### [2.1.2](https://www.github.com/googleapis/nodejs-text-to-speech/compare/v2.1.1...v2.1.2) (2020-01-03) ##### Bug Fixes - "client already closed" error fires earlier ([41b39bc](https://www.github.com/googleapis/nodejs-text-to-speech/commit/41b39bce3a598e6034a4b63c122b1ce89ddec5b5)) ##### [2.1.1](https://www.github.com/googleapis/nodejs-text-to-speech/compare/v2.1.0...v2.1.1) (2019-12-30) ##### Bug Fixes - increase timeout from 20s to 60s ([#​312](https://www.github.com/googleapis/nodejs-text-to-speech/issues/312)) ([ea9f75c](https://www.github.com/googleapis/nodejs-text-to-speech/commit/ea9f75c383351724ae0f5186073c5289d2f8996a)) - move region tag to encompass catch ([#​320](https://www.github.com/googleapis/nodejs-text-to-speech/issues/320)) ([988c5f5](https://www.github.com/googleapis/nodejs-text-to-speech/commit/988c5f55859bca543a79800d6eb4668dafeec70f)) ### [`v2.1.3`](https://togithub.com/googleapis/nodejs-text-to-speech/blob/master/CHANGELOG.md#​213-httpswwwgithubcomgoogleapisnodejs-text-to-speechcomparev212v213-2020-02-01) [Compare Source](https://togithub.com/googleapis/nodejs-text-to-speech/compare/v2.1.2...v2.1.3) ### [`v2.1.2`](https://togithub.com/googleapis/nodejs-text-to-speech/blob/master/CHANGELOG.md#​212-httpswwwgithubcomgoogleapisnodejs-text-to-speechcomparev211v212-2020-01-03) [Compare Source](https://togithub.com/googleapis/nodejs-text-to-speech/compare/v2.1.1...v2.1.2) ### [`v2.1.1`](https://togithub.com/googleapis/nodejs-text-to-speech/blob/master/CHANGELOG.md#​211-httpswwwgithubcomgoogleapisnodejs-text-to-speechcomparev210v211-2019-12-30) [Compare Source](https://togithub.com/googleapis/nodejs-text-to-speech/compare/v2.1.0...v2.1.1) ### [`v2.1.0`](https://togithub.com/googleapis/nodejs-text-to-speech/blob/master/CHANGELOG.md#​210-httpswwwgithubcomgoogleapisnodejs-text-to-speechcomparev202v210-2019-12-11) [Compare Source](https://togithub.com/googleapis/nodejs-text-to-speech/compare/v2.0.2...v2.1.0) ##### Features - make service stub public ([921f404](https://www.github.com/googleapis/nodejs-text-to-speech/commit/921f404c156379c6073f5a0db224df703b2d3e3e)) ##### Bug Fixes - **deps:** pin TypeScript below 3.7.0 ([4da93ee](https://www.github.com/googleapis/nodejs-text-to-speech/commit/4da93ee0b509c1260b9c49e7794b6546ecd2ed6e)) ##### [2.0.2](https://www.github.com/googleapis/nodejs-text-to-speech/compare/v2.0.1...v2.0.2) (2019-11-20) ##### Bug Fixes - **docs:** bump release level to beta ([#​297](https://www.github.com/googleapis/nodejs-text-to-speech/issues/297)) ([247ae7a](https://www.github.com/googleapis/nodejs-text-to-speech/commit/247ae7a1c402d04ec5285faad6e92d736a03c825)) ##### [2.0.1](https://www.github.com/googleapis/nodejs-text-to-speech/compare/v2.0.0...v2.0.1) (2019-11-18) ##### Bug Fixes - **deps:** update dependency yargs to v15 ([#​295](https://www.github.com/googleapis/nodejs-text-to-speech/issues/295)) ([2c7eea2](https://www.github.com/googleapis/nodejs-text-to-speech/commit/2c7eea213ad6211a38b0ee2d591d52d79a3b4c0a)) ### [`v2.0.2`](https://togithub.com/googleapis/nodejs-text-to-speech/blob/master/CHANGELOG.md#​202-httpswwwgithubcomgoogleapisnodejs-text-to-speechcomparev201v202-2019-11-20) [Compare Source](https://togithub.com/googleapis/nodejs-text-to-speech/compare/v2.0.1...v2.0.2) ### [`v2.0.1`](https://togithub.com/googleapis/nodejs-text-to-speech/blob/master/CHANGELOG.md#​201-httpswwwgithubcomgoogleapisnodejs-text-to-speechcomparev200v201-2019-11-18) [Compare Source](https://togithub.com/googleapis/nodejs-text-to-speech/compare/v2.0.0...v2.0.1) ### [`v2.0.0`](https://togithub.com/googleapis/nodejs-text-to-speech/blob/master/CHANGELOG.md#​200-httpswwwgithubcomgoogleapisnodejs-text-to-speechcomparev141v200-2019-11-14) [Compare Source](https://togithub.com/googleapis/nodejs-text-to-speech/compare/v1.4.1...v2.0.0) ##### ⚠ BREAKING CHANGES - move library to typescript code generation ([#​285](https://togithub.com/googleapis/nodejs-text-to-speech/issues/285)) Starting with this release, the auto-generated library code was changed from JavaScript to TypeScript, so all the TypeScript types are now exported from the `.d.ts` files. Please note that if you used `@types/google-cloud__text-to-speech` package to get TypeScript types for this library, you need to stop using it and remove it from your `devDependencies`. If you see any issues caused by this migration to TypeScript, please feel free to submit an issue! ##### Features - move library to typescript code generation ([#​285](https://www.github.com/googleapis/nodejs-text-to-speech/issues/285)) ([d3d6208](https://www.github.com/googleapis/nodejs-text-to-speech/commit/d3d620853adc54fe7b671fa01643f6b0ef94794b)) ##### Bug Fixes - import long into proto ts declaration file ([#​288](https://www.github.com/googleapis/nodejs-text-to-speech/issues/288)) ([5bfb2ab](https://www.github.com/googleapis/nodejs-text-to-speech/commit/5bfb2ab7f76625361d52ad945733087877e03800)) - **docs:** snippets are now replaced in jsdoc comments ([#​287](https://www.github.com/googleapis/nodejs-text-to-speech/issues/287)) ([6e77aaf](https://www.github.com/googleapis/nodejs-text-to-speech/commit/6e77aaf10d814ab5366117c7251c29f25aa603b3)) ##### [1.4.1](https://www.github.com/googleapis/nodejs-text-to-speech/compare/v1.4.0...v1.4.1) (2019-10-22) ##### Bug Fixes - **deps:** bump google-gax to 1.7.5 ([#​280](https://www.github.com/googleapis/nodejs-text-to-speech/issues/280)) ([9e426ca](https://www.github.com/googleapis/nodejs-text-to-speech/commit/9e426cab4d62165d0cb79d8e489a5ccd1a1cfb46))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-translate). --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 528b088fd69..bc8a782ff11 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@google-cloud/automl": "^2.0.0", - "@google-cloud/text-to-speech": "^1.1.4", + "@google-cloud/text-to-speech": "^3.0.0", "@google-cloud/translate": "^6.0.0", "@google-cloud/vision": "^2.0.0", "yargs": "^15.0.0" From cd979eba826b535498a0275a47100534bd91c0f8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Jun 2020 19:56:06 +0200 Subject: [PATCH 378/513] chore(deps): update dependency http2spy to v2 (#544) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [http2spy](https://togithub.com/bcoe/http2spy) | devDependencies | major | [`^1.1.0` -> `^2.0.0`](https://renovatebot.com/diffs/npm/http2spy/1.1.0/2.0.0) | --- ### Release Notes
bcoe/http2spy ### [`v2.0.0`](https://togithub.com/bcoe/http2spy/blob/master/CHANGELOG.md#​200-httpswwwgithubcombcoehttp2spycomparev110v200-2020-06-11) [Compare Source](https://togithub.com/bcoe/http2spy/compare/v1.1.0...v2.0.0) ##### ⚠ BREAKING CHANGES - drop support for node.js 8.x ([#​11](https://togithub.com/bcoe/http2spy/issues/11)) ##### Features - convert to typescript ([#​15](https://www.github.com/bcoe/http2spy/issues/15)) ([084ef65](https://www.github.com/bcoe/http2spy/commit/084ef6535e81ec2f3f87a35372e4c5e24e084a10)) ##### Build System - drop support for node.js 8.x ([#​11](https://www.github.com/bcoe/http2spy/issues/11)) ([877691c](https://www.github.com/bcoe/http2spy/commit/877691c1bf8bea07e4b39ad8bd14873f1a469e0b))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c76b4ad81bf..deec8c56ca1 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -65,7 +65,7 @@ "codecov": "^3.0.2", "google-auth-library": "^6.0.0", "gts": "^2.0.0", - "http2spy": "^1.1.0", + "http2spy": "^2.0.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", From 1886e2b5829f38e23c4d707bf377fff683c389f5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 19 Jun 2020 15:24:21 -0700 Subject: [PATCH 379/513] fix: update node issue template (#551) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/87b131b2-8b10-4a99-8f57-5fac42bba415/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/b10590a4a1568548dd13cfcea9aa11d40898144b --- packages/google-cloud-translate/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 1216a3ee482..252d63b1f93 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "bcdef0f990d660857121d9d2f2dbe64c4c0da7d8" + "sha": "b5fa577be68795a98a6dd5baf794f38e920d192f" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" + "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" } } ], From 8648c8b1cadf0ea2ac9ddcf15c16472764b73f71 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 29 Jun 2020 13:25:30 -0700 Subject: [PATCH 380/513] build: add config .gitattributes (#552) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/e6ac0f7f-2fc1-4ac2-9eb5-23ba1215b6a2/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/dc9caca650c77b7039e2bbc3339ffb34ae78e5b7 --- packages/google-cloud-translate/.gitattributes | 3 +++ packages/google-cloud-translate/synth.metadata | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-translate/.gitattributes diff --git a/packages/google-cloud-translate/.gitattributes b/packages/google-cloud-translate/.gitattributes new file mode 100644 index 00000000000..2e63216ae9c --- /dev/null +++ b/packages/google-cloud-translate/.gitattributes @@ -0,0 +1,3 @@ +*.ts text eol=lf +*.js test eol=lf +protos/* linguist-generated diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 252d63b1f93..30a8c92c86f 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "b5fa577be68795a98a6dd5baf794f38e920d192f" + "sha": "548d1e5219141b293631087723ee111382a8e857" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" + "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" } } ], From 9b420e415af2997d828cff3ea85f5e9252266445 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2020 14:25:56 -0700 Subject: [PATCH 381/513] chore: release 6.0.1 (#541) --- packages/google-cloud-translate/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index fa858d491c9..77bdd54f1d3 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,17 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.0.1](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.0...v6.0.1) (2020-06-29) + + +### Bug Fixes + +* handle fallback option properly ([#547](https://www.github.com/googleapis/nodejs-translate/issues/547)) ([9146de2](https://www.github.com/googleapis/nodejs-translate/commit/9146de2a08565418dc118d1c8f3034f90ef9778e)) +* **deps:** update dependency @google-cloud/text-to-speech to v3 ([#538](https://www.github.com/googleapis/nodejs-translate/issues/538)) ([423dba3](https://www.github.com/googleapis/nodejs-translate/commit/423dba36a2c82ac6335c279edb1d246add55b754)) +* **deps:** update dependency @google-cloud/vision to v2 ([#539](https://www.github.com/googleapis/nodejs-translate/issues/539)) ([5dbeac4](https://www.github.com/googleapis/nodejs-translate/commit/5dbeac4e9a3133a6008cd8fb882046fe4a9946bc)) +* **samples:** typo in CLI invocation ([9755e2d](https://www.github.com/googleapis/nodejs-translate/commit/9755e2deff080d8a250ecbd251c7810288cd92d9)) +* update node issue template ([#551](https://www.github.com/googleapis/nodejs-translate/issues/551)) ([548d1e5](https://www.github.com/googleapis/nodejs-translate/commit/548d1e5219141b293631087723ee111382a8e857)) + ## [6.0.0](https://www.github.com/googleapis/nodejs-translate/compare/v5.3.0...v6.0.0) (2020-06-03) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index deec8c56ca1..cf15dfda2ed 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.0.0", + "version": "6.0.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index bc8a782ff11..7086eb5b1cd 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.0.0", + "@google-cloud/translate": "^6.0.1", "@google-cloud/vision": "^2.0.0", "yargs": "^15.0.0" }, From a228c6ed34d8356db806ab812684a94f2d474d3b Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 6 Jul 2020 15:12:04 -0700 Subject: [PATCH 382/513] build: use bazel build (#553) --- .../google-cloud-translate/synth.metadata | 26 +++++++------------ packages/google-cloud-translate/synth.py | 14 +++------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 30a8c92c86f..172d8bc53cb 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "548d1e5219141b293631087723ee111382a8e857" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a3a0bf0f6291d69f2ff3df7fcd63d28ee20ac727", - "internalRef": "310060413" + "remote": "git@github.com:googleapis/nodejs-translate.git", + "sha": "1ae1dba21e29d28c768085d6381b0953c69dada2" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" + "sha": "303271797a360f8a439203413f13a160f2f5b3b4" } } ], @@ -27,19 +19,19 @@ { "client": { "source": "googleapis", - "apiName": "translate", + "apiName": "translation", "apiVersion": "v3beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "language": "nodejs", + "generator": "bazel" } }, { "client": { "source": "googleapis", - "apiName": "translate", + "apiName": "translation", "apiVersion": "v3", - "language": "typescript", - "generator": "gapic-generator-typescript" + "language": "nodejs", + "generator": "bazel" } } ] diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/synth.py index 507cf84973d..b84718da7e1 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/synth.py @@ -20,19 +20,11 @@ import logging # Run the gapic generator -gapic = gcp.GAPICMicrogenerator() +gapic = gcp.GAPICBazel() versions = ['v3beta1', 'v3'] -name = 'translate' +name = 'translation' for version in versions: - library = gapic.typescript_library( - name, - proto_path=f"google/cloud/{name}/{version}", - generator_args={ - "grpc-service-config": f"google/cloud/{name}/{version}/{name}_grpc_service_config.json", - "package-name": f"@google-cloud/{name}" - }, - extra_proto_files=['google/cloud/common_resources.proto'], - version=version) + library = gapic.node_library(name, version, proto_path=f'google/cloud/translate/{version}') s.copy(library, excludes=['README.md', 'package.json', 'src/index.ts']) logging.basicConfig(level=logging.DEBUG) From 8b2bec7a614ab8e888e1a601d36ac4d01b1adaa4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 14 Jul 2020 21:30:22 +0200 Subject: [PATCH 383/513] chore(deps): update dependency @types/mocha to v8 (#557) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index cf15dfda2ed..dac900b2ce6 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -56,7 +56,7 @@ }, "devDependencies": { "@types/extend": "^3.0.0", - "@types/mocha": "^7.0.0", + "@types/mocha": "^8.0.0", "@types/node": "^10.5.7", "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", From e2ab62641adca8eac53aa1169820a481ca92c073 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 14 Jul 2020 19:07:02 -0700 Subject: [PATCH 384/513] fix: typeo in nodejs .gitattribute (#556) replace `test` to `text` Source-Author: Summer Ji Source-Date: Wed Jul 8 14:02:57 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b Source-Link: https://github.com/googleapis/synthtool/commit/799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b Co-authored-by: Justin Beckwith --- packages/google-cloud-translate/.gitattributes | 2 +- packages/google-cloud-translate/synth.metadata | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/.gitattributes b/packages/google-cloud-translate/.gitattributes index 2e63216ae9c..d4f4169b28b 100644 --- a/packages/google-cloud-translate/.gitattributes +++ b/packages/google-cloud-translate/.gitattributes @@ -1,3 +1,3 @@ *.ts text eol=lf -*.js test eol=lf +*.js text eol=lf protos/* linguist-generated diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 172d8bc53cb..9e80d7e92af 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -3,15 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-translate.git", - "sha": "1ae1dba21e29d28c768085d6381b0953c69dada2" + "remote": "https://github.com/googleapis/nodejs-translate.git", + "sha": "7535c71bf84834bfa466466aab4e1865a359cc52" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", + "internalRef": "320300472" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "303271797a360f8a439203413f13a160f2f5b3b4" + "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" } } ], From 7b4e45de793a6d0441ea5bda391b7b4ea5827936 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 15 Jul 2020 10:07:02 -0700 Subject: [PATCH 385/513] chore: release 6.0.2 (#559) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 77bdd54f1d3..3c2c8a1b04a 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.0.2](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.1...v6.0.2) (2020-07-15) + + +### Bug Fixes + +* typeo in nodejs .gitattribute ([#556](https://www.github.com/googleapis/nodejs-translate/issues/556)) ([f774b0c](https://www.github.com/googleapis/nodejs-translate/commit/f774b0cae621be822b80b34c67adbbebb995ceec)) + ### [6.0.1](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.0...v6.0.1) (2020-06-29) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index dac900b2ce6..1b8407114e7 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.0.1", + "version": "6.0.2", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 7086eb5b1cd..21d112c5081 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.0.1", + "@google-cloud/translate": "^6.0.2", "@google-cloud/vision": "^2.0.0", "yargs": "^15.0.0" }, From e5a076c735baddfc97c8eaeb1d15d77b6dc12446 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 20 Jul 2020 10:12:53 -0700 Subject: [PATCH 386/513] build: add Node 8 tests (#561) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/91408a5a-0866-4f1e-92b1-4f0e885b0e2e/targets - [ ] To automatically regenerate this PR, check this box. --- .../google-cloud-translate/protos/protos.js | 232 ++++++++++++++---- .../google-cloud-translate/synth.metadata | 2 +- 2 files changed, 187 insertions(+), 47 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index b1c1ec7df7a..48a8aefe348 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -744,7 +744,7 @@ TranslateTextRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.TranslateTextRequest(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.TranslateTextRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -772,12 +772,26 @@ message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); break; case 10: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; break; default: reader.skipType(tag & 7); @@ -1620,7 +1634,7 @@ DetectLanguageRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DetectLanguageRequest(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DetectLanguageRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1637,12 +1651,26 @@ message.mimeType = reader.string(); break; case 6: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; break; default: reader.skipType(tag & 7); @@ -3897,7 +3925,7 @@ BatchTranslateTextRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateTextRequest(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateTextRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3913,12 +3941,26 @@ message.targetLanguageCodes.push(reader.string()); break; case 4: - reader.skip().pos++; if (message.models === $util.emptyObject) message.models = {}; - key = reader.string(); - reader.pos++; - message.models[key] = reader.string(); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.models[key] = value; break; case 5: if (!(message.inputConfigs && message.inputConfigs.length)) @@ -3929,20 +3971,48 @@ message.outputConfig = $root.google.cloud.translation.v3.OutputConfig.decode(reader, reader.uint32()); break; case 7: - reader.skip().pos++; if (message.glossaries === $util.emptyObject) message.glossaries = {}; - key = reader.string(); - reader.pos++; - message.glossaries[key] = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.glossaries[key] = value; break; case 9: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; break; default: reader.skipType(tag & 7); @@ -8468,7 +8538,7 @@ TranslateTextRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.TranslateTextRequest(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.TranslateTextRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -8496,12 +8566,26 @@ message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); break; case 10: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; break; default: reader.skipType(tag & 7); @@ -9344,7 +9428,7 @@ DetectLanguageRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DetectLanguageRequest(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DetectLanguageRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -9361,12 +9445,26 @@ message.mimeType = reader.string(); break; case 6: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; break; default: reader.skipType(tag & 7); @@ -11621,7 +11719,7 @@ BatchTranslateTextRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateTextRequest(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateTextRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -11637,12 +11735,26 @@ message.targetLanguageCodes.push(reader.string()); break; case 4: - reader.skip().pos++; if (message.models === $util.emptyObject) message.models = {}; - key = reader.string(); - reader.pos++; - message.models[key] = reader.string(); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.models[key] = value; break; case 5: if (!(message.inputConfigs && message.inputConfigs.length)) @@ -11653,20 +11765,48 @@ message.outputConfig = $root.google.cloud.translation.v3beta1.OutputConfig.decode(reader, reader.uint32()); break; case 7: - reader.skip().pos++; if (message.glossaries === $util.emptyObject) message.glossaries = {}; - key = reader.string(); - reader.pos++; - message.glossaries[key] = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.glossaries[key] = value; break; case 9: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; break; default: reader.skipType(tag & 7); diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 9e80d7e92af..fc31cbf5fa7 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "7535c71bf84834bfa466466aab4e1865a359cc52" + "sha": "65c3389267d449d34e8a70abd3a50616a564443f" } }, { From 32f8a3fc813bda9e375ee42eebd6c6fafc8df96b Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Tue, 21 Jul 2020 14:39:32 -0400 Subject: [PATCH 387/513] chore: add dev dependencies for cloud-rad ref docs (#563) --- packages/google-cloud-translate/package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 1b8407114e7..c126ad62b4f 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -43,7 +43,9 @@ "predocs-test": "npm run docs", "prelint": "cd samples; npm link ../; npm install", "clean": "gts clean", - "precompile": "gts clean" + "precompile": "gts clean", + "api-extractor": "api-extractor run --local", + "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { "@google-cloud/common": "^3.0.0", @@ -74,6 +76,8 @@ "pack-n-play": "^1.0.0-2", "proxyquire": "^2.0.1", "sinon": "^9.0.1", - "typescript": "^3.8.3" + "typescript": "^3.8.3", + "@microsoft/api-documenter": "^7.8.10", + "@microsoft/api-extractor": "^7.8.10" } } From 6b17cb683fc57baaa443a3e7c9fdaa732e9c0644 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 26 Jul 2020 21:45:43 -0700 Subject: [PATCH 388/513] build: missing parenthesis in publish script, delete Node 8 tests, add config for cloud-rad for nodejs (#562) --- .../google-cloud-translate/api-extractor.json | 369 ++++++++++++++++++ .../google-cloud-translate/synth.metadata | 2 +- 2 files changed, 370 insertions(+), 1 deletion(-) create mode 100644 packages/google-cloud-translate/api-extractor.json diff --git a/packages/google-cloud-translate/api-extractor.json b/packages/google-cloud-translate/api-extractor.json new file mode 100644 index 00000000000..de228294b23 --- /dev/null +++ b/packages/google-cloud-translate/api-extractor.json @@ -0,0 +1,369 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/protos/protos.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [ ], + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + // "reportFileName": ".api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + // "reportFolder": "/etc/", + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/" + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true, + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": true, + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning", + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + }, + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + }, + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } + +} diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index fc31cbf5fa7..279d5df2151 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" + "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" } } ], From f4478e8c7fb18830ce08a1de6934a8782b3da33a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 28 Jul 2020 09:34:40 -0700 Subject: [PATCH 389/513] build: move gitatrtributes files to node templates, rename __toc to toc (#564) * build: rename _toc to toc Source-Author: F. Hinkelmann Source-Date: Tue Jul 21 10:53:20 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 99c93fe09f8c1dca09dfc0301c8668e3a70dd796 Source-Link: https://github.com/googleapis/synthtool/commit/99c93fe09f8c1dca09dfc0301c8668e3a70dd796 * build: move gitattributes files to node templates Source-Author: F. Hinkelmann Source-Date: Thu Jul 23 01:45:04 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 Source-Link: https://github.com/googleapis/synthtool/commit/3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 --- packages/google-cloud-translate/.gitattributes | 1 + packages/google-cloud-translate/synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/.gitattributes b/packages/google-cloud-translate/.gitattributes index d4f4169b28b..33739cb74e4 100644 --- a/packages/google-cloud-translate/.gitattributes +++ b/packages/google-cloud-translate/.gitattributes @@ -1,3 +1,4 @@ *.ts text eol=lf *.js text eol=lf protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 279d5df2151..d2c9036c67c 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "65c3389267d449d34e8a70abd3a50616a564443f" + "sha": "0a7543eb0e33d2b17236e16ea2a909f3adf64cbe" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" + "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" } } ], From 6c0dbf313b4f428622c374561ef62e17b7078a34 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 30 Jul 2020 14:18:57 -0700 Subject: [PATCH 390/513] docs: corrects spelling of build dependency adds backticks in docstring (#569) --- .../google/cloud/translate/v3/translation_service.proto | 8 ++++---- .../cloud/translate/v3beta1/translation_service.proto | 8 ++++---- packages/google-cloud-translate/protos/protos.d.ts | 2 +- packages/google-cloud-translate/protos/protos.js | 2 +- packages/google-cloud-translate/synth.metadata | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto index ad43831c29b..3e939a5d2c8 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto @@ -502,7 +502,7 @@ message OutputConfig { // written). // // The format of translations_file (for target language code 'trg') is: - // gs://translation_test/a_b_c_'trg'_translations.[extension] + // `gs://translation_test/a_b_c_'trg'_translations.[extension]` // // If the input file extension is tsv, the output has the following // columns: @@ -519,10 +519,10 @@ message OutputConfig { // If input file extension is a txt or html, the translation is directly // written to the output file. If glossary is requested, a separate // glossary_translations_file has format of - // gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] + // `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` // // The format of errors file (for target language code 'trg') is: - // gs://translation_test/a_b_c_'trg'_errors.[extension] + // `gs://translation_test/a_b_c_'trg'_errors.[extension]` // // If the input file extension is tsv, errors_file contains the following: // Column 1: ID of the request provided in the input, if it's not @@ -534,7 +534,7 @@ message OutputConfig { // // If the input file extension is txt or html, glossary_error_file will be // generated that contains error details. glossary_error_file has format of - // gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] + // `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` GcsDestination gcs_destination = 1; } } diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto index e62a5088382..ef49f000007 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto @@ -490,7 +490,7 @@ message OutputConfig { // written). // // The format of translations_file (for target language code 'trg') is: - // gs://translation_test/a_b_c_'trg'_translations.[extension] + // `gs://translation_test/a_b_c_'trg'_translations.[extension]` // // If the input file extension is tsv, the output has the following // columns: @@ -507,10 +507,10 @@ message OutputConfig { // If input file extension is a txt or html, the translation is directly // written to the output file. If glossary is requested, a separate // glossary_translations_file has format of - // gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] + // `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` // // The format of errors file (for target language code 'trg') is: - // gs://translation_test/a_b_c_'trg'_errors.[extension] + // `gs://translation_test/a_b_c_'trg'_errors.[extension]` // // If the input file extension is tsv, errors_file contains the following: // Column 1: ID of the request provided in the input, if it's not @@ -522,7 +522,7 @@ message OutputConfig { // // If the input file extension is txt or html, glossary_error_file will be // generated that contains error details. glossary_error_file has format of - // gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] + // `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` GcsDestination gcs_destination = 1; } } diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index a9b8988b123..f9c1d7c0a15 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -13,7 +13,7 @@ // limitations under the License. import * as Long from "long"; -import * as $protobuf from "protobufjs"; +import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index 48a8aefe348..5d384402a38 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -19,7 +19,7 @@ define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("protobufjs/minimal")); + module.exports = factory(require("google-gax").protobufMinimal); })(this, function($protobuf) { "use strict"; diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index d2c9036c67c..5029462ef60 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "0a7543eb0e33d2b17236e16ea2a909f3adf64cbe" + "sha": "95a18d7a7bc2ee2f52467d283f2e460d6da94620" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", - "internalRef": "320300472" + "sha": "d399c754bdea83297877ab49e5f66b257a957a78", + "internalRef": "323860336" } }, { From fa5459348de00ce8947c16e68aa38de27003ca9f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 31 Jul 2020 09:24:16 -0700 Subject: [PATCH 391/513] docs: add links to the CHANGELOG from the README.md for Java and Node (#570) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/b205fd33-200c-4298-88b8-18b0d1c79a3e/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5936421202fb53ed4641bcb824017dd393a3dbcc Source-Link: https://github.com/googleapis/synthtool/commit/89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa --- packages/google-cloud-translate/README.md | 3 +++ packages/google-cloud-translate/synth.metadata | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 4de340ad61a..b8e16a81898 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -19,6 +19,9 @@ API is part of the larger Cloud Machine Learning API family. Cloud Translation API Client Library for Node.js +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-translate/blob/master/CHANGELOG.md). + * [Cloud Translation Node.js Client API Reference][client-docs] * [Cloud Translation Documentation][product-docs] * [github.com/googleapis/nodejs-translate](https://github.com/googleapis/nodejs-translate) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 5029462ef60..d99818968af 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" + "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" } } ], From 2545b703d50cab847ca2125abbf6a31602dcc4e9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 10 Aug 2020 10:56:34 -0700 Subject: [PATCH 392/513] build: --credential-file-override is no longer required (#572) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/96fb0e9d-e02a-4451-878f-e646368369cc/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/94421c47802f56a44c320257b2b4c190dc7d6b68 --- packages/google-cloud-translate/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index d99818968af..e5344835a5e 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "95a18d7a7bc2ee2f52467d283f2e460d6da94620" + "sha": "ca8a591e02aa21f0b1a0e7b7e98335a059e7decd" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" + "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" } } ], From 722e062fd998cccf699bc9456eee25ad29efc51b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 13 Aug 2020 20:15:38 -0700 Subject: [PATCH 393/513] build: use gapic-generator-typescript v1.0.7. (#573) This new generator will bring some changes to the generated code across all libraries, but the behavior will only change for nodejs-logging and nodejs-pubsub (those two libraries that use request batching). For other libraries, the changes should be minor (the createApiCall call is simplified) and it should be safe to merge them. Please talk to @alexander-fenster if you have any questions. PiperOrigin-RevId: 325949033 Source-Author: Google APIs Source-Date: Mon Aug 10 21:11:13 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 94006b3cb8d2fb44703cf535da15608eed6bf7db Source-Link: https://github.com/googleapis/googleapis/commit/94006b3cb8d2fb44703cf535da15608eed6bf7db --- .../src/v3/translation_service_client.ts | 8 +++++--- .../src/v3beta1/translation_service_client.ts | 8 +++++--- packages/google-cloud-translate/synth.metadata | 6 +++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index f99587697e0..e5f517496bf 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -303,12 +303,14 @@ export class TranslationServiceClient { } ); + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 12a02a3db78..37a583cec37 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -304,12 +304,14 @@ export class TranslationServiceClient { } ); + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index e5344835a5e..b7fab0c6ca5 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "ca8a591e02aa21f0b1a0e7b7e98335a059e7decd" + "sha": "6ff6bb22320ac21c4c553f01cf22ae0afbf0acd2" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d399c754bdea83297877ab49e5f66b257a957a78", - "internalRef": "323860336" + "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", + "internalRef": "325949033" } }, { From c2b00cfb7558e2259845bdfc69a9bd0c9ce80659 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 9 Sep 2020 12:46:09 -0700 Subject: [PATCH 394/513] build: update config for node12 (#578) --- .../google-cloud-translate/synth.metadata | 91 ++++++++++++++++--- 1 file changed, 80 insertions(+), 11 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index b7fab0c6ca5..561fe3879ff 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -3,23 +3,16 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "6ff6bb22320ac21c4c553f01cf22ae0afbf0acd2" + "remote": "git@github.com:googleapis/nodejs-translate.git", + "sha": "35786baf2537579ac719d76e75be31de0bf89e18" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", - "internalRef": "325949033" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" + "sha": "7e1a21195ede14f97f7da30efcff4c6bac599bb5", + "internalRef": "330665887" } } ], @@ -42,5 +35,81 @@ "generator": "bazel" } } + ], + "generatedFiles": [ + ".eslintignore", + ".eslintrc.json", + ".gitattributes", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/release-please.yml", + ".github/workflows/ci.yaml", + ".gitignore", + ".jsdoc.js", + ".kokoro/.gitattributes", + ".kokoro/common.cfg", + ".kokoro/continuous/node10/common.cfg", + ".kokoro/continuous/node10/docs.cfg", + ".kokoro/continuous/node10/test.cfg", + ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/lint.cfg", + ".kokoro/continuous/node12/samples-test.cfg", + ".kokoro/continuous/node12/system-test.cfg", + ".kokoro/continuous/node12/test.cfg", + ".kokoro/docs.sh", + ".kokoro/lint.sh", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/node10/common.cfg", + ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/samples-test.cfg", + ".kokoro/presubmit/node12/system-test.cfg", + ".kokoro/presubmit/node12/test.cfg", + ".kokoro/publish.sh", + ".kokoro/release/docs-devsite.cfg", + ".kokoro/release/docs-devsite.sh", + ".kokoro/release/docs.cfg", + ".kokoro/release/docs.sh", + ".kokoro/release/publish.cfg", + ".kokoro/samples-test.sh", + ".kokoro/system-test.sh", + ".kokoro/test.bat", + ".kokoro/test.sh", + ".kokoro/trampoline.sh", + ".mocharc.js", + ".nycrc", + ".prettierignore", + ".prettierrc.js", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "README.md", + "api-extractor.json", + "linkinator.config.json", + "package-lock.json.338134618", + "protos/google/cloud/translate/v3/translation_service.proto", + "protos/google/cloud/translate/v3beta1/translation_service.proto", + "protos/protos.d.ts", + "protos/protos.js", + "protos/protos.json", + "renovate.json", + "samples/README.md", + "samples/package-lock.json.1765310384", + "src/v3/index.ts", + "src/v3/translation_service_client.ts", + "src/v3/translation_service_client_config.json", + "src/v3/translation_service_proto_list.json", + "src/v3beta1/index.ts", + "src/v3beta1/translation_service_client.ts", + "src/v3beta1/translation_service_client_config.json", + "src/v3beta1/translation_service_proto_list.json", + "system-test/fixtures/sample/src/index.js", + "system-test/fixtures/sample/src/index.ts", + "system-test/install.ts", + "test/gapic_translation_service_v3.ts", + "test/gapic_translation_service_v3beta1.ts", + "tsconfig.json", + "webpack.config.js" ] } \ No newline at end of file From 4e6ed35b1cdbdd536214d533f7c77c04401f0222 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 9 Sep 2020 22:20:03 +0200 Subject: [PATCH 395/513] fix(deps): update dependency yargs to v16 (#577) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [yargs](https://yargs.js.org/) ([source](https://togithub.com/yargs/yargs)) | dependencies | major | [`^15.0.0` -> `^16.0.0`](https://renovatebot.com/diffs/npm/yargs/15.4.1/16.0.2) | --- ### Release Notes
yargs/yargs ### [`v16.0.2`](https://togithub.com/yargs/yargs/blob/master/CHANGELOG.md#​1602-httpswwwgithubcomyargsyargscomparev1601v1602-2020-09-09) [Compare Source](https://togithub.com/yargs/yargs/compare/v16.0.1...v16.0.2) ### [`v16.0.1`](https://togithub.com/yargs/yargs/blob/master/CHANGELOG.md#​1601-httpswwwgithubcomyargsyargscomparev1600v1601-2020-09-09) [Compare Source](https://togithub.com/yargs/yargs/compare/v16.0.0...v16.0.1) ### [`v16.0.0`](https://togithub.com/yargs/yargs/blob/master/CHANGELOG.md#​1600-httpswwwgithubcomyargsyargscomparev1542v1600-2020-09-09) [Compare Source](https://togithub.com/yargs/yargs/compare/v15.4.1...v16.0.0) ##### ⚠ BREAKING CHANGES - tweaks to ESM/Deno API surface: now exports yargs function by default; getProcessArgvWithoutBin becomes hideBin; types now exported for Deno. - find-up replaced with escalade; export map added (limits importable files in Node >= 12); yarser-parser@19.x.x (new decamelize/camelcase implementation). - **usage:** single character aliases are now shown first in help output - rebase helper is no longer provided on yargs instance. - drop support for EOL Node 8 ([#​1686](https://togithub.com/yargs/yargs/issues/1686)) ##### Features - adds strictOptions() ([#​1738](https://www.github.com/yargs/yargs/issues/1738)) ([b215fba](https://www.github.com/yargs/yargs/commit/b215fba0ed6e124e5aad6cf22c8d5875661c63a3)) - **helpers:** rebase, Parser, applyExtends now blessed helpers ([#​1733](https://www.github.com/yargs/yargs/issues/1733)) ([c7debe8](https://www.github.com/yargs/yargs/commit/c7debe8eb1e5bc6ea20b5ed68026c56e5ebec9e1)) - adds support for ESM and Deno ([#​1708](https://www.github.com/yargs/yargs/issues/1708)) ([ac6d5d1](https://www.github.com/yargs/yargs/commit/ac6d5d105a75711fe703f6a39dad5181b383d6c6)) - drop support for EOL Node 8 ([#​1686](https://www.github.com/yargs/yargs/issues/1686)) ([863937f](https://www.github.com/yargs/yargs/commit/863937f23c3102f804cdea78ee3097e28c7c289f)) - i18n for ESM and Deno ([#​1735](https://www.github.com/yargs/yargs/issues/1735)) ([c71783a](https://www.github.com/yargs/yargs/commit/c71783a5a898a0c0e92ac501c939a3ec411ac0c1)) - tweaks to API surface based on user feedback ([#​1726](https://www.github.com/yargs/yargs/issues/1726)) ([4151fee](https://www.github.com/yargs/yargs/commit/4151fee4c33a97d26bc40de7e623e5b0eb87e9bb)) - **usage:** single char aliases first in help ([#​1574](https://www.github.com/yargs/yargs/issues/1574)) ([a552990](https://www.github.com/yargs/yargs/commit/a552990c120646c2d85a5c9b628e1ce92a68e797)) ##### Bug Fixes - **yargs:** add missing command(module) signature ([#​1707](https://www.github.com/yargs/yargs/issues/1707)) ([0f81024](https://www.github.com/yargs/yargs/commit/0f810245494ccf13a35b7786d021b30fc95ecad5)), closes [#​1704](https://www.github.com/yargs/yargs/issues/1704)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 21d112c5081..f3cba7e59cd 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -18,7 +18,7 @@ "@google-cloud/text-to-speech": "^3.0.0", "@google-cloud/translate": "^6.0.2", "@google-cloud/vision": "^2.0.0", - "yargs": "^15.0.0" + "yargs": "^16.0.0" }, "devDependencies": { "@google-cloud/storage": "^5.0.0", From e273374c6d534648aa20c2bc2811f50743a8b34a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 17 Sep 2020 07:58:55 -0700 Subject: [PATCH 396/513] build: update test configuration (#581) --- packages/google-cloud-translate/.mocharc.js | 3 ++- packages/google-cloud-translate/synth.metadata | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-translate/.mocharc.js b/packages/google-cloud-translate/.mocharc.js index ff7b34fa5d1..0b600509bed 100644 --- a/packages/google-cloud-translate/.mocharc.js +++ b/packages/google-cloud-translate/.mocharc.js @@ -14,7 +14,8 @@ const config = { "enable-source-maps": true, "throw-deprecation": true, - "timeout": 10000 + "timeout": 10000, + "recursive": true } if (process.env.MOCHA_THROW_DEPRECATION === 'false') { delete config['throw-deprecation']; diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 561fe3879ff..f50ee9adc57 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -3,8 +3,8 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-translate.git", - "sha": "35786baf2537579ac719d76e75be31de0bf89e18" + "remote": "https://github.com/googleapis/nodejs-translate.git", + "sha": "6ca7d9aea43a8934f6426d7c99d9c48a5a81f9fb" } }, { @@ -14,6 +14,13 @@ "sha": "7e1a21195ede14f97f7da30efcff4c6bac599bb5", "internalRef": "330665887" } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" + } } ], "destinations": [ @@ -87,7 +94,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.338134618", "protos/google/cloud/translate/v3/translation_service.proto", "protos/google/cloud/translate/v3beta1/translation_service.proto", "protos/protos.d.ts", @@ -95,7 +101,6 @@ "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.1765310384", "src/v3/index.ts", "src/v3/translation_service_client.ts", "src/v3/translation_service_client_config.json", From 90662b7d0514b50f2346252b27e9d395db989909 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 17 Sep 2020 15:02:34 -0700 Subject: [PATCH 397/513] chore: release 6.0.3 (#579) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 3c2c8a1b04a..f2a7dc801d8 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.0.3](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.2...v6.0.3) (2020-09-17) + + +### Bug Fixes + +* **deps:** update dependency yargs to v16 ([#577](https://www.github.com/googleapis/nodejs-translate/issues/577)) ([6ca7d9a](https://www.github.com/googleapis/nodejs-translate/commit/6ca7d9aea43a8934f6426d7c99d9c48a5a81f9fb)) + ### [6.0.2](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.1...v6.0.2) (2020-07-15) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c126ad62b4f..3a0ab0a1831 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.0.2", + "version": "6.0.3", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index f3cba7e59cd..072f7f2a029 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.0.2", + "@google-cloud/translate": "^6.0.3", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From 56712c925d749fced45173eb59a669fcaa03d811 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 1 Oct 2020 13:22:14 -0700 Subject: [PATCH 398/513] chore: update bucket for cloud-rad (#584) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/de06ef39-12e7-44a8-903b-7c87ac7a56b4/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/079dcce498117f9570cebe6e6cff254b38ba3860 --- packages/google-cloud-translate/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index f50ee9adc57..dfb70e93b67 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "6ca7d9aea43a8934f6426d7c99d9c48a5a81f9fb" + "sha": "ce31fc45f651f72825530f8883fac820d314b678" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" + "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" } } ], From bd81ae787b8bd87404849bcbe15e3eb196d376fc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 5 Oct 2020 10:42:04 -0700 Subject: [PATCH 399/513] build(node_library): migrate to Trampoline V2 (#585) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/ce28a18d-da8c-4e38-94c0-e9f48b3c281e/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9 --- packages/google-cloud-translate/synth.metadata | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index dfb70e93b67..31175970d62 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "ce31fc45f651f72825530f8883fac820d314b678" + "sha": "79aa79219f58a3cc53e4ccbbd254804e4e58229e" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" + "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" } } ], @@ -84,10 +84,12 @@ ".kokoro/test.bat", ".kokoro/test.sh", ".kokoro/trampoline.sh", + ".kokoro/trampoline_v2.sh", ".mocharc.js", ".nycrc", ".prettierignore", ".prettierrc.js", + ".trampolinerc", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "LICENSE", From 79076c45e7eab627af23a876979432469b547b2a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 16 Oct 2020 10:08:20 -0700 Subject: [PATCH 400/513] build: only check --engine-strict for production deps (#589) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/d00df0bd-3ec0-4f8f-af57-f6679c4b1aae/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5451633881133e5573cc271a18e73b18caca8b1b --- packages/google-cloud-translate/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 31175970d62..b5a8aee0594 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "79aa79219f58a3cc53e4ccbbd254804e4e58229e" + "sha": "b2b482208d6e3917b67c701e50bc3128266661b8" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" + "sha": "5451633881133e5573cc271a18e73b18caca8b1b" } } ], From 3454b36331e54452769c55bc44e7b9c04d5d7729 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 3 Nov 2020 10:36:38 -0800 Subject: [PATCH 401/513] chore: clean up Node.js TOC for cloud-rad (#590) * chore: clean up Node.js TOC for cloud-rad Source-Author: F. Hinkelmann Source-Date: Wed Oct 21 09:26:04 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 Source-Link: https://github.com/googleapis/synthtool/commit/f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 * chore: fix Node.js TOC for cloud-rad Source-Author: F. Hinkelmann Source-Date: Wed Oct 21 12:01:24 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 901ddd44e9ef7887ee681b9183bbdea99437fdcc Source-Link: https://github.com/googleapis/synthtool/commit/901ddd44e9ef7887ee681b9183bbdea99437fdcc --- packages/google-cloud-translate/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index b5a8aee0594..4bd25f1fbb9 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "b2b482208d6e3917b67c701e50bc3128266661b8" + "sha": "f7a3c5856f1302ede48c9ceba09580729a3f01f9" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5451633881133e5573cc271a18e73b18caca8b1b" + "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" } } ], From 6950ae771b58b1da96da0c9baf8d6d24e09abc92 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Wed, 4 Nov 2020 05:06:48 -0800 Subject: [PATCH 402/513] chore(docs): update code of conduct of synthtool and templates Source-Author: Christopher Wilcox Source-Date: Thu Oct 22 14:22:01 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 5f6ef0ec5501d33c4667885b37a7685a30d41a76 Source-Link: https://github.com/googleapis/synthtool/commit/5f6ef0ec5501d33c4667885b37a7685a30d41a76 --- .../google-cloud-translate/CODE_OF_CONDUCT.md | 123 +++++++++++++----- .../google-cloud-translate/synth.metadata | 4 +- 2 files changed, 89 insertions(+), 38 deletions(-) diff --git a/packages/google-cloud-translate/CODE_OF_CONDUCT.md b/packages/google-cloud-translate/CODE_OF_CONDUCT.md index 46b2a08ea6d..2add2547a81 100644 --- a/packages/google-cloud-translate/CODE_OF_CONDUCT.md +++ b/packages/google-cloud-translate/CODE_OF_CONDUCT.md @@ -1,43 +1,94 @@ -# Contributor Code of Conduct + +# Code of Conduct -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. +## Our Pledge -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 4bd25f1fbb9..0d59a41585e 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "f7a3c5856f1302ede48c9ceba09580729a3f01f9" + "sha": "77a873f5854fb1ad5065e332e144ecc2a4b398b7" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" + "sha": "5f6ef0ec5501d33c4667885b37a7685a30d41a76" } } ], From ccf6481aae63276ea9ae499567354843a07f1f25 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Wed, 4 Nov 2020 05:06:48 -0800 Subject: [PATCH 403/513] build(node): update testing matrix Source-Author: Benjamin E. Coe Source-Date: Thu Oct 22 22:32:52 2020 -0500 Source-Repo: googleapis/synthtool Source-Sha: b7413d38b763827c72c0360f0a3d286c84656eeb Source-Link: https://github.com/googleapis/synthtool/commit/b7413d38b763827c72c0360f0a3d286c84656eeb --- packages/google-cloud-translate/synth.metadata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 0d59a41585e..b81e8e59387 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5f6ef0ec5501d33c4667885b37a7685a30d41a76" + "sha": "b7413d38b763827c72c0360f0a3d286c84656eeb" } } ], From bbe8547f1cf079bd41a340ca7740410c2d522cf9 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Wed, 4 Nov 2020 05:09:26 -0800 Subject: [PATCH 404/513] build(node): don't run prepare during smoke test Source-Author: Benjamin E. Coe Source-Date: Fri Oct 23 17:27:51 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: a783321fd55f010709294455584a553f4b24b944 Source-Link: https://github.com/googleapis/synthtool/commit/a783321fd55f010709294455584a553f4b24b944 --- packages/google-cloud-translate/synth.metadata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index b81e8e59387..baaf7a77da6 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b7413d38b763827c72c0360f0a3d286c84656eeb" + "sha": "a783321fd55f010709294455584a553f4b24b944" } } ], From e457a108940bfc27681c42a8c36a64a0ce6530f8 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Wed, 4 Nov 2020 05:09:26 -0800 Subject: [PATCH 405/513] build(node): cleanup production deps before installing dev/production Source-Author: Benjamin E. Coe Source-Date: Mon Oct 26 10:37:03 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 89c849ba5013e45e8fb688b138f33c2ec6083dc5 Source-Link: https://github.com/googleapis/synthtool/commit/89c849ba5013e45e8fb688b138f33c2ec6083dc5 --- packages/google-cloud-translate/synth.metadata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index baaf7a77da6..51b2ee0af62 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "a783321fd55f010709294455584a553f4b24b944" + "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" } } ], From b2ac959a39a0a196b0a4548e86bc4e81e49198c6 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Wed, 4 Nov 2020 05:11:11 -0800 Subject: [PATCH 406/513] build(node): add KOKORO_BUILD_ARTIFACTS_SUBDIR to env Source-Author: Benjamin E. Coe Source-Date: Mon Nov 2 15:56:09 2020 -0500 Source-Repo: googleapis/synthtool Source-Sha: ba9918cd22874245b55734f57470c719b577e591 Source-Link: https://github.com/googleapis/synthtool/commit/ba9918cd22874245b55734f57470c719b577e591 --- packages/google-cloud-translate/synth.metadata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 51b2ee0af62..8463aa7f94b 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" + "sha": "ba9918cd22874245b55734f57470c719b577e591" } } ], From 90c4a652faa026640ee3614dff366e02cec97903 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 6 Nov 2020 17:22:08 -0800 Subject: [PATCH 407/513] fix: do not modify options object, use defaultScopes (#593) Regenerated the library using [gapic-generator-typescript](https://github.com/googleapis/gapic-generator-typescript) v1.2.1. --- packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/src/index.ts | 1 + .../src/v3/translation_service_client.ts | 231 +++++++++++------- .../src/v3beta1/translation_service_client.ts | 231 +++++++++++------- .../google-cloud-translate/synth.metadata | 16 +- .../system-test/fixtures/sample/src/index.ts | 9 +- .../system-test/install.ts | 18 +- 7 files changed, 298 insertions(+), 210 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 3a0ab0a1831..c5199f99978 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -52,7 +52,7 @@ "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^2.1.0", + "google-gax": "^2.9.2", "is-html": "^2.0.0", "protobufjs": "^6.8.8" }, diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 807b96497d1..58aff8bcf7e 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -57,6 +57,7 @@ import * as v3 from './v3'; export * from './v3'; const TranslationServiceClient = v3.TranslationServiceClient; +type TranslationServiceClient = v3.TranslationServiceClient; export {TranslationServiceClient, v2, v3beta1, v3}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index e5f517496bf..01c61964eb3 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -62,8 +62,10 @@ export class TranslationServiceClient { /** * Construct an instance of TranslationServiceClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] @@ -83,42 +85,33 @@ export class TranslationServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. + * TODO(@alexander-fenster): link to gax documentation. + * @param {boolean} fallback - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof TranslationServiceClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - if (!opts) { - opts = {servicePath, port}; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the TranslationServiceClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this.constructor as typeof TranslationServiceClient).scopes; + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); // Save options to use in initialize() method. @@ -127,6 +120,11 @@ export class TranslationServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { @@ -321,6 +319,7 @@ export class TranslationServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'translate.googleapis.com'; @@ -329,6 +328,7 @@ export class TranslationServiceClient { /** * The DNS address for this API service - same as servicePath(), * exists for compatibility reasons. + * @returns {string} The DNS address for this service. */ static get apiEndpoint() { return 'translate.googleapis.com'; @@ -336,6 +336,7 @@ export class TranslationServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -344,6 +345,7 @@ export class TranslationServiceClient { /** * The scopes needed to make gRPC calls for every method defined * in this service. + * @returns {string[]} List of default scopes. */ static get scopes() { return [ @@ -356,8 +358,7 @@ export class TranslationServiceClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -474,7 +475,11 @@ export class TranslationServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3.TranslateTextResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.translateText(request); */ translateText( request: protos.google.cloud.translation.v3.ITranslateTextRequest, @@ -596,7 +601,11 @@ export class TranslationServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3.DetectLanguageResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.detectLanguage(request); */ detectLanguage( request: protos.google.cloud.translation.v3.IDetectLanguageRequest, @@ -718,7 +727,11 @@ export class TranslationServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3.SupportedLanguages}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getSupportedLanguages(request); */ getSupportedLanguages( request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, @@ -806,7 +819,11 @@ export class TranslationServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3.Glossary}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getGlossary(request); */ getGlossary( request: protos.google.cloud.translation.v3.IGetGlossaryRequest, @@ -953,8 +970,15 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.batchTranslateText(request); + * const [response] = await operation.promise(); */ batchTranslateText( request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, @@ -1006,18 +1030,19 @@ export class TranslationServiceClient { return this.innerApiCalls.batchTranslateText(request, options, callback); } /** - * Check the status of the long running operation returned by the batchTranslateText() method. + * Check the status of the long running operation returned by `batchTranslateText()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * - * @example: - * const decodedOperation = await checkBatchTranslateTextProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkBatchTranslateTextProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkBatchTranslateTextProgress( name: string @@ -1090,8 +1115,15 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.createGlossary(request); + * const [response] = await operation.promise(); */ createGlossary( request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, @@ -1143,18 +1175,19 @@ export class TranslationServiceClient { return this.innerApiCalls.createGlossary(request, options, callback); } /** - * Check the status of the long running operation returned by the createGlossary() method. + * Check the status of the long running operation returned by `createGlossary()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * - * @example: - * const decodedOperation = await checkCreateGlossaryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateGlossaryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkCreateGlossaryProgress( name: string @@ -1226,8 +1259,15 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.deleteGlossary(request); + * const [response] = await operation.promise(); */ deleteGlossary( request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, @@ -1279,18 +1319,19 @@ export class TranslationServiceClient { return this.innerApiCalls.deleteGlossary(request, options, callback); } /** - * Check the status of the long running operation returned by the deleteGlossary() method. + * Check the status of the long running operation returned by `deleteGlossary()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * - * @example: - * const decodedOperation = await checkDeleteGlossaryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkDeleteGlossaryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkDeleteGlossaryProgress( name: string @@ -1369,19 +1410,14 @@ export class TranslationServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3.Glossary}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Glossary]{@link google.cloud.translation.v3.Glossary} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListGlossariesRequest]{@link google.cloud.translation.v3.ListGlossariesRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListGlossariesResponse]{@link google.cloud.translation.v3.ListGlossariesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listGlossariesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listGlossaries( request: protos.google.cloud.translation.v3.IListGlossariesRequest, @@ -1429,18 +1465,7 @@ export class TranslationServiceClient { } /** - * Equivalent to {@link listGlossaries}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGlossaries} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1461,6 +1486,13 @@ export class TranslationServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3.Glossary} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listGlossariesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listGlossariesStream( request?: protos.google.cloud.translation.v3.IListGlossariesRequest, @@ -1485,10 +1517,9 @@ export class TranslationServiceClient { } /** - * Equivalent to {@link listGlossaries}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listGlossaries`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1508,7 +1539,18 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Glossary]{@link google.cloud.translation.v3.Glossary}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listGlossariesAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listGlossariesAsync( request?: protos.google.cloud.translation.v3.IListGlossariesRequest, @@ -1622,9 +1664,10 @@ export class TranslationServiceClient { } /** - * Terminate the GRPC channel and close the client. + * Terminate the gRPC channel and close the client. * * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { this.initialize(); diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 37a583cec37..c077797bcac 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -62,8 +62,10 @@ export class TranslationServiceClient { /** * Construct an instance of TranslationServiceClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] @@ -83,42 +85,33 @@ export class TranslationServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. + * TODO(@alexander-fenster): link to gax documentation. + * @param {boolean} fallback - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof TranslationServiceClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - if (!opts) { - opts = {servicePath, port}; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the TranslationServiceClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this.constructor as typeof TranslationServiceClient).scopes; + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); // Save options to use in initialize() method. @@ -127,6 +120,11 @@ export class TranslationServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { @@ -322,6 +320,7 @@ export class TranslationServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'translate.googleapis.com'; @@ -330,6 +329,7 @@ export class TranslationServiceClient { /** * The DNS address for this API service - same as servicePath(), * exists for compatibility reasons. + * @returns {string} The DNS address for this service. */ static get apiEndpoint() { return 'translate.googleapis.com'; @@ -337,6 +337,7 @@ export class TranslationServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -345,6 +346,7 @@ export class TranslationServiceClient { /** * The scopes needed to make gRPC calls for every method defined * in this service. + * @returns {string[]} List of default scopes. */ static get scopes() { return [ @@ -357,8 +359,7 @@ export class TranslationServiceClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -475,7 +476,11 @@ export class TranslationServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3beta1.TranslateTextResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.translateText(request); */ translateText( request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, @@ -600,7 +605,11 @@ export class TranslationServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3beta1.DetectLanguageResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.detectLanguage(request); */ detectLanguage( request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, @@ -725,7 +734,11 @@ export class TranslationServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3beta1.SupportedLanguages}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getSupportedLanguages(request); */ getSupportedLanguages( request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, @@ -817,7 +830,11 @@ export class TranslationServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getGlossary(request); */ getGlossary( request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, @@ -966,8 +983,15 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.batchTranslateText(request); + * const [response] = await operation.promise(); */ batchTranslateText( request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, @@ -1019,18 +1043,19 @@ export class TranslationServiceClient { return this.innerApiCalls.batchTranslateText(request, options, callback); } /** - * Check the status of the long running operation returned by the batchTranslateText() method. + * Check the status of the long running operation returned by `batchTranslateText()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * - * @example: - * const decodedOperation = await checkBatchTranslateTextProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkBatchTranslateTextProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkBatchTranslateTextProgress( name: string @@ -1103,8 +1128,15 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.createGlossary(request); + * const [response] = await operation.promise(); */ createGlossary( request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, @@ -1156,18 +1188,19 @@ export class TranslationServiceClient { return this.innerApiCalls.createGlossary(request, options, callback); } /** - * Check the status of the long running operation returned by the createGlossary() method. + * Check the status of the long running operation returned by `createGlossary()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * - * @example: - * const decodedOperation = await checkCreateGlossaryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateGlossaryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkCreateGlossaryProgress( name: string @@ -1239,8 +1272,15 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.deleteGlossary(request); + * const [response] = await operation.promise(); */ deleteGlossary( request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, @@ -1292,18 +1332,19 @@ export class TranslationServiceClient { return this.innerApiCalls.deleteGlossary(request, options, callback); } /** - * Check the status of the long running operation returned by the deleteGlossary() method. + * Check the status of the long running operation returned by `deleteGlossary()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * - * @example: - * const decodedOperation = await checkDeleteGlossaryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkDeleteGlossaryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkDeleteGlossaryProgress( name: string @@ -1382,19 +1423,14 @@ export class TranslationServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListGlossariesRequest]{@link google.cloud.translation.v3beta1.ListGlossariesRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListGlossariesResponse]{@link google.cloud.translation.v3beta1.ListGlossariesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listGlossariesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listGlossaries( request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, @@ -1442,18 +1478,7 @@ export class TranslationServiceClient { } /** - * Equivalent to {@link listGlossaries}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGlossaries} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1474,6 +1499,13 @@ export class TranslationServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listGlossariesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listGlossariesStream( request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, @@ -1498,10 +1530,9 @@ export class TranslationServiceClient { } /** - * Equivalent to {@link listGlossaries}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listGlossaries`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1521,7 +1552,18 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listGlossariesAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listGlossariesAsync( request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, @@ -1635,9 +1677,10 @@ export class TranslationServiceClient { } /** - * Terminate the GRPC channel and close the client. + * Terminate the gRPC channel and close the client. * * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { this.initialize(); diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 8463aa7f94b..ea22fe3dda3 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "77a873f5854fb1ad5065e332e144ecc2a4b398b7" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "7e1a21195ede14f97f7da30efcff4c6bac599bb5", - "internalRef": "330665887" + "remote": "git@github.com:googleapis/nodejs-translate.git", + "sha": "205c645cdf08fbf94a583b06ff921b54e5b56f7b" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ba9918cd22874245b55734f57470c719b577e591" + "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" } } ], @@ -96,6 +88,7 @@ "README.md", "api-extractor.json", "linkinator.config.json", + "package-lock.json.515292936", "protos/google/cloud/translate/v3/translation_service.proto", "protos/google/cloud/translate/v3beta1/translation_service.proto", "protos/protos.d.ts", @@ -103,6 +96,7 @@ "protos/protos.json", "renovate.json", "samples/README.md", + "samples/package-lock.json.3537124090", "src/v3/index.ts", "src/v3/translation_service_client.ts", "src/v3/translation_service_client_config.json", diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts index 8ef08d3c3da..f2c2d83a07e 100644 --- a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts @@ -18,8 +18,15 @@ import {TranslationServiceClient} from '@google-cloud/translate'; +// check that the client class type name can be used +function doStuffWithTranslationServiceClient(client: TranslationServiceClient) { + client.close(); +} + function main() { - new TranslationServiceClient(); + // check that the client instance can be created + const translationServiceClient = new TranslationServiceClient(); + doStuffWithTranslationServiceClient(translationServiceClient); } main(); diff --git a/packages/google-cloud-translate/system-test/install.ts b/packages/google-cloud-translate/system-test/install.ts index 4c1ba3eb79a..39d90f771de 100644 --- a/packages/google-cloud-translate/system-test/install.ts +++ b/packages/google-cloud-translate/system-test/install.ts @@ -20,32 +20,32 @@ import {packNTest} from 'pack-n-play'; import {readFileSync} from 'fs'; import {describe, it} from 'mocha'; -describe('typescript consumer tests', () => { - it('should have correct type signature for typescript users', async function () { +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), sample: { - description: 'typescript based user can use the type definitions', + description: 'TypeScript user can use the type definitions', ts: readFileSync( './system-test/fixtures/sample/src/index.ts' ).toString(), }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); }); - it('should have correct type signature for javascript users', async function () { + it('JavaScript code', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), sample: { - description: 'typescript based user can use the type definitions', + description: 'JavaScript user can use the library', ts: readFileSync( './system-test/fixtures/sample/src/index.js' ).toString(), }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); }); }); From ebb3b2e9253eeea5f4683773fd675308a4cdfd14 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2020 09:20:59 -0800 Subject: [PATCH 408/513] chore: release 6.0.4 (#594) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index f2a7dc801d8..125b33712a9 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.0.4](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.3...v6.0.4) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#593](https://www.github.com/googleapis/nodejs-translate/issues/593)) ([f38bbcd](https://www.github.com/googleapis/nodejs-translate/commit/f38bbcdb6df9f5e3849c20ff0cc2dfd020284c61)) + ### [6.0.3](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.2...v6.0.3) (2020-09-17) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c5199f99978..c3efdd08e54 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.0.3", + "version": "6.0.4", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 072f7f2a029..f08116cf6c9 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.0.3", + "@google-cloud/translate": "^6.0.4", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From c0f033649c2453f58d905c0196a8b801d4bbba91 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Nov 2020 12:26:03 -0800 Subject: [PATCH 409/513] fix(browser): check for fetch on window --- .../google-cloud-translate/protos/protos.json | 304 ++++++++++++++++-- .../src/v3/translation_service_client.ts | 100 +++--- .../src/v3beta1/translation_service_client.ts | 100 +++--- .../google-cloud-translate/synth.metadata | 14 +- 4 files changed, 402 insertions(+), 116 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index d4b117ee9d9..ddc15d4cece 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -33,7 +33,25 @@ "(google.api.http).additional_bindings.post": "/v3/{parent=projects/*}:translateText", "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "parent,model,mime_type,source_language_code,target_language_code,contents" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*}:translateText", + "body": "*", + "additional_bindings": { + "post": "/v3/{parent=projects/*}:translateText", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,target_language_code,contents" + }, + { + "(google.api.method_signature)": "parent,model,mime_type,source_language_code,target_language_code,contents" + } + ] }, "DetectLanguage": { "requestType": "DetectLanguageRequest", @@ -44,7 +62,22 @@ "(google.api.http).additional_bindings.post": "/v3/{parent=projects/*}:detectLanguage", "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "parent,model,mime_type,content" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*}:detectLanguage", + "body": "*", + "additional_bindings": { + "post": "/v3/{parent=projects/*}:detectLanguage", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,model,mime_type,content" + } + ] }, "GetSupportedLanguages": { "requestType": "GetSupportedLanguagesRequest", @@ -53,7 +86,20 @@ "(google.api.http).get": "/v3/{parent=projects/*/locations/*}/supportedLanguages", "(google.api.http).additional_bindings.get": "/v3/{parent=projects/*}/supportedLanguages", "(google.api.method_signature)": "parent,model,display_language_code" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*}/supportedLanguages", + "additional_bindings": { + "get": "/v3/{parent=projects/*}/supportedLanguages" + } + } + }, + { + "(google.api.method_signature)": "parent,model,display_language_code" + } + ] }, "BatchTranslateText": { "requestType": "BatchTranslateTextRequest", @@ -63,7 +109,21 @@ "(google.api.http).body": "*", "(google.longrunning.operation_info).response_type": "BatchTranslateResponse", "(google.longrunning.operation_info).metadata_type": "BatchTranslateMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*}:batchTranslateText", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchTranslateResponse", + "metadata_type": "BatchTranslateMetadata" + } + } + ] }, "CreateGlossary": { "requestType": "CreateGlossaryRequest", @@ -74,7 +134,24 @@ "(google.api.method_signature)": "parent,glossary", "(google.longrunning.operation_info).response_type": "Glossary", "(google.longrunning.operation_info).metadata_type": "CreateGlossaryMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*}/glossaries", + "body": "glossary" + } + }, + { + "(google.api.method_signature)": "parent,glossary" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Glossary", + "metadata_type": "CreateGlossaryMetadata" + } + } + ] }, "ListGlossaries": { "requestType": "ListGlossariesRequest", @@ -82,7 +159,17 @@ "options": { "(google.api.http).get": "/v3/{parent=projects/*/locations/*}/glossaries", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*}/glossaries" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "GetGlossary": { "requestType": "GetGlossaryRequest", @@ -90,7 +177,17 @@ "options": { "(google.api.http).get": "/v3/{name=projects/*/locations/*/glossaries/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*/locations/*/glossaries/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "DeleteGlossary": { "requestType": "DeleteGlossaryRequest", @@ -100,7 +197,23 @@ "(google.api.method_signature)": "name", "(google.longrunning.operation_info).response_type": "DeleteGlossaryResponse", "(google.longrunning.operation_info).metadata_type": "DeleteGlossaryMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*/locations/*/glossaries/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeleteGlossaryResponse", + "metadata_type": "DeleteGlossaryMetadata" + } + } + ] } } }, @@ -799,7 +912,19 @@ "(google.api.http).body": "*", "(google.api.http).additional_bindings.post": "/v3beta1/{parent=projects/*}:translateText", "(google.api.http).additional_bindings.body": "*" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*}:translateText", + "body": "*", + "additional_bindings": { + "post": "/v3beta1/{parent=projects/*}:translateText", + "body": "*" + } + } + } + ] }, "DetectLanguage": { "requestType": "DetectLanguageRequest", @@ -810,7 +935,22 @@ "(google.api.http).additional_bindings.post": "/v3beta1/{parent=projects/*}:detectLanguage", "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "parent,model,mime_type" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*}:detectLanguage", + "body": "*", + "additional_bindings": { + "post": "/v3beta1/{parent=projects/*}:detectLanguage", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,model,mime_type" + } + ] }, "GetSupportedLanguages": { "requestType": "GetSupportedLanguagesRequest", @@ -819,7 +959,20 @@ "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*}/supportedLanguages", "(google.api.http).additional_bindings.get": "/v3beta1/{parent=projects/*}/supportedLanguages", "(google.api.method_signature)": "parent,display_language_code,model" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*}/supportedLanguages", + "additional_bindings": { + "get": "/v3beta1/{parent=projects/*}/supportedLanguages" + } + } + }, + { + "(google.api.method_signature)": "parent,display_language_code,model" + } + ] }, "BatchTranslateText": { "requestType": "BatchTranslateTextRequest", @@ -829,7 +982,21 @@ "(google.api.http).body": "*", "(google.longrunning.operation_info).response_type": "BatchTranslateResponse", "(google.longrunning.operation_info).metadata_type": "BatchTranslateMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*}:batchTranslateText", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchTranslateResponse", + "metadata_type": "BatchTranslateMetadata" + } + } + ] }, "CreateGlossary": { "requestType": "CreateGlossaryRequest", @@ -840,7 +1007,24 @@ "(google.api.method_signature)": "parent,glossary", "(google.longrunning.operation_info).response_type": "Glossary", "(google.longrunning.operation_info).metadata_type": "CreateGlossaryMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*}/glossaries", + "body": "glossary" + } + }, + { + "(google.api.method_signature)": "parent,glossary" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Glossary", + "metadata_type": "CreateGlossaryMetadata" + } + } + ] }, "ListGlossaries": { "requestType": "ListGlossariesRequest", @@ -848,7 +1032,20 @@ "options": { "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*}/glossaries", "(google.api.method_signature)": "parent,filter" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*}/glossaries" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] }, "GetGlossary": { "requestType": "GetGlossaryRequest", @@ -856,7 +1053,17 @@ "options": { "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/glossaries/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/glossaries/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "DeleteGlossary": { "requestType": "DeleteGlossaryRequest", @@ -866,7 +1073,23 @@ "(google.api.method_signature)": "name", "(google.longrunning.operation_info).response_type": "DeleteGlossaryResponse", "(google.longrunning.operation_info).metadata_type": "DeleteGlossaryMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/glossaries/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeleteGlossaryResponse", + "metadata_type": "DeleteGlossaryMetadata" + } + } + ] } } }, @@ -2709,7 +2932,17 @@ "options": { "(google.api.http).get": "/v1/{name=operations}", "(google.api.method_signature)": "name,filter" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] }, "GetOperation": { "requestType": "GetOperationRequest", @@ -2717,7 +2950,17 @@ "options": { "(google.api.http).get": "/v1/{name=operations/**}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "DeleteOperation": { "requestType": "DeleteOperationRequest", @@ -2725,7 +2968,17 @@ "options": { "(google.api.http).delete": "/v1/{name=operations/**}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "CancelOperation": { "requestType": "CancelOperationRequest", @@ -2734,7 +2987,18 @@ "(google.api.http).post": "/v1/{name=operations/**}:cancel", "(google.api.http).body": "*", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "WaitOperation": { "requestType": "WaitOperationRequest", diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 01c61964eb3..63256a936b5 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v3/translation_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './translation_service_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -85,9 +91,9 @@ export class TranslationServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -100,7 +106,9 @@ export class TranslationServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -375,7 +383,7 @@ export class TranslationServiceClient { // ------------------- translateText( request: protos.google.cloud.translation.v3.ITranslateTextRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.translation.v3.ITranslateTextResponse, @@ -385,7 +393,7 @@ export class TranslationServiceClient { >; translateText( request: protos.google.cloud.translation.v3.ITranslateTextRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.translation.v3.ITranslateTextResponse, | protos.google.cloud.translation.v3.ITranslateTextRequest @@ -484,7 +492,7 @@ export class TranslationServiceClient { translateText( request: protos.google.cloud.translation.v3.ITranslateTextRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.translation.v3.ITranslateTextResponse, | protos.google.cloud.translation.v3.ITranslateTextRequest @@ -507,12 +515,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -527,7 +535,7 @@ export class TranslationServiceClient { } detectLanguage( request: protos.google.cloud.translation.v3.IDetectLanguageRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.translation.v3.IDetectLanguageResponse, @@ -537,7 +545,7 @@ export class TranslationServiceClient { >; detectLanguage( request: protos.google.cloud.translation.v3.IDetectLanguageRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.translation.v3.IDetectLanguageResponse, | protos.google.cloud.translation.v3.IDetectLanguageRequest @@ -610,7 +618,7 @@ export class TranslationServiceClient { detectLanguage( request: protos.google.cloud.translation.v3.IDetectLanguageRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.translation.v3.IDetectLanguageResponse, | protos.google.cloud.translation.v3.IDetectLanguageRequest @@ -633,12 +641,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -653,7 +661,7 @@ export class TranslationServiceClient { } getSupportedLanguages( request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.translation.v3.ISupportedLanguages, @@ -666,7 +674,7 @@ export class TranslationServiceClient { >; getSupportedLanguages( request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.translation.v3.ISupportedLanguages, | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest @@ -736,7 +744,7 @@ export class TranslationServiceClient { getSupportedLanguages( request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.translation.v3.ISupportedLanguages, | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest @@ -762,12 +770,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -782,7 +790,7 @@ export class TranslationServiceClient { } getGlossary( request: protos.google.cloud.translation.v3.IGetGlossaryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.translation.v3.IGlossary, @@ -792,7 +800,7 @@ export class TranslationServiceClient { >; getGlossary( request: protos.google.cloud.translation.v3.IGetGlossaryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.translation.v3.IGlossary, protos.google.cloud.translation.v3.IGetGlossaryRequest | null | undefined, @@ -828,7 +836,7 @@ export class TranslationServiceClient { getGlossary( request: protos.google.cloud.translation.v3.IGetGlossaryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.translation.v3.IGlossary, | protos.google.cloud.translation.v3.IGetGlossaryRequest @@ -849,12 +857,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -870,7 +878,7 @@ export class TranslationServiceClient { batchTranslateText( request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -883,7 +891,7 @@ export class TranslationServiceClient { >; batchTranslateText( request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.translation.v3.IBatchTranslateResponse, @@ -983,7 +991,7 @@ export class TranslationServiceClient { batchTranslateText( request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.translation.v3.IBatchTranslateResponse, @@ -1011,12 +1019,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1068,7 +1076,7 @@ export class TranslationServiceClient { } createGlossary( request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1081,7 +1089,7 @@ export class TranslationServiceClient { >; createGlossary( request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.translation.v3.IGlossary, @@ -1128,7 +1136,7 @@ export class TranslationServiceClient { createGlossary( request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.translation.v3.IGlossary, @@ -1156,12 +1164,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1213,7 +1221,7 @@ export class TranslationServiceClient { } deleteGlossary( request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1226,7 +1234,7 @@ export class TranslationServiceClient { >; deleteGlossary( request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.translation.v3.IDeleteGlossaryResponse, @@ -1272,7 +1280,7 @@ export class TranslationServiceClient { deleteGlossary( request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.translation.v3.IDeleteGlossaryResponse, @@ -1300,12 +1308,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1357,7 +1365,7 @@ export class TranslationServiceClient { } listGlossaries( request: protos.google.cloud.translation.v3.IListGlossariesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.translation.v3.IGlossary[], @@ -1367,7 +1375,7 @@ export class TranslationServiceClient { >; listGlossaries( request: protos.google.cloud.translation.v3.IListGlossariesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.translation.v3.IListGlossariesRequest, | protos.google.cloud.translation.v3.IListGlossariesResponse @@ -1422,7 +1430,7 @@ export class TranslationServiceClient { listGlossaries( request: protos.google.cloud.translation.v3.IListGlossariesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.translation.v3.IListGlossariesRequest, | protos.google.cloud.translation.v3.IListGlossariesResponse @@ -1445,12 +1453,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1496,7 +1504,7 @@ export class TranslationServiceClient { */ listGlossariesStream( request?: protos.google.cloud.translation.v3.IListGlossariesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1554,7 +1562,7 @@ export class TranslationServiceClient { */ listGlossariesAsync( request?: protos.google.cloud.translation.v3.IListGlossariesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index c077797bcac..e15cd73cee1 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/translation_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './translation_service_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -85,9 +91,9 @@ export class TranslationServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -100,7 +106,9 @@ export class TranslationServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -376,7 +384,7 @@ export class TranslationServiceClient { // ------------------- translateText( request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.translation.v3beta1.ITranslateTextResponse, @@ -386,7 +394,7 @@ export class TranslationServiceClient { >; translateText( request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.translation.v3beta1.ITranslateTextResponse, | protos.google.cloud.translation.v3beta1.ITranslateTextRequest @@ -485,7 +493,7 @@ export class TranslationServiceClient { translateText( request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.translation.v3beta1.ITranslateTextResponse, | protos.google.cloud.translation.v3beta1.ITranslateTextRequest @@ -508,12 +516,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -528,7 +536,7 @@ export class TranslationServiceClient { } detectLanguage( request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, @@ -541,7 +549,7 @@ export class TranslationServiceClient { >; detectLanguage( request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest @@ -614,7 +622,7 @@ export class TranslationServiceClient { detectLanguage( request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest @@ -640,12 +648,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -660,7 +668,7 @@ export class TranslationServiceClient { } getSupportedLanguages( request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.translation.v3beta1.ISupportedLanguages, @@ -673,7 +681,7 @@ export class TranslationServiceClient { >; getSupportedLanguages( request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.translation.v3beta1.ISupportedLanguages, | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest @@ -743,7 +751,7 @@ export class TranslationServiceClient { getSupportedLanguages( request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.translation.v3beta1.ISupportedLanguages, | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest @@ -769,12 +777,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -789,7 +797,7 @@ export class TranslationServiceClient { } getGlossary( request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.translation.v3beta1.IGlossary, @@ -799,7 +807,7 @@ export class TranslationServiceClient { >; getGlossary( request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.translation.v3beta1.IGlossary, | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest @@ -839,7 +847,7 @@ export class TranslationServiceClient { getGlossary( request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.translation.v3beta1.IGlossary, | protos.google.cloud.translation.v3beta1.IGetGlossaryRequest @@ -862,12 +870,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -883,7 +891,7 @@ export class TranslationServiceClient { batchTranslateText( request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -896,7 +904,7 @@ export class TranslationServiceClient { >; batchTranslateText( request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, @@ -996,7 +1004,7 @@ export class TranslationServiceClient { batchTranslateText( request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, @@ -1024,12 +1032,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1081,7 +1089,7 @@ export class TranslationServiceClient { } createGlossary( request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1094,7 +1102,7 @@ export class TranslationServiceClient { >; createGlossary( request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.translation.v3beta1.IGlossary, @@ -1141,7 +1149,7 @@ export class TranslationServiceClient { createGlossary( request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.translation.v3beta1.IGlossary, @@ -1169,12 +1177,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1226,7 +1234,7 @@ export class TranslationServiceClient { } deleteGlossary( request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1239,7 +1247,7 @@ export class TranslationServiceClient { >; deleteGlossary( request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, @@ -1285,7 +1293,7 @@ export class TranslationServiceClient { deleteGlossary( request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, @@ -1313,12 +1321,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1370,7 +1378,7 @@ export class TranslationServiceClient { } listGlossaries( request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.translation.v3beta1.IGlossary[], @@ -1380,7 +1388,7 @@ export class TranslationServiceClient { >; listGlossaries( request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.translation.v3beta1.IListGlossariesRequest, | protos.google.cloud.translation.v3beta1.IListGlossariesResponse @@ -1435,7 +1443,7 @@ export class TranslationServiceClient { listGlossaries( request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.translation.v3beta1.IListGlossariesRequest, | protos.google.cloud.translation.v3beta1.IListGlossariesResponse @@ -1458,12 +1466,12 @@ export class TranslationServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1509,7 +1517,7 @@ export class TranslationServiceClient { */ listGlossariesStream( request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1567,7 +1575,7 @@ export class TranslationServiceClient { */ listGlossariesAsync( request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index ea22fe3dda3..0bb3c7453b9 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -3,8 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-translate.git", - "sha": "205c645cdf08fbf94a583b06ff921b54e5b56f7b" + "remote": "https://github.com/googleapis/nodejs-translate.git", + "sha": "cea46334c98eae24183ff42af5b15887a86d1b96" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "2f019bf70bfe06f1e2af1b04011b0a2405190e43", + "internalRef": "343202295" } }, { @@ -88,7 +96,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.515292936", "protos/google/cloud/translate/v3/translation_service.proto", "protos/google/cloud/translate/v3beta1/translation_service.proto", "protos/protos.d.ts", @@ -96,7 +103,6 @@ "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.3537124090", "src/v3/index.ts", "src/v3/translation_service_client.ts", "src/v3/translation_service_client_config.json", From 322a188d22f0d17e9ff4c9e9add0bedd6d40a603 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 30 Nov 2020 08:19:54 -0800 Subject: [PATCH 410/513] docs: spelling correction for "targetting" (#601) Co-authored-by: Benjamin E. Coe Source-Author: Samyak Jain Source-Date: Tue Nov 24 20:27:51 2020 +0530 Source-Repo: googleapis/synthtool Source-Sha: 15013eff642a7e7e855aed5a29e6e83c39beba2a Source-Link: https://github.com/googleapis/synthtool/commit/15013eff642a7e7e855aed5a29e6e83c39beba2a --- packages/google-cloud-translate/README.md | 2 +- .../google-cloud-translate/synth.metadata | 80 +------------------ 2 files changed, 3 insertions(+), 79 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index b8e16a81898..6f5ac8b91df 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -115,7 +115,7 @@ Our client libraries follow the [Node.js release schedule](https://nodejs.org/en Libraries are compatible with all current _active_ and _maintenance_ versions of Node.js. -Client libraries targetting some end-of-life versions of Node.js are available, and +Client libraries targeting some end-of-life versions of Node.js are available, and can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). The dist-tags follow the naming convention `legacy-(version)`. diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 0bb3c7453b9..ec5dfd2b61f 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "cea46334c98eae24183ff42af5b15887a86d1b96" + "sha": "de3e5624981cd07249bd2aad6fcb0f53a6383a3f" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" + "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" } } ], @@ -42,81 +42,5 @@ "generator": "bazel" } } - ], - "generatedFiles": [ - ".eslintignore", - ".eslintrc.json", - ".gitattributes", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/release-please.yml", - ".github/workflows/ci.yaml", - ".gitignore", - ".jsdoc.js", - ".kokoro/.gitattributes", - ".kokoro/common.cfg", - ".kokoro/continuous/node10/common.cfg", - ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/test.cfg", - ".kokoro/continuous/node12/common.cfg", - ".kokoro/continuous/node12/lint.cfg", - ".kokoro/continuous/node12/samples-test.cfg", - ".kokoro/continuous/node12/system-test.cfg", - ".kokoro/continuous/node12/test.cfg", - ".kokoro/docs.sh", - ".kokoro/lint.sh", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/node10/common.cfg", - ".kokoro/presubmit/node12/common.cfg", - ".kokoro/presubmit/node12/samples-test.cfg", - ".kokoro/presubmit/node12/system-test.cfg", - ".kokoro/presubmit/node12/test.cfg", - ".kokoro/publish.sh", - ".kokoro/release/docs-devsite.cfg", - ".kokoro/release/docs-devsite.sh", - ".kokoro/release/docs.cfg", - ".kokoro/release/docs.sh", - ".kokoro/release/publish.cfg", - ".kokoro/samples-test.sh", - ".kokoro/system-test.sh", - ".kokoro/test.bat", - ".kokoro/test.sh", - ".kokoro/trampoline.sh", - ".kokoro/trampoline_v2.sh", - ".mocharc.js", - ".nycrc", - ".prettierignore", - ".prettierrc.js", - ".trampolinerc", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "README.md", - "api-extractor.json", - "linkinator.config.json", - "protos/google/cloud/translate/v3/translation_service.proto", - "protos/google/cloud/translate/v3beta1/translation_service.proto", - "protos/protos.d.ts", - "protos/protos.js", - "protos/protos.json", - "renovate.json", - "samples/README.md", - "src/v3/index.ts", - "src/v3/translation_service_client.ts", - "src/v3/translation_service_client_config.json", - "src/v3/translation_service_proto_list.json", - "src/v3beta1/index.ts", - "src/v3beta1/translation_service_client.ts", - "src/v3beta1/translation_service_client_config.json", - "src/v3beta1/translation_service_proto_list.json", - "system-test/fixtures/sample/src/index.js", - "system-test/fixtures/sample/src/index.ts", - "system-test/install.ts", - "test/gapic_translation_service_v3.ts", - "test/gapic_translation_service_v3beta1.ts", - "tsconfig.json", - "webpack.config.js" ] } \ No newline at end of file From 25fe6a46c8857ba3d5304dc531624b16506e6a36 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 4 Dec 2020 08:56:02 -0800 Subject: [PATCH 411/513] chore: generate GAPIC metadata JSON file (#603) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9777e4fc-493b-4824-939e-2bf12cea9581/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 345596855 Source-Link: https://github.com/googleapis/googleapis/commit/d189e871205fea665a9648f7c4676f027495ccaf --- .../src/v3/gapic_metadata.json | 107 ++++++++++++++++++ .../src/v3beta1/gapic_metadata.json | 107 ++++++++++++++++++ .../google-cloud-translate/synth.metadata | 6 +- 3 files changed, 217 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-translate/src/v3/gapic_metadata.json create mode 100644 packages/google-cloud-translate/src/v3beta1/gapic_metadata.json diff --git a/packages/google-cloud-translate/src/v3/gapic_metadata.json b/packages/google-cloud-translate/src/v3/gapic_metadata.json new file mode 100644 index 00000000000..54b01faa492 --- /dev/null +++ b/packages/google-cloud-translate/src/v3/gapic_metadata.json @@ -0,0 +1,107 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.translation.v3", + "libraryPackage": "@google-cloud/translate", + "services": { + "TranslationService": { + "clients": { + "grpc": { + "libraryClient": "TranslationServiceClient", + "rpcs": { + "TranslateText": { + "methods": [ + "translateText" + ] + }, + "DetectLanguage": { + "methods": [ + "detectLanguage" + ] + }, + "GetSupportedLanguages": { + "methods": [ + "getSupportedLanguages" + ] + }, + "GetGlossary": { + "methods": [ + "getGlossary" + ] + }, + "BatchTranslateText": { + "methods": [ + "batchTranslateText" + ] + }, + "CreateGlossary": { + "methods": [ + "createGlossary" + ] + }, + "DeleteGlossary": { + "methods": [ + "deleteGlossary" + ] + }, + "ListGlossaries": { + "methods": [ + "listGlossaries", + "listGlossariesStream", + "listGlossariesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TranslationServiceClient", + "rpcs": { + "TranslateText": { + "methods": [ + "translateText" + ] + }, + "DetectLanguage": { + "methods": [ + "detectLanguage" + ] + }, + "GetSupportedLanguages": { + "methods": [ + "getSupportedLanguages" + ] + }, + "GetGlossary": { + "methods": [ + "getGlossary" + ] + }, + "BatchTranslateText": { + "methods": [ + "batchTranslateText" + ] + }, + "CreateGlossary": { + "methods": [ + "createGlossary" + ] + }, + "DeleteGlossary": { + "methods": [ + "deleteGlossary" + ] + }, + "ListGlossaries": { + "methods": [ + "listGlossaries", + "listGlossariesStream", + "listGlossariesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-translate/src/v3beta1/gapic_metadata.json b/packages/google-cloud-translate/src/v3beta1/gapic_metadata.json new file mode 100644 index 00000000000..8a34399c0d1 --- /dev/null +++ b/packages/google-cloud-translate/src/v3beta1/gapic_metadata.json @@ -0,0 +1,107 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.translation.v3beta1", + "libraryPackage": "@google-cloud/translate", + "services": { + "TranslationService": { + "clients": { + "grpc": { + "libraryClient": "TranslationServiceClient", + "rpcs": { + "TranslateText": { + "methods": [ + "translateText" + ] + }, + "DetectLanguage": { + "methods": [ + "detectLanguage" + ] + }, + "GetSupportedLanguages": { + "methods": [ + "getSupportedLanguages" + ] + }, + "GetGlossary": { + "methods": [ + "getGlossary" + ] + }, + "BatchTranslateText": { + "methods": [ + "batchTranslateText" + ] + }, + "CreateGlossary": { + "methods": [ + "createGlossary" + ] + }, + "DeleteGlossary": { + "methods": [ + "deleteGlossary" + ] + }, + "ListGlossaries": { + "methods": [ + "listGlossaries", + "listGlossariesStream", + "listGlossariesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TranslationServiceClient", + "rpcs": { + "TranslateText": { + "methods": [ + "translateText" + ] + }, + "DetectLanguage": { + "methods": [ + "detectLanguage" + ] + }, + "GetSupportedLanguages": { + "methods": [ + "getSupportedLanguages" + ] + }, + "GetGlossary": { + "methods": [ + "getGlossary" + ] + }, + "BatchTranslateText": { + "methods": [ + "batchTranslateText" + ] + }, + "CreateGlossary": { + "methods": [ + "createGlossary" + ] + }, + "DeleteGlossary": { + "methods": [ + "deleteGlossary" + ] + }, + "ListGlossaries": { + "methods": [ + "listGlossaries", + "listGlossariesStream", + "listGlossariesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index ec5dfd2b61f..92b6df27480 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "de3e5624981cd07249bd2aad6fcb0f53a6383a3f" + "sha": "3f78a0fc9fe336a2084cc1641ec63f42fc11d0d0" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2f019bf70bfe06f1e2af1b04011b0a2405190e43", - "internalRef": "343202295" + "sha": "d189e871205fea665a9648f7c4676f027495ccaf", + "internalRef": "345596855" } }, { From e23f6bc1ef07b357563e568cd2e0bb90c8e57bee Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Dec 2020 13:03:01 -0800 Subject: [PATCH 412/513] chore: release 6.0.5 (#599) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 125b33712a9..2b2d3287ccf 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.0.5](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.4...v6.0.5) (2020-12-04) + + +### Bug Fixes + +* **browser:** check for fetch on window ([de3e562](https://www.github.com/googleapis/nodejs-translate/commit/de3e5624981cd07249bd2aad6fcb0f53a6383a3f)) + ### [6.0.4](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.3...v6.0.4) (2020-11-07) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c3efdd08e54..7f9709891e9 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.0.4", + "version": "6.0.5", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index f08116cf6c9..ba7b2edbda7 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.0.4", + "@google-cloud/translate": "^6.0.5", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From 39159fb7de4ed2cbeb6c6bede998a201e67c8624 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 22 Dec 2020 11:42:20 -0800 Subject: [PATCH 413/513] docs: add instructions for authenticating for system tests (#608) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/959b7829-922a-41dc-a5a7-1178c3a8f0e7/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/363fe305e9ce34a6cd53951c6ee5f997094b54ee --- packages/google-cloud-translate/CONTRIBUTING.md | 15 +++++++++++++-- packages/google-cloud-translate/README.md | 3 +-- packages/google-cloud-translate/synth.metadata | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-translate/CONTRIBUTING.md b/packages/google-cloud-translate/CONTRIBUTING.md index f6c4cf010e3..cc99e9dc9fa 100644 --- a/packages/google-cloud-translate/CONTRIBUTING.md +++ b/packages/google-cloud-translate/CONTRIBUTING.md @@ -37,6 +37,15 @@ accept your pull requests. 1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. 1. Submit a pull request. +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Translation API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + ## Running the tests 1. [Prepare your environment for Node.js setup][setup]. @@ -51,11 +60,9 @@ accept your pull requests. npm test # Run sample integration tests. - gcloud auth application-default login npm run samples-test # Run all system tests. - gcloud auth application-default login npm run system-test 1. Lint (and maybe fix) any changes: @@ -63,3 +70,7 @@ accept your pull requests. npm run fix [setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=translate.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 6f5ac8b91df..f7059e061e8 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -95,8 +95,7 @@ quickStart(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-translate/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-translate/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 92b6df27480..532e005397b 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "3f78a0fc9fe336a2084cc1641ec63f42fc11d0d0" + "sha": "f0397048fe4633f04354a8b1a783561fe9188e3e" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" + "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" } } ], From 5529e7bb400c359b11e5acaf5465511d7b9afc97 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 7 Jan 2021 11:42:07 -0800 Subject: [PATCH 414/513] docs: update dates (#610) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/000b31a7-d841-4bba-9f39-9c136bef31bc/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-translate/.jsdoc.js | 4 ++-- packages/google-cloud-translate/protos/protos.d.ts | 2 +- packages/google-cloud-translate/protos/protos.js | 2 +- packages/google-cloud-translate/src/v3/index.ts | 2 +- .../src/v3/translation_service_client.ts | 2 +- packages/google-cloud-translate/src/v3beta1/index.ts | 2 +- .../src/v3beta1/translation_service_client.ts | 2 +- packages/google-cloud-translate/synth.metadata | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-translate/system-test/install.ts | 2 +- .../test/gapic_translation_service_v3.ts | 2 +- .../test/gapic_translation_service_v3beta1.ts | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index a9fe77d5096..0a8a25c2efa 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2020 Google LLC', + copyright: 'Copyright 2021 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/translate', diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index f9c1d7c0a15..155b53186bd 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index 5d384402a38..f0edaee6917 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/src/v3/index.ts b/packages/google-cloud-translate/src/v3/index.ts index 698e0dbadfc..46c4e3c5aa0 100644 --- a/packages/google-cloud-translate/src/v3/index.ts +++ b/packages/google-cloud-translate/src/v3/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 63256a936b5..99cd5d9f6d4 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/src/v3beta1/index.ts b/packages/google-cloud-translate/src/v3beta1/index.ts index 698e0dbadfc..46c4e3c5aa0 100644 --- a/packages/google-cloud-translate/src/v3beta1/index.ts +++ b/packages/google-cloud-translate/src/v3beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index e15cd73cee1..8cf11d89752 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index 532e005397b..cd98b4a297f 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "f0397048fe4633f04354a8b1a783561fe9188e3e" + "sha": "c5400a8ed60371ce793230c27d622e1da70feeaf" } }, { diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js index e994918631d..46a6206922b 100644 --- a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts index f2c2d83a07e..6c04cfbdbb1 100644 --- a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/system-test/install.ts b/packages/google-cloud-translate/system-test/install.ts index 39d90f771de..d2d61c0396f 100644 --- a/packages/google-cloud-translate/system-test/install.ts +++ b/packages/google-cloud-translate/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts index 43d4da0e20d..b18f1caec96 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts index 4d65c273d52..8453e2763c2 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From caab64f92d8ca58a6110803b0dc837677bed69da Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 Jan 2021 18:40:14 -0800 Subject: [PATCH 415/513] feat: adds style enumeration (#611) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/3cbe2688-2bdb-41ef-9967-e7d03a185d83/targets - [ ] To automatically regenerate this PR, check this box. --- .../google-cloud-translate/protos/protos.d.ts | 12 +++ .../google-cloud-translate/protos/protos.js | 78 ++++++++++++++++++- .../google-cloud-translate/protos/protos.json | 13 +++- .../google-cloud-translate/synth.metadata | 2 +- 4 files changed, 102 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index 155b53186bd..578f3429c6a 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -6795,6 +6795,9 @@ export namespace google { /** ResourceDescriptor singular */ singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } /** Represents a ResourceDescriptor. */ @@ -6824,6 +6827,9 @@ export namespace google { /** ResourceDescriptor singular. */ public singular: string; + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + /** * Creates a new ResourceDescriptor instance using the specified properties. * @param [properties] Properties to set @@ -6903,6 +6909,12 @@ export namespace google { ORIGINALLY_SINGLE_PATTERN = 1, FUTURE_MULTI_PATTERN = 2 } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } } /** Properties of a ResourceReference. */ diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index f0edaee6917..7cf7fbccf47 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -16598,6 +16598,7 @@ * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history * @property {string|null} [plural] ResourceDescriptor plural * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style */ /** @@ -16610,6 +16611,7 @@ */ function ResourceDescriptor(properties) { this.pattern = []; + this.style = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16664,6 +16666,14 @@ */ ResourceDescriptor.prototype.singular = ""; + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + /** * Creates a new ResourceDescriptor instance using the specified properties. * @function create @@ -16701,6 +16711,12 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } return writer; }; @@ -16755,6 +16771,16 @@ case 6: message.singular = reader.string(); break; + case 10: + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; default: reader.skipType(tag & 7); break; @@ -16818,6 +16844,18 @@ if (message.singular != null && message.hasOwnProperty("singular")) if (!$util.isString(message.singular)) return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } return null; }; @@ -16862,6 +16900,23 @@ message.plural = String(object.plural); if (object.singular != null) message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } return message; }; @@ -16878,8 +16933,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.pattern = []; + object.style = []; + } if (options.defaults) { object.type = ""; object.nameField = ""; @@ -16902,6 +16959,11 @@ object.plural = message.plural; if (message.singular != null && message.hasOwnProperty("singular")) object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } return object; }; @@ -16932,6 +16994,20 @@ return values; })(); + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + return ResourceDescriptor; })(); diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index ddc15d4cece..eb44b823b9d 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -1943,6 +1943,11 @@ "singular": { "type": "string", "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 } }, "nested": { @@ -1952,6 +1957,12 @@ "ORIGINALLY_SINGLE_PATTERN": 1, "FUTURE_MULTI_PATTERN": 2 } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } } } }, @@ -1971,7 +1982,7 @@ }, "protobuf": { "options": { - "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "go_package": "google.golang.org/protobuf/types/descriptorpb", "java_package": "com.google.protobuf", "java_outer_classname": "DescriptorProtos", "csharp_namespace": "Google.Protobuf.Reflection", diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index cd98b4a297f..c578c145e17 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "c5400a8ed60371ce793230c27d622e1da70feeaf" + "sha": "12066f64da5a3613dd00a72bb721bccf477208f4" } }, { From 871e2503630f10e2db21da89034eb306c9ae850d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 12 Jan 2021 18:36:15 +0000 Subject: [PATCH 416/513] chore: release 6.1.0 (#612) :robot: I have created a release \*beep\* \*boop\* --- ## [6.1.0](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.5...v6.1.0) (2021-01-09) ### Features * adds style enumeration ([#611](https://www.github.com/googleapis/nodejs-translate/issues/611)) ([3189de4](https://www.github.com/googleapis/nodejs-translate/commit/3189de48c865e86e86475819a95698bc9c7e6822)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 2b2d3287ccf..dae3077cd99 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [6.1.0](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.5...v6.1.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#611](https://www.github.com/googleapis/nodejs-translate/issues/611)) ([3189de4](https://www.github.com/googleapis/nodejs-translate/commit/3189de48c865e86e86475819a95698bc9c7e6822)) + ### [6.0.5](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.4...v6.0.5) (2020-12-04) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7f9709891e9..bbb1032ff4d 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.0.5", + "version": "6.1.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index ba7b2edbda7..c9c3a40134e 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.0.5", + "@google-cloud/translate": "^6.1.0", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From cc2e11a7d6ea38b4ec485ba016a30f2628e58af2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 Jan 2021 08:40:18 -0800 Subject: [PATCH 417/513] refactor(nodejs): move build cop to flakybot (#618) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/1bcecc39-aa5c-40f4-9453-955704c7ca01/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/57c23fa5705499a4181095ced81f0ee0933b64f6 --- packages/google-cloud-translate/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index c578c145e17..f5c0530661e 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "12066f64da5a3613dd00a72bb721bccf477208f4" + "sha": "a7778971408cfd8d672f5f141705a0a03c7dc74b" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" + "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" } } ], From 3081b79b7e010f50a1ddae8203e0ed999da4cced Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 2 Feb 2021 17:52:18 -0800 Subject: [PATCH 418/513] chore: update CODEOWNERS config (#620) --- packages/google-cloud-translate/.repo-metadata.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/.repo-metadata.json b/packages/google-cloud-translate/.repo-metadata.json index 580ea4a1cc3..55e16431d8b 100644 --- a/packages/google-cloud-translate/.repo-metadata.json +++ b/packages/google-cloud-translate/.repo-metadata.json @@ -9,5 +9,6 @@ "repo": "googleapis/nodejs-translate", "distribution_name": "@google-cloud/translate", "api_id": "translate.googleapis.com", - "requires_billing": true -} \ No newline at end of file + "requires_billing": true, + "codeowner_team": "@googleapis/ml-apis" +} From cb7a2f2b41443a0f1817226006cf30a86363dde8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Feb 2021 18:12:04 -0800 Subject: [PATCH 419/513] build: adds UNORDERED_LIST enum (#621) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/3ab4095b-0974-4516-aab6-99038956a6bc/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-translate/protos/protos.d.ts | 3 ++- packages/google-cloud-translate/protos/protos.js | 7 +++++++ packages/google-cloud-translate/protos/protos.json | 3 ++- packages/google-cloud-translate/synth.metadata | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index 578f3429c6a..d0e11c7789a 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -6772,7 +6772,8 @@ export namespace google { REQUIRED = 2, OUTPUT_ONLY = 3, INPUT_ONLY = 4, - IMMUTABLE = 5 + IMMUTABLE = 5, + UNORDERED_LIST = 6 } /** Properties of a ResourceDescriptor. */ diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index 7cf7fbccf47..d3ca09feb75 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -16574,6 +16574,7 @@ * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value * @property {number} INPUT_ONLY=4 INPUT_ONLY value * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value */ api.FieldBehavior = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -16583,6 +16584,7 @@ values[valuesById[3] = "OUTPUT_ONLY"] = 3; values[valuesById[4] = "INPUT_ONLY"] = 4; values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; return values; })(); @@ -22750,6 +22752,7 @@ case 3: case 4: case 5: + case 6: break; } } @@ -22850,6 +22853,10 @@ case 5: message[".google.api.fieldBehavior"][i] = 5; break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; } } if (object[".google.api.resourceReference"] != null) { diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index eb44b823b9d..64b1cab3277 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -1898,7 +1898,8 @@ "REQUIRED": 2, "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, - "IMMUTABLE": 5 + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 } }, "resourceReference": { diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index f5c0530661e..f725938cb85 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "a7778971408cfd8d672f5f141705a0a03c7dc74b" + "sha": "8ab5c0e450fd88a3be09354908387a73de0ed2f9" } }, { From 2c832dcad268d1f87f0c72da814e8a8fbbddd2d0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 7 Mar 2021 09:00:15 -0800 Subject: [PATCH 420/513] build: update gapic-generator-typescript to v1.2.10. (#625) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/2812cef8-9404-4275-bb51-8c6dafc1bc6f/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 361273630 Source-Link: https://github.com/googleapis/googleapis/commit/5477122b3e8037a1dc5bc920536158edbd151dc4 --- packages/google-cloud-translate/synth.metadata | 6 +++--- packages/google-cloud-translate/webpack.config.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index f725938cb85..ce126eb7426 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "8ab5c0e450fd88a3be09354908387a73de0ed2f9" + "sha": "a23635ac8bcf7ce9586785e387adc7925083f8f2" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d189e871205fea665a9648f7c4676f027495ccaf", - "internalRef": "345596855" + "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", + "internalRef": "361273630" } }, { diff --git a/packages/google-cloud-translate/webpack.config.js b/packages/google-cloud-translate/webpack.config.js index 87404681b50..289fef92e44 100644 --- a/packages/google-cloud-translate/webpack.config.js +++ b/packages/google-cloud-translate/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 4491c19dff397a7ea103c9a1181bc0696b3b2735 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 23 Mar 2021 17:50:09 +0100 Subject: [PATCH 421/513] chore(deps): update dependency sinon to v10 (#633) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^9.0.1` -> `^10.0.0`](https://renovatebot.com/diffs/npm/sinon/9.2.4/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/compatibility-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/confidence-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v10.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1000--2021-03-22) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v9.2.4...v10.0.0) ================== - Upgrade nise to 4.1.0 - Use [@​sinonjs/eslint-config](https://togithub.com/sinonjs/eslint-config)[@​4](https://togithub.com/4) => Adopts ES2017 => Drops support for IE 11, Legacy Edge and legacy Safari
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index bbb1032ff4d..2f955bae160 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -75,7 +75,7 @@ "mocha": "^8.0.0", "pack-n-play": "^1.0.0-2", "proxyquire": "^2.0.1", - "sinon": "^9.0.1", + "sinon": "^10.0.0", "typescript": "^3.8.3", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" From 254ba131eb41e0b05f1e672649d0f73bcdafc971 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 6 Apr 2021 18:24:03 -0700 Subject: [PATCH 422/513] build: compile-protos should be part of prepare (#638) We should be running `compile-protos` as part of prepare, do so. Fixes #632 --- packages/google-cloud-translate/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 2f955bae160..24619e30699 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -35,8 +35,9 @@ "system-test": "mocha build/system-test --timeout 600000", "test": "c8 mocha build/test", "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", "fix": "gts fix", - "prepare": "npm run compile", + "prepare": "npm run compile-protos && npm run compile", "pretest": "npm run compile", "presystem-test": "npm run compile", "docs-test": "linkinator docs", From b4ea83170852fc9a807b53abc45ca91e8812a552 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 7 Apr 2021 09:35:59 -0700 Subject: [PATCH 423/513] feat: added v3beta1 proto for online and batch document translation (#639) PiperOrigin-RevId: 364358156 Source-Author: Google APIs Source-Date: Mon Mar 22 10:55:28 2021 -0700 Source-Repo: googleapis/googleapis Source-Sha: d6b4fb337caf6eccb606728ef727ac76364a4f14 Source-Link: https://github.com/googleapis/googleapis/commit/d6b4fb337caf6eccb606728ef727ac76364a4f14 --- .../v3beta1/translation_service.proto | 657 +- .../google-cloud-translate/protos/protos.d.ts | 2731 ++++-- .../google-cloud-translate/protos/protos.js | 7883 ++++++++++++----- .../google-cloud-translate/protos/protos.json | 382 +- .../src/v3beta1/gapic_metadata.json | 20 + .../src/v3beta1/translation_service_client.ts | 474 +- .../translation_service_client_config.json | 10 + .../google-cloud-translate/synth.metadata | 6 +- .../test/gapic_translation_service_v3beta1.ts | 329 + 9 files changed, 9387 insertions(+), 3105 deletions(-) diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto index ef49f000007..6c10de0fce0 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // 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. -// syntax = "proto3"; @@ -68,7 +67,8 @@ service TranslationService { } // Returns a list of supported languages for translation. - rpc GetSupportedLanguages(GetSupportedLanguagesRequest) returns (SupportedLanguages) { + rpc GetSupportedLanguages(GetSupportedLanguagesRequest) + returns (SupportedLanguages) { option (google.api.http) = { get: "/v3beta1/{parent=projects/*/locations/*}/supportedLanguages" additional_bindings { @@ -78,6 +78,15 @@ service TranslationService { option (google.api.method_signature) = "parent,display_language_code,model"; } + // Translates documents in synchronous mode. + rpc TranslateDocument(TranslateDocumentRequest) + returns (TranslateDocumentResponse) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*}:translateDocument" + body: "*" + }; + } + // Translates a large volume of text in asynchronous batch mode. // This function provides real-time output as the inputs are being processed. // If caller cancels a request, the partial results (for an input file, it's @@ -85,7 +94,8 @@ service TranslationService { // // This call returns immediately and you can // use google.longrunning.Operation.name to poll the status of the call. - rpc BatchTranslateText(BatchTranslateTextRequest) returns (google.longrunning.Operation) { + rpc BatchTranslateText(BatchTranslateTextRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v3beta1/{parent=projects/*/locations/*}:batchTranslateText" body: "*" @@ -96,9 +106,29 @@ service TranslationService { }; } + // Translates a large volume of documents in asynchronous batch mode. + // This function provides real-time output as the inputs are being processed. + // If caller cancels a request, the partial results (for an input file, it's + // all or nothing) may still be available on the specified output location. + // + // This call returns immediately and you can use + // google.longrunning.Operation.name to poll the status of the call. + rpc BatchTranslateDocument(BatchTranslateDocumentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*}:batchTranslateDocument" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "BatchTranslateDocumentResponse" + metadata_type: "BatchTranslateDocumentMetadata" + }; + } + // Creates a glossary and returns the long-running operation. Returns // NOT_FOUND, if the project doesn't exist. - rpc CreateGlossary(CreateGlossaryRequest) returns (google.longrunning.Operation) { + rpc CreateGlossary(CreateGlossaryRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v3beta1/{parent=projects/*/locations/*}/glossaries" body: "glossary" @@ -116,7 +146,6 @@ service TranslationService { option (google.api.http) = { get: "/v3beta1/{parent=projects/*/locations/*}/glossaries" }; - option (google.api.method_signature) = "parent"; option (google.api.method_signature) = "parent,filter"; } @@ -132,7 +161,8 @@ service TranslationService { // Deletes a glossary, or cancels glossary construction // if the glossary isn't created yet. // Returns NOT_FOUND, if the glossary doesn't exist. - rpc DeleteGlossary(DeleteGlossaryRequest) returns (google.longrunning.Operation) { + rpc DeleteGlossary(DeleteGlossaryRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v3beta1/{name=projects/*/locations/*/glossaries/*}" }; @@ -159,7 +189,8 @@ message TranslateTextGlossaryConfig { // The request message for synchronous translation. message TranslateTextRequest { // Required. The content of the input in string format. - // We recommend the total content be less than 30k codepoints. + // We recommend the total content be less than 30k codepoints. The max length + // of this field is 1024. // Use BatchTranslateText for larger text. repeated string contents = 1 [(google.api.field_behavior) = REQUIRED]; @@ -181,11 +212,11 @@ message TranslateTextRequest { // Required. Project or location to make a call. Must refer to a caller's // project. // - // Format: `projects/{project-id}` or - // `projects/{project-id}/locations/{location-id}`. + // Format: `projects/{project-number-or-id}` or + // `projects/{project-number-or-id}/locations/{location-id}`. // - // For global calls, use `projects/{project-id}/locations/global` or - // `projects/{project-id}`. + // For global calls, use `projects/{project-number-or-id}/locations/global` or + // `projects/{project-number-or-id}`. // // Non-global location is required for requests using AutoML models or // custom glossaries. @@ -204,16 +235,16 @@ message TranslateTextRequest { // The format depends on model type: // // - AutoML Translation models: - // `projects/{project-id}/locations/{location-id}/models/{model-id}` + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` // // - General (built-in) models: - // `projects/{project-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-id}/locations/{location-id}/models/general/base` + // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // For global (non-regionalized) requests, use `location-id` `global`. // For example, - // `projects/{project-id}/locations/global/models/general/nmt`. + // `projects/{project-number-or-id}/locations/global/models/general/nmt`. // // If missing, the system decides which google base model to use. string model = 6 [(google.api.field_behavior) = OPTIONAL]; @@ -221,7 +252,8 @@ message TranslateTextRequest { // Optional. Glossary to be applied. The glossary must be // within the same region (have the same location-id) as the model, otherwise // an INVALID_ARGUMENT (400) error is returned. - TranslateTextGlossaryConfig glossary_config = 7 [(google.api.field_behavior) = OPTIONAL]; + TranslateTextGlossaryConfig glossary_config = 7 + [(google.api.field_behavior) = OPTIONAL]; // Optional. The labels with user-defined metadata for the request. // @@ -242,8 +274,8 @@ message TranslateTextResponse { // Text translation responses if a glossary is provided in the request. // This can be the same as - // [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply. - // This field has the same length as + // [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] + // if no terms apply. This field has the same length as // [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents]. repeated Translation glossary_translations = 3; } @@ -254,7 +286,13 @@ message Translation { string translated_text = 1; // Only present when `model` is present in the request. - // This is same as `model` provided in the request. + // `model` here is normalized to have project number. + // + // For example: + // If the `model` requested in TranslationTextRequest is + // `projects/{project-id}/locations/{location-id}/models/general/nmt` then + // `model` here would be normalized to + // `projects/{project-number}/locations/{location-id}/models/general/nmt`. string model = 2; // The BCP-47 language code of source text in the initial request, detected @@ -272,13 +310,13 @@ message DetectLanguageRequest { // Required. Project or location to make a call. Must refer to a caller's // project. // - // Format: `projects/{project-id}/locations/{location-id}` or - // `projects/{project-id}`. + // Format: `projects/{project-number-or-id}/locations/{location-id}` or + // `projects/{project-number-or-id}`. // - // For global calls, use `projects/{project-id}/locations/global` or - // `projects/{project-id}`. + // For global calls, use `projects/{project-number-or-id}/locations/global` or + // `projects/{project-number-or-id}`. // - // Only models within the same region (has same location-id) can be used. + // Only models within the same region, which have the same location-id, can be used. // Otherwise an INVALID_ARGUMENT (400) error is returned. string parent = 5 [ (google.api.field_behavior) = REQUIRED, @@ -290,10 +328,10 @@ message DetectLanguageRequest { // Optional. The language detection model to be used. // // Format: - // `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` + // `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` // // Only one language detection model is currently supported: - // `projects/{project-id}/locations/{location-id}/models/language-detection/default`. + // `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. // // If not specified, the default model is used. string model = 4 [(google.api.field_behavior) = OPTIONAL]; @@ -316,7 +354,7 @@ message DetectLanguageRequest { // Label values are optional. Label keys must start with a letter. // // See https://cloud.google.com/translate/docs/labels for more information. - map labels = 6; + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; } // The response message for language detection. @@ -341,11 +379,11 @@ message GetSupportedLanguagesRequest { // Required. Project or location to make a call. Must refer to a caller's // project. // - // Format: `projects/{project-id}` or - // `projects/{project-id}/locations/{location-id}`. + // Format: `projects/{project-number-or-id}` or + // `projects/{project-number-or-id}/locations/{location-id}`. // - // For global calls, use `projects/{project-id}/locations/global` or - // `projects/{project-id}`. + // For global calls, use `projects/{project-number-or-id}/locations/global` or + // `projects/{project-number-or-id}`. // // Non-global location is required for AutoML models. // @@ -368,11 +406,11 @@ message GetSupportedLanguagesRequest { // The format depends on model type: // // - AutoML Translation models: - // `projects/{project-id}/locations/{location-id}/models/{model-id}` + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` // // - General (built-in) models: - // `projects/{project-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-id}/locations/{location-id}/models/general/base` + // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // Returns languages supported by the specified model. @@ -485,12 +523,17 @@ message OutputConfig { // content to output. // // Once a row is present in index.csv, the input/output matching never - // changes. Callers should also expect all the content in input_file are + // changes. Callers should also expect the contents in the input_file are // processed and ready to be consumed (that is, no partial output file is // written). // + // Since index.csv will be updated during the process, please make + // sure there is no custom retention policy applied on the output bucket + // that may prevent file updating. + // (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + // // The format of translations_file (for target language code 'trg') is: - // `gs://translation_test/a_b_c_'trg'_translations.[extension]` + // gs://translation_test/a_b_c_'trg'_translations.[extension] // // If the input file extension is tsv, the output has the following // columns: @@ -507,10 +550,10 @@ message OutputConfig { // If input file extension is a txt or html, the translation is directly // written to the output file. If glossary is requested, a separate // glossary_translations_file has format of - // `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + // gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] // // The format of errors file (for target language code 'trg') is: - // `gs://translation_test/a_b_c_'trg'_errors.[extension]` + // gs://translation_test/a_b_c_'trg'_errors.[extension] // // If the input file extension is tsv, errors_file contains the following: // Column 1: ID of the request provided in the input, if it's not @@ -522,16 +565,230 @@ message OutputConfig { // // If the input file extension is txt or html, glossary_error_file will be // generated that contains error details. glossary_error_file has format of - // `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + // gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] GcsDestination gcs_destination = 1; } } +// A document translation request input config. +message DocumentInputConfig { + // Specifies the source for the document's content. + // The input file size should be <= 20MB for + // - application/vnd.openxmlformats-officedocument.wordprocessingml.document + // - application/vnd.openxmlformats-officedocument.presentationml.presentation + // - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + // The input file size should be <= 20MB and the maximum page limit is 20 for + // - application/pdf + oneof source { + // Document's content represented as a stream of bytes. + bytes content = 1; + + // Google Cloud Storage location. This must be a single file. + // For example: gs://example_bucket/example_file.pdf + GcsSource gcs_source = 2; + } + + // Specifies the input document's mime_type. + // + // If not specified it will be determined using the file extension for + // gcs_source provided files. For a file provided through bytes content the + // mime_type must be provided. + // Currently supported mime types are: + // - application/pdf + // - application/vnd.openxmlformats-officedocument.wordprocessingml.document + // - application/vnd.openxmlformats-officedocument.presentationml.presentation + // - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + string mime_type = 4; +} + +// A document translation request output config. +message DocumentOutputConfig { + // A URI destination for the translated document. + // It is optional to provide a destination. If provided the results from + // TranslateDocument will be stored in the destination. + // Whether a destination is provided or not, the translated documents will be + // returned within TranslateDocumentResponse.document_translation and + // TranslateDocumentResponse.glossary_document_translation. + oneof destination { + // Optional. Google Cloud Storage destination for the translation output, + // e.g., `gs://my_bucket/my_directory/`. + // + // The destination directory provided does not have to be empty, but the + // bucket must exist. If a file with the same name as the output file + // already exists in the destination an error will be returned. + // + // For a DocumentInputConfig.contents provided document, the output file + // will have the name "output_[trg]_translations.[ext]", where + // - [trg] corresponds to the translated file's language code, + // - [ext] corresponds to the translated file's extension according to its + // mime type. + // + // + // For a DocumentInputConfig.gcs_uri provided document, the output file will + // have a name according to its URI. For example: an input file with URI: + // "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name + // "my_bucket" will have an output URI: + // "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where + // - [trg] corresponds to the translated file's language code, + // - [ext] corresponds to the translated file's extension according to its + // mime type. + // + // + // If the document was directly provided through the request, then the + // output document will have the format: + // "gs://my_bucket/translated_document_[trg]_translations.[ext], where + // - [trg] corresponds to the translated file's language code, + // - [ext] corresponds to the translated file's extension according to its + // mime type. + // + // If a glossary was provided, then the output URI for the glossary + // translation will be equal to the default output URI but have + // `glossary_translations` instead of `translations`. For the previous + // example, its glossary URI would be: + // "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]". + // + // Thus the max number of output files will be 2 (Translated document, + // Glossary translated document). + // + // Callers should expect no partial outputs. If there is any error during + // document translation, no output will be stored in the Cloud Storage + // bucket. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Specifies the translated document's mime_type. + // If not specified, the translated file's mime type will be the same as the + // input file's mime type. + // Currently only support the output mime type to be the same as input mime + // type. + // - application/pdf + // - application/vnd.openxmlformats-officedocument.wordprocessingml.document + // - application/vnd.openxmlformats-officedocument.presentationml.presentation + // - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A document translation request. +message TranslateDocumentRequest { + // Required. Location to make a regional call. + // + // Format: `projects/{project-number-or-id}/locations/{location-id}`. + // + // For global calls, use `projects/{project-number-or-id}/locations/global` or + // `projects/{project-number-or-id}`. + // + // Non-global location is required for requests using AutoML models or custom + // glossaries. + // + // Models and glossaries must be within the same region (have the same + // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The BCP-47 language code of the input document if known, for + // example, "en-US" or "sr-Latn". Supported language codes are listed in + // Language Support. If the source language isn't specified, the API attempts + // to identify the source language automatically and returns the source + // language within the response. Source language must be specified if the + // request contains a glossary or a custom model. + string source_language_code = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The BCP-47 language code to use for translation of the input + // document, set to one of the language codes listed in Language Support. + string target_language_code = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input configurations. + DocumentInputConfig document_input_config = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Output configurations. + // Defines if the output file should be stored within Cloud Storage as well + // as the desired output format. If not provided the translated file will + // only be returned through a byte-stream and its output mime type will be + // the same as the input file's mime type. + DocumentOutputConfig document_output_config = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The `model` type requested for this translation. + // + // The format depends on model type: + // + // - AutoML Translation models: + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + // + // - General (built-in) models: + // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + // + // + // If not provided, the default Google model (NMT) will be used for + // translation. + string model = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Glossary to be applied. The glossary must be within the same + // region (have the same location-id) as the model, otherwise an + // INVALID_ARGUMENT (400) error is returned. + TranslateTextGlossaryConfig glossary_config = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels with user-defined metadata for the request. + // + // Label keys and values can be no longer than 63 characters (Unicode + // codepoints), can only contain lowercase letters, numeric characters, + // underscores and dashes. International characters are allowed. Label values + // are optional. Label keys must start with a letter. + // + // See https://cloud.google.com/translate/docs/advanced/labels for more + // information. + map labels = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// A translated document message. +message DocumentTranslation { + // The array of translated documents. It is expected to be size 1 for now. We + // may produce multiple translated documents in the future for other type of + // file formats. + repeated bytes byte_stream_outputs = 1; + + // The translated document's mime type. + string mime_type = 2; + + // The detected language for the input document. + // If the user did not provide the source language for the input document, + // this field will have the language code automatically detected. If the + // source language was passed, auto-detection of the language does not occur + // and this field is empty. + string detected_language_code = 3; +} + +// A translated document response message. +message TranslateDocumentResponse { + // Translated document. + DocumentTranslation document_translation = 1; + + // The document's translation output if a glossary is provided in the request. + // This can be the same as [TranslateDocumentResponse.document_translation] + // if no glossary terms apply. + DocumentTranslation glossary_document_translation = 2; + + // Only present when 'model' is present in the request. + // 'model' is normalized to have a project number. + // + // For example: + // If the 'model' field in TranslateDocumentRequest is: + // `projects/{project-id}/locations/{location-id}/models/general/nmt` then + // `model` here would be normalized to + // `projects/{project-number}/locations/{location-id}/models/general/nmt`. + string model = 3; + + // The `glossary_config` used for this translation. + TranslateTextGlossaryConfig glossary_config = 4; +} + // The batch translation request. message BatchTranslateTextRequest { // Required. Location to make a call. Must refer to a caller's project. // - // Format: `projects/{project-id}/locations/{location-id}`. + // Format: `projects/{project-number-or-id}/locations/{location-id}`. // // The `global` location is not supported for batch translation. // @@ -549,20 +806,21 @@ message BatchTranslateTextRequest { string source_language_code = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Specify up to 10 language codes here. - repeated string target_language_codes = 3 [(google.api.field_behavior) = REQUIRED]; + repeated string target_language_codes = 3 + [(google.api.field_behavior) = REQUIRED]; // Optional. The models to use for translation. Map's key is target language - // code. Map's value is model name. Value can be a built-in general model, + // code. Map's value is the model name. Value can be a built-in general model, // or an AutoML Translation model. // // The value format depends on model type: // // - AutoML Translation models: - // `projects/{project-id}/locations/{location-id}/models/{model-id}` + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` // // - General (built-in) models: - // `projects/{project-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-id}/locations/{location-id}/models/general/base` + // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // If the map is empty or a specific model is @@ -570,10 +828,11 @@ message BatchTranslateTextRequest { map models = 4 [(google.api.field_behavior) = OPTIONAL]; // Required. Input configurations. - // The total number of files matched should be <= 1000. + // The total number of files matched should be <= 100. // The total content size should be <= 100M Unicode codepoints. // The files must use UTF-8 encoding. - repeated InputConfig input_configs = 5 [(google.api.field_behavior) = REQUIRED]; + repeated InputConfig input_configs = 5 + [(google.api.field_behavior) = REQUIRED]; // Required. Output configuration. // If 2 input configs match to the same file (that is, same input path), @@ -582,7 +841,8 @@ message BatchTranslateTextRequest { // Optional. Glossaries to be applied for translation. // It's keyed by target language code. - map glossaries = 7 [(google.api.field_behavior) = OPTIONAL]; + map glossaries = 7 + [(google.api.field_behavior) = OPTIONAL]; // Optional. The labels with user-defined metadata for the request. // @@ -641,8 +901,10 @@ message BatchTranslateMetadata { google.protobuf.Timestamp submit_time = 5; } -// Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by -// BatchTranslateText if at least one sentence is translated successfully. +// Stored in the +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field returned by BatchTranslateText if at least one sentence is translated +// successfully. message BatchTranslateResponse { // Total number of characters (Unicode codepoints). int64 total_characters = 1; @@ -657,7 +919,8 @@ message BatchTranslateResponse { google.protobuf.Timestamp submit_time = 4; // The time when the operation is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true. + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is + // set to true. google.protobuf.Timestamp end_time = 5; } @@ -718,7 +981,7 @@ message Glossary { } // Required. The resource name of the glossary. Glossary names have the form - // `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`. + // `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. string name = 1 [(google.api.field_behavior) = REQUIRED]; // Languages supported by the glossary. @@ -738,10 +1001,12 @@ message Glossary { int32 entry_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. When CreateGlossary was called. - google.protobuf.Timestamp submit_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp submit_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. When the glossary creation was finished. - google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp end_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request message for CreateGlossary. @@ -801,7 +1066,20 @@ message ListGlossariesRequest { string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Filter specifying constraints of a list operation. - // Filtering is not supported yet, and the parameter currently has no effect. + // Specify the constraint by the format of "key=value", where key must be + // "src" or "tgt", and the value must be a valid language code. + // For multiple restrictions, concatenate them by "AND" (uppercase only), + // such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + // here, which means using 'en-US' and 'en' can lead to different results, + // which depends on the language code you used when you create the glossary. + // For the unidirectional glossaries, the "src" and "tgt" add restrictions + // on the source and target language code separately. + // For the equivalent term set glossaries, the "src" and/or "tgt" add + // restrictions on the term set. + // For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + // glossaries which exactly match the source language code as "en-US" and the + // target language code "zh-CN", but all equivalent term set glossaries which + // contain "en-US" and "zh-CN" in their language set will be picked. // If missing, no filtering is performed. string filter = 4 [(google.api.field_behavior) = OPTIONAL]; } @@ -817,8 +1095,9 @@ message ListGlossariesResponse { string next_page_token = 2; } -// Stored in the [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by -// CreateGlossary. +// Stored in the +// [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] +// field returned by CreateGlossary. message CreateGlossaryMetadata { // Enumerates the possible states that the creation request can be in. enum State { @@ -852,8 +1131,9 @@ message CreateGlossaryMetadata { google.protobuf.Timestamp submit_time = 3; } -// Stored in the [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by -// DeleteGlossary. +// Stored in the +// [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] +// field returned by DeleteGlossary. message DeleteGlossaryMetadata { // Enumerates the possible states that the creation request can be in. enum State { @@ -887,8 +1167,9 @@ message DeleteGlossaryMetadata { google.protobuf.Timestamp submit_time = 3; } -// Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by -// DeleteGlossary. +// Stored in the +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field returned by DeleteGlossary. message DeleteGlossaryResponse { // The name of the deleted glossary. string name = 1; @@ -897,6 +1178,256 @@ message DeleteGlossaryResponse { google.protobuf.Timestamp submit_time = 2; // The time when the glossary deletion is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true. + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is + // set to true. google.protobuf.Timestamp end_time = 3; } + +// The BatchTranslateDocument request. +message BatchTranslateDocumentRequest { + // Required. Location to make a regional call. + // + // Format: `projects/{project-number-or-id}/locations/{location-id}`. + // + // The `global` location is not supported for batch translation. + // + // Only AutoML Translation models or glossaries within the same region (have + // the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + // error is returned. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BCP-47 language code of the input document if known, for + // example, "en-US" or "sr-Latn". Supported language codes are listed in + // Language Support (https://cloud.google.com/translate/docs/languages). + string source_language_code = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BCP-47 language code to use for translation of the input + // document. Specify up to 10 language codes here. + repeated string target_language_codes = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Input configurations. + // The total number of files matched should be <= 100. + // The total content size to translate should be <= 100M Unicode codepoints. + // The files must use UTF-8 encoding. + repeated BatchDocumentInputConfig input_configs = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Output configuration. + // If 2 input configs match to the same file (that is, same input path), + // we don't generate output for duplicate inputs. + BatchDocumentOutputConfig output_config = 5 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The models to use for translation. Map's key is target language + // code. Map's value is the model name. Value can be a built-in general model, + // or an AutoML Translation model. + // + // The value format depends on model type: + // + // - AutoML Translation models: + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + // + // - General (built-in) models: + // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + // + // + // If the map is empty or a specific model is not requested for a language + // pair, then default google model (nmt) is used. + map models = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Glossaries to be applied. It's keyed by target language code. + map glossaries = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Input configuration for BatchTranslateDocument request. +message BatchDocumentInputConfig { + // Specify the input. + oneof source { + // Google Cloud Storage location for the source input. + // This can be a single file (for example, + // `gs://translation-test/input.docx`) or a wildcard (for example, + // `gs://translation-test/*`). + // + // File mime type is determined based on extension. Supported mime type + // includes: + // - `pdf`, application/pdf + // - `docx`, + // application/vnd.openxmlformats-officedocument.wordprocessingml.document + // - `pptx`, + // application/vnd.openxmlformats-officedocument.presentationml.presentation + // - `xlsx`, + // application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + // + // The max file size supported for `.docx`, `.pptx` and `.xlsx` is 100MB. + // The max file size supported for `.pdf` is 1GB and the max page limit is + // 1000 pages. + // The max file size supported for all input documents is 1GB. + GcsSource gcs_source = 1; + } +} + +// Output configuration for BatchTranslateDocument request. +message BatchDocumentOutputConfig { + // The destination of output. The destination directory provided must exist + // and be empty. + oneof destination { + // Google Cloud Storage destination for output content. + // For every single input document (for example, gs://a/b/c.[extension]), we + // generate at most 2 * n output files. (n is the # of target_language_codes + // in the BatchTranslateDocumentRequest). + // + // While the input documents are being processed, we write/update an index + // file `index.csv` under `gcs_destination.output_uri_prefix` (for example, + // gs://translation_output/index.csv) The index file is generated/updated as + // new files are being translated. The format is: + // + // input_document,target_language_code,translation_output,error_output, + // glossary_translation_output,glossary_error_output + // + // `input_document` is one file we matched using gcs_source.input_uri. + // `target_language_code` is provided in the request. + // `translation_output` contains the translations. (details provided below) + // `error_output` contains the error message during processing of the file. + // Both translations_file and errors_file could be empty strings if we have + // no content to output. + // `glossary_translation_output` and `glossary_error_output` are the + // translated output/error when we apply glossaries. They could also be + // empty if we have no content to output. + // + // Once a row is present in index.csv, the input/output matching never + // changes. Callers should also expect all the content in input_file are + // processed and ready to be consumed (that is, no partial output file is + // written). + // + // Since index.csv will be keeping updated during the process, please make + // sure there is no custom retention policy applied on the output bucket + // that may avoid file updating. + // (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + // + // The naming format of translation output files follows (for target + // language code [trg]): `translation_output`: + // gs://translation_output/a_b_c_[trg]_translation.[extension] + // `glossary_translation_output`: + // gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The + // output document will maintain the same file format as the input document. + // + // The naming format of error output files follows (for target language code + // [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt + // `glossary_error_output`: + // gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error + // output is a txt file containing error details. + GcsDestination gcs_destination = 1; + } +} + +// Stored in the +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field returned by BatchTranslateDocument if at least one document is +// translated successfully. +message BatchTranslateDocumentResponse { + // Total number of pages to translate in all documents. Documents without a + // clear page definition (such as XLSX) are not counted. + int64 total_pages = 1; + + // Number of successfully translated pages in all documents. Documents without + // a clear page definition (such as XLSX) are not counted. + int64 translated_pages = 2; + + // Number of pages that failed to process in all documents. Documents without + // a clear page definition (such as XLSX) are not counted. + int64 failed_pages = 3; + + // Number of billable pages in documents with clear page definition (such as + // PDF, DOCX, PPTX) + int64 total_billable_pages = 4; + + // Total number of characters (Unicode codepoints) in all documents. + int64 total_characters = 5; + + // Number of successfully translated characters (Unicode codepoints) in all + // documents. + int64 translated_characters = 6; + + // Number of characters that have failed to process (Unicode codepoints) in + // all documents. + int64 failed_characters = 7; + + // Number of billable characters (Unicode codepoints) in documents without + // clear page definition, such as XLSX. + int64 total_billable_characters = 8; + + // Time when the operation was submitted. + google.protobuf.Timestamp submit_time = 9; + + // The time when the operation is finished and + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is + // set to true. + google.protobuf.Timestamp end_time = 10; +} + +// State metadata for the batch translation operation. +message BatchTranslateDocumentMetadata { + // State of the job. + enum State { + // Invalid. + STATE_UNSPECIFIED = 0; + + // Request is being processed. + RUNNING = 1; + + // The batch is processed, and at least one item was successfully processed. + SUCCEEDED = 2; + + // The batch is done and no item was successfully processed. + FAILED = 3; + + // Request is in the process of being canceled after caller invoked + // longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4; + + // The batch is done after the user has called the + // longrunning.Operations.CancelOperation. Any records processed before the + // cancel command are output as specified in the request. + CANCELLED = 5; + } + + // The state of the operation. + State state = 1; + + // Total number of pages to translate in all documents so far. Documents + // without clear page definition (such as XLSX) are not counted. + int64 total_pages = 2; + + // Number of successfully translated pages in all documents so far. Documents + // without clear page definition (such as XLSX) are not counted. + int64 translated_pages = 3; + + // Number of pages that failed to process in all documents so far. Documents + // without clear page definition (such as XLSX) are not counted. + int64 failed_pages = 4; + + // Number of billable pages in documents with clear page definition (such as + // PDF, DOCX, PPTX) so far. + int64 total_billable_pages = 5; + + // Total number of characters (Unicode codepoints) in all documents so far. + int64 total_characters = 6; + + // Number of successfully translated characters (Unicode codepoints) in all + // documents so far. + int64 translated_characters = 7; + + // Number of characters that have failed to process (Unicode codepoints) in + // all documents so far. + int64 failed_characters = 8; + + // Number of billable characters (Unicode codepoints) in documents without + // clear page definition (such as XLSX) so far. + int64 total_billable_characters = 9; + + // Time when the operation was submitted. + google.protobuf.Timestamp submit_time = 10; +} diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index d0e11c7789a..828d613de73 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -3287,6 +3287,20 @@ export namespace google { */ public getSupportedLanguages(request: google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest): Promise; + /** + * Calls TranslateDocument. + * @param request TranslateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TranslateDocumentResponse + */ + public translateDocument(request: google.cloud.translation.v3beta1.ITranslateDocumentRequest, callback: google.cloud.translation.v3beta1.TranslationService.TranslateDocumentCallback): void; + + /** + * Calls TranslateDocument. + * @param request TranslateDocumentRequest message or plain object + * @returns Promise + */ + public translateDocument(request: google.cloud.translation.v3beta1.ITranslateDocumentRequest): Promise; + /** * Calls BatchTranslateText. * @param request BatchTranslateTextRequest message or plain object @@ -3301,6 +3315,20 @@ export namespace google { */ public batchTranslateText(request: google.cloud.translation.v3beta1.IBatchTranslateTextRequest): Promise; + /** + * Calls BatchTranslateDocument. + * @param request BatchTranslateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchTranslateDocument(request: google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, callback: google.cloud.translation.v3beta1.TranslationService.BatchTranslateDocumentCallback): void; + + /** + * Calls BatchTranslateDocument. + * @param request BatchTranslateDocumentRequest message or plain object + * @returns Promise + */ + public batchTranslateDocument(request: google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest): Promise; + /** * Calls CreateGlossary. * @param request CreateGlossaryRequest message or plain object @@ -3381,6 +3409,13 @@ export namespace google { */ type GetSupportedLanguagesCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.SupportedLanguages) => void; + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#translateDocument}. + * @param error Error, if any + * @param [response] TranslateDocumentResponse + */ + type TranslateDocumentCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.TranslateDocumentResponse) => void; + /** * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#batchTranslateText}. * @param error Error, if any @@ -3388,6 +3423,13 @@ export namespace google { */ type BatchTranslateTextCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#batchTranslateDocument}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchTranslateDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#createGlossary}. * @param error Error, if any @@ -4824,1601 +4866,2760 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a BatchTranslateTextRequest. */ - interface IBatchTranslateTextRequest { - - /** BatchTranslateTextRequest parent */ - parent?: (string|null); - - /** BatchTranslateTextRequest sourceLanguageCode */ - sourceLanguageCode?: (string|null); - - /** BatchTranslateTextRequest targetLanguageCodes */ - targetLanguageCodes?: (string[]|null); - - /** BatchTranslateTextRequest models */ - models?: ({ [k: string]: string }|null); - - /** BatchTranslateTextRequest inputConfigs */ - inputConfigs?: (google.cloud.translation.v3beta1.IInputConfig[]|null); + /** Properties of a DocumentInputConfig. */ + interface IDocumentInputConfig { - /** BatchTranslateTextRequest outputConfig */ - outputConfig?: (google.cloud.translation.v3beta1.IOutputConfig|null); + /** DocumentInputConfig content */ + content?: (Uint8Array|string|null); - /** BatchTranslateTextRequest glossaries */ - glossaries?: ({ [k: string]: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig }|null); + /** DocumentInputConfig gcsSource */ + gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); - /** BatchTranslateTextRequest labels */ - labels?: ({ [k: string]: string }|null); + /** DocumentInputConfig mimeType */ + mimeType?: (string|null); } - /** Represents a BatchTranslateTextRequest. */ - class BatchTranslateTextRequest implements IBatchTranslateTextRequest { + /** Represents a DocumentInputConfig. */ + class DocumentInputConfig implements IDocumentInputConfig { /** - * Constructs a new BatchTranslateTextRequest. + * Constructs a new DocumentInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateTextRequest); - - /** BatchTranslateTextRequest parent. */ - public parent: string; - - /** BatchTranslateTextRequest sourceLanguageCode. */ - public sourceLanguageCode: string; - - /** BatchTranslateTextRequest targetLanguageCodes. */ - public targetLanguageCodes: string[]; - - /** BatchTranslateTextRequest models. */ - public models: { [k: string]: string }; + constructor(properties?: google.cloud.translation.v3beta1.IDocumentInputConfig); - /** BatchTranslateTextRequest inputConfigs. */ - public inputConfigs: google.cloud.translation.v3beta1.IInputConfig[]; + /** DocumentInputConfig content. */ + public content: (Uint8Array|string); - /** BatchTranslateTextRequest outputConfig. */ - public outputConfig?: (google.cloud.translation.v3beta1.IOutputConfig|null); + /** DocumentInputConfig gcsSource. */ + public gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); - /** BatchTranslateTextRequest glossaries. */ - public glossaries: { [k: string]: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig }; + /** DocumentInputConfig mimeType. */ + public mimeType: string; - /** BatchTranslateTextRequest labels. */ - public labels: { [k: string]: string }; + /** DocumentInputConfig source. */ + public source?: ("content"|"gcsSource"); /** - * Creates a new BatchTranslateTextRequest instance using the specified properties. + * Creates a new DocumentInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns BatchTranslateTextRequest instance + * @returns DocumentInputConfig instance */ - public static create(properties?: google.cloud.translation.v3beta1.IBatchTranslateTextRequest): google.cloud.translation.v3beta1.BatchTranslateTextRequest; + public static create(properties?: google.cloud.translation.v3beta1.IDocumentInputConfig): google.cloud.translation.v3beta1.DocumentInputConfig; /** - * Encodes the specified BatchTranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateTextRequest.verify|verify} messages. - * @param message BatchTranslateTextRequest message or plain object to encode + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.IBatchTranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchTranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateTextRequest.verify|verify} messages. - * @param message BatchTranslateTextRequest message or plain object to encode + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchTranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchTranslateTextRequest message from the specified reader or buffer. + * Decodes a DocumentInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchTranslateTextRequest + * @returns DocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchTranslateTextRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DocumentInputConfig; /** - * Decodes a BatchTranslateTextRequest message from the specified reader or buffer, length delimited. + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchTranslateTextRequest + * @returns DocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchTranslateTextRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DocumentInputConfig; /** - * Verifies a BatchTranslateTextRequest message. + * Verifies a DocumentInputConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchTranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchTranslateTextRequest + * @returns DocumentInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchTranslateTextRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DocumentInputConfig; /** - * Creates a plain object from a BatchTranslateTextRequest message. Also converts values to other types if specified. - * @param message BatchTranslateTextRequest + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. + * @param message DocumentInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.BatchTranslateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.DocumentInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchTranslateTextRequest to JSON. + * Converts this DocumentInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchTranslateMetadata. */ - interface IBatchTranslateMetadata { - - /** BatchTranslateMetadata state */ - state?: (google.cloud.translation.v3beta1.BatchTranslateMetadata.State|keyof typeof google.cloud.translation.v3beta1.BatchTranslateMetadata.State|null); - - /** BatchTranslateMetadata translatedCharacters */ - translatedCharacters?: (number|Long|string|null); - - /** BatchTranslateMetadata failedCharacters */ - failedCharacters?: (number|Long|string|null); + /** Properties of a DocumentOutputConfig. */ + interface IDocumentOutputConfig { - /** BatchTranslateMetadata totalCharacters */ - totalCharacters?: (number|Long|string|null); + /** DocumentOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.translation.v3beta1.IGcsDestination|null); - /** BatchTranslateMetadata submitTime */ - submitTime?: (google.protobuf.ITimestamp|null); + /** DocumentOutputConfig mimeType */ + mimeType?: (string|null); } - /** Represents a BatchTranslateMetadata. */ - class BatchTranslateMetadata implements IBatchTranslateMetadata { + /** Represents a DocumentOutputConfig. */ + class DocumentOutputConfig implements IDocumentOutputConfig { /** - * Constructs a new BatchTranslateMetadata. + * Constructs a new DocumentOutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateMetadata); - - /** BatchTranslateMetadata state. */ - public state: (google.cloud.translation.v3beta1.BatchTranslateMetadata.State|keyof typeof google.cloud.translation.v3beta1.BatchTranslateMetadata.State); - - /** BatchTranslateMetadata translatedCharacters. */ - public translatedCharacters: (number|Long|string); + constructor(properties?: google.cloud.translation.v3beta1.IDocumentOutputConfig); - /** BatchTranslateMetadata failedCharacters. */ - public failedCharacters: (number|Long|string); + /** DocumentOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.translation.v3beta1.IGcsDestination|null); - /** BatchTranslateMetadata totalCharacters. */ - public totalCharacters: (number|Long|string); + /** DocumentOutputConfig mimeType. */ + public mimeType: string; - /** BatchTranslateMetadata submitTime. */ - public submitTime?: (google.protobuf.ITimestamp|null); + /** DocumentOutputConfig destination. */ + public destination?: "gcsDestination"; /** - * Creates a new BatchTranslateMetadata instance using the specified properties. + * Creates a new DocumentOutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns BatchTranslateMetadata instance + * @returns DocumentOutputConfig instance */ - public static create(properties?: google.cloud.translation.v3beta1.IBatchTranslateMetadata): google.cloud.translation.v3beta1.BatchTranslateMetadata; + public static create(properties?: google.cloud.translation.v3beta1.IDocumentOutputConfig): google.cloud.translation.v3beta1.DocumentOutputConfig; /** - * Encodes the specified BatchTranslateMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateMetadata.verify|verify} messages. - * @param message BatchTranslateMetadata message or plain object to encode + * Encodes the specified DocumentOutputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.DocumentOutputConfig.verify|verify} messages. + * @param message DocumentOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.IBatchTranslateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.IDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchTranslateMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateMetadata.verify|verify} messages. - * @param message BatchTranslateMetadata message or plain object to encode + * Encodes the specified DocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DocumentOutputConfig.verify|verify} messages. + * @param message DocumentOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchTranslateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.IDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchTranslateMetadata message from the specified reader or buffer. + * Decodes a DocumentOutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchTranslateMetadata + * @returns DocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchTranslateMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DocumentOutputConfig; /** - * Decodes a BatchTranslateMetadata message from the specified reader or buffer, length delimited. + * Decodes a DocumentOutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchTranslateMetadata + * @returns DocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchTranslateMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DocumentOutputConfig; /** - * Verifies a BatchTranslateMetadata message. + * Verifies a DocumentOutputConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchTranslateMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentOutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchTranslateMetadata + * @returns DocumentOutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchTranslateMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DocumentOutputConfig; /** - * Creates a plain object from a BatchTranslateMetadata message. Also converts values to other types if specified. - * @param message BatchTranslateMetadata + * Creates a plain object from a DocumentOutputConfig message. Also converts values to other types if specified. + * @param message DocumentOutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.BatchTranslateMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.DocumentOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchTranslateMetadata to JSON. + * Converts this DocumentOutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace BatchTranslateMetadata { + /** Properties of a TranslateDocumentRequest. */ + interface ITranslateDocumentRequest { - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - RUNNING = 1, - SUCCEEDED = 2, - FAILED = 3, - CANCELLING = 4, - CANCELLED = 5 - } - } + /** TranslateDocumentRequest parent */ + parent?: (string|null); - /** Properties of a BatchTranslateResponse. */ - interface IBatchTranslateResponse { + /** TranslateDocumentRequest sourceLanguageCode */ + sourceLanguageCode?: (string|null); - /** BatchTranslateResponse totalCharacters */ - totalCharacters?: (number|Long|string|null); + /** TranslateDocumentRequest targetLanguageCode */ + targetLanguageCode?: (string|null); - /** BatchTranslateResponse translatedCharacters */ - translatedCharacters?: (number|Long|string|null); + /** TranslateDocumentRequest documentInputConfig */ + documentInputConfig?: (google.cloud.translation.v3beta1.IDocumentInputConfig|null); - /** BatchTranslateResponse failedCharacters */ - failedCharacters?: (number|Long|string|null); + /** TranslateDocumentRequest documentOutputConfig */ + documentOutputConfig?: (google.cloud.translation.v3beta1.IDocumentOutputConfig|null); - /** BatchTranslateResponse submitTime */ - submitTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentRequest model */ + model?: (string|null); - /** BatchTranslateResponse endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentRequest glossaryConfig */ + glossaryConfig?: (google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null); + + /** TranslateDocumentRequest labels */ + labels?: ({ [k: string]: string }|null); } - /** Represents a BatchTranslateResponse. */ - class BatchTranslateResponse implements IBatchTranslateResponse { + /** Represents a TranslateDocumentRequest. */ + class TranslateDocumentRequest implements ITranslateDocumentRequest { /** - * Constructs a new BatchTranslateResponse. + * Constructs a new TranslateDocumentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateResponse); + constructor(properties?: google.cloud.translation.v3beta1.ITranslateDocumentRequest); - /** BatchTranslateResponse totalCharacters. */ - public totalCharacters: (number|Long|string); + /** TranslateDocumentRequest parent. */ + public parent: string; - /** BatchTranslateResponse translatedCharacters. */ - public translatedCharacters: (number|Long|string); + /** TranslateDocumentRequest sourceLanguageCode. */ + public sourceLanguageCode: string; - /** BatchTranslateResponse failedCharacters. */ - public failedCharacters: (number|Long|string); + /** TranslateDocumentRequest targetLanguageCode. */ + public targetLanguageCode: string; - /** BatchTranslateResponse submitTime. */ - public submitTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentRequest documentInputConfig. */ + public documentInputConfig?: (google.cloud.translation.v3beta1.IDocumentInputConfig|null); - /** BatchTranslateResponse endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentRequest documentOutputConfig. */ + public documentOutputConfig?: (google.cloud.translation.v3beta1.IDocumentOutputConfig|null); + + /** TranslateDocumentRequest model. */ + public model: string; + + /** TranslateDocumentRequest glossaryConfig. */ + public glossaryConfig?: (google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null); + + /** TranslateDocumentRequest labels. */ + public labels: { [k: string]: string }; /** - * Creates a new BatchTranslateResponse instance using the specified properties. + * Creates a new TranslateDocumentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchTranslateResponse instance + * @returns TranslateDocumentRequest instance */ - public static create(properties?: google.cloud.translation.v3beta1.IBatchTranslateResponse): google.cloud.translation.v3beta1.BatchTranslateResponse; + public static create(properties?: google.cloud.translation.v3beta1.ITranslateDocumentRequest): google.cloud.translation.v3beta1.TranslateDocumentRequest; /** - * Encodes the specified BatchTranslateResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateResponse.verify|verify} messages. - * @param message BatchTranslateResponse message or plain object to encode + * Encodes the specified TranslateDocumentRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateDocumentRequest.verify|verify} messages. + * @param message TranslateDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.IBatchTranslateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.ITranslateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchTranslateResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateResponse.verify|verify} messages. - * @param message BatchTranslateResponse message or plain object to encode + * Encodes the specified TranslateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateDocumentRequest.verify|verify} messages. + * @param message TranslateDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchTranslateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.ITranslateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchTranslateResponse message from the specified reader or buffer. + * Decodes a TranslateDocumentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchTranslateResponse + * @returns TranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchTranslateResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.TranslateDocumentRequest; /** - * Decodes a BatchTranslateResponse message from the specified reader or buffer, length delimited. + * Decodes a TranslateDocumentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchTranslateResponse + * @returns TranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchTranslateResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.TranslateDocumentRequest; /** - * Verifies a BatchTranslateResponse message. + * Verifies a TranslateDocumentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchTranslateResponse message from a plain object. Also converts values to their respective internal types. + * Creates a TranslateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchTranslateResponse + * @returns TranslateDocumentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchTranslateResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.TranslateDocumentRequest; /** - * Creates a plain object from a BatchTranslateResponse message. Also converts values to other types if specified. - * @param message BatchTranslateResponse + * Creates a plain object from a TranslateDocumentRequest message. Also converts values to other types if specified. + * @param message TranslateDocumentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.BatchTranslateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.TranslateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchTranslateResponse to JSON. + * Converts this TranslateDocumentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GlossaryInputConfig. */ - interface IGlossaryInputConfig { + /** Properties of a DocumentTranslation. */ + interface IDocumentTranslation { - /** GlossaryInputConfig gcsSource */ - gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); + /** DocumentTranslation byteStreamOutputs */ + byteStreamOutputs?: (Uint8Array[]|null); + + /** DocumentTranslation mimeType */ + mimeType?: (string|null); + + /** DocumentTranslation detectedLanguageCode */ + detectedLanguageCode?: (string|null); } - /** Represents a GlossaryInputConfig. */ - class GlossaryInputConfig implements IGlossaryInputConfig { + /** Represents a DocumentTranslation. */ + class DocumentTranslation implements IDocumentTranslation { /** - * Constructs a new GlossaryInputConfig. + * Constructs a new DocumentTranslation. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.IGlossaryInputConfig); + constructor(properties?: google.cloud.translation.v3beta1.IDocumentTranslation); - /** GlossaryInputConfig gcsSource. */ - public gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); + /** DocumentTranslation byteStreamOutputs. */ + public byteStreamOutputs: Uint8Array[]; - /** GlossaryInputConfig source. */ - public source?: "gcsSource"; + /** DocumentTranslation mimeType. */ + public mimeType: string; + + /** DocumentTranslation detectedLanguageCode. */ + public detectedLanguageCode: string; /** - * Creates a new GlossaryInputConfig instance using the specified properties. + * Creates a new DocumentTranslation instance using the specified properties. * @param [properties] Properties to set - * @returns GlossaryInputConfig instance + * @returns DocumentTranslation instance */ - public static create(properties?: google.cloud.translation.v3beta1.IGlossaryInputConfig): google.cloud.translation.v3beta1.GlossaryInputConfig; + public static create(properties?: google.cloud.translation.v3beta1.IDocumentTranslation): google.cloud.translation.v3beta1.DocumentTranslation; /** - * Encodes the specified GlossaryInputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.GlossaryInputConfig.verify|verify} messages. - * @param message GlossaryInputConfig message or plain object to encode + * Encodes the specified DocumentTranslation message. Does not implicitly {@link google.cloud.translation.v3beta1.DocumentTranslation.verify|verify} messages. + * @param message DocumentTranslation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.IGlossaryInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.IDocumentTranslation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GlossaryInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GlossaryInputConfig.verify|verify} messages. - * @param message GlossaryInputConfig message or plain object to encode + * Encodes the specified DocumentTranslation message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DocumentTranslation.verify|verify} messages. + * @param message DocumentTranslation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.IGlossaryInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.IDocumentTranslation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GlossaryInputConfig message from the specified reader or buffer. + * Decodes a DocumentTranslation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GlossaryInputConfig + * @returns DocumentTranslation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.GlossaryInputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DocumentTranslation; /** - * Decodes a GlossaryInputConfig message from the specified reader or buffer, length delimited. + * Decodes a DocumentTranslation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GlossaryInputConfig + * @returns DocumentTranslation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.GlossaryInputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DocumentTranslation; /** - * Verifies a GlossaryInputConfig message. + * Verifies a DocumentTranslation message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GlossaryInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentTranslation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GlossaryInputConfig + * @returns DocumentTranslation */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.GlossaryInputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DocumentTranslation; /** - * Creates a plain object from a GlossaryInputConfig message. Also converts values to other types if specified. - * @param message GlossaryInputConfig + * Creates a plain object from a DocumentTranslation message. Also converts values to other types if specified. + * @param message DocumentTranslation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.GlossaryInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.DocumentTranslation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GlossaryInputConfig to JSON. + * Converts this DocumentTranslation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Glossary. */ - interface IGlossary { - - /** Glossary name */ - name?: (string|null); - - /** Glossary languagePair */ - languagePair?: (google.cloud.translation.v3beta1.Glossary.ILanguageCodePair|null); - - /** Glossary languageCodesSet */ - languageCodesSet?: (google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet|null); + /** Properties of a TranslateDocumentResponse. */ + interface ITranslateDocumentResponse { - /** Glossary inputConfig */ - inputConfig?: (google.cloud.translation.v3beta1.IGlossaryInputConfig|null); + /** TranslateDocumentResponse documentTranslation */ + documentTranslation?: (google.cloud.translation.v3beta1.IDocumentTranslation|null); - /** Glossary entryCount */ - entryCount?: (number|null); + /** TranslateDocumentResponse glossaryDocumentTranslation */ + glossaryDocumentTranslation?: (google.cloud.translation.v3beta1.IDocumentTranslation|null); - /** Glossary submitTime */ - submitTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentResponse model */ + model?: (string|null); - /** Glossary endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentResponse glossaryConfig */ + glossaryConfig?: (google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null); } - /** Represents a Glossary. */ - class Glossary implements IGlossary { + /** Represents a TranslateDocumentResponse. */ + class TranslateDocumentResponse implements ITranslateDocumentResponse { /** - * Constructs a new Glossary. + * Constructs a new TranslateDocumentResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.IGlossary); - - /** Glossary name. */ - public name: string; - - /** Glossary languagePair. */ - public languagePair?: (google.cloud.translation.v3beta1.Glossary.ILanguageCodePair|null); - - /** Glossary languageCodesSet. */ - public languageCodesSet?: (google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet|null); - - /** Glossary inputConfig. */ - public inputConfig?: (google.cloud.translation.v3beta1.IGlossaryInputConfig|null); + constructor(properties?: google.cloud.translation.v3beta1.ITranslateDocumentResponse); - /** Glossary entryCount. */ - public entryCount: number; + /** TranslateDocumentResponse documentTranslation. */ + public documentTranslation?: (google.cloud.translation.v3beta1.IDocumentTranslation|null); - /** Glossary submitTime. */ - public submitTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentResponse glossaryDocumentTranslation. */ + public glossaryDocumentTranslation?: (google.cloud.translation.v3beta1.IDocumentTranslation|null); - /** Glossary endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentResponse model. */ + public model: string; - /** Glossary languages. */ - public languages?: ("languagePair"|"languageCodesSet"); + /** TranslateDocumentResponse glossaryConfig. */ + public glossaryConfig?: (google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null); /** - * Creates a new Glossary instance using the specified properties. + * Creates a new TranslateDocumentResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Glossary instance + * @returns TranslateDocumentResponse instance */ - public static create(properties?: google.cloud.translation.v3beta1.IGlossary): google.cloud.translation.v3beta1.Glossary; + public static create(properties?: google.cloud.translation.v3beta1.ITranslateDocumentResponse): google.cloud.translation.v3beta1.TranslateDocumentResponse; /** - * Encodes the specified Glossary message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.verify|verify} messages. - * @param message Glossary message or plain object to encode + * Encodes the specified TranslateDocumentResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateDocumentResponse.verify|verify} messages. + * @param message TranslateDocumentResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.IGlossary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.ITranslateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Glossary message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.verify|verify} messages. - * @param message Glossary message or plain object to encode + * Encodes the specified TranslateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateDocumentResponse.verify|verify} messages. + * @param message TranslateDocumentResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.IGlossary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.ITranslateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Glossary message from the specified reader or buffer. + * Decodes a TranslateDocumentResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Glossary + * @returns TranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.Glossary; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.TranslateDocumentResponse; /** - * Decodes a Glossary message from the specified reader or buffer, length delimited. + * Decodes a TranslateDocumentResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Glossary + * @returns TranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.Glossary; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.TranslateDocumentResponse; /** - * Verifies a Glossary message. + * Verifies a TranslateDocumentResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Glossary message from a plain object. Also converts values to their respective internal types. + * Creates a TranslateDocumentResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Glossary + * @returns TranslateDocumentResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.Glossary; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.TranslateDocumentResponse; /** - * Creates a plain object from a Glossary message. Also converts values to other types if specified. - * @param message Glossary + * Creates a plain object from a TranslateDocumentResponse message. Also converts values to other types if specified. + * @param message TranslateDocumentResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.Glossary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.TranslateDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Glossary to JSON. + * Converts this TranslateDocumentResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Glossary { - - /** Properties of a LanguageCodePair. */ - interface ILanguageCodePair { + /** Properties of a BatchTranslateTextRequest. */ + interface IBatchTranslateTextRequest { - /** LanguageCodePair sourceLanguageCode */ - sourceLanguageCode?: (string|null); + /** BatchTranslateTextRequest parent */ + parent?: (string|null); - /** LanguageCodePair targetLanguageCode */ - targetLanguageCode?: (string|null); - } + /** BatchTranslateTextRequest sourceLanguageCode */ + sourceLanguageCode?: (string|null); - /** Represents a LanguageCodePair. */ - class LanguageCodePair implements ILanguageCodePair { + /** BatchTranslateTextRequest targetLanguageCodes */ + targetLanguageCodes?: (string[]|null); - /** - * Constructs a new LanguageCodePair. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.translation.v3beta1.Glossary.ILanguageCodePair); + /** BatchTranslateTextRequest models */ + models?: ({ [k: string]: string }|null); - /** LanguageCodePair sourceLanguageCode. */ - public sourceLanguageCode: string; + /** BatchTranslateTextRequest inputConfigs */ + inputConfigs?: (google.cloud.translation.v3beta1.IInputConfig[]|null); - /** LanguageCodePair targetLanguageCode. */ - public targetLanguageCode: string; + /** BatchTranslateTextRequest outputConfig */ + outputConfig?: (google.cloud.translation.v3beta1.IOutputConfig|null); - /** - * Creates a new LanguageCodePair instance using the specified properties. - * @param [properties] Properties to set - * @returns LanguageCodePair instance - */ - public static create(properties?: google.cloud.translation.v3beta1.Glossary.ILanguageCodePair): google.cloud.translation.v3beta1.Glossary.LanguageCodePair; + /** BatchTranslateTextRequest glossaries */ + glossaries?: ({ [k: string]: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig }|null); - /** - * Encodes the specified LanguageCodePair message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify|verify} messages. - * @param message LanguageCodePair message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.translation.v3beta1.Glossary.ILanguageCodePair, writer?: $protobuf.Writer): $protobuf.Writer; + /** BatchTranslateTextRequest labels */ + labels?: ({ [k: string]: string }|null); + } - /** - * Encodes the specified LanguageCodePair message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify|verify} messages. - * @param message LanguageCodePair message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.Glossary.ILanguageCodePair, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a BatchTranslateTextRequest. */ + class BatchTranslateTextRequest implements IBatchTranslateTextRequest { - /** - * Decodes a LanguageCodePair message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LanguageCodePair - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.Glossary.LanguageCodePair; + /** + * Constructs a new BatchTranslateTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateTextRequest); - /** - * Decodes a LanguageCodePair message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LanguageCodePair - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.Glossary.LanguageCodePair; + /** BatchTranslateTextRequest parent. */ + public parent: string; - /** - * Verifies a LanguageCodePair message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** BatchTranslateTextRequest sourceLanguageCode. */ + public sourceLanguageCode: string; - /** - * Creates a LanguageCodePair message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LanguageCodePair - */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.Glossary.LanguageCodePair; + /** BatchTranslateTextRequest targetLanguageCodes. */ + public targetLanguageCodes: string[]; - /** - * Creates a plain object from a LanguageCodePair message. Also converts values to other types if specified. - * @param message LanguageCodePair - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.translation.v3beta1.Glossary.LanguageCodePair, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** BatchTranslateTextRequest models. */ + public models: { [k: string]: string }; - /** - * Converts this LanguageCodePair to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** BatchTranslateTextRequest inputConfigs. */ + public inputConfigs: google.cloud.translation.v3beta1.IInputConfig[]; - /** Properties of a LanguageCodesSet. */ - interface ILanguageCodesSet { + /** BatchTranslateTextRequest outputConfig. */ + public outputConfig?: (google.cloud.translation.v3beta1.IOutputConfig|null); - /** LanguageCodesSet languageCodes */ - languageCodes?: (string[]|null); - } + /** BatchTranslateTextRequest glossaries. */ + public glossaries: { [k: string]: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig }; - /** Represents a LanguageCodesSet. */ - class LanguageCodesSet implements ILanguageCodesSet { + /** BatchTranslateTextRequest labels. */ + public labels: { [k: string]: string }; - /** - * Constructs a new LanguageCodesSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet); + /** + * Creates a new BatchTranslateTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchTranslateTextRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IBatchTranslateTextRequest): google.cloud.translation.v3beta1.BatchTranslateTextRequest; - /** LanguageCodesSet languageCodes. */ - public languageCodes: string[]; + /** + * Encodes the specified BatchTranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateTextRequest.verify|verify} messages. + * @param message BatchTranslateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IBatchTranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new LanguageCodesSet instance using the specified properties. - * @param [properties] Properties to set - * @returns LanguageCodesSet instance - */ - public static create(properties?: google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet): google.cloud.translation.v3beta1.Glossary.LanguageCodesSet; + /** + * Encodes the specified BatchTranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateTextRequest.verify|verify} messages. + * @param message BatchTranslateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchTranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified LanguageCodesSet message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify|verify} messages. - * @param message LanguageCodesSet message or plain object to encode + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchTranslateTextRequest; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchTranslateTextRequest; + + /** + * Verifies a BatchTranslateTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchTranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchTranslateTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchTranslateTextRequest; + + /** + * Creates a plain object from a BatchTranslateTextRequest message. Also converts values to other types if specified. + * @param message BatchTranslateTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.BatchTranslateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchTranslateTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchTranslateMetadata. */ + interface IBatchTranslateMetadata { + + /** BatchTranslateMetadata state */ + state?: (google.cloud.translation.v3beta1.BatchTranslateMetadata.State|keyof typeof google.cloud.translation.v3beta1.BatchTranslateMetadata.State|null); + + /** BatchTranslateMetadata translatedCharacters */ + translatedCharacters?: (number|Long|string|null); + + /** BatchTranslateMetadata failedCharacters */ + failedCharacters?: (number|Long|string|null); + + /** BatchTranslateMetadata totalCharacters */ + totalCharacters?: (number|Long|string|null); + + /** BatchTranslateMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchTranslateMetadata. */ + class BatchTranslateMetadata implements IBatchTranslateMetadata { + + /** + * Constructs a new BatchTranslateMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateMetadata); + + /** BatchTranslateMetadata state. */ + public state: (google.cloud.translation.v3beta1.BatchTranslateMetadata.State|keyof typeof google.cloud.translation.v3beta1.BatchTranslateMetadata.State); + + /** BatchTranslateMetadata translatedCharacters. */ + public translatedCharacters: (number|Long|string); + + /** BatchTranslateMetadata failedCharacters. */ + public failedCharacters: (number|Long|string); + + /** BatchTranslateMetadata totalCharacters. */ + public totalCharacters: (number|Long|string); + + /** BatchTranslateMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchTranslateMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchTranslateMetadata instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IBatchTranslateMetadata): google.cloud.translation.v3beta1.BatchTranslateMetadata; + + /** + * Encodes the specified BatchTranslateMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateMetadata.verify|verify} messages. + * @param message BatchTranslateMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IBatchTranslateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchTranslateMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateMetadata.verify|verify} messages. + * @param message BatchTranslateMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchTranslateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchTranslateMetadata; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchTranslateMetadata; + + /** + * Verifies a BatchTranslateMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchTranslateMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchTranslateMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchTranslateMetadata; + + /** + * Creates a plain object from a BatchTranslateMetadata message. Also converts values to other types if specified. + * @param message BatchTranslateMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.BatchTranslateMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchTranslateMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BatchTranslateMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } + + /** Properties of a BatchTranslateResponse. */ + interface IBatchTranslateResponse { + + /** BatchTranslateResponse totalCharacters */ + totalCharacters?: (number|Long|string|null); + + /** BatchTranslateResponse translatedCharacters */ + translatedCharacters?: (number|Long|string|null); + + /** BatchTranslateResponse failedCharacters */ + failedCharacters?: (number|Long|string|null); + + /** BatchTranslateResponse submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchTranslateResponse endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchTranslateResponse. */ + class BatchTranslateResponse implements IBatchTranslateResponse { + + /** + * Constructs a new BatchTranslateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateResponse); + + /** BatchTranslateResponse totalCharacters. */ + public totalCharacters: (number|Long|string); + + /** BatchTranslateResponse translatedCharacters. */ + public translatedCharacters: (number|Long|string); + + /** BatchTranslateResponse failedCharacters. */ + public failedCharacters: (number|Long|string); + + /** BatchTranslateResponse submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchTranslateResponse endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchTranslateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchTranslateResponse instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IBatchTranslateResponse): google.cloud.translation.v3beta1.BatchTranslateResponse; + + /** + * Encodes the specified BatchTranslateResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateResponse.verify|verify} messages. + * @param message BatchTranslateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IBatchTranslateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchTranslateResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateResponse.verify|verify} messages. + * @param message BatchTranslateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchTranslateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchTranslateResponse; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchTranslateResponse; + + /** + * Verifies a BatchTranslateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchTranslateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchTranslateResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchTranslateResponse; + + /** + * Creates a plain object from a BatchTranslateResponse message. Also converts values to other types if specified. + * @param message BatchTranslateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.BatchTranslateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchTranslateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GlossaryInputConfig. */ + interface IGlossaryInputConfig { + + /** GlossaryInputConfig gcsSource */ + gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); + } + + /** Represents a GlossaryInputConfig. */ + class GlossaryInputConfig implements IGlossaryInputConfig { + + /** + * Constructs a new GlossaryInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IGlossaryInputConfig); + + /** GlossaryInputConfig gcsSource. */ + public gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); + + /** GlossaryInputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new GlossaryInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GlossaryInputConfig instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IGlossaryInputConfig): google.cloud.translation.v3beta1.GlossaryInputConfig; + + /** + * Encodes the specified GlossaryInputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.GlossaryInputConfig.verify|verify} messages. + * @param message GlossaryInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IGlossaryInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GlossaryInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GlossaryInputConfig.verify|verify} messages. + * @param message GlossaryInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IGlossaryInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.GlossaryInputConfig; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.GlossaryInputConfig; + + /** + * Verifies a GlossaryInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GlossaryInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GlossaryInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.GlossaryInputConfig; + + /** + * Creates a plain object from a GlossaryInputConfig message. Also converts values to other types if specified. + * @param message GlossaryInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.GlossaryInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GlossaryInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Glossary. */ + interface IGlossary { + + /** Glossary name */ + name?: (string|null); + + /** Glossary languagePair */ + languagePair?: (google.cloud.translation.v3beta1.Glossary.ILanguageCodePair|null); + + /** Glossary languageCodesSet */ + languageCodesSet?: (google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet|null); + + /** Glossary inputConfig */ + inputConfig?: (google.cloud.translation.v3beta1.IGlossaryInputConfig|null); + + /** Glossary entryCount */ + entryCount?: (number|null); + + /** Glossary submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** Glossary endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Glossary. */ + class Glossary implements IGlossary { + + /** + * Constructs a new Glossary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IGlossary); + + /** Glossary name. */ + public name: string; + + /** Glossary languagePair. */ + public languagePair?: (google.cloud.translation.v3beta1.Glossary.ILanguageCodePair|null); + + /** Glossary languageCodesSet. */ + public languageCodesSet?: (google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet|null); + + /** Glossary inputConfig. */ + public inputConfig?: (google.cloud.translation.v3beta1.IGlossaryInputConfig|null); + + /** Glossary entryCount. */ + public entryCount: number; + + /** Glossary submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** Glossary endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Glossary languages. */ + public languages?: ("languagePair"|"languageCodesSet"); + + /** + * Creates a new Glossary instance using the specified properties. + * @param [properties] Properties to set + * @returns Glossary instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IGlossary): google.cloud.translation.v3beta1.Glossary; + + /** + * Encodes the specified Glossary message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.verify|verify} messages. + * @param message Glossary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IGlossary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Glossary message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.verify|verify} messages. + * @param message Glossary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IGlossary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Glossary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.Glossary; + + /** + * Decodes a Glossary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.Glossary; + + /** + * Verifies a Glossary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Glossary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Glossary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.Glossary; + + /** + * Creates a plain object from a Glossary message. Also converts values to other types if specified. + * @param message Glossary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.Glossary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Glossary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Glossary { + + /** Properties of a LanguageCodePair. */ + interface ILanguageCodePair { + + /** LanguageCodePair sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** LanguageCodePair targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a LanguageCodePair. */ + class LanguageCodePair implements ILanguageCodePair { + + /** + * Constructs a new LanguageCodePair. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.Glossary.ILanguageCodePair); + + /** LanguageCodePair sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** LanguageCodePair targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new LanguageCodePair instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageCodePair instance + */ + public static create(properties?: google.cloud.translation.v3beta1.Glossary.ILanguageCodePair): google.cloud.translation.v3beta1.Glossary.LanguageCodePair; + + /** + * Encodes the specified LanguageCodePair message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify|verify} messages. + * @param message LanguageCodePair message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.Glossary.ILanguageCodePair, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageCodePair message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify|verify} messages. + * @param message LanguageCodePair message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.Glossary.ILanguageCodePair, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.Glossary.LanguageCodePair; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.Glossary.LanguageCodePair; + + /** + * Verifies a LanguageCodePair message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LanguageCodePair message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageCodePair + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.Glossary.LanguageCodePair; + + /** + * Creates a plain object from a LanguageCodePair message. Also converts values to other types if specified. + * @param message LanguageCodePair + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.Glossary.LanguageCodePair, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageCodePair to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LanguageCodesSet. */ + interface ILanguageCodesSet { + + /** LanguageCodesSet languageCodes */ + languageCodes?: (string[]|null); + } + + /** Represents a LanguageCodesSet. */ + class LanguageCodesSet implements ILanguageCodesSet { + + /** + * Constructs a new LanguageCodesSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet); + + /** LanguageCodesSet languageCodes. */ + public languageCodes: string[]; + + /** + * Creates a new LanguageCodesSet instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageCodesSet instance + */ + public static create(properties?: google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet): google.cloud.translation.v3beta1.Glossary.LanguageCodesSet; + + /** + * Encodes the specified LanguageCodesSet message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify|verify} messages. + * @param message LanguageCodesSet message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encode(message: google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified LanguageCodesSet message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify|verify} messages. - * @param message LanguageCodesSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified LanguageCodesSet message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify|verify} messages. + * @param message LanguageCodesSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.Glossary.LanguageCodesSet; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.Glossary.LanguageCodesSet; + + /** + * Verifies a LanguageCodesSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LanguageCodesSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageCodesSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.Glossary.LanguageCodesSet; + + /** + * Creates a plain object from a LanguageCodesSet message. Also converts values to other types if specified. + * @param message LanguageCodesSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.Glossary.LanguageCodesSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageCodesSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a CreateGlossaryRequest. */ + interface ICreateGlossaryRequest { + + /** CreateGlossaryRequest parent */ + parent?: (string|null); + + /** CreateGlossaryRequest glossary */ + glossary?: (google.cloud.translation.v3beta1.IGlossary|null); + } + + /** Represents a CreateGlossaryRequest. */ + class CreateGlossaryRequest implements ICreateGlossaryRequest { + + /** + * Constructs a new CreateGlossaryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.ICreateGlossaryRequest); + + /** CreateGlossaryRequest parent. */ + public parent: string; + + /** CreateGlossaryRequest glossary. */ + public glossary?: (google.cloud.translation.v3beta1.IGlossary|null); + + /** + * Creates a new CreateGlossaryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGlossaryRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.ICreateGlossaryRequest): google.cloud.translation.v3beta1.CreateGlossaryRequest; + + /** + * Encodes the specified CreateGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryRequest.verify|verify} messages. + * @param message CreateGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.ICreateGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryRequest.verify|verify} messages. + * @param message CreateGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.ICreateGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.CreateGlossaryRequest; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.CreateGlossaryRequest; + + /** + * Verifies a CreateGlossaryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGlossaryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.CreateGlossaryRequest; + + /** + * Creates a plain object from a CreateGlossaryRequest message. Also converts values to other types if specified. + * @param message CreateGlossaryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.CreateGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGlossaryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetGlossaryRequest. */ + interface IGetGlossaryRequest { + + /** GetGlossaryRequest name */ + name?: (string|null); + } + + /** Represents a GetGlossaryRequest. */ + class GetGlossaryRequest implements IGetGlossaryRequest { + + /** + * Constructs a new GetGlossaryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IGetGlossaryRequest); + + /** GetGlossaryRequest name. */ + public name: string; + + /** + * Creates a new GetGlossaryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGlossaryRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IGetGlossaryRequest): google.cloud.translation.v3beta1.GetGlossaryRequest; + + /** + * Encodes the specified GetGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.GetGlossaryRequest.verify|verify} messages. + * @param message GetGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IGetGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GetGlossaryRequest.verify|verify} messages. + * @param message GetGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IGetGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.GetGlossaryRequest; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.GetGlossaryRequest; + + /** + * Verifies a GetGlossaryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGlossaryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.GetGlossaryRequest; + + /** + * Creates a plain object from a GetGlossaryRequest message. Also converts values to other types if specified. + * @param message GetGlossaryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.GetGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGlossaryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteGlossaryRequest. */ + interface IDeleteGlossaryRequest { + + /** DeleteGlossaryRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGlossaryRequest. */ + class DeleteGlossaryRequest implements IDeleteGlossaryRequest { + + /** + * Constructs a new DeleteGlossaryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryRequest); + + /** DeleteGlossaryRequest name. */ + public name: string; + + /** + * Creates a new DeleteGlossaryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlossaryRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryRequest): google.cloud.translation.v3beta1.DeleteGlossaryRequest; + + /** + * Encodes the specified DeleteGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryRequest.verify|verify} messages. + * @param message DeleteGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IDeleteGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryRequest.verify|verify} messages. + * @param message DeleteGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IDeleteGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DeleteGlossaryRequest; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DeleteGlossaryRequest; + + /** + * Verifies a DeleteGlossaryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlossaryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DeleteGlossaryRequest; + + /** + * Creates a plain object from a DeleteGlossaryRequest message. Also converts values to other types if specified. + * @param message DeleteGlossaryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.DeleteGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlossaryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlossariesRequest. */ + interface IListGlossariesRequest { + + /** ListGlossariesRequest parent */ + parent?: (string|null); + + /** ListGlossariesRequest pageSize */ + pageSize?: (number|null); + + /** ListGlossariesRequest pageToken */ + pageToken?: (string|null); + + /** ListGlossariesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListGlossariesRequest. */ + class ListGlossariesRequest implements IListGlossariesRequest { + + /** + * Constructs a new ListGlossariesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.IListGlossariesRequest); + + /** ListGlossariesRequest parent. */ + public parent: string; + + /** ListGlossariesRequest pageSize. */ + public pageSize: number; + + /** ListGlossariesRequest pageToken. */ + public pageToken: string; - /** - * Decodes a LanguageCodesSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LanguageCodesSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.Glossary.LanguageCodesSet; + /** ListGlossariesRequest filter. */ + public filter: string; - /** - * Decodes a LanguageCodesSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LanguageCodesSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.Glossary.LanguageCodesSet; + /** + * Creates a new ListGlossariesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlossariesRequest instance + */ + public static create(properties?: google.cloud.translation.v3beta1.IListGlossariesRequest): google.cloud.translation.v3beta1.ListGlossariesRequest; - /** - * Verifies a LanguageCodesSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified ListGlossariesRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesRequest.verify|verify} messages. + * @param message ListGlossariesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IListGlossariesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a LanguageCodesSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LanguageCodesSet - */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.Glossary.LanguageCodesSet; + /** + * Encodes the specified ListGlossariesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesRequest.verify|verify} messages. + * @param message ListGlossariesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IListGlossariesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a LanguageCodesSet message. Also converts values to other types if specified. - * @param message LanguageCodesSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.translation.v3beta1.Glossary.LanguageCodesSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.ListGlossariesRequest; - /** - * Converts this LanguageCodesSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.ListGlossariesRequest; + + /** + * Verifies a ListGlossariesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlossariesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlossariesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.ListGlossariesRequest; + + /** + * Creates a plain object from a ListGlossariesRequest message. Also converts values to other types if specified. + * @param message ListGlossariesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.ListGlossariesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlossariesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Properties of a CreateGlossaryRequest. */ - interface ICreateGlossaryRequest { + /** Properties of a ListGlossariesResponse. */ + interface IListGlossariesResponse { - /** CreateGlossaryRequest parent */ - parent?: (string|null); + /** ListGlossariesResponse glossaries */ + glossaries?: (google.cloud.translation.v3beta1.IGlossary[]|null); - /** CreateGlossaryRequest glossary */ - glossary?: (google.cloud.translation.v3beta1.IGlossary|null); + /** ListGlossariesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a CreateGlossaryRequest. */ - class CreateGlossaryRequest implements ICreateGlossaryRequest { + /** Represents a ListGlossariesResponse. */ + class ListGlossariesResponse implements IListGlossariesResponse { /** - * Constructs a new CreateGlossaryRequest. + * Constructs a new ListGlossariesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.ICreateGlossaryRequest); + constructor(properties?: google.cloud.translation.v3beta1.IListGlossariesResponse); - /** CreateGlossaryRequest parent. */ - public parent: string; + /** ListGlossariesResponse glossaries. */ + public glossaries: google.cloud.translation.v3beta1.IGlossary[]; - /** CreateGlossaryRequest glossary. */ - public glossary?: (google.cloud.translation.v3beta1.IGlossary|null); + /** ListGlossariesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new CreateGlossaryRequest instance using the specified properties. + * Creates a new ListGlossariesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns CreateGlossaryRequest instance + * @returns ListGlossariesResponse instance */ - public static create(properties?: google.cloud.translation.v3beta1.ICreateGlossaryRequest): google.cloud.translation.v3beta1.CreateGlossaryRequest; + public static create(properties?: google.cloud.translation.v3beta1.IListGlossariesResponse): google.cloud.translation.v3beta1.ListGlossariesResponse; /** - * Encodes the specified CreateGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryRequest.verify|verify} messages. - * @param message CreateGlossaryRequest message or plain object to encode + * Encodes the specified ListGlossariesResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesResponse.verify|verify} messages. + * @param message ListGlossariesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3beta1.IListGlossariesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlossariesResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesResponse.verify|verify} messages. + * @param message ListGlossariesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3beta1.IListGlossariesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.ListGlossariesResponse; + + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.ListGlossariesResponse; + + /** + * Verifies a ListGlossariesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlossariesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlossariesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.ListGlossariesResponse; + + /** + * Creates a plain object from a ListGlossariesResponse message. Also converts values to other types if specified. + * @param message ListGlossariesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3beta1.ListGlossariesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlossariesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateGlossaryMetadata. */ + interface ICreateGlossaryMetadata { + + /** CreateGlossaryMetadata name */ + name?: (string|null); + + /** CreateGlossaryMetadata state */ + state?: (google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|keyof typeof google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|null); + + /** CreateGlossaryMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateGlossaryMetadata. */ + class CreateGlossaryMetadata implements ICreateGlossaryMetadata { + + /** + * Constructs a new CreateGlossaryMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3beta1.ICreateGlossaryMetadata); + + /** CreateGlossaryMetadata name. */ + public name: string; + + /** CreateGlossaryMetadata state. */ + public state: (google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|keyof typeof google.cloud.translation.v3beta1.CreateGlossaryMetadata.State); + + /** CreateGlossaryMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateGlossaryMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGlossaryMetadata instance + */ + public static create(properties?: google.cloud.translation.v3beta1.ICreateGlossaryMetadata): google.cloud.translation.v3beta1.CreateGlossaryMetadata; + + /** + * Encodes the specified CreateGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryMetadata.verify|verify} messages. + * @param message CreateGlossaryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.ICreateGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.ICreateGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryRequest.verify|verify} messages. - * @param message CreateGlossaryRequest message or plain object to encode + * Encodes the specified CreateGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryMetadata.verify|verify} messages. + * @param message CreateGlossaryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.ICreateGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.ICreateGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateGlossaryRequest message from the specified reader or buffer. + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateGlossaryRequest + * @returns CreateGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.CreateGlossaryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.CreateGlossaryMetadata; /** - * Decodes a CreateGlossaryRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateGlossaryRequest + * @returns CreateGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.CreateGlossaryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.CreateGlossaryMetadata; /** - * Verifies a CreateGlossaryRequest message. + * Verifies a CreateGlossaryMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateGlossaryMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateGlossaryRequest + * @returns CreateGlossaryMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.CreateGlossaryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.CreateGlossaryMetadata; /** - * Creates a plain object from a CreateGlossaryRequest message. Also converts values to other types if specified. - * @param message CreateGlossaryRequest + * Creates a plain object from a CreateGlossaryMetadata message. Also converts values to other types if specified. + * @param message CreateGlossaryMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.CreateGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.CreateGlossaryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateGlossaryRequest to JSON. + * Converts this CreateGlossaryMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetGlossaryRequest. */ - interface IGetGlossaryRequest { + namespace CreateGlossaryMetadata { - /** GetGlossaryRequest name */ + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } + + /** Properties of a DeleteGlossaryMetadata. */ + interface IDeleteGlossaryMetadata { + + /** DeleteGlossaryMetadata name */ name?: (string|null); + + /** DeleteGlossaryMetadata state */ + state?: (google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|keyof typeof google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|null); + + /** DeleteGlossaryMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); } - /** Represents a GetGlossaryRequest. */ - class GetGlossaryRequest implements IGetGlossaryRequest { + /** Represents a DeleteGlossaryMetadata. */ + class DeleteGlossaryMetadata implements IDeleteGlossaryMetadata { /** - * Constructs a new GetGlossaryRequest. + * Constructs a new DeleteGlossaryMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.IGetGlossaryRequest); + constructor(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryMetadata); - /** GetGlossaryRequest name. */ + /** DeleteGlossaryMetadata name. */ public name: string; + /** DeleteGlossaryMetadata state. */ + public state: (google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|keyof typeof google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State); + + /** DeleteGlossaryMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + /** - * Creates a new GetGlossaryRequest instance using the specified properties. + * Creates a new DeleteGlossaryMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns GetGlossaryRequest instance + * @returns DeleteGlossaryMetadata instance */ - public static create(properties?: google.cloud.translation.v3beta1.IGetGlossaryRequest): google.cloud.translation.v3beta1.GetGlossaryRequest; + public static create(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryMetadata): google.cloud.translation.v3beta1.DeleteGlossaryMetadata; /** - * Encodes the specified GetGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.GetGlossaryRequest.verify|verify} messages. - * @param message GetGlossaryRequest message or plain object to encode + * Encodes the specified DeleteGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryMetadata.verify|verify} messages. + * @param message DeleteGlossaryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.IGetGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.IDeleteGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GetGlossaryRequest.verify|verify} messages. - * @param message GetGlossaryRequest message or plain object to encode + * Encodes the specified DeleteGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryMetadata.verify|verify} messages. + * @param message DeleteGlossaryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.IGetGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.IDeleteGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetGlossaryRequest message from the specified reader or buffer. + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetGlossaryRequest + * @returns DeleteGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.GetGlossaryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DeleteGlossaryMetadata; /** - * Decodes a GetGlossaryRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetGlossaryRequest + * @returns DeleteGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.GetGlossaryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DeleteGlossaryMetadata; /** - * Verifies a GetGlossaryRequest message. + * Verifies a DeleteGlossaryMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteGlossaryMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetGlossaryRequest + * @returns DeleteGlossaryMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.GetGlossaryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DeleteGlossaryMetadata; /** - * Creates a plain object from a GetGlossaryRequest message. Also converts values to other types if specified. - * @param message GetGlossaryRequest + * Creates a plain object from a DeleteGlossaryMetadata message. Also converts values to other types if specified. + * @param message DeleteGlossaryMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.GetGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.DeleteGlossaryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetGlossaryRequest to JSON. + * Converts this DeleteGlossaryMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteGlossaryRequest. */ - interface IDeleteGlossaryRequest { + namespace DeleteGlossaryMetadata { - /** DeleteGlossaryRequest name */ + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } + + /** Properties of a DeleteGlossaryResponse. */ + interface IDeleteGlossaryResponse { + + /** DeleteGlossaryResponse name */ name?: (string|null); + + /** DeleteGlossaryResponse submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** DeleteGlossaryResponse endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents a DeleteGlossaryRequest. */ - class DeleteGlossaryRequest implements IDeleteGlossaryRequest { + /** Represents a DeleteGlossaryResponse. */ + class DeleteGlossaryResponse implements IDeleteGlossaryResponse { /** - * Constructs a new DeleteGlossaryRequest. + * Constructs a new DeleteGlossaryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryRequest); + constructor(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryResponse); - /** DeleteGlossaryRequest name. */ + /** DeleteGlossaryResponse name. */ public name: string; + /** DeleteGlossaryResponse submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** DeleteGlossaryResponse endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + /** - * Creates a new DeleteGlossaryRequest instance using the specified properties. + * Creates a new DeleteGlossaryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteGlossaryRequest instance + * @returns DeleteGlossaryResponse instance */ - public static create(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryRequest): google.cloud.translation.v3beta1.DeleteGlossaryRequest; + public static create(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryResponse): google.cloud.translation.v3beta1.DeleteGlossaryResponse; /** - * Encodes the specified DeleteGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryRequest.verify|verify} messages. - * @param message DeleteGlossaryRequest message or plain object to encode + * Encodes the specified DeleteGlossaryResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryResponse.verify|verify} messages. + * @param message DeleteGlossaryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.IDeleteGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.IDeleteGlossaryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryRequest.verify|verify} messages. - * @param message DeleteGlossaryRequest message or plain object to encode + * Encodes the specified DeleteGlossaryResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryResponse.verify|verify} messages. + * @param message DeleteGlossaryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.IDeleteGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.IDeleteGlossaryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteGlossaryRequest message from the specified reader or buffer. + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteGlossaryRequest + * @returns DeleteGlossaryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DeleteGlossaryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DeleteGlossaryResponse; /** - * Decodes a DeleteGlossaryRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteGlossaryRequest + * @returns DeleteGlossaryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DeleteGlossaryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DeleteGlossaryResponse; /** - * Verifies a DeleteGlossaryRequest message. + * Verifies a DeleteGlossaryResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteGlossaryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteGlossaryRequest + * @returns DeleteGlossaryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DeleteGlossaryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DeleteGlossaryResponse; /** - * Creates a plain object from a DeleteGlossaryRequest message. Also converts values to other types if specified. - * @param message DeleteGlossaryRequest + * Creates a plain object from a DeleteGlossaryResponse message. Also converts values to other types if specified. + * @param message DeleteGlossaryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.DeleteGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.DeleteGlossaryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteGlossaryRequest to JSON. + * Converts this DeleteGlossaryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListGlossariesRequest. */ - interface IListGlossariesRequest { + /** Properties of a BatchTranslateDocumentRequest. */ + interface IBatchTranslateDocumentRequest { - /** ListGlossariesRequest parent */ + /** BatchTranslateDocumentRequest parent */ parent?: (string|null); - /** ListGlossariesRequest pageSize */ - pageSize?: (number|null); + /** BatchTranslateDocumentRequest sourceLanguageCode */ + sourceLanguageCode?: (string|null); - /** ListGlossariesRequest pageToken */ - pageToken?: (string|null); + /** BatchTranslateDocumentRequest targetLanguageCodes */ + targetLanguageCodes?: (string[]|null); - /** ListGlossariesRequest filter */ - filter?: (string|null); + /** BatchTranslateDocumentRequest inputConfigs */ + inputConfigs?: (google.cloud.translation.v3beta1.IBatchDocumentInputConfig[]|null); + + /** BatchTranslateDocumentRequest outputConfig */ + outputConfig?: (google.cloud.translation.v3beta1.IBatchDocumentOutputConfig|null); + + /** BatchTranslateDocumentRequest models */ + models?: ({ [k: string]: string }|null); + + /** BatchTranslateDocumentRequest glossaries */ + glossaries?: ({ [k: string]: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig }|null); } - /** Represents a ListGlossariesRequest. */ - class ListGlossariesRequest implements IListGlossariesRequest { + /** Represents a BatchTranslateDocumentRequest. */ + class BatchTranslateDocumentRequest implements IBatchTranslateDocumentRequest { /** - * Constructs a new ListGlossariesRequest. + * Constructs a new BatchTranslateDocumentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.IListGlossariesRequest); + constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest); - /** ListGlossariesRequest parent. */ + /** BatchTranslateDocumentRequest parent. */ public parent: string; - /** ListGlossariesRequest pageSize. */ - public pageSize: number; + /** BatchTranslateDocumentRequest sourceLanguageCode. */ + public sourceLanguageCode: string; - /** ListGlossariesRequest pageToken. */ - public pageToken: string; + /** BatchTranslateDocumentRequest targetLanguageCodes. */ + public targetLanguageCodes: string[]; - /** ListGlossariesRequest filter. */ - public filter: string; + /** BatchTranslateDocumentRequest inputConfigs. */ + public inputConfigs: google.cloud.translation.v3beta1.IBatchDocumentInputConfig[]; + + /** BatchTranslateDocumentRequest outputConfig. */ + public outputConfig?: (google.cloud.translation.v3beta1.IBatchDocumentOutputConfig|null); + + /** BatchTranslateDocumentRequest models. */ + public models: { [k: string]: string }; + + /** BatchTranslateDocumentRequest glossaries. */ + public glossaries: { [k: string]: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig }; /** - * Creates a new ListGlossariesRequest instance using the specified properties. + * Creates a new BatchTranslateDocumentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListGlossariesRequest instance + * @returns BatchTranslateDocumentRequest instance */ - public static create(properties?: google.cloud.translation.v3beta1.IListGlossariesRequest): google.cloud.translation.v3beta1.ListGlossariesRequest; + public static create(properties?: google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest): google.cloud.translation.v3beta1.BatchTranslateDocumentRequest; /** - * Encodes the specified ListGlossariesRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesRequest.verify|verify} messages. - * @param message ListGlossariesRequest message or plain object to encode + * Encodes the specified BatchTranslateDocumentRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateDocumentRequest.verify|verify} messages. + * @param message BatchTranslateDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.IListGlossariesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListGlossariesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesRequest.verify|verify} messages. - * @param message ListGlossariesRequest message or plain object to encode + * Encodes the specified BatchTranslateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateDocumentRequest.verify|verify} messages. + * @param message BatchTranslateDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.IListGlossariesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListGlossariesRequest message from the specified reader or buffer. + * Decodes a BatchTranslateDocumentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListGlossariesRequest + * @returns BatchTranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.ListGlossariesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchTranslateDocumentRequest; /** - * Decodes a ListGlossariesRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchTranslateDocumentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListGlossariesRequest + * @returns BatchTranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.ListGlossariesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchTranslateDocumentRequest; /** - * Verifies a ListGlossariesRequest message. + * Verifies a BatchTranslateDocumentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListGlossariesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchTranslateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListGlossariesRequest + * @returns BatchTranslateDocumentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.ListGlossariesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchTranslateDocumentRequest; /** - * Creates a plain object from a ListGlossariesRequest message. Also converts values to other types if specified. - * @param message ListGlossariesRequest + * Creates a plain object from a BatchTranslateDocumentRequest message. Also converts values to other types if specified. + * @param message BatchTranslateDocumentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.ListGlossariesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.BatchTranslateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListGlossariesRequest to JSON. + * Converts this BatchTranslateDocumentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListGlossariesResponse. */ - interface IListGlossariesResponse { - - /** ListGlossariesResponse glossaries */ - glossaries?: (google.cloud.translation.v3beta1.IGlossary[]|null); + /** Properties of a BatchDocumentInputConfig. */ + interface IBatchDocumentInputConfig { - /** ListGlossariesResponse nextPageToken */ - nextPageToken?: (string|null); + /** BatchDocumentInputConfig gcsSource */ + gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); } - /** Represents a ListGlossariesResponse. */ - class ListGlossariesResponse implements IListGlossariesResponse { + /** Represents a BatchDocumentInputConfig. */ + class BatchDocumentInputConfig implements IBatchDocumentInputConfig { /** - * Constructs a new ListGlossariesResponse. + * Constructs a new BatchDocumentInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.IListGlossariesResponse); + constructor(properties?: google.cloud.translation.v3beta1.IBatchDocumentInputConfig); - /** ListGlossariesResponse glossaries. */ - public glossaries: google.cloud.translation.v3beta1.IGlossary[]; + /** BatchDocumentInputConfig gcsSource. */ + public gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); - /** ListGlossariesResponse nextPageToken. */ - public nextPageToken: string; + /** BatchDocumentInputConfig source. */ + public source?: "gcsSource"; /** - * Creates a new ListGlossariesResponse instance using the specified properties. + * Creates a new BatchDocumentInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ListGlossariesResponse instance + * @returns BatchDocumentInputConfig instance */ - public static create(properties?: google.cloud.translation.v3beta1.IListGlossariesResponse): google.cloud.translation.v3beta1.ListGlossariesResponse; + public static create(properties?: google.cloud.translation.v3beta1.IBatchDocumentInputConfig): google.cloud.translation.v3beta1.BatchDocumentInputConfig; /** - * Encodes the specified ListGlossariesResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesResponse.verify|verify} messages. - * @param message ListGlossariesResponse message or plain object to encode + * Encodes the specified BatchDocumentInputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchDocumentInputConfig.verify|verify} messages. + * @param message BatchDocumentInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.IListGlossariesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.IBatchDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListGlossariesResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesResponse.verify|verify} messages. - * @param message ListGlossariesResponse message or plain object to encode + * Encodes the specified BatchDocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchDocumentInputConfig.verify|verify} messages. + * @param message BatchDocumentInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.IListGlossariesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListGlossariesResponse message from the specified reader or buffer. + * Decodes a BatchDocumentInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListGlossariesResponse + * @returns BatchDocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.ListGlossariesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchDocumentInputConfig; /** - * Decodes a ListGlossariesResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchDocumentInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListGlossariesResponse + * @returns BatchDocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.ListGlossariesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchDocumentInputConfig; /** - * Verifies a ListGlossariesResponse message. + * Verifies a BatchDocumentInputConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListGlossariesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDocumentInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListGlossariesResponse + * @returns BatchDocumentInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.ListGlossariesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchDocumentInputConfig; /** - * Creates a plain object from a ListGlossariesResponse message. Also converts values to other types if specified. - * @param message ListGlossariesResponse + * Creates a plain object from a BatchDocumentInputConfig message. Also converts values to other types if specified. + * @param message BatchDocumentInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.ListGlossariesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.BatchDocumentInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListGlossariesResponse to JSON. + * Converts this BatchDocumentInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateGlossaryMetadata. */ - interface ICreateGlossaryMetadata { - - /** CreateGlossaryMetadata name */ - name?: (string|null); - - /** CreateGlossaryMetadata state */ - state?: (google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|keyof typeof google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|null); + /** Properties of a BatchDocumentOutputConfig. */ + interface IBatchDocumentOutputConfig { - /** CreateGlossaryMetadata submitTime */ - submitTime?: (google.protobuf.ITimestamp|null); + /** BatchDocumentOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.translation.v3beta1.IGcsDestination|null); } - /** Represents a CreateGlossaryMetadata. */ - class CreateGlossaryMetadata implements ICreateGlossaryMetadata { + /** Represents a BatchDocumentOutputConfig. */ + class BatchDocumentOutputConfig implements IBatchDocumentOutputConfig { /** - * Constructs a new CreateGlossaryMetadata. + * Constructs a new BatchDocumentOutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.ICreateGlossaryMetadata); - - /** CreateGlossaryMetadata name. */ - public name: string; + constructor(properties?: google.cloud.translation.v3beta1.IBatchDocumentOutputConfig); - /** CreateGlossaryMetadata state. */ - public state: (google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|keyof typeof google.cloud.translation.v3beta1.CreateGlossaryMetadata.State); + /** BatchDocumentOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.translation.v3beta1.IGcsDestination|null); - /** CreateGlossaryMetadata submitTime. */ - public submitTime?: (google.protobuf.ITimestamp|null); + /** BatchDocumentOutputConfig destination. */ + public destination?: "gcsDestination"; /** - * Creates a new CreateGlossaryMetadata instance using the specified properties. + * Creates a new BatchDocumentOutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns CreateGlossaryMetadata instance + * @returns BatchDocumentOutputConfig instance */ - public static create(properties?: google.cloud.translation.v3beta1.ICreateGlossaryMetadata): google.cloud.translation.v3beta1.CreateGlossaryMetadata; + public static create(properties?: google.cloud.translation.v3beta1.IBatchDocumentOutputConfig): google.cloud.translation.v3beta1.BatchDocumentOutputConfig; /** - * Encodes the specified CreateGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryMetadata.verify|verify} messages. - * @param message CreateGlossaryMetadata message or plain object to encode + * Encodes the specified BatchDocumentOutputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchDocumentOutputConfig.verify|verify} messages. + * @param message BatchDocumentOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.ICreateGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.IBatchDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryMetadata.verify|verify} messages. - * @param message CreateGlossaryMetadata message or plain object to encode + * Encodes the specified BatchDocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchDocumentOutputConfig.verify|verify} messages. + * @param message BatchDocumentOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.ICreateGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateGlossaryMetadata message from the specified reader or buffer. + * Decodes a BatchDocumentOutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateGlossaryMetadata + * @returns BatchDocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.CreateGlossaryMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchDocumentOutputConfig; /** - * Decodes a CreateGlossaryMetadata message from the specified reader or buffer, length delimited. + * Decodes a BatchDocumentOutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateGlossaryMetadata + * @returns BatchDocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.CreateGlossaryMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchDocumentOutputConfig; /** - * Verifies a CreateGlossaryMetadata message. + * Verifies a BatchDocumentOutputConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDocumentOutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateGlossaryMetadata + * @returns BatchDocumentOutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.CreateGlossaryMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchDocumentOutputConfig; /** - * Creates a plain object from a CreateGlossaryMetadata message. Also converts values to other types if specified. - * @param message CreateGlossaryMetadata + * Creates a plain object from a BatchDocumentOutputConfig message. Also converts values to other types if specified. + * @param message BatchDocumentOutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.CreateGlossaryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.BatchDocumentOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateGlossaryMetadata to JSON. + * Converts this BatchDocumentOutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace CreateGlossaryMetadata { + /** Properties of a BatchTranslateDocumentResponse. */ + interface IBatchTranslateDocumentResponse { - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - RUNNING = 1, - SUCCEEDED = 2, - FAILED = 3, - CANCELLING = 4, - CANCELLED = 5 - } - } + /** BatchTranslateDocumentResponse totalPages */ + totalPages?: (number|Long|string|null); - /** Properties of a DeleteGlossaryMetadata. */ - interface IDeleteGlossaryMetadata { + /** BatchTranslateDocumentResponse translatedPages */ + translatedPages?: (number|Long|string|null); - /** DeleteGlossaryMetadata name */ - name?: (string|null); + /** BatchTranslateDocumentResponse failedPages */ + failedPages?: (number|Long|string|null); - /** DeleteGlossaryMetadata state */ - state?: (google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|keyof typeof google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|null); + /** BatchTranslateDocumentResponse totalBillablePages */ + totalBillablePages?: (number|Long|string|null); - /** DeleteGlossaryMetadata submitTime */ + /** BatchTranslateDocumentResponse totalCharacters */ + totalCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentResponse translatedCharacters */ + translatedCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentResponse failedCharacters */ + failedCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentResponse totalBillableCharacters */ + totalBillableCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentResponse submitTime */ submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchTranslateDocumentResponse endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents a DeleteGlossaryMetadata. */ - class DeleteGlossaryMetadata implements IDeleteGlossaryMetadata { + /** Represents a BatchTranslateDocumentResponse. */ + class BatchTranslateDocumentResponse implements IBatchTranslateDocumentResponse { /** - * Constructs a new DeleteGlossaryMetadata. + * Constructs a new BatchTranslateDocumentResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryMetadata); + constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse); - /** DeleteGlossaryMetadata name. */ - public name: string; + /** BatchTranslateDocumentResponse totalPages. */ + public totalPages: (number|Long|string); - /** DeleteGlossaryMetadata state. */ - public state: (google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|keyof typeof google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State); + /** BatchTranslateDocumentResponse translatedPages. */ + public translatedPages: (number|Long|string); - /** DeleteGlossaryMetadata submitTime. */ + /** BatchTranslateDocumentResponse failedPages. */ + public failedPages: (number|Long|string); + + /** BatchTranslateDocumentResponse totalBillablePages. */ + public totalBillablePages: (number|Long|string); + + /** BatchTranslateDocumentResponse totalCharacters. */ + public totalCharacters: (number|Long|string); + + /** BatchTranslateDocumentResponse translatedCharacters. */ + public translatedCharacters: (number|Long|string); + + /** BatchTranslateDocumentResponse failedCharacters. */ + public failedCharacters: (number|Long|string); + + /** BatchTranslateDocumentResponse totalBillableCharacters. */ + public totalBillableCharacters: (number|Long|string); + + /** BatchTranslateDocumentResponse submitTime. */ public submitTime?: (google.protobuf.ITimestamp|null); + /** BatchTranslateDocumentResponse endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + /** - * Creates a new DeleteGlossaryMetadata instance using the specified properties. + * Creates a new BatchTranslateDocumentResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteGlossaryMetadata instance + * @returns BatchTranslateDocumentResponse instance */ - public static create(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryMetadata): google.cloud.translation.v3beta1.DeleteGlossaryMetadata; + public static create(properties?: google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse): google.cloud.translation.v3beta1.BatchTranslateDocumentResponse; /** - * Encodes the specified DeleteGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryMetadata.verify|verify} messages. - * @param message DeleteGlossaryMetadata message or plain object to encode + * Encodes the specified BatchTranslateDocumentResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateDocumentResponse.verify|verify} messages. + * @param message BatchTranslateDocumentResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.IDeleteGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryMetadata.verify|verify} messages. - * @param message DeleteGlossaryMetadata message or plain object to encode + * Encodes the specified BatchTranslateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateDocumentResponse.verify|verify} messages. + * @param message BatchTranslateDocumentResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.IDeleteGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer. + * Decodes a BatchTranslateDocumentResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteGlossaryMetadata + * @returns BatchTranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DeleteGlossaryMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchTranslateDocumentResponse; /** - * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer, length delimited. + * Decodes a BatchTranslateDocumentResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteGlossaryMetadata + * @returns BatchTranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DeleteGlossaryMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchTranslateDocumentResponse; /** - * Verifies a DeleteGlossaryMetadata message. + * Verifies a BatchTranslateDocumentResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a BatchTranslateDocumentResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteGlossaryMetadata + * @returns BatchTranslateDocumentResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DeleteGlossaryMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchTranslateDocumentResponse; /** - * Creates a plain object from a DeleteGlossaryMetadata message. Also converts values to other types if specified. - * @param message DeleteGlossaryMetadata + * Creates a plain object from a BatchTranslateDocumentResponse message. Also converts values to other types if specified. + * @param message BatchTranslateDocumentResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.DeleteGlossaryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.BatchTranslateDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteGlossaryMetadata to JSON. + * Converts this BatchTranslateDocumentResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace DeleteGlossaryMetadata { + /** Properties of a BatchTranslateDocumentMetadata. */ + interface IBatchTranslateDocumentMetadata { - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - RUNNING = 1, - SUCCEEDED = 2, - FAILED = 3, - CANCELLING = 4, - CANCELLED = 5 - } - } + /** BatchTranslateDocumentMetadata state */ + state?: (google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State|keyof typeof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State|null); - /** Properties of a DeleteGlossaryResponse. */ - interface IDeleteGlossaryResponse { + /** BatchTranslateDocumentMetadata totalPages */ + totalPages?: (number|Long|string|null); - /** DeleteGlossaryResponse name */ - name?: (string|null); + /** BatchTranslateDocumentMetadata translatedPages */ + translatedPages?: (number|Long|string|null); - /** DeleteGlossaryResponse submitTime */ - submitTime?: (google.protobuf.ITimestamp|null); + /** BatchTranslateDocumentMetadata failedPages */ + failedPages?: (number|Long|string|null); - /** DeleteGlossaryResponse endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** BatchTranslateDocumentMetadata totalBillablePages */ + totalBillablePages?: (number|Long|string|null); + + /** BatchTranslateDocumentMetadata totalCharacters */ + totalCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentMetadata translatedCharacters */ + translatedCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentMetadata failedCharacters */ + failedCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentMetadata totalBillableCharacters */ + totalBillableCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); } - /** Represents a DeleteGlossaryResponse. */ - class DeleteGlossaryResponse implements IDeleteGlossaryResponse { + /** Represents a BatchTranslateDocumentMetadata. */ + class BatchTranslateDocumentMetadata implements IBatchTranslateDocumentMetadata { /** - * Constructs a new DeleteGlossaryResponse. + * Constructs a new BatchTranslateDocumentMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryResponse); + constructor(properties?: google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata); - /** DeleteGlossaryResponse name. */ - public name: string; + /** BatchTranslateDocumentMetadata state. */ + public state: (google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State|keyof typeof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State); - /** DeleteGlossaryResponse submitTime. */ - public submitTime?: (google.protobuf.ITimestamp|null); + /** BatchTranslateDocumentMetadata totalPages. */ + public totalPages: (number|Long|string); - /** DeleteGlossaryResponse endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** BatchTranslateDocumentMetadata translatedPages. */ + public translatedPages: (number|Long|string); + + /** BatchTranslateDocumentMetadata failedPages. */ + public failedPages: (number|Long|string); + + /** BatchTranslateDocumentMetadata totalBillablePages. */ + public totalBillablePages: (number|Long|string); + + /** BatchTranslateDocumentMetadata totalCharacters. */ + public totalCharacters: (number|Long|string); + + /** BatchTranslateDocumentMetadata translatedCharacters. */ + public translatedCharacters: (number|Long|string); + + /** BatchTranslateDocumentMetadata failedCharacters. */ + public failedCharacters: (number|Long|string); + + /** BatchTranslateDocumentMetadata totalBillableCharacters. */ + public totalBillableCharacters: (number|Long|string); + + /** BatchTranslateDocumentMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new DeleteGlossaryResponse instance using the specified properties. + * Creates a new BatchTranslateDocumentMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteGlossaryResponse instance + * @returns BatchTranslateDocumentMetadata instance */ - public static create(properties?: google.cloud.translation.v3beta1.IDeleteGlossaryResponse): google.cloud.translation.v3beta1.DeleteGlossaryResponse; + public static create(properties?: google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata): google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata; /** - * Encodes the specified DeleteGlossaryResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryResponse.verify|verify} messages. - * @param message DeleteGlossaryResponse message or plain object to encode + * Encodes the specified BatchTranslateDocumentMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.verify|verify} messages. + * @param message BatchTranslateDocumentMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3beta1.IDeleteGlossaryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteGlossaryResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryResponse.verify|verify} messages. - * @param message DeleteGlossaryResponse message or plain object to encode + * Encodes the specified BatchTranslateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.verify|verify} messages. + * @param message BatchTranslateDocumentMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3beta1.IDeleteGlossaryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteGlossaryResponse message from the specified reader or buffer. + * Decodes a BatchTranslateDocumentMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteGlossaryResponse + * @returns BatchTranslateDocumentMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.DeleteGlossaryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata; /** - * Decodes a DeleteGlossaryResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchTranslateDocumentMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteGlossaryResponse + * @returns BatchTranslateDocumentMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.DeleteGlossaryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata; /** - * Verifies a DeleteGlossaryResponse message. + * Verifies a BatchTranslateDocumentMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteGlossaryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchTranslateDocumentMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteGlossaryResponse + * @returns BatchTranslateDocumentMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.DeleteGlossaryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata; /** - * Creates a plain object from a DeleteGlossaryResponse message. Also converts values to other types if specified. - * @param message DeleteGlossaryResponse + * Creates a plain object from a BatchTranslateDocumentMetadata message. Also converts values to other types if specified. + * @param message BatchTranslateDocumentMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3beta1.DeleteGlossaryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteGlossaryResponse to JSON. + * Converts this BatchTranslateDocumentMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + + namespace BatchTranslateDocumentMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } } } } diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index d3ca09feb75..5e4756b138b 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -7991,6 +7991,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#translateDocument}. + * @memberof google.cloud.translation.v3beta1.TranslationService + * @typedef TranslateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.translation.v3beta1.TranslateDocumentResponse} [response] TranslateDocumentResponse + */ + + /** + * Calls TranslateDocument. + * @function translateDocument + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.ITranslateDocumentRequest} request TranslateDocumentRequest message or plain object + * @param {google.cloud.translation.v3beta1.TranslationService.TranslateDocumentCallback} callback Node-style callback called with the error, if any, and TranslateDocumentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.translateDocument = function translateDocument(request, callback) { + return this.rpcCall(translateDocument, $root.google.cloud.translation.v3beta1.TranslateDocumentRequest, $root.google.cloud.translation.v3beta1.TranslateDocumentResponse, request, callback); + }, "name", { value: "TranslateDocument" }); + + /** + * Calls TranslateDocument. + * @function translateDocument + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.ITranslateDocumentRequest} request TranslateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#batchTranslateText}. * @memberof google.cloud.translation.v3beta1.TranslationService @@ -8024,6 +8057,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#batchTranslateDocument}. + * @memberof google.cloud.translation.v3beta1.TranslationService + * @typedef BatchTranslateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchTranslateDocument. + * @function batchTranslateDocument + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest} request BatchTranslateDocumentRequest message or plain object + * @param {google.cloud.translation.v3beta1.TranslationService.BatchTranslateDocumentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.batchTranslateDocument = function batchTranslateDocument(request, callback) { + return this.rpcCall(batchTranslateDocument, $root.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchTranslateDocument" }); + + /** + * Calls BatchTranslateDocument. + * @function batchTranslateDocument + * @memberof google.cloud.translation.v3beta1.TranslationService + * @instance + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest} request BatchTranslateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#createGlossary}. * @memberof google.cloud.translation.v3beta1.TranslationService @@ -11542,36 +11608,26 @@ return OutputConfig; })(); - v3beta1.BatchTranslateTextRequest = (function() { + v3beta1.DocumentInputConfig = (function() { /** - * Properties of a BatchTranslateTextRequest. + * Properties of a DocumentInputConfig. * @memberof google.cloud.translation.v3beta1 - * @interface IBatchTranslateTextRequest - * @property {string|null} [parent] BatchTranslateTextRequest parent - * @property {string|null} [sourceLanguageCode] BatchTranslateTextRequest sourceLanguageCode - * @property {Array.|null} [targetLanguageCodes] BatchTranslateTextRequest targetLanguageCodes - * @property {Object.|null} [models] BatchTranslateTextRequest models - * @property {Array.|null} [inputConfigs] BatchTranslateTextRequest inputConfigs - * @property {google.cloud.translation.v3beta1.IOutputConfig|null} [outputConfig] BatchTranslateTextRequest outputConfig - * @property {Object.|null} [glossaries] BatchTranslateTextRequest glossaries - * @property {Object.|null} [labels] BatchTranslateTextRequest labels + * @interface IDocumentInputConfig + * @property {Uint8Array|null} [content] DocumentInputConfig content + * @property {google.cloud.translation.v3beta1.IGcsSource|null} [gcsSource] DocumentInputConfig gcsSource + * @property {string|null} [mimeType] DocumentInputConfig mimeType */ /** - * Constructs a new BatchTranslateTextRequest. + * Constructs a new DocumentInputConfig. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a BatchTranslateTextRequest. - * @implements IBatchTranslateTextRequest + * @classdesc Represents a DocumentInputConfig. + * @implements IDocumentInputConfig * @constructor - * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.IDocumentInputConfig=} [properties] Properties to set */ - function BatchTranslateTextRequest(properties) { - this.targetLanguageCodes = []; - this.models = {}; - this.inputConfigs = []; - this.glossaries = {}; - this.labels = {}; + function DocumentInputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11579,234 +11635,115 @@ } /** - * BatchTranslateTextRequest parent. - * @member {string} parent - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest - * @instance - */ - BatchTranslateTextRequest.prototype.parent = ""; - - /** - * BatchTranslateTextRequest sourceLanguageCode. - * @member {string} sourceLanguageCode - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest - * @instance - */ - BatchTranslateTextRequest.prototype.sourceLanguageCode = ""; - - /** - * BatchTranslateTextRequest targetLanguageCodes. - * @member {Array.} targetLanguageCodes - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest - * @instance - */ - BatchTranslateTextRequest.prototype.targetLanguageCodes = $util.emptyArray; - - /** - * BatchTranslateTextRequest models. - * @member {Object.} models - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * DocumentInputConfig content. + * @member {Uint8Array} content + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @instance */ - BatchTranslateTextRequest.prototype.models = $util.emptyObject; + DocumentInputConfig.prototype.content = $util.newBuffer([]); /** - * BatchTranslateTextRequest inputConfigs. - * @member {Array.} inputConfigs - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * DocumentInputConfig gcsSource. + * @member {google.cloud.translation.v3beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @instance */ - BatchTranslateTextRequest.prototype.inputConfigs = $util.emptyArray; + DocumentInputConfig.prototype.gcsSource = null; /** - * BatchTranslateTextRequest outputConfig. - * @member {google.cloud.translation.v3beta1.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * DocumentInputConfig mimeType. + * @member {string} mimeType + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @instance */ - BatchTranslateTextRequest.prototype.outputConfig = null; + DocumentInputConfig.prototype.mimeType = ""; - /** - * BatchTranslateTextRequest glossaries. - * @member {Object.} glossaries - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest - * @instance - */ - BatchTranslateTextRequest.prototype.glossaries = $util.emptyObject; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * BatchTranslateTextRequest labels. - * @member {Object.} labels - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * DocumentInputConfig source. + * @member {"content"|"gcsSource"|undefined} source + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @instance */ - BatchTranslateTextRequest.prototype.labels = $util.emptyObject; + Object.defineProperty(DocumentInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["content", "gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new BatchTranslateTextRequest instance using the specified properties. + * Creates a new DocumentInputConfig instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @static - * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.BatchTranslateTextRequest} BatchTranslateTextRequest instance + * @param {google.cloud.translation.v3beta1.IDocumentInputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.DocumentInputConfig} DocumentInputConfig instance */ - BatchTranslateTextRequest.create = function create(properties) { - return new BatchTranslateTextRequest(properties); + DocumentInputConfig.create = function create(properties) { + return new DocumentInputConfig(properties); }; /** - * Encodes the specified BatchTranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateTextRequest.verify|verify} messages. + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.DocumentInputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @static - * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest} message BatchTranslateTextRequest message or plain object to encode + * @param {google.cloud.translation.v3beta1.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchTranslateTextRequest.encode = function encode(message, writer) { + DocumentInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); - if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) - for (var i = 0; i < message.targetLanguageCodes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); - if (message.models != null && Object.hasOwnProperty.call(message, "models")) - for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); - if (message.inputConfigs != null && message.inputConfigs.length) - for (var i = 0; i < message.inputConfigs.length; ++i) - $root.google.cloud.translation.v3beta1.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) - $root.google.cloud.translation.v3beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.glossaries != null && Object.hasOwnProperty.call(message, "glossaries")) - for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.translation.v3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mimeType); return writer; }; /** - * Encodes the specified BatchTranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateTextRequest.verify|verify} messages. + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DocumentInputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @static - * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest} message BatchTranslateTextRequest message or plain object to encode + * @param {google.cloud.translation.v3beta1.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchTranslateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + DocumentInputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchTranslateTextRequest message from the specified reader or buffer. + * Decodes a DocumentInputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.BatchTranslateTextRequest} BatchTranslateTextRequest + * @returns {google.cloud.translation.v3beta1.DocumentInputConfig} DocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchTranslateTextRequest.decode = function decode(reader, length) { + DocumentInputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateTextRequest(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DocumentInputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.content = reader.bytes(); break; case 2: - message.sourceLanguageCode = reader.string(); - break; - case 3: - if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) - message.targetLanguageCodes = []; - message.targetLanguageCodes.push(reader.string()); + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); break; case 4: - if (message.models === $util.emptyObject) - message.models = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.models[key] = value; - break; - case 5: - if (!(message.inputConfigs && message.inputConfigs.length)) - message.inputConfigs = []; - message.inputConfigs.push($root.google.cloud.translation.v3beta1.InputConfig.decode(reader, reader.uint32())); - break; - case 6: - message.outputConfig = $root.google.cloud.translation.v3beta1.OutputConfig.decode(reader, reader.uint32()); - break; - case 7: - if (message.glossaries === $util.emptyObject) - message.glossaries = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.glossaries[key] = value; - break; - case 9: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; + message.mimeType = reader.string(); break; default: reader.skipType(tag & 7); @@ -11817,251 +11754,144 @@ }; /** - * Decodes a BatchTranslateTextRequest message from the specified reader or buffer, length delimited. + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.BatchTranslateTextRequest} BatchTranslateTextRequest + * @returns {google.cloud.translation.v3beta1.DocumentInputConfig} DocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchTranslateTextRequest.decodeDelimited = function decodeDelimited(reader) { + DocumentInputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchTranslateTextRequest message. + * Verifies a DocumentInputConfig message. * @function verify - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchTranslateTextRequest.verify = function verify(message) { + DocumentInputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - if (!$util.isString(message.sourceLanguageCode)) - return "sourceLanguageCode: string expected"; - if (message.targetLanguageCodes != null && message.hasOwnProperty("targetLanguageCodes")) { - if (!Array.isArray(message.targetLanguageCodes)) - return "targetLanguageCodes: array expected"; - for (var i = 0; i < message.targetLanguageCodes.length; ++i) - if (!$util.isString(message.targetLanguageCodes[i])) - return "targetLanguageCodes: string[] expected"; - } - if (message.models != null && message.hasOwnProperty("models")) { - if (!$util.isObject(message.models)) - return "models: object expected"; - var key = Object.keys(message.models); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.models[key[i]])) - return "models: string{k:string} expected"; - } - if (message.inputConfigs != null && message.hasOwnProperty("inputConfigs")) { - if (!Array.isArray(message.inputConfigs)) - return "inputConfigs: array expected"; - for (var i = 0; i < message.inputConfigs.length; ++i) { - var error = $root.google.cloud.translation.v3beta1.InputConfig.verify(message.inputConfigs[i]); - if (error) - return "inputConfigs." + error; - } - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.translation.v3beta1.OutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; + var properties = {}; + if (message.content != null && message.hasOwnProperty("content")) { + properties.source = 1; + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; } - if (message.glossaries != null && message.hasOwnProperty("glossaries")) { - if (!$util.isObject(message.glossaries)) - return "glossaries: object expected"; - var key = Object.keys(message.glossaries); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.verify(message.glossaries[key[i]]); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.translation.v3beta1.GcsSource.verify(message.gcsSource); if (error) - return "glossaries." + error; + return "gcsSource." + error; } } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; return null; }; /** - * Creates a BatchTranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.BatchTranslateTextRequest} BatchTranslateTextRequest + * @returns {google.cloud.translation.v3beta1.DocumentInputConfig} DocumentInputConfig */ - BatchTranslateTextRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.BatchTranslateTextRequest) + DocumentInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.DocumentInputConfig) return object; - var message = new $root.google.cloud.translation.v3beta1.BatchTranslateTextRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.sourceLanguageCode != null) - message.sourceLanguageCode = String(object.sourceLanguageCode); - if (object.targetLanguageCodes) { - if (!Array.isArray(object.targetLanguageCodes)) - throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.targetLanguageCodes: array expected"); - message.targetLanguageCodes = []; - for (var i = 0; i < object.targetLanguageCodes.length; ++i) - message.targetLanguageCodes[i] = String(object.targetLanguageCodes[i]); - } - if (object.models) { - if (typeof object.models !== "object") - throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.models: object expected"); - message.models = {}; - for (var keys = Object.keys(object.models), i = 0; i < keys.length; ++i) - message.models[keys[i]] = String(object.models[keys[i]]); - } - if (object.inputConfigs) { - if (!Array.isArray(object.inputConfigs)) - throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.inputConfigs: array expected"); - message.inputConfigs = []; - for (var i = 0; i < object.inputConfigs.length; ++i) { - if (typeof object.inputConfigs[i] !== "object") - throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.inputConfigs: object expected"); - message.inputConfigs[i] = $root.google.cloud.translation.v3beta1.InputConfig.fromObject(object.inputConfigs[i]); - } - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.translation.v3beta1.OutputConfig.fromObject(object.outputConfig); - } - if (object.glossaries) { - if (typeof object.glossaries !== "object") - throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.glossaries: object expected"); - message.glossaries = {}; - for (var keys = Object.keys(object.glossaries), i = 0; i < keys.length; ++i) { - if (typeof object.glossaries[keys[i]] !== "object") - throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.glossaries: object expected"); - message.glossaries[keys[i]] = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.fromObject(object.glossaries[keys[i]]); - } - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); + var message = new $root.google.cloud.translation.v3beta1.DocumentInputConfig(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length) + message.content = object.content; + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.translation.v3beta1.DocumentInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.fromObject(object.gcsSource); } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); return message; }; /** - * Creates a plain object from a BatchTranslateTextRequest message. Also converts values to other types if specified. + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @static - * @param {google.cloud.translation.v3beta1.BatchTranslateTextRequest} message BatchTranslateTextRequest + * @param {google.cloud.translation.v3beta1.DocumentInputConfig} message DocumentInputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchTranslateTextRequest.toObject = function toObject(message, options) { + DocumentInputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.targetLanguageCodes = []; - object.inputConfigs = []; - } - if (options.objects || options.defaults) { - object.models = {}; - object.glossaries = {}; - object.labels = {}; - } - if (options.defaults) { - object.parent = ""; - object.sourceLanguageCode = ""; - object.outputConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - object.sourceLanguageCode = message.sourceLanguageCode; - if (message.targetLanguageCodes && message.targetLanguageCodes.length) { - object.targetLanguageCodes = []; - for (var j = 0; j < message.targetLanguageCodes.length; ++j) - object.targetLanguageCodes[j] = message.targetLanguageCodes[j]; - } - var keys2; - if (message.models && (keys2 = Object.keys(message.models)).length) { - object.models = {}; - for (var j = 0; j < keys2.length; ++j) - object.models[keys2[j]] = message.models[keys2[j]]; - } - if (message.inputConfigs && message.inputConfigs.length) { - object.inputConfigs = []; - for (var j = 0; j < message.inputConfigs.length; ++j) - object.inputConfigs[j] = $root.google.cloud.translation.v3beta1.InputConfig.toObject(message.inputConfigs[j], options); - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.translation.v3beta1.OutputConfig.toObject(message.outputConfig, options); - if (message.glossaries && (keys2 = Object.keys(message.glossaries)).length) { - object.glossaries = {}; - for (var j = 0; j < keys2.length; ++j) - object.glossaries[keys2[j]] = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.toObject(message.glossaries[keys2[j]], options); + if (options.defaults) + object.mimeType = ""; + if (message.content != null && message.hasOwnProperty("content")) { + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (options.oneofs) + object.source = "content"; } - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; return object; }; /** - * Converts this BatchTranslateTextRequest to JSON. + * Converts this DocumentInputConfig to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @instance * @returns {Object.} JSON object */ - BatchTranslateTextRequest.prototype.toJSON = function toJSON() { + DocumentInputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchTranslateTextRequest; + return DocumentInputConfig; })(); - v3beta1.BatchTranslateMetadata = (function() { + v3beta1.DocumentOutputConfig = (function() { /** - * Properties of a BatchTranslateMetadata. + * Properties of a DocumentOutputConfig. * @memberof google.cloud.translation.v3beta1 - * @interface IBatchTranslateMetadata - * @property {google.cloud.translation.v3beta1.BatchTranslateMetadata.State|null} [state] BatchTranslateMetadata state - * @property {number|Long|null} [translatedCharacters] BatchTranslateMetadata translatedCharacters - * @property {number|Long|null} [failedCharacters] BatchTranslateMetadata failedCharacters - * @property {number|Long|null} [totalCharacters] BatchTranslateMetadata totalCharacters - * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateMetadata submitTime + * @interface IDocumentOutputConfig + * @property {google.cloud.translation.v3beta1.IGcsDestination|null} [gcsDestination] DocumentOutputConfig gcsDestination + * @property {string|null} [mimeType] DocumentOutputConfig mimeType */ /** - * Constructs a new BatchTranslateMetadata. + * Constructs a new DocumentOutputConfig. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a BatchTranslateMetadata. - * @implements IBatchTranslateMetadata + * @classdesc Represents a DocumentOutputConfig. + * @implements IDocumentOutputConfig * @constructor - * @param {google.cloud.translation.v3beta1.IBatchTranslateMetadata=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.IDocumentOutputConfig=} [properties] Properties to set */ - function BatchTranslateMetadata(properties) { + function DocumentOutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12069,127 +11899,102 @@ } /** - * BatchTranslateMetadata state. - * @member {google.cloud.translation.v3beta1.BatchTranslateMetadata.State} state - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata - * @instance - */ - BatchTranslateMetadata.prototype.state = 0; - - /** - * BatchTranslateMetadata translatedCharacters. - * @member {number|Long} translatedCharacters - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * DocumentOutputConfig gcsDestination. + * @member {google.cloud.translation.v3beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig * @instance */ - BatchTranslateMetadata.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DocumentOutputConfig.prototype.gcsDestination = null; /** - * BatchTranslateMetadata failedCharacters. - * @member {number|Long} failedCharacters - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * DocumentOutputConfig mimeType. + * @member {string} mimeType + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig * @instance */ - BatchTranslateMetadata.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DocumentOutputConfig.prototype.mimeType = ""; - /** - * BatchTranslateMetadata totalCharacters. - * @member {number|Long} totalCharacters - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata - * @instance - */ - BatchTranslateMetadata.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * BatchTranslateMetadata submitTime. - * @member {google.protobuf.ITimestamp|null|undefined} submitTime - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * DocumentOutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig * @instance */ - BatchTranslateMetadata.prototype.submitTime = null; + Object.defineProperty(DocumentOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new BatchTranslateMetadata instance using the specified properties. + * Creates a new DocumentOutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig * @static - * @param {google.cloud.translation.v3beta1.IBatchTranslateMetadata=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.BatchTranslateMetadata} BatchTranslateMetadata instance + * @param {google.cloud.translation.v3beta1.IDocumentOutputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.DocumentOutputConfig} DocumentOutputConfig instance */ - BatchTranslateMetadata.create = function create(properties) { - return new BatchTranslateMetadata(properties); + DocumentOutputConfig.create = function create(properties) { + return new DocumentOutputConfig(properties); }; /** - * Encodes the specified BatchTranslateMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateMetadata.verify|verify} messages. + * Encodes the specified DocumentOutputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.DocumentOutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig * @static - * @param {google.cloud.translation.v3beta1.IBatchTranslateMetadata} message BatchTranslateMetadata message or plain object to encode + * @param {google.cloud.translation.v3beta1.IDocumentOutputConfig} message DocumentOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchTranslateMetadata.encode = function encode(message, writer) { + DocumentOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalCharacters); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) - $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.translation.v3beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); return writer; }; /** - * Encodes the specified BatchTranslateMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateMetadata.verify|verify} messages. + * Encodes the specified DocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DocumentOutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig * @static - * @param {google.cloud.translation.v3beta1.IBatchTranslateMetadata} message BatchTranslateMetadata message or plain object to encode + * @param {google.cloud.translation.v3beta1.IDocumentOutputConfig} message DocumentOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchTranslateMetadata.encodeDelimited = function encodeDelimited(message, writer) { + DocumentOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchTranslateMetadata message from the specified reader or buffer. + * Decodes a DocumentOutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.BatchTranslateMetadata} BatchTranslateMetadata + * @returns {google.cloud.translation.v3beta1.DocumentOutputConfig} DocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchTranslateMetadata.decode = function decode(reader, length) { + DocumentOutputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DocumentOutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.state = reader.int32(); - break; - case 2: - message.translatedCharacters = reader.int64(); + message.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.decode(reader, reader.uint32()); break; case 3: - message.failedCharacters = reader.int64(); - break; - case 4: - message.totalCharacters = reader.int64(); - break; - case 5: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.mimeType = reader.string(); break; default: reader.skipType(tag & 7); @@ -12200,246 +12005,134 @@ }; /** - * Decodes a BatchTranslateMetadata message from the specified reader or buffer, length delimited. + * Decodes a DocumentOutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.BatchTranslateMetadata} BatchTranslateMetadata + * @returns {google.cloud.translation.v3beta1.DocumentOutputConfig} DocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchTranslateMetadata.decodeDelimited = function decodeDelimited(reader) { + DocumentOutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchTranslateMetadata message. + * Verifies a DocumentOutputConfig message. * @function verify - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchTranslateMetadata.verify = function verify(message) { + DocumentOutputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.translation.v3beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; } - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) - if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) - return "translatedCharacters: integer|Long expected"; - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) - if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) - return "failedCharacters: integer|Long expected"; - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) - if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) - return "totalCharacters: integer|Long expected"; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.submitTime); - if (error) - return "submitTime." + error; } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; return null; }; /** - * Creates a BatchTranslateMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentOutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.BatchTranslateMetadata} BatchTranslateMetadata + * @returns {google.cloud.translation.v3beta1.DocumentOutputConfig} DocumentOutputConfig */ - BatchTranslateMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.BatchTranslateMetadata) + DocumentOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.DocumentOutputConfig) return object; - var message = new $root.google.cloud.translation.v3beta1.BatchTranslateMetadata(); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "RUNNING": - case 1: - message.state = 1; - break; - case "SUCCEEDED": - case 2: - message.state = 2; - break; - case "FAILED": - case 3: - message.state = 3; - break; - case "CANCELLING": - case 4: - message.state = 4; - break; - case "CANCELLED": - case 5: - message.state = 5; - break; - } - if (object.translatedCharacters != null) - if ($util.Long) - (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; - else if (typeof object.translatedCharacters === "string") - message.translatedCharacters = parseInt(object.translatedCharacters, 10); - else if (typeof object.translatedCharacters === "number") - message.translatedCharacters = object.translatedCharacters; - else if (typeof object.translatedCharacters === "object") - message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); - if (object.failedCharacters != null) - if ($util.Long) - (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; - else if (typeof object.failedCharacters === "string") - message.failedCharacters = parseInt(object.failedCharacters, 10); - else if (typeof object.failedCharacters === "number") - message.failedCharacters = object.failedCharacters; - else if (typeof object.failedCharacters === "object") - message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); - if (object.totalCharacters != null) - if ($util.Long) - (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; - else if (typeof object.totalCharacters === "string") - message.totalCharacters = parseInt(object.totalCharacters, 10); - else if (typeof object.totalCharacters === "number") - message.totalCharacters = object.totalCharacters; - else if (typeof object.totalCharacters === "object") - message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); - if (object.submitTime != null) { - if (typeof object.submitTime !== "object") - throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateMetadata.submitTime: object expected"); - message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + var message = new $root.google.cloud.translation.v3beta1.DocumentOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.translation.v3beta1.DocumentOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.fromObject(object.gcsDestination); } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); return message; }; /** - * Creates a plain object from a BatchTranslateMetadata message. Also converts values to other types if specified. + * Creates a plain object from a DocumentOutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig * @static - * @param {google.cloud.translation.v3beta1.BatchTranslateMetadata} message BatchTranslateMetadata + * @param {google.cloud.translation.v3beta1.DocumentOutputConfig} message DocumentOutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchTranslateMetadata.toObject = function toObject(message, options) { + DocumentOutputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.translatedCharacters = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.failedCharacters = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalCharacters = options.longs === String ? "0" : 0; - object.submitTime = null; + if (options.defaults) + object.mimeType = ""; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.BatchTranslateMetadata.State[message.state] : message.state; - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) - if (typeof message.translatedCharacters === "number") - object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; - else - object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) - if (typeof message.failedCharacters === "number") - object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; - else - object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) - if (typeof message.totalCharacters === "number") - object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; - else - object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) - object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; return object; }; /** - * Converts this BatchTranslateMetadata to JSON. + * Converts this DocumentOutputConfig to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig * @instance * @returns {Object.} JSON object */ - BatchTranslateMetadata.prototype.toJSON = function toJSON() { + DocumentOutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.translation.v3beta1.BatchTranslateMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} SUCCEEDED=2 SUCCEEDED value - * @property {number} FAILED=3 FAILED value - * @property {number} CANCELLING=4 CANCELLING value - * @property {number} CANCELLED=5 CANCELLED value - */ - BatchTranslateMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "SUCCEEDED"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "CANCELLING"] = 4; - values[valuesById[5] = "CANCELLED"] = 5; - return values; - })(); - - return BatchTranslateMetadata; + return DocumentOutputConfig; })(); - v3beta1.BatchTranslateResponse = (function() { + v3beta1.TranslateDocumentRequest = (function() { /** - * Properties of a BatchTranslateResponse. + * Properties of a TranslateDocumentRequest. * @memberof google.cloud.translation.v3beta1 - * @interface IBatchTranslateResponse - * @property {number|Long|null} [totalCharacters] BatchTranslateResponse totalCharacters - * @property {number|Long|null} [translatedCharacters] BatchTranslateResponse translatedCharacters - * @property {number|Long|null} [failedCharacters] BatchTranslateResponse failedCharacters - * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateResponse submitTime - * @property {google.protobuf.ITimestamp|null} [endTime] BatchTranslateResponse endTime + * @interface ITranslateDocumentRequest + * @property {string|null} [parent] TranslateDocumentRequest parent + * @property {string|null} [sourceLanguageCode] TranslateDocumentRequest sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslateDocumentRequest targetLanguageCode + * @property {google.cloud.translation.v3beta1.IDocumentInputConfig|null} [documentInputConfig] TranslateDocumentRequest documentInputConfig + * @property {google.cloud.translation.v3beta1.IDocumentOutputConfig|null} [documentOutputConfig] TranslateDocumentRequest documentOutputConfig + * @property {string|null} [model] TranslateDocumentRequest model + * @property {google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null} [glossaryConfig] TranslateDocumentRequest glossaryConfig + * @property {Object.|null} [labels] TranslateDocumentRequest labels */ /** - * Constructs a new BatchTranslateResponse. + * Constructs a new TranslateDocumentRequest. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a BatchTranslateResponse. - * @implements IBatchTranslateResponse + * @classdesc Represents a TranslateDocumentRequest. + * @implements ITranslateDocumentRequest * @constructor - * @param {google.cloud.translation.v3beta1.IBatchTranslateResponse=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.ITranslateDocumentRequest=} [properties] Properties to set */ - function BatchTranslateResponse(properties) { + function TranslateDocumentRequest(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12447,127 +12140,186 @@ } /** - * BatchTranslateResponse totalCharacters. - * @member {number|Long} totalCharacters - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * TranslateDocumentRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @instance */ - BatchTranslateResponse.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + TranslateDocumentRequest.prototype.parent = ""; /** - * BatchTranslateResponse translatedCharacters. - * @member {number|Long} translatedCharacters - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * TranslateDocumentRequest sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @instance */ - BatchTranslateResponse.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + TranslateDocumentRequest.prototype.sourceLanguageCode = ""; /** - * BatchTranslateResponse failedCharacters. - * @member {number|Long} failedCharacters - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * TranslateDocumentRequest targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @instance */ - BatchTranslateResponse.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + TranslateDocumentRequest.prototype.targetLanguageCode = ""; /** - * BatchTranslateResponse submitTime. - * @member {google.protobuf.ITimestamp|null|undefined} submitTime - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * TranslateDocumentRequest documentInputConfig. + * @member {google.cloud.translation.v3beta1.IDocumentInputConfig|null|undefined} documentInputConfig + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @instance */ - BatchTranslateResponse.prototype.submitTime = null; + TranslateDocumentRequest.prototype.documentInputConfig = null; /** - * BatchTranslateResponse endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * TranslateDocumentRequest documentOutputConfig. + * @member {google.cloud.translation.v3beta1.IDocumentOutputConfig|null|undefined} documentOutputConfig + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @instance */ - BatchTranslateResponse.prototype.endTime = null; + TranslateDocumentRequest.prototype.documentOutputConfig = null; /** - * Creates a new BatchTranslateResponse instance using the specified properties. + * TranslateDocumentRequest model. + * @member {string} model + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest + * @instance + */ + TranslateDocumentRequest.prototype.model = ""; + + /** + * TranslateDocumentRequest glossaryConfig. + * @member {google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null|undefined} glossaryConfig + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest + * @instance + */ + TranslateDocumentRequest.prototype.glossaryConfig = null; + + /** + * TranslateDocumentRequest labels. + * @member {Object.} labels + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest + * @instance + */ + TranslateDocumentRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new TranslateDocumentRequest instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @static - * @param {google.cloud.translation.v3beta1.IBatchTranslateResponse=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.BatchTranslateResponse} BatchTranslateResponse instance + * @param {google.cloud.translation.v3beta1.ITranslateDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.TranslateDocumentRequest} TranslateDocumentRequest instance */ - BatchTranslateResponse.create = function create(properties) { - return new BatchTranslateResponse(properties); + TranslateDocumentRequest.create = function create(properties) { + return new TranslateDocumentRequest(properties); }; /** - * Encodes the specified BatchTranslateResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateResponse.verify|verify} messages. + * Encodes the specified TranslateDocumentRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateDocumentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @static - * @param {google.cloud.translation.v3beta1.IBatchTranslateResponse} message BatchTranslateResponse message or plain object to encode + * @param {google.cloud.translation.v3beta1.ITranslateDocumentRequest} message TranslateDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchTranslateResponse.encode = function encode(message, writer) { + TranslateDocumentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalCharacters); - if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) - $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCode); + if (message.documentInputConfig != null && Object.hasOwnProperty.call(message, "documentInputConfig")) + $root.google.cloud.translation.v3beta1.DocumentInputConfig.encode(message.documentInputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.documentOutputConfig != null && Object.hasOwnProperty.call(message, "documentOutputConfig")) + $root.google.cloud.translation.v3beta1.DocumentOutputConfig.encode(message.documentOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.model); + if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) + $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified BatchTranslateResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateResponse.verify|verify} messages. + * Encodes the specified TranslateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateDocumentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @static - * @param {google.cloud.translation.v3beta1.IBatchTranslateResponse} message BatchTranslateResponse message or plain object to encode + * @param {google.cloud.translation.v3beta1.ITranslateDocumentRequest} message TranslateDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchTranslateResponse.encodeDelimited = function encodeDelimited(message, writer) { + TranslateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchTranslateResponse message from the specified reader or buffer. + * Decodes a TranslateDocumentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.BatchTranslateResponse} BatchTranslateResponse + * @returns {google.cloud.translation.v3beta1.TranslateDocumentRequest} TranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchTranslateResponse.decode = function decode(reader, length) { + TranslateDocumentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.TranslateDocumentRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.totalCharacters = reader.int64(); + message.parent = reader.string(); break; case 2: - message.translatedCharacters = reader.int64(); + message.sourceLanguageCode = reader.string(); break; case 3: - message.failedCharacters = reader.int64(); + message.targetLanguageCode = reader.string(); break; case 4: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.documentInputConfig = $root.google.cloud.translation.v3beta1.DocumentInputConfig.decode(reader, reader.uint32()); break; case 5: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.documentOutputConfig = $root.google.cloud.translation.v3beta1.DocumentOutputConfig.decode(reader, reader.uint32()); + break; + case 6: + message.model = reader.string(); + break; + case 7: + message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + case 8: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; break; default: reader.skipType(tag & 7); @@ -12578,192 +12330,197 @@ }; /** - * Decodes a BatchTranslateResponse message from the specified reader or buffer, length delimited. + * Decodes a TranslateDocumentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.BatchTranslateResponse} BatchTranslateResponse + * @returns {google.cloud.translation.v3beta1.TranslateDocumentRequest} TranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchTranslateResponse.decodeDelimited = function decodeDelimited(reader) { + TranslateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchTranslateResponse message. + * Verifies a TranslateDocumentRequest message. * @function verify - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchTranslateResponse.verify = function verify(message) { + TranslateDocumentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) - if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) - return "totalCharacters: integer|Long expected"; - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) - if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) - return "translatedCharacters: integer|Long expected"; - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) - if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) - return "failedCharacters: integer|Long expected"; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + if (message.documentInputConfig != null && message.hasOwnProperty("documentInputConfig")) { + var error = $root.google.cloud.translation.v3beta1.DocumentInputConfig.verify(message.documentInputConfig); if (error) - return "submitTime." + error; + return "documentInputConfig." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) { + var error = $root.google.cloud.translation.v3beta1.DocumentOutputConfig.verify(message.documentOutputConfig); if (error) - return "endTime." + error; + return "documentOutputConfig." + error; + } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) { + var error = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.verify(message.glossaryConfig); + if (error) + return "glossaryConfig." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; } return null; }; /** - * Creates a BatchTranslateResponse message from a plain object. Also converts values to their respective internal types. + * Creates a TranslateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.BatchTranslateResponse} BatchTranslateResponse + * @returns {google.cloud.translation.v3beta1.TranslateDocumentRequest} TranslateDocumentRequest */ - BatchTranslateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.BatchTranslateResponse) + TranslateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.TranslateDocumentRequest) return object; - var message = new $root.google.cloud.translation.v3beta1.BatchTranslateResponse(); - if (object.totalCharacters != null) - if ($util.Long) - (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; - else if (typeof object.totalCharacters === "string") - message.totalCharacters = parseInt(object.totalCharacters, 10); - else if (typeof object.totalCharacters === "number") - message.totalCharacters = object.totalCharacters; - else if (typeof object.totalCharacters === "object") - message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); - if (object.translatedCharacters != null) - if ($util.Long) - (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; - else if (typeof object.translatedCharacters === "string") - message.translatedCharacters = parseInt(object.translatedCharacters, 10); - else if (typeof object.translatedCharacters === "number") - message.translatedCharacters = object.translatedCharacters; - else if (typeof object.translatedCharacters === "object") - message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); - if (object.failedCharacters != null) - if ($util.Long) - (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; - else if (typeof object.failedCharacters === "string") - message.failedCharacters = parseInt(object.failedCharacters, 10); - else if (typeof object.failedCharacters === "number") - message.failedCharacters = object.failedCharacters; - else if (typeof object.failedCharacters === "object") - message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); - if (object.submitTime != null) { - if (typeof object.submitTime !== "object") - throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateResponse.submitTime: object expected"); - message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + var message = new $root.google.cloud.translation.v3beta1.TranslateDocumentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + if (object.documentInputConfig != null) { + if (typeof object.documentInputConfig !== "object") + throw TypeError(".google.cloud.translation.v3beta1.TranslateDocumentRequest.documentInputConfig: object expected"); + message.documentInputConfig = $root.google.cloud.translation.v3beta1.DocumentInputConfig.fromObject(object.documentInputConfig); } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateResponse.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + if (object.documentOutputConfig != null) { + if (typeof object.documentOutputConfig !== "object") + throw TypeError(".google.cloud.translation.v3beta1.TranslateDocumentRequest.documentOutputConfig: object expected"); + message.documentOutputConfig = $root.google.cloud.translation.v3beta1.DocumentOutputConfig.fromObject(object.documentOutputConfig); + } + if (object.model != null) + message.model = String(object.model); + if (object.glossaryConfig != null) { + if (typeof object.glossaryConfig !== "object") + throw TypeError(".google.cloud.translation.v3beta1.TranslateDocumentRequest.glossaryConfig: object expected"); + message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.fromObject(object.glossaryConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.translation.v3beta1.TranslateDocumentRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); } return message; }; /** - * Creates a plain object from a BatchTranslateResponse message. Also converts values to other types if specified. + * Creates a plain object from a TranslateDocumentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @static - * @param {google.cloud.translation.v3beta1.BatchTranslateResponse} message BatchTranslateResponse + * @param {google.cloud.translation.v3beta1.TranslateDocumentRequest} message TranslateDocumentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchTranslateResponse.toObject = function toObject(message, options) { + TranslateDocumentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.labels = {}; if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalCharacters = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.translatedCharacters = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.failedCharacters = options.longs === String ? "0" : 0; - object.submitTime = null; - object.endTime = null; + object.parent = ""; + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + object.documentInputConfig = null; + object.documentOutputConfig = null; + object.model = ""; + object.glossaryConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + if (message.documentInputConfig != null && message.hasOwnProperty("documentInputConfig")) + object.documentInputConfig = $root.google.cloud.translation.v3beta1.DocumentInputConfig.toObject(message.documentInputConfig, options); + if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) + object.documentOutputConfig = $root.google.cloud.translation.v3beta1.DocumentOutputConfig.toObject(message.documentOutputConfig, options); + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + object.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.toObject(message.glossaryConfig, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; } - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) - if (typeof message.totalCharacters === "number") - object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; - else - object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) - if (typeof message.translatedCharacters === "number") - object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; - else - object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) - if (typeof message.failedCharacters === "number") - object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; - else - object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) - object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); return object; }; /** - * Converts this BatchTranslateResponse to JSON. + * Converts this TranslateDocumentRequest to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest * @instance * @returns {Object.} JSON object */ - BatchTranslateResponse.prototype.toJSON = function toJSON() { + TranslateDocumentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchTranslateResponse; + return TranslateDocumentRequest; })(); - v3beta1.GlossaryInputConfig = (function() { + v3beta1.DocumentTranslation = (function() { /** - * Properties of a GlossaryInputConfig. + * Properties of a DocumentTranslation. * @memberof google.cloud.translation.v3beta1 - * @interface IGlossaryInputConfig - * @property {google.cloud.translation.v3beta1.IGcsSource|null} [gcsSource] GlossaryInputConfig gcsSource + * @interface IDocumentTranslation + * @property {Array.|null} [byteStreamOutputs] DocumentTranslation byteStreamOutputs + * @property {string|null} [mimeType] DocumentTranslation mimeType + * @property {string|null} [detectedLanguageCode] DocumentTranslation detectedLanguageCode */ /** - * Constructs a new GlossaryInputConfig. + * Constructs a new DocumentTranslation. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a GlossaryInputConfig. - * @implements IGlossaryInputConfig + * @classdesc Represents a DocumentTranslation. + * @implements IDocumentTranslation * @constructor - * @param {google.cloud.translation.v3beta1.IGlossaryInputConfig=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.IDocumentTranslation=} [properties] Properties to set */ - function GlossaryInputConfig(properties) { + function DocumentTranslation(properties) { + this.byteStreamOutputs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12771,89 +12528,104 @@ } /** - * GlossaryInputConfig gcsSource. - * @member {google.cloud.translation.v3beta1.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * DocumentTranslation byteStreamOutputs. + * @member {Array.} byteStreamOutputs + * @memberof google.cloud.translation.v3beta1.DocumentTranslation * @instance */ - GlossaryInputConfig.prototype.gcsSource = null; + DocumentTranslation.prototype.byteStreamOutputs = $util.emptyArray; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * DocumentTranslation mimeType. + * @member {string} mimeType + * @memberof google.cloud.translation.v3beta1.DocumentTranslation + * @instance + */ + DocumentTranslation.prototype.mimeType = ""; /** - * GlossaryInputConfig source. - * @member {"gcsSource"|undefined} source - * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * DocumentTranslation detectedLanguageCode. + * @member {string} detectedLanguageCode + * @memberof google.cloud.translation.v3beta1.DocumentTranslation * @instance */ - Object.defineProperty(GlossaryInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), - set: $util.oneOfSetter($oneOfFields) - }); + DocumentTranslation.prototype.detectedLanguageCode = ""; /** - * Creates a new GlossaryInputConfig instance using the specified properties. + * Creates a new DocumentTranslation instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @memberof google.cloud.translation.v3beta1.DocumentTranslation * @static - * @param {google.cloud.translation.v3beta1.IGlossaryInputConfig=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.GlossaryInputConfig} GlossaryInputConfig instance + * @param {google.cloud.translation.v3beta1.IDocumentTranslation=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.DocumentTranslation} DocumentTranslation instance */ - GlossaryInputConfig.create = function create(properties) { - return new GlossaryInputConfig(properties); + DocumentTranslation.create = function create(properties) { + return new DocumentTranslation(properties); }; /** - * Encodes the specified GlossaryInputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.GlossaryInputConfig.verify|verify} messages. + * Encodes the specified DocumentTranslation message. Does not implicitly {@link google.cloud.translation.v3beta1.DocumentTranslation.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @memberof google.cloud.translation.v3beta1.DocumentTranslation * @static - * @param {google.cloud.translation.v3beta1.IGlossaryInputConfig} message GlossaryInputConfig message or plain object to encode + * @param {google.cloud.translation.v3beta1.IDocumentTranslation} message DocumentTranslation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GlossaryInputConfig.encode = function encode(message, writer) { + DocumentTranslation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - $root.google.cloud.translation.v3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.byteStreamOutputs != null && message.byteStreamOutputs.length) + for (var i = 0; i < message.byteStreamOutputs.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.byteStreamOutputs[i]); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.detectedLanguageCode != null && Object.hasOwnProperty.call(message, "detectedLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.detectedLanguageCode); return writer; }; /** - * Encodes the specified GlossaryInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GlossaryInputConfig.verify|verify} messages. + * Encodes the specified DocumentTranslation message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DocumentTranslation.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @memberof google.cloud.translation.v3beta1.DocumentTranslation * @static - * @param {google.cloud.translation.v3beta1.IGlossaryInputConfig} message GlossaryInputConfig message or plain object to encode + * @param {google.cloud.translation.v3beta1.IDocumentTranslation} message DocumentTranslation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GlossaryInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + DocumentTranslation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GlossaryInputConfig message from the specified reader or buffer. + * Decodes a DocumentTranslation message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @memberof google.cloud.translation.v3beta1.DocumentTranslation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.GlossaryInputConfig} GlossaryInputConfig + * @returns {google.cloud.translation.v3beta1.DocumentTranslation} DocumentTranslation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GlossaryInputConfig.decode = function decode(reader, length) { + DocumentTranslation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.GlossaryInputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DocumentTranslation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); + if (!(message.byteStreamOutputs && message.byteStreamOutputs.length)) + message.byteStreamOutputs = []; + message.byteStreamOutputs.push(reader.bytes()); + break; + case 2: + message.mimeType = reader.string(); + break; + case 3: + message.detectedLanguageCode = reader.string(); break; default: reader.skipType(tag & 7); @@ -12864,123 +12636,143 @@ }; /** - * Decodes a GlossaryInputConfig message from the specified reader or buffer, length delimited. + * Decodes a DocumentTranslation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @memberof google.cloud.translation.v3beta1.DocumentTranslation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.GlossaryInputConfig} GlossaryInputConfig + * @returns {google.cloud.translation.v3beta1.DocumentTranslation} DocumentTranslation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GlossaryInputConfig.decodeDelimited = function decodeDelimited(reader) { + DocumentTranslation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GlossaryInputConfig message. + * Verifies a DocumentTranslation message. * @function verify - * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @memberof google.cloud.translation.v3beta1.DocumentTranslation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GlossaryInputConfig.verify = function verify(message) { + DocumentTranslation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - properties.source = 1; - { - var error = $root.google.cloud.translation.v3beta1.GcsSource.verify(message.gcsSource); - if (error) - return "gcsSource." + error; - } + if (message.byteStreamOutputs != null && message.hasOwnProperty("byteStreamOutputs")) { + if (!Array.isArray(message.byteStreamOutputs)) + return "byteStreamOutputs: array expected"; + for (var i = 0; i < message.byteStreamOutputs.length; ++i) + if (!(message.byteStreamOutputs[i] && typeof message.byteStreamOutputs[i].length === "number" || $util.isString(message.byteStreamOutputs[i]))) + return "byteStreamOutputs: buffer[] expected"; } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + if (!$util.isString(message.detectedLanguageCode)) + return "detectedLanguageCode: string expected"; return null; }; /** - * Creates a GlossaryInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentTranslation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @memberof google.cloud.translation.v3beta1.DocumentTranslation * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.GlossaryInputConfig} GlossaryInputConfig + * @returns {google.cloud.translation.v3beta1.DocumentTranslation} DocumentTranslation */ - GlossaryInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.GlossaryInputConfig) + DocumentTranslation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.DocumentTranslation) return object; - var message = new $root.google.cloud.translation.v3beta1.GlossaryInputConfig(); - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.translation.v3beta1.GlossaryInputConfig.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.fromObject(object.gcsSource); + var message = new $root.google.cloud.translation.v3beta1.DocumentTranslation(); + if (object.byteStreamOutputs) { + if (!Array.isArray(object.byteStreamOutputs)) + throw TypeError(".google.cloud.translation.v3beta1.DocumentTranslation.byteStreamOutputs: array expected"); + message.byteStreamOutputs = []; + for (var i = 0; i < object.byteStreamOutputs.length; ++i) + if (typeof object.byteStreamOutputs[i] === "string") + $util.base64.decode(object.byteStreamOutputs[i], message.byteStreamOutputs[i] = $util.newBuffer($util.base64.length(object.byteStreamOutputs[i])), 0); + else if (object.byteStreamOutputs[i].length) + message.byteStreamOutputs[i] = object.byteStreamOutputs[i]; } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.detectedLanguageCode != null) + message.detectedLanguageCode = String(object.detectedLanguageCode); return message; }; /** - * Creates a plain object from a GlossaryInputConfig message. Also converts values to other types if specified. + * Creates a plain object from a DocumentTranslation message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @memberof google.cloud.translation.v3beta1.DocumentTranslation * @static - * @param {google.cloud.translation.v3beta1.GlossaryInputConfig} message GlossaryInputConfig + * @param {google.cloud.translation.v3beta1.DocumentTranslation} message DocumentTranslation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GlossaryInputConfig.toObject = function toObject(message, options) { + DocumentTranslation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; + if (options.arrays || options.defaults) + object.byteStreamOutputs = []; + if (options.defaults) { + object.mimeType = ""; + object.detectedLanguageCode = ""; + } + if (message.byteStreamOutputs && message.byteStreamOutputs.length) { + object.byteStreamOutputs = []; + for (var j = 0; j < message.byteStreamOutputs.length; ++j) + object.byteStreamOutputs[j] = options.bytes === String ? $util.base64.encode(message.byteStreamOutputs[j], 0, message.byteStreamOutputs[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.byteStreamOutputs[j]) : message.byteStreamOutputs[j]; } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + object.detectedLanguageCode = message.detectedLanguageCode; return object; }; /** - * Converts this GlossaryInputConfig to JSON. + * Converts this DocumentTranslation to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @memberof google.cloud.translation.v3beta1.DocumentTranslation * @instance * @returns {Object.} JSON object */ - GlossaryInputConfig.prototype.toJSON = function toJSON() { + DocumentTranslation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GlossaryInputConfig; + return DocumentTranslation; })(); - v3beta1.Glossary = (function() { + v3beta1.TranslateDocumentResponse = (function() { /** - * Properties of a Glossary. + * Properties of a TranslateDocumentResponse. * @memberof google.cloud.translation.v3beta1 - * @interface IGlossary - * @property {string|null} [name] Glossary name - * @property {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair|null} [languagePair] Glossary languagePair - * @property {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet|null} [languageCodesSet] Glossary languageCodesSet - * @property {google.cloud.translation.v3beta1.IGlossaryInputConfig|null} [inputConfig] Glossary inputConfig - * @property {number|null} [entryCount] Glossary entryCount - * @property {google.protobuf.ITimestamp|null} [submitTime] Glossary submitTime - * @property {google.protobuf.ITimestamp|null} [endTime] Glossary endTime + * @interface ITranslateDocumentResponse + * @property {google.cloud.translation.v3beta1.IDocumentTranslation|null} [documentTranslation] TranslateDocumentResponse documentTranslation + * @property {google.cloud.translation.v3beta1.IDocumentTranslation|null} [glossaryDocumentTranslation] TranslateDocumentResponse glossaryDocumentTranslation + * @property {string|null} [model] TranslateDocumentResponse model + * @property {google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null} [glossaryConfig] TranslateDocumentResponse glossaryConfig */ /** - * Constructs a new Glossary. + * Constructs a new TranslateDocumentResponse. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a Glossary. - * @implements IGlossary + * @classdesc Represents a TranslateDocumentResponse. + * @implements ITranslateDocumentResponse * @constructor - * @param {google.cloud.translation.v3beta1.IGlossary=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.ITranslateDocumentResponse=} [properties] Properties to set */ - function Glossary(properties) { + function TranslateDocumentResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12988,167 +12780,114 @@ } /** - * Glossary name. - * @member {string} name - * @memberof google.cloud.translation.v3beta1.Glossary - * @instance - */ - Glossary.prototype.name = ""; - - /** - * Glossary languagePair. - * @member {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair|null|undefined} languagePair - * @memberof google.cloud.translation.v3beta1.Glossary - * @instance - */ - Glossary.prototype.languagePair = null; - - /** - * Glossary languageCodesSet. - * @member {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet|null|undefined} languageCodesSet - * @memberof google.cloud.translation.v3beta1.Glossary - * @instance - */ - Glossary.prototype.languageCodesSet = null; - - /** - * Glossary inputConfig. - * @member {google.cloud.translation.v3beta1.IGlossaryInputConfig|null|undefined} inputConfig - * @memberof google.cloud.translation.v3beta1.Glossary - * @instance - */ - Glossary.prototype.inputConfig = null; - - /** - * Glossary entryCount. - * @member {number} entryCount - * @memberof google.cloud.translation.v3beta1.Glossary + * TranslateDocumentResponse documentTranslation. + * @member {google.cloud.translation.v3beta1.IDocumentTranslation|null|undefined} documentTranslation + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @instance */ - Glossary.prototype.entryCount = 0; + TranslateDocumentResponse.prototype.documentTranslation = null; /** - * Glossary submitTime. - * @member {google.protobuf.ITimestamp|null|undefined} submitTime - * @memberof google.cloud.translation.v3beta1.Glossary + * TranslateDocumentResponse glossaryDocumentTranslation. + * @member {google.cloud.translation.v3beta1.IDocumentTranslation|null|undefined} glossaryDocumentTranslation + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @instance */ - Glossary.prototype.submitTime = null; + TranslateDocumentResponse.prototype.glossaryDocumentTranslation = null; /** - * Glossary endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.translation.v3beta1.Glossary + * TranslateDocumentResponse model. + * @member {string} model + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @instance */ - Glossary.prototype.endTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + TranslateDocumentResponse.prototype.model = ""; /** - * Glossary languages. - * @member {"languagePair"|"languageCodesSet"|undefined} languages - * @memberof google.cloud.translation.v3beta1.Glossary + * TranslateDocumentResponse glossaryConfig. + * @member {google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig|null|undefined} glossaryConfig + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @instance */ - Object.defineProperty(Glossary.prototype, "languages", { - get: $util.oneOfGetter($oneOfFields = ["languagePair", "languageCodesSet"]), - set: $util.oneOfSetter($oneOfFields) - }); + TranslateDocumentResponse.prototype.glossaryConfig = null; /** - * Creates a new Glossary instance using the specified properties. + * Creates a new TranslateDocumentResponse instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.Glossary + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @static - * @param {google.cloud.translation.v3beta1.IGlossary=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.Glossary} Glossary instance + * @param {google.cloud.translation.v3beta1.ITranslateDocumentResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.TranslateDocumentResponse} TranslateDocumentResponse instance */ - Glossary.create = function create(properties) { - return new Glossary(properties); + TranslateDocumentResponse.create = function create(properties) { + return new TranslateDocumentResponse(properties); }; /** - * Encodes the specified Glossary message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.verify|verify} messages. + * Encodes the specified TranslateDocumentResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateDocumentResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.Glossary + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @static - * @param {google.cloud.translation.v3beta1.IGlossary} message Glossary message or plain object to encode + * @param {google.cloud.translation.v3beta1.ITranslateDocumentResponse} message TranslateDocumentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Glossary.encode = function encode(message, writer) { + TranslateDocumentResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.languagePair != null && Object.hasOwnProperty.call(message, "languagePair")) - $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.encode(message.languagePair, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.languageCodesSet != null && Object.hasOwnProperty.call(message, "languageCodesSet")) - $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.encode(message.languageCodesSet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) - $root.google.cloud.translation.v3beta1.GlossaryInputConfig.encode(message.inputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.entryCount != null && Object.hasOwnProperty.call(message, "entryCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.entryCount); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) - $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.documentTranslation != null && Object.hasOwnProperty.call(message, "documentTranslation")) + $root.google.cloud.translation.v3beta1.DocumentTranslation.encode(message.documentTranslation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.glossaryDocumentTranslation != null && Object.hasOwnProperty.call(message, "glossaryDocumentTranslation")) + $root.google.cloud.translation.v3beta1.DocumentTranslation.encode(message.glossaryDocumentTranslation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) + $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified Glossary message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.verify|verify} messages. + * Encodes the specified TranslateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.TranslateDocumentResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.Glossary + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @static - * @param {google.cloud.translation.v3beta1.IGlossary} message Glossary message or plain object to encode + * @param {google.cloud.translation.v3beta1.ITranslateDocumentResponse} message TranslateDocumentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Glossary.encodeDelimited = function encodeDelimited(message, writer) { + TranslateDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Glossary message from the specified reader or buffer. + * Decodes a TranslateDocumentResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.Glossary + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.Glossary} Glossary + * @returns {google.cloud.translation.v3beta1.TranslateDocumentResponse} TranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Glossary.decode = function decode(reader, length) { + TranslateDocumentResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.Glossary(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.TranslateDocumentResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.documentTranslation = $root.google.cloud.translation.v3beta1.DocumentTranslation.decode(reader, reader.uint32()); + break; + case 2: + message.glossaryDocumentTranslation = $root.google.cloud.translation.v3beta1.DocumentTranslation.decode(reader, reader.uint32()); break; case 3: - message.languagePair = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.decode(reader, reader.uint32()); + message.model = reader.string(); break; case 4: - message.languageCodesSet = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.decode(reader, reader.uint32()); - break; - case 5: - message.inputConfig = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.decode(reader, reader.uint32()); - break; - case 6: - message.entryCount = reader.int32(); - break; - case 7: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 8: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -13159,608 +12898,3423 @@ }; /** - * Decodes a Glossary message from the specified reader or buffer, length delimited. + * Decodes a TranslateDocumentResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.Glossary + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.Glossary} Glossary + * @returns {google.cloud.translation.v3beta1.TranslateDocumentResponse} TranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Glossary.decodeDelimited = function decodeDelimited(reader) { + TranslateDocumentResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Glossary message. + * Verifies a TranslateDocumentResponse message. * @function verify - * @memberof google.cloud.translation.v3beta1.Glossary + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Glossary.verify = function verify(message) { + TranslateDocumentResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.languagePair != null && message.hasOwnProperty("languagePair")) { - properties.languages = 1; - { - var error = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify(message.languagePair); - if (error) - return "languagePair." + error; - } - } - if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) { - if (properties.languages === 1) - return "languages: multiple values"; - properties.languages = 1; - { - var error = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify(message.languageCodesSet); - if (error) - return "languageCodesSet." + error; - } + if (message.documentTranslation != null && message.hasOwnProperty("documentTranslation")) { + var error = $root.google.cloud.translation.v3beta1.DocumentTranslation.verify(message.documentTranslation); + if (error) + return "documentTranslation." + error; } - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { - var error = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.verify(message.inputConfig); + if (message.glossaryDocumentTranslation != null && message.hasOwnProperty("glossaryDocumentTranslation")) { + var error = $root.google.cloud.translation.v3beta1.DocumentTranslation.verify(message.glossaryDocumentTranslation); if (error) - return "inputConfig." + error; - } - if (message.entryCount != null && message.hasOwnProperty("entryCount")) - if (!$util.isInteger(message.entryCount)) - return "entryCount: integer expected"; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.submitTime); - if (error) - return "submitTime." + error; + return "glossaryDocumentTranslation." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) { + var error = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.verify(message.glossaryConfig); if (error) - return "endTime." + error; + return "glossaryConfig." + error; } return null; }; /** - * Creates a Glossary message from a plain object. Also converts values to their respective internal types. + * Creates a TranslateDocumentResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.Glossary + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.Glossary} Glossary + * @returns {google.cloud.translation.v3beta1.TranslateDocumentResponse} TranslateDocumentResponse */ - Glossary.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.Glossary) + TranslateDocumentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.TranslateDocumentResponse) return object; - var message = new $root.google.cloud.translation.v3beta1.Glossary(); - if (object.name != null) - message.name = String(object.name); - if (object.languagePair != null) { - if (typeof object.languagePair !== "object") - throw TypeError(".google.cloud.translation.v3beta1.Glossary.languagePair: object expected"); - message.languagePair = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.fromObject(object.languagePair); - } - if (object.languageCodesSet != null) { - if (typeof object.languageCodesSet !== "object") - throw TypeError(".google.cloud.translation.v3beta1.Glossary.languageCodesSet: object expected"); - message.languageCodesSet = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.fromObject(object.languageCodesSet); - } - if (object.inputConfig != null) { - if (typeof object.inputConfig !== "object") - throw TypeError(".google.cloud.translation.v3beta1.Glossary.inputConfig: object expected"); - message.inputConfig = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.fromObject(object.inputConfig); + var message = new $root.google.cloud.translation.v3beta1.TranslateDocumentResponse(); + if (object.documentTranslation != null) { + if (typeof object.documentTranslation !== "object") + throw TypeError(".google.cloud.translation.v3beta1.TranslateDocumentResponse.documentTranslation: object expected"); + message.documentTranslation = $root.google.cloud.translation.v3beta1.DocumentTranslation.fromObject(object.documentTranslation); } - if (object.entryCount != null) - message.entryCount = object.entryCount | 0; - if (object.submitTime != null) { - if (typeof object.submitTime !== "object") - throw TypeError(".google.cloud.translation.v3beta1.Glossary.submitTime: object expected"); - message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + if (object.glossaryDocumentTranslation != null) { + if (typeof object.glossaryDocumentTranslation !== "object") + throw TypeError(".google.cloud.translation.v3beta1.TranslateDocumentResponse.glossaryDocumentTranslation: object expected"); + message.glossaryDocumentTranslation = $root.google.cloud.translation.v3beta1.DocumentTranslation.fromObject(object.glossaryDocumentTranslation); } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.translation.v3beta1.Glossary.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + if (object.model != null) + message.model = String(object.model); + if (object.glossaryConfig != null) { + if (typeof object.glossaryConfig !== "object") + throw TypeError(".google.cloud.translation.v3beta1.TranslateDocumentResponse.glossaryConfig: object expected"); + message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.fromObject(object.glossaryConfig); } return message; }; /** - * Creates a plain object from a Glossary message. Also converts values to other types if specified. + * Creates a plain object from a TranslateDocumentResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.Glossary + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @static - * @param {google.cloud.translation.v3beta1.Glossary} message Glossary + * @param {google.cloud.translation.v3beta1.TranslateDocumentResponse} message TranslateDocumentResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Glossary.toObject = function toObject(message, options) { + TranslateDocumentResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.inputConfig = null; - object.entryCount = 0; - object.submitTime = null; - object.endTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.languagePair != null && message.hasOwnProperty("languagePair")) { - object.languagePair = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.toObject(message.languagePair, options); - if (options.oneofs) - object.languages = "languagePair"; - } - if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) { - object.languageCodesSet = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.toObject(message.languageCodesSet, options); - if (options.oneofs) - object.languages = "languageCodesSet"; + object.documentTranslation = null; + object.glossaryDocumentTranslation = null; + object.model = ""; + object.glossaryConfig = null; } - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - object.inputConfig = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.toObject(message.inputConfig, options); - if (message.entryCount != null && message.hasOwnProperty("entryCount")) - object.entryCount = message.entryCount; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) - object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.documentTranslation != null && message.hasOwnProperty("documentTranslation")) + object.documentTranslation = $root.google.cloud.translation.v3beta1.DocumentTranslation.toObject(message.documentTranslation, options); + if (message.glossaryDocumentTranslation != null && message.hasOwnProperty("glossaryDocumentTranslation")) + object.glossaryDocumentTranslation = $root.google.cloud.translation.v3beta1.DocumentTranslation.toObject(message.glossaryDocumentTranslation, options); + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + object.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.toObject(message.glossaryConfig, options); return object; }; /** - * Converts this Glossary to JSON. + * Converts this TranslateDocumentResponse to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.Glossary + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse * @instance * @returns {Object.} JSON object */ - Glossary.prototype.toJSON = function toJSON() { + TranslateDocumentResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Glossary.LanguageCodePair = (function() { + return TranslateDocumentResponse; + })(); - /** - * Properties of a LanguageCodePair. - * @memberof google.cloud.translation.v3beta1.Glossary - * @interface ILanguageCodePair - * @property {string|null} [sourceLanguageCode] LanguageCodePair sourceLanguageCode - * @property {string|null} [targetLanguageCode] LanguageCodePair targetLanguageCode - */ + v3beta1.BatchTranslateTextRequest = (function() { - /** - * Constructs a new LanguageCodePair. - * @memberof google.cloud.translation.v3beta1.Glossary - * @classdesc Represents a LanguageCodePair. - * @implements ILanguageCodePair - * @constructor - * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair=} [properties] Properties to set - */ - function LanguageCodePair(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a BatchTranslateTextRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface IBatchTranslateTextRequest + * @property {string|null} [parent] BatchTranslateTextRequest parent + * @property {string|null} [sourceLanguageCode] BatchTranslateTextRequest sourceLanguageCode + * @property {Array.|null} [targetLanguageCodes] BatchTranslateTextRequest targetLanguageCodes + * @property {Object.|null} [models] BatchTranslateTextRequest models + * @property {Array.|null} [inputConfigs] BatchTranslateTextRequest inputConfigs + * @property {google.cloud.translation.v3beta1.IOutputConfig|null} [outputConfig] BatchTranslateTextRequest outputConfig + * @property {Object.|null} [glossaries] BatchTranslateTextRequest glossaries + * @property {Object.|null} [labels] BatchTranslateTextRequest labels + */ - /** - * LanguageCodePair sourceLanguageCode. - * @member {string} sourceLanguageCode - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair - * @instance - */ - LanguageCodePair.prototype.sourceLanguageCode = ""; + /** + * Constructs a new BatchTranslateTextRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a BatchTranslateTextRequest. + * @implements IBatchTranslateTextRequest + * @constructor + * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest=} [properties] Properties to set + */ + function BatchTranslateTextRequest(properties) { + this.targetLanguageCodes = []; + this.models = {}; + this.inputConfigs = []; + this.glossaries = {}; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * LanguageCodePair targetLanguageCode. - * @member {string} targetLanguageCode - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair - * @instance - */ - LanguageCodePair.prototype.targetLanguageCode = ""; + /** + * BatchTranslateTextRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.parent = ""; - /** - * Creates a new LanguageCodePair instance using the specified properties. - * @function create - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair - * @static - * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} LanguageCodePair instance - */ - LanguageCodePair.create = function create(properties) { - return new LanguageCodePair(properties); - }; + /** + * BatchTranslateTextRequest sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.sourceLanguageCode = ""; - /** - * Encodes the specified LanguageCodePair message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify|verify} messages. - * @function encode - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair - * @static - * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair} message LanguageCodePair message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LanguageCodePair.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); - return writer; - }; + /** + * BatchTranslateTextRequest targetLanguageCodes. + * @member {Array.} targetLanguageCodes + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.targetLanguageCodes = $util.emptyArray; - /** - * Encodes the specified LanguageCodePair message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair - * @static - * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair} message LanguageCodePair message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LanguageCodePair.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * BatchTranslateTextRequest models. + * @member {Object.} models + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.models = $util.emptyObject; - /** - * Decodes a LanguageCodePair message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} LanguageCodePair - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LanguageCodePair.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sourceLanguageCode = reader.string(); - break; - case 2: - message.targetLanguageCode = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * BatchTranslateTextRequest inputConfigs. + * @member {Array.} inputConfigs + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.inputConfigs = $util.emptyArray; + + /** + * BatchTranslateTextRequest outputConfig. + * @member {google.cloud.translation.v3beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.outputConfig = null; + + /** + * BatchTranslateTextRequest glossaries. + * @member {Object.} glossaries + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.glossaries = $util.emptyObject; + + /** + * BatchTranslateTextRequest labels. + * @member {Object.} labels + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new BatchTranslateTextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.BatchTranslateTextRequest} BatchTranslateTextRequest instance + */ + BatchTranslateTextRequest.create = function create(properties) { + return new BatchTranslateTextRequest(properties); + }; + + /** + * Encodes the specified BatchTranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateTextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest} message BatchTranslateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) + for (var i = 0; i < message.targetLanguageCodes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); + if (message.models != null && Object.hasOwnProperty.call(message, "models")) + for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); + if (message.inputConfigs != null && message.inputConfigs.length) + for (var i = 0; i < message.inputConfigs.length; ++i) + $root.google.cloud.translation.v3beta1.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.translation.v3beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.glossaries != null && Object.hasOwnProperty.call(message, "glossaries")) + for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchTranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateTextRequest} message BatchTranslateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.BatchTranslateTextRequest} BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateTextRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.sourceLanguageCode = reader.string(); + break; + case 3: + if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) + message.targetLanguageCodes = []; + message.targetLanguageCodes.push(reader.string()); + break; + case 4: + if (message.models === $util.emptyObject) + message.models = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.models[key] = value; + break; + case 5: + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.translation.v3beta1.InputConfig.decode(reader, reader.uint32())); + break; + case 6: + message.outputConfig = $root.google.cloud.translation.v3beta1.OutputConfig.decode(reader, reader.uint32()); + break; + case 7: + if (message.glossaries === $util.emptyObject) + message.glossaries = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.glossaries[key] = value; + break; + case 9: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.BatchTranslateTextRequest} BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchTranslateTextRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchTranslateTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCodes != null && message.hasOwnProperty("targetLanguageCodes")) { + if (!Array.isArray(message.targetLanguageCodes)) + return "targetLanguageCodes: array expected"; + for (var i = 0; i < message.targetLanguageCodes.length; ++i) + if (!$util.isString(message.targetLanguageCodes[i])) + return "targetLanguageCodes: string[] expected"; + } + if (message.models != null && message.hasOwnProperty("models")) { + if (!$util.isObject(message.models)) + return "models: object expected"; + var key = Object.keys(message.models); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.models[key[i]])) + return "models: string{k:string} expected"; + } + if (message.inputConfigs != null && message.hasOwnProperty("inputConfigs")) { + if (!Array.isArray(message.inputConfigs)) + return "inputConfigs: array expected"; + for (var i = 0; i < message.inputConfigs.length; ++i) { + var error = $root.google.cloud.translation.v3beta1.InputConfig.verify(message.inputConfigs[i]); + if (error) + return "inputConfigs." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.translation.v3beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.glossaries != null && message.hasOwnProperty("glossaries")) { + if (!$util.isObject(message.glossaries)) + return "glossaries: object expected"; + var key = Object.keys(message.glossaries); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.verify(message.glossaries[key[i]]); + if (error) + return "glossaries." + error; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchTranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.BatchTranslateTextRequest} BatchTranslateTextRequest + */ + BatchTranslateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.BatchTranslateTextRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.BatchTranslateTextRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCodes) { + if (!Array.isArray(object.targetLanguageCodes)) + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.targetLanguageCodes: array expected"); + message.targetLanguageCodes = []; + for (var i = 0; i < object.targetLanguageCodes.length; ++i) + message.targetLanguageCodes[i] = String(object.targetLanguageCodes[i]); + } + if (object.models) { + if (typeof object.models !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.models: object expected"); + message.models = {}; + for (var keys = Object.keys(object.models), i = 0; i < keys.length; ++i) + message.models[keys[i]] = String(object.models[keys[i]]); + } + if (object.inputConfigs) { + if (!Array.isArray(object.inputConfigs)) + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.inputConfigs: array expected"); + message.inputConfigs = []; + for (var i = 0; i < object.inputConfigs.length; ++i) { + if (typeof object.inputConfigs[i] !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.inputConfigs: object expected"); + message.inputConfigs[i] = $root.google.cloud.translation.v3beta1.InputConfig.fromObject(object.inputConfigs[i]); + } + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.translation.v3beta1.OutputConfig.fromObject(object.outputConfig); + } + if (object.glossaries) { + if (typeof object.glossaries !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.glossaries: object expected"); + message.glossaries = {}; + for (var keys = Object.keys(object.glossaries), i = 0; i < keys.length; ++i) { + if (typeof object.glossaries[keys[i]] !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.glossaries: object expected"); + message.glossaries[keys[i]] = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.fromObject(object.glossaries[keys[i]]); + } + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateTextRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchTranslateTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3beta1.BatchTranslateTextRequest} message BatchTranslateTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchTranslateTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targetLanguageCodes = []; + object.inputConfigs = []; + } + if (options.objects || options.defaults) { + object.models = {}; + object.glossaries = {}; + object.labels = {}; + } + if (options.defaults) { + object.parent = ""; + object.sourceLanguageCode = ""; + object.outputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCodes && message.targetLanguageCodes.length) { + object.targetLanguageCodes = []; + for (var j = 0; j < message.targetLanguageCodes.length; ++j) + object.targetLanguageCodes[j] = message.targetLanguageCodes[j]; + } + var keys2; + if (message.models && (keys2 = Object.keys(message.models)).length) { + object.models = {}; + for (var j = 0; j < keys2.length; ++j) + object.models[keys2[j]] = message.models[keys2[j]]; + } + if (message.inputConfigs && message.inputConfigs.length) { + object.inputConfigs = []; + for (var j = 0; j < message.inputConfigs.length; ++j) + object.inputConfigs[j] = $root.google.cloud.translation.v3beta1.InputConfig.toObject(message.inputConfigs[j], options); + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.translation.v3beta1.OutputConfig.toObject(message.outputConfig, options); + if (message.glossaries && (keys2 = Object.keys(message.glossaries)).length) { + object.glossaries = {}; + for (var j = 0; j < keys2.length; ++j) + object.glossaries[keys2[j]] = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.toObject(message.glossaries[keys2[j]], options); + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchTranslateTextRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @instance + * @returns {Object.} JSON object + */ + BatchTranslateTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchTranslateTextRequest; + })(); + + v3beta1.BatchTranslateMetadata = (function() { + + /** + * Properties of a BatchTranslateMetadata. + * @memberof google.cloud.translation.v3beta1 + * @interface IBatchTranslateMetadata + * @property {google.cloud.translation.v3beta1.BatchTranslateMetadata.State|null} [state] BatchTranslateMetadata state + * @property {number|Long|null} [translatedCharacters] BatchTranslateMetadata translatedCharacters + * @property {number|Long|null} [failedCharacters] BatchTranslateMetadata failedCharacters + * @property {number|Long|null} [totalCharacters] BatchTranslateMetadata totalCharacters + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateMetadata submitTime + */ + + /** + * Constructs a new BatchTranslateMetadata. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a BatchTranslateMetadata. + * @implements IBatchTranslateMetadata + * @constructor + * @param {google.cloud.translation.v3beta1.IBatchTranslateMetadata=} [properties] Properties to set + */ + function BatchTranslateMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchTranslateMetadata state. + * @member {google.cloud.translation.v3beta1.BatchTranslateMetadata.State} state + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.state = 0; + + /** + * BatchTranslateMetadata translatedCharacters. + * @member {number|Long} translatedCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateMetadata failedCharacters. + * @member {number|Long} failedCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateMetadata totalCharacters. + * @member {number|Long} totalCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.submitTime = null; + + /** + * Creates a new BatchTranslateMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.BatchTranslateMetadata} BatchTranslateMetadata instance + */ + BatchTranslateMetadata.create = function create(properties) { + return new BatchTranslateMetadata(properties); + }; + + /** + * Encodes the specified BatchTranslateMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateMetadata} message BatchTranslateMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalCharacters); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchTranslateMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateMetadata} message BatchTranslateMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.BatchTranslateMetadata} BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.translatedCharacters = reader.int64(); + break; + case 3: + message.failedCharacters = reader.int64(); + break; + case 4: + message.totalCharacters = reader.int64(); + break; + case 5: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.BatchTranslateMetadata} BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchTranslateMetadata message. + * @function verify + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchTranslateMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) + return "translatedCharacters: integer|Long expected"; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) + return "failedCharacters: integer|Long expected"; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) + return "totalCharacters: integer|Long expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + return null; + }; + + /** + * Creates a BatchTranslateMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.BatchTranslateMetadata} BatchTranslateMetadata + */ + BatchTranslateMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.BatchTranslateMetadata) + return object; + var message = new $root.google.cloud.translation.v3beta1.BatchTranslateMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.translatedCharacters != null) + if ($util.Long) + (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; + else if (typeof object.translatedCharacters === "string") + message.translatedCharacters = parseInt(object.translatedCharacters, 10); + else if (typeof object.translatedCharacters === "number") + message.translatedCharacters = object.translatedCharacters; + else if (typeof object.translatedCharacters === "object") + message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); + if (object.failedCharacters != null) + if ($util.Long) + (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; + else if (typeof object.failedCharacters === "string") + message.failedCharacters = parseInt(object.failedCharacters, 10); + else if (typeof object.failedCharacters === "number") + message.failedCharacters = object.failedCharacters; + else if (typeof object.failedCharacters === "object") + message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); + if (object.totalCharacters != null) + if ($util.Long) + (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; + else if (typeof object.totalCharacters === "string") + message.totalCharacters = parseInt(object.totalCharacters, 10); + else if (typeof object.totalCharacters === "number") + message.totalCharacters = object.totalCharacters; + else if (typeof object.totalCharacters === "object") + message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchTranslateMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3beta1.BatchTranslateMetadata} message BatchTranslateMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchTranslateMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCharacters = options.longs === String ? "0" : 0; + object.submitTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.BatchTranslateMetadata.State[message.state] : message.state; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (typeof message.translatedCharacters === "number") + object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; + else + object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (typeof message.failedCharacters === "number") + object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; + else + object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (typeof message.totalCharacters === "number") + object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; + else + object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + return object; + }; + + /** + * Converts this BatchTranslateMetadata to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchTranslateMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.translation.v3beta1.BatchTranslateMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + BatchTranslateMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return BatchTranslateMetadata; + })(); + + v3beta1.BatchTranslateResponse = (function() { + + /** + * Properties of a BatchTranslateResponse. + * @memberof google.cloud.translation.v3beta1 + * @interface IBatchTranslateResponse + * @property {number|Long|null} [totalCharacters] BatchTranslateResponse totalCharacters + * @property {number|Long|null} [translatedCharacters] BatchTranslateResponse translatedCharacters + * @property {number|Long|null} [failedCharacters] BatchTranslateResponse failedCharacters + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateResponse submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] BatchTranslateResponse endTime + */ + + /** + * Constructs a new BatchTranslateResponse. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a BatchTranslateResponse. + * @implements IBatchTranslateResponse + * @constructor + * @param {google.cloud.translation.v3beta1.IBatchTranslateResponse=} [properties] Properties to set + */ + function BatchTranslateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchTranslateResponse totalCharacters. + * @member {number|Long} totalCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateResponse translatedCharacters. + * @member {number|Long} translatedCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateResponse failedCharacters. + * @member {number|Long} failedCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateResponse submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.submitTime = null; + + /** + * BatchTranslateResponse endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.endTime = null; + + /** + * Creates a new BatchTranslateResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.BatchTranslateResponse} BatchTranslateResponse instance + */ + BatchTranslateResponse.create = function create(properties) { + return new BatchTranslateResponse(properties); + }; + + /** + * Encodes the specified BatchTranslateResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateResponse} message BatchTranslateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalCharacters); + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchTranslateResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3beta1.IBatchTranslateResponse} message BatchTranslateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.BatchTranslateResponse} BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalCharacters = reader.int64(); + break; + case 2: + message.translatedCharacters = reader.int64(); + break; + case 3: + message.failedCharacters = reader.int64(); + break; + case 4: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.BatchTranslateResponse} BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchTranslateResponse message. + * @function verify + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchTranslateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) + return "totalCharacters: integer|Long expected"; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) + return "translatedCharacters: integer|Long expected"; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) + return "failedCharacters: integer|Long expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a BatchTranslateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.BatchTranslateResponse} BatchTranslateResponse + */ + BatchTranslateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.BatchTranslateResponse) + return object; + var message = new $root.google.cloud.translation.v3beta1.BatchTranslateResponse(); + if (object.totalCharacters != null) + if ($util.Long) + (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; + else if (typeof object.totalCharacters === "string") + message.totalCharacters = parseInt(object.totalCharacters, 10); + else if (typeof object.totalCharacters === "number") + message.totalCharacters = object.totalCharacters; + else if (typeof object.totalCharacters === "object") + message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); + if (object.translatedCharacters != null) + if ($util.Long) + (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; + else if (typeof object.translatedCharacters === "string") + message.translatedCharacters = parseInt(object.translatedCharacters, 10); + else if (typeof object.translatedCharacters === "number") + message.translatedCharacters = object.translatedCharacters; + else if (typeof object.translatedCharacters === "object") + message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); + if (object.failedCharacters != null) + if ($util.Long) + (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; + else if (typeof object.failedCharacters === "string") + message.failedCharacters = parseInt(object.failedCharacters, 10); + else if (typeof object.failedCharacters === "number") + message.failedCharacters = object.failedCharacters; + else if (typeof object.failedCharacters === "object") + message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateResponse.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateResponse.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchTranslateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3beta1.BatchTranslateResponse} message BatchTranslateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchTranslateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCharacters = options.longs === String ? "0" : 0; + object.submitTime = null; + object.endTime = null; + } + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (typeof message.totalCharacters === "number") + object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; + else + object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (typeof message.translatedCharacters === "number") + object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; + else + object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (typeof message.failedCharacters === "number") + object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; + else + object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this BatchTranslateResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @instance + * @returns {Object.} JSON object + */ + BatchTranslateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchTranslateResponse; + })(); + + v3beta1.GlossaryInputConfig = (function() { + + /** + * Properties of a GlossaryInputConfig. + * @memberof google.cloud.translation.v3beta1 + * @interface IGlossaryInputConfig + * @property {google.cloud.translation.v3beta1.IGcsSource|null} [gcsSource] GlossaryInputConfig gcsSource + */ + + /** + * Constructs a new GlossaryInputConfig. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a GlossaryInputConfig. + * @implements IGlossaryInputConfig + * @constructor + * @param {google.cloud.translation.v3beta1.IGlossaryInputConfig=} [properties] Properties to set + */ + function GlossaryInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GlossaryInputConfig gcsSource. + * @member {google.cloud.translation.v3beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @instance + */ + GlossaryInputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GlossaryInputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @instance + */ + Object.defineProperty(GlossaryInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GlossaryInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3beta1.IGlossaryInputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.GlossaryInputConfig} GlossaryInputConfig instance + */ + GlossaryInputConfig.create = function create(properties) { + return new GlossaryInputConfig(properties); + }; + + /** + * Encodes the specified GlossaryInputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.GlossaryInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3beta1.IGlossaryInputConfig} message GlossaryInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlossaryInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.translation.v3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GlossaryInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GlossaryInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3beta1.IGlossaryInputConfig} message GlossaryInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlossaryInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.GlossaryInputConfig} GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlossaryInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.GlossaryInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.GlossaryInputConfig} GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlossaryInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GlossaryInputConfig message. + * @function verify + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GlossaryInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.translation.v3beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + return null; + }; + + /** + * Creates a GlossaryInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.GlossaryInputConfig} GlossaryInputConfig + */ + GlossaryInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.GlossaryInputConfig) + return object; + var message = new $root.google.cloud.translation.v3beta1.GlossaryInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.translation.v3beta1.GlossaryInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from a GlossaryInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3beta1.GlossaryInputConfig} message GlossaryInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GlossaryInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this GlossaryInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @instance + * @returns {Object.} JSON object + */ + GlossaryInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GlossaryInputConfig; + })(); + + v3beta1.Glossary = (function() { + + /** + * Properties of a Glossary. + * @memberof google.cloud.translation.v3beta1 + * @interface IGlossary + * @property {string|null} [name] Glossary name + * @property {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair|null} [languagePair] Glossary languagePair + * @property {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet|null} [languageCodesSet] Glossary languageCodesSet + * @property {google.cloud.translation.v3beta1.IGlossaryInputConfig|null} [inputConfig] Glossary inputConfig + * @property {number|null} [entryCount] Glossary entryCount + * @property {google.protobuf.ITimestamp|null} [submitTime] Glossary submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] Glossary endTime + */ + + /** + * Constructs a new Glossary. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a Glossary. + * @implements IGlossary + * @constructor + * @param {google.cloud.translation.v3beta1.IGlossary=} [properties] Properties to set + */ + function Glossary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Glossary name. + * @member {string} name + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.name = ""; + + /** + * Glossary languagePair. + * @member {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair|null|undefined} languagePair + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.languagePair = null; + + /** + * Glossary languageCodesSet. + * @member {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet|null|undefined} languageCodesSet + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.languageCodesSet = null; + + /** + * Glossary inputConfig. + * @member {google.cloud.translation.v3beta1.IGlossaryInputConfig|null|undefined} inputConfig + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.inputConfig = null; + + /** + * Glossary entryCount. + * @member {number} entryCount + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.entryCount = 0; + + /** + * Glossary submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.submitTime = null; + + /** + * Glossary endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Glossary.prototype.endTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Glossary languages. + * @member {"languagePair"|"languageCodesSet"|undefined} languages + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + */ + Object.defineProperty(Glossary.prototype, "languages", { + get: $util.oneOfGetter($oneOfFields = ["languagePair", "languageCodesSet"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Glossary instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {google.cloud.translation.v3beta1.IGlossary=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.Glossary} Glossary instance + */ + Glossary.create = function create(properties) { + return new Glossary(properties); + }; + + /** + * Encodes the specified Glossary message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {google.cloud.translation.v3beta1.IGlossary} message Glossary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Glossary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.languagePair != null && Object.hasOwnProperty.call(message, "languagePair")) + $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.encode(message.languagePair, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.languageCodesSet != null && Object.hasOwnProperty.call(message, "languageCodesSet")) + $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.encode(message.languageCodesSet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.translation.v3beta1.GlossaryInputConfig.encode(message.inputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.entryCount != null && Object.hasOwnProperty.call(message, "entryCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.entryCount); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Glossary message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {google.cloud.translation.v3beta1.IGlossary} message Glossary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Glossary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Glossary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.Glossary} Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Glossary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.Glossary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.languagePair = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.decode(reader, reader.uint32()); + break; + case 4: + message.languageCodesSet = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.decode(reader, reader.uint32()); + break; + case 5: + message.inputConfig = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.decode(reader, reader.uint32()); + break; + case 6: + message.entryCount = reader.int32(); + break; + case 7: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Glossary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.Glossary} Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Glossary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Glossary message. + * @function verify + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Glossary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languagePair != null && message.hasOwnProperty("languagePair")) { + properties.languages = 1; + { + var error = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify(message.languagePair); + if (error) + return "languagePair." + error; + } + } + if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) { + if (properties.languages === 1) + return "languages: multiple values"; + properties.languages = 1; + { + var error = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify(message.languageCodesSet); + if (error) + return "languageCodesSet." + error; + } + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + if (!$util.isInteger(message.entryCount)) + return "entryCount: integer expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a Glossary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.Glossary} Glossary + */ + Glossary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.Glossary) + return object; + var message = new $root.google.cloud.translation.v3beta1.Glossary(); + if (object.name != null) + message.name = String(object.name); + if (object.languagePair != null) { + if (typeof object.languagePair !== "object") + throw TypeError(".google.cloud.translation.v3beta1.Glossary.languagePair: object expected"); + message.languagePair = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.fromObject(object.languagePair); + } + if (object.languageCodesSet != null) { + if (typeof object.languageCodesSet !== "object") + throw TypeError(".google.cloud.translation.v3beta1.Glossary.languageCodesSet: object expected"); + message.languageCodesSet = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.fromObject(object.languageCodesSet); + } + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.translation.v3beta1.Glossary.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.fromObject(object.inputConfig); + } + if (object.entryCount != null) + message.entryCount = object.entryCount | 0; + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.Glossary.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.Glossary.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a Glossary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {google.cloud.translation.v3beta1.Glossary} message Glossary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Glossary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputConfig = null; + object.entryCount = 0; + object.submitTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languagePair != null && message.hasOwnProperty("languagePair")) { + object.languagePair = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.toObject(message.languagePair, options); + if (options.oneofs) + object.languages = "languagePair"; + } + if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) { + object.languageCodesSet = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.toObject(message.languageCodesSet, options); + if (options.oneofs) + object.languages = "languageCodesSet"; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.toObject(message.inputConfig, options); + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + object.entryCount = message.entryCount; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this Glossary to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.Glossary + * @instance + * @returns {Object.} JSON object + */ + Glossary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Glossary.LanguageCodePair = (function() { + + /** + * Properties of a LanguageCodePair. + * @memberof google.cloud.translation.v3beta1.Glossary + * @interface ILanguageCodePair + * @property {string|null} [sourceLanguageCode] LanguageCodePair sourceLanguageCode + * @property {string|null} [targetLanguageCode] LanguageCodePair targetLanguageCode + */ + + /** + * Constructs a new LanguageCodePair. + * @memberof google.cloud.translation.v3beta1.Glossary + * @classdesc Represents a LanguageCodePair. + * @implements ILanguageCodePair + * @constructor + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair=} [properties] Properties to set + */ + function LanguageCodePair(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageCodePair sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @instance + */ + LanguageCodePair.prototype.sourceLanguageCode = ""; + + /** + * LanguageCodePair targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @instance + */ + LanguageCodePair.prototype.targetLanguageCode = ""; + + /** + * Creates a new LanguageCodePair instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} LanguageCodePair instance + */ + LanguageCodePair.create = function create(properties) { + return new LanguageCodePair(properties); + }; + + /** + * Encodes the specified LanguageCodePair message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair} message LanguageCodePair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodePair.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified LanguageCodePair message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodePair.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodePair} message LanguageCodePair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodePair.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodePair.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourceLanguageCode = reader.string(); + break; + case 2: + message.targetLanguageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodePair.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageCodePair message. + * @function verify + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageCodePair.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a LanguageCodePair message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} LanguageCodePair + */ + LanguageCodePair.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair) + return object; + var message = new $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair(); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a LanguageCodePair message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} message LanguageCodePair + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageCodePair.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this LanguageCodePair to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @instance + * @returns {Object.} JSON object + */ + LanguageCodePair.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LanguageCodePair; + })(); + + Glossary.LanguageCodesSet = (function() { + + /** + * Properties of a LanguageCodesSet. + * @memberof google.cloud.translation.v3beta1.Glossary + * @interface ILanguageCodesSet + * @property {Array.|null} [languageCodes] LanguageCodesSet languageCodes + */ + + /** + * Constructs a new LanguageCodesSet. + * @memberof google.cloud.translation.v3beta1.Glossary + * @classdesc Represents a LanguageCodesSet. + * @implements ILanguageCodesSet + * @constructor + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet=} [properties] Properties to set + */ + function LanguageCodesSet(properties) { + this.languageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageCodesSet languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @instance + */ + LanguageCodesSet.prototype.languageCodes = $util.emptyArray; + + /** + * Creates a new LanguageCodesSet instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} LanguageCodesSet instance + */ + LanguageCodesSet.create = function create(properties) { + return new LanguageCodesSet(properties); + }; + + /** + * Encodes the specified LanguageCodesSet message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet} message LanguageCodesSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodesSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCodes[i]); + return writer; + }; + + /** + * Encodes the specified LanguageCodesSet message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet} message LanguageCodesSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodesSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodesSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodesSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageCodesSet message. + * @function verify + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageCodesSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + return null; + }; + + /** + * Creates a LanguageCodesSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} LanguageCodesSet + */ + LanguageCodesSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet) + return object; + var message = new $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet(); + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + return message; + }; + + /** + * Creates a plain object from a LanguageCodesSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} message LanguageCodesSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageCodesSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageCodes = []; + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + return object; + }; + + /** + * Converts this LanguageCodesSet to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @instance + * @returns {Object.} JSON object + */ + LanguageCodesSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LanguageCodesSet; + })(); + + return Glossary; + })(); + + v3beta1.CreateGlossaryRequest = (function() { + + /** + * Properties of a CreateGlossaryRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface ICreateGlossaryRequest + * @property {string|null} [parent] CreateGlossaryRequest parent + * @property {google.cloud.translation.v3beta1.IGlossary|null} [glossary] CreateGlossaryRequest glossary + */ + + /** + * Constructs a new CreateGlossaryRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a CreateGlossaryRequest. + * @implements ICreateGlossaryRequest + * @constructor + * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest=} [properties] Properties to set + */ + function CreateGlossaryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGlossaryRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @instance + */ + CreateGlossaryRequest.prototype.parent = ""; + + /** + * CreateGlossaryRequest glossary. + * @member {google.cloud.translation.v3beta1.IGlossary|null|undefined} glossary + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @instance + */ + CreateGlossaryRequest.prototype.glossary = null; + + /** + * Creates a new CreateGlossaryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.CreateGlossaryRequest} CreateGlossaryRequest instance + */ + CreateGlossaryRequest.create = function create(properties) { + return new CreateGlossaryRequest(properties); + }; + + /** + * Encodes the specified CreateGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest} message CreateGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGlossaryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) + $root.google.cloud.translation.v3beta1.Glossary.encode(message.glossary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest} message CreateGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.CreateGlossaryRequest} CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGlossaryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.CreateGlossaryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.glossary = $root.google.cloud.translation.v3beta1.Glossary.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.CreateGlossaryRequest} CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGlossaryRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGlossaryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.glossary != null && message.hasOwnProperty("glossary")) { + var error = $root.google.cloud.translation.v3beta1.Glossary.verify(message.glossary); + if (error) + return "glossary." + error; + } + return null; + }; + + /** + * Creates a CreateGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.CreateGlossaryRequest} CreateGlossaryRequest + */ + CreateGlossaryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.CreateGlossaryRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.CreateGlossaryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.glossary != null) { + if (typeof object.glossary !== "object") + throw TypeError(".google.cloud.translation.v3beta1.CreateGlossaryRequest.glossary: object expected"); + message.glossary = $root.google.cloud.translation.v3beta1.Glossary.fromObject(object.glossary); + } + return message; + }; + + /** + * Creates a plain object from a CreateGlossaryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.CreateGlossaryRequest} message CreateGlossaryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGlossaryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.glossary = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.glossary != null && message.hasOwnProperty("glossary")) + object.glossary = $root.google.cloud.translation.v3beta1.Glossary.toObject(message.glossary, options); + return object; + }; + + /** + * Converts this CreateGlossaryRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGlossaryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateGlossaryRequest; + })(); + + v3beta1.GetGlossaryRequest = (function() { + + /** + * Properties of a GetGlossaryRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface IGetGlossaryRequest + * @property {string|null} [name] GetGlossaryRequest name + */ + + /** + * Constructs a new GetGlossaryRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a GetGlossaryRequest. + * @implements IGetGlossaryRequest + * @constructor + * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest=} [properties] Properties to set + */ + function GetGlossaryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGlossaryRequest name. + * @member {string} name + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @instance + */ + GetGlossaryRequest.prototype.name = ""; + + /** + * Creates a new GetGlossaryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.GetGlossaryRequest} GetGlossaryRequest instance + */ + GetGlossaryRequest.create = function create(properties) { + return new GetGlossaryRequest(properties); + }; + + /** + * Encodes the specified GetGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.GetGlossaryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest} message GetGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlossaryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GetGlossaryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest} message GetGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.GetGlossaryRequest} GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlossaryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.GetGlossaryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.GetGlossaryRequest} GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGlossaryRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGlossaryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.GetGlossaryRequest} GetGlossaryRequest + */ + GetGlossaryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.GetGlossaryRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.GetGlossaryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGlossaryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.GetGlossaryRequest} message GetGlossaryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGlossaryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetGlossaryRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @instance + * @returns {Object.} JSON object + */ + GetGlossaryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGlossaryRequest; + })(); + + v3beta1.DeleteGlossaryRequest = (function() { + + /** + * Properties of a DeleteGlossaryRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface IDeleteGlossaryRequest + * @property {string|null} [name] DeleteGlossaryRequest name + */ + + /** + * Constructs a new DeleteGlossaryRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a DeleteGlossaryRequest. + * @implements IDeleteGlossaryRequest + * @constructor + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest=} [properties] Properties to set + */ + function DeleteGlossaryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlossaryRequest name. + * @member {string} name + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @instance + */ + DeleteGlossaryRequest.prototype.name = ""; + + /** + * Creates a new DeleteGlossaryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryRequest} DeleteGlossaryRequest instance + */ + DeleteGlossaryRequest.create = function create(properties) { + return new DeleteGlossaryRequest(properties); + }; + + /** + * Encodes the specified DeleteGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest} message DeleteGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest} message DeleteGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryRequest} DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryRequest} DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlossaryRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlossaryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryRequest} DeleteGlossaryRequest + */ + DeleteGlossaryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.DeleteGlossaryRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGlossaryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3beta1.DeleteGlossaryRequest} message DeleteGlossaryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlossaryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteGlossaryRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGlossaryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a LanguageCodePair message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} LanguageCodePair - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LanguageCodePair.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return DeleteGlossaryRequest; + })(); - /** - * Verifies a LanguageCodePair message. - * @function verify - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LanguageCodePair.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - if (!$util.isString(message.sourceLanguageCode)) - return "sourceLanguageCode: string expected"; - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) - if (!$util.isString(message.targetLanguageCode)) - return "targetLanguageCode: string expected"; - return null; - }; + v3beta1.ListGlossariesRequest = (function() { - /** - * Creates a LanguageCodePair message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} LanguageCodePair - */ - LanguageCodePair.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair) - return object; - var message = new $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair(); - if (object.sourceLanguageCode != null) - message.sourceLanguageCode = String(object.sourceLanguageCode); - if (object.targetLanguageCode != null) - message.targetLanguageCode = String(object.targetLanguageCode); - return message; - }; + /** + * Properties of a ListGlossariesRequest. + * @memberof google.cloud.translation.v3beta1 + * @interface IListGlossariesRequest + * @property {string|null} [parent] ListGlossariesRequest parent + * @property {number|null} [pageSize] ListGlossariesRequest pageSize + * @property {string|null} [pageToken] ListGlossariesRequest pageToken + * @property {string|null} [filter] ListGlossariesRequest filter + */ - /** - * Creates a plain object from a LanguageCodePair message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair - * @static - * @param {google.cloud.translation.v3beta1.Glossary.LanguageCodePair} message LanguageCodePair - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LanguageCodePair.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sourceLanguageCode = ""; - object.targetLanguageCode = ""; + /** + * Constructs a new ListGlossariesRequest. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a ListGlossariesRequest. + * @implements IListGlossariesRequest + * @constructor + * @param {google.cloud.translation.v3beta1.IListGlossariesRequest=} [properties] Properties to set + */ + function ListGlossariesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGlossariesRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.parent = ""; + + /** + * ListGlossariesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.pageSize = 0; + + /** + * ListGlossariesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.pageToken = ""; + + /** + * ListGlossariesRequest filter. + * @member {string} filter + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.filter = ""; + + /** + * Creates a new ListGlossariesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3beta1.IListGlossariesRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.ListGlossariesRequest} ListGlossariesRequest instance + */ + ListGlossariesRequest.create = function create(properties) { + return new ListGlossariesRequest(properties); + }; + + /** + * Encodes the specified ListGlossariesRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3beta1.IListGlossariesRequest} message ListGlossariesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListGlossariesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3beta1.IListGlossariesRequest} message ListGlossariesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.ListGlossariesRequest} ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.ListGlossariesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - object.sourceLanguageCode = message.sourceLanguageCode; - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) - object.targetLanguageCode = message.targetLanguageCode; - return object; - }; + } + return message; + }; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.ListGlossariesRequest} ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlossariesRequest message. + * @function verify + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlossariesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; - /** - * Converts this LanguageCodePair to JSON. - * @function toJSON - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair - * @instance - * @returns {Object.} JSON object - */ - LanguageCodePair.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a ListGlossariesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.ListGlossariesRequest} ListGlossariesRequest + */ + ListGlossariesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.ListGlossariesRequest) + return object; + var message = new $root.google.cloud.translation.v3beta1.ListGlossariesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; - return LanguageCodePair; - })(); + /** + * Creates a plain object from a ListGlossariesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3beta1.ListGlossariesRequest} message ListGlossariesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlossariesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; - Glossary.LanguageCodesSet = (function() { + /** + * Converts this ListGlossariesRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @instance + * @returns {Object.} JSON object + */ + ListGlossariesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a LanguageCodesSet. - * @memberof google.cloud.translation.v3beta1.Glossary - * @interface ILanguageCodesSet - * @property {Array.|null} [languageCodes] LanguageCodesSet languageCodes - */ + return ListGlossariesRequest; + })(); - /** - * Constructs a new LanguageCodesSet. - * @memberof google.cloud.translation.v3beta1.Glossary - * @classdesc Represents a LanguageCodesSet. - * @implements ILanguageCodesSet - * @constructor - * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet=} [properties] Properties to set - */ - function LanguageCodesSet(properties) { - this.languageCodes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v3beta1.ListGlossariesResponse = (function() { - /** - * LanguageCodesSet languageCodes. - * @member {Array.} languageCodes - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet - * @instance - */ - LanguageCodesSet.prototype.languageCodes = $util.emptyArray; + /** + * Properties of a ListGlossariesResponse. + * @memberof google.cloud.translation.v3beta1 + * @interface IListGlossariesResponse + * @property {Array.|null} [glossaries] ListGlossariesResponse glossaries + * @property {string|null} [nextPageToken] ListGlossariesResponse nextPageToken + */ - /** - * Creates a new LanguageCodesSet instance using the specified properties. - * @function create - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet - * @static - * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} LanguageCodesSet instance - */ - LanguageCodesSet.create = function create(properties) { - return new LanguageCodesSet(properties); - }; + /** + * Constructs a new ListGlossariesResponse. + * @memberof google.cloud.translation.v3beta1 + * @classdesc Represents a ListGlossariesResponse. + * @implements IListGlossariesResponse + * @constructor + * @param {google.cloud.translation.v3beta1.IListGlossariesResponse=} [properties] Properties to set + */ + function ListGlossariesResponse(properties) { + this.glossaries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified LanguageCodesSet message. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify|verify} messages. - * @function encode - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet - * @static - * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet} message LanguageCodesSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LanguageCodesSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.languageCodes != null && message.languageCodes.length) - for (var i = 0; i < message.languageCodes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCodes[i]); - return writer; - }; + /** + * ListGlossariesResponse glossaries. + * @member {Array.} glossaries + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @instance + */ + ListGlossariesResponse.prototype.glossaries = $util.emptyArray; - /** - * Encodes the specified LanguageCodesSet message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet - * @static - * @param {google.cloud.translation.v3beta1.Glossary.ILanguageCodesSet} message LanguageCodesSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LanguageCodesSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ListGlossariesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @instance + */ + ListGlossariesResponse.prototype.nextPageToken = ""; - /** - * Decodes a LanguageCodesSet message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} LanguageCodesSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LanguageCodesSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.languageCodes && message.languageCodes.length)) - message.languageCodes = []; - message.languageCodes.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new ListGlossariesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3beta1.IListGlossariesResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.ListGlossariesResponse} ListGlossariesResponse instance + */ + ListGlossariesResponse.create = function create(properties) { + return new ListGlossariesResponse(properties); + }; - /** - * Decodes a LanguageCodesSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} LanguageCodesSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LanguageCodesSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified ListGlossariesResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3beta1.IListGlossariesResponse} message ListGlossariesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.glossaries != null && message.glossaries.length) + for (var i = 0; i < message.glossaries.length; ++i) + $root.google.cloud.translation.v3beta1.Glossary.encode(message.glossaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; - /** - * Verifies a LanguageCodesSet message. - * @function verify - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LanguageCodesSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { - if (!Array.isArray(message.languageCodes)) - return "languageCodes: array expected"; - for (var i = 0; i < message.languageCodes.length; ++i) - if (!$util.isString(message.languageCodes[i])) - return "languageCodes: string[] expected"; - } - return null; - }; + /** + * Encodes the specified ListGlossariesResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3beta1.IListGlossariesResponse} message ListGlossariesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a LanguageCodesSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} LanguageCodesSet - */ - LanguageCodesSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet) - return object; - var message = new $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet(); - if (object.languageCodes) { - if (!Array.isArray(object.languageCodes)) - throw TypeError(".google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.languageCodes: array expected"); - message.languageCodes = []; - for (var i = 0; i < object.languageCodes.length; ++i) - message.languageCodes[i] = String(object.languageCodes[i]); + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3beta1.ListGlossariesResponse} ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.ListGlossariesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.glossaries && message.glossaries.length)) + message.glossaries = []; + message.glossaries.push($root.google.cloud.translation.v3beta1.Glossary.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a LanguageCodesSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet - * @static - * @param {google.cloud.translation.v3beta1.Glossary.LanguageCodesSet} message LanguageCodesSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LanguageCodesSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.languageCodes = []; - if (message.languageCodes && message.languageCodes.length) { - object.languageCodes = []; - for (var j = 0; j < message.languageCodes.length; ++j) - object.languageCodes[j] = message.languageCodes[j]; + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3beta1.ListGlossariesResponse} ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlossariesResponse message. + * @function verify + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlossariesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.glossaries != null && message.hasOwnProperty("glossaries")) { + if (!Array.isArray(message.glossaries)) + return "glossaries: array expected"; + for (var i = 0; i < message.glossaries.length; ++i) { + var error = $root.google.cloud.translation.v3beta1.Glossary.verify(message.glossaries[i]); + if (error) + return "glossaries." + error; } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListGlossariesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3beta1.ListGlossariesResponse} ListGlossariesResponse + */ + ListGlossariesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.ListGlossariesResponse) return object; - }; + var message = new $root.google.cloud.translation.v3beta1.ListGlossariesResponse(); + if (object.glossaries) { + if (!Array.isArray(object.glossaries)) + throw TypeError(".google.cloud.translation.v3beta1.ListGlossariesResponse.glossaries: array expected"); + message.glossaries = []; + for (var i = 0; i < object.glossaries.length; ++i) { + if (typeof object.glossaries[i] !== "object") + throw TypeError(".google.cloud.translation.v3beta1.ListGlossariesResponse.glossaries: object expected"); + message.glossaries[i] = $root.google.cloud.translation.v3beta1.Glossary.fromObject(object.glossaries[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Converts this LanguageCodesSet to JSON. - * @function toJSON - * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet - * @instance - * @returns {Object.} JSON object - */ - LanguageCodesSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ListGlossariesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3beta1.ListGlossariesResponse} message ListGlossariesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlossariesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.glossaries = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.glossaries && message.glossaries.length) { + object.glossaries = []; + for (var j = 0; j < message.glossaries.length; ++j) + object.glossaries[j] = $root.google.cloud.translation.v3beta1.Glossary.toObject(message.glossaries[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - return LanguageCodesSet; - })(); + /** + * Converts this ListGlossariesResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @instance + * @returns {Object.} JSON object + */ + ListGlossariesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Glossary; + return ListGlossariesResponse; })(); - v3beta1.CreateGlossaryRequest = (function() { + v3beta1.CreateGlossaryMetadata = (function() { /** - * Properties of a CreateGlossaryRequest. + * Properties of a CreateGlossaryMetadata. * @memberof google.cloud.translation.v3beta1 - * @interface ICreateGlossaryRequest - * @property {string|null} [parent] CreateGlossaryRequest parent - * @property {google.cloud.translation.v3beta1.IGlossary|null} [glossary] CreateGlossaryRequest glossary + * @interface ICreateGlossaryMetadata + * @property {string|null} [name] CreateGlossaryMetadata name + * @property {google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|null} [state] CreateGlossaryMetadata state + * @property {google.protobuf.ITimestamp|null} [submitTime] CreateGlossaryMetadata submitTime */ /** - * Constructs a new CreateGlossaryRequest. + * Constructs a new CreateGlossaryMetadata. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a CreateGlossaryRequest. - * @implements ICreateGlossaryRequest + * @classdesc Represents a CreateGlossaryMetadata. + * @implements ICreateGlossaryMetadata * @constructor - * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.ICreateGlossaryMetadata=} [properties] Properties to set */ - function CreateGlossaryRequest(properties) { + function CreateGlossaryMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13768,88 +16322,101 @@ } /** - * CreateGlossaryRequest parent. - * @member {string} parent - * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * CreateGlossaryMetadata name. + * @member {string} name + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @instance + */ + CreateGlossaryMetadata.prototype.name = ""; + + /** + * CreateGlossaryMetadata state. + * @member {google.cloud.translation.v3beta1.CreateGlossaryMetadata.State} state + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata * @instance */ - CreateGlossaryRequest.prototype.parent = ""; + CreateGlossaryMetadata.prototype.state = 0; /** - * CreateGlossaryRequest glossary. - * @member {google.cloud.translation.v3beta1.IGlossary|null|undefined} glossary - * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * CreateGlossaryMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata * @instance */ - CreateGlossaryRequest.prototype.glossary = null; + CreateGlossaryMetadata.prototype.submitTime = null; /** - * Creates a new CreateGlossaryRequest instance using the specified properties. + * Creates a new CreateGlossaryMetadata instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata * @static - * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.CreateGlossaryRequest} CreateGlossaryRequest instance + * @param {google.cloud.translation.v3beta1.ICreateGlossaryMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.CreateGlossaryMetadata} CreateGlossaryMetadata instance */ - CreateGlossaryRequest.create = function create(properties) { - return new CreateGlossaryRequest(properties); + CreateGlossaryMetadata.create = function create(properties) { + return new CreateGlossaryMetadata(properties); }; /** - * Encodes the specified CreateGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryRequest.verify|verify} messages. + * Encodes the specified CreateGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata * @static - * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest} message CreateGlossaryRequest message or plain object to encode + * @param {google.cloud.translation.v3beta1.ICreateGlossaryMetadata} message CreateGlossaryMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateGlossaryRequest.encode = function encode(message, writer) { + CreateGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) - $root.google.cloud.translation.v3beta1.Glossary.encode(message.glossary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryRequest.verify|verify} messages. + * Encodes the specified CreateGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata * @static - * @param {google.cloud.translation.v3beta1.ICreateGlossaryRequest} message CreateGlossaryRequest message or plain object to encode + * @param {google.cloud.translation.v3beta1.ICreateGlossaryMetadata} message CreateGlossaryMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateGlossaryMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateGlossaryRequest message from the specified reader or buffer. + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.CreateGlossaryRequest} CreateGlossaryRequest + * @returns {google.cloud.translation.v3beta1.CreateGlossaryMetadata} CreateGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateGlossaryRequest.decode = function decode(reader, length) { + CreateGlossaryMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.CreateGlossaryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.glossary = $root.google.cloud.translation.v3beta1.Glossary.decode(reader, reader.uint32()); + message.state = reader.int32(); + break; + case 3: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -13860,121 +16427,186 @@ }; /** - * Decodes a CreateGlossaryRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.CreateGlossaryRequest} CreateGlossaryRequest + * @returns {google.cloud.translation.v3beta1.CreateGlossaryMetadata} CreateGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + CreateGlossaryMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateGlossaryRequest message. + * Verifies a CreateGlossaryMetadata message. * @function verify - * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateGlossaryRequest.verify = function verify(message) { + CreateGlossaryMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.glossary != null && message.hasOwnProperty("glossary")) { - var error = $root.google.cloud.translation.v3beta1.Glossary.verify(message.glossary); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); if (error) - return "glossary." + error; + return "submitTime." + error; } return null; }; /** - * Creates a CreateGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateGlossaryMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.CreateGlossaryRequest} CreateGlossaryRequest + * @returns {google.cloud.translation.v3beta1.CreateGlossaryMetadata} CreateGlossaryMetadata */ - CreateGlossaryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.CreateGlossaryRequest) + CreateGlossaryMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata) return object; - var message = new $root.google.cloud.translation.v3beta1.CreateGlossaryRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.glossary != null) { - if (typeof object.glossary !== "object") - throw TypeError(".google.cloud.translation.v3beta1.CreateGlossaryRequest.glossary: object expected"); - message.glossary = $root.google.cloud.translation.v3beta1.Glossary.fromObject(object.glossary); + var message = new $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.CreateGlossaryMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); } return message; }; /** - * Creates a plain object from a CreateGlossaryRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateGlossaryMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata * @static - * @param {google.cloud.translation.v3beta1.CreateGlossaryRequest} message CreateGlossaryRequest + * @param {google.cloud.translation.v3beta1.CreateGlossaryMetadata} message CreateGlossaryMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateGlossaryRequest.toObject = function toObject(message, options) { + CreateGlossaryMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.glossary = null; + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.submitTime = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.glossary != null && message.hasOwnProperty("glossary")) - object.glossary = $root.google.cloud.translation.v3beta1.Glossary.toObject(message.glossary, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata.State[message.state] : message.state; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); return object; }; /** - * Converts this CreateGlossaryRequest to JSON. + * Converts this CreateGlossaryMetadata to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata * @instance * @returns {Object.} JSON object */ - CreateGlossaryRequest.prototype.toJSON = function toJSON() { + CreateGlossaryMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateGlossaryRequest; + /** + * State enum. + * @name google.cloud.translation.v3beta1.CreateGlossaryMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + CreateGlossaryMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return CreateGlossaryMetadata; })(); - v3beta1.GetGlossaryRequest = (function() { + v3beta1.DeleteGlossaryMetadata = (function() { /** - * Properties of a GetGlossaryRequest. + * Properties of a DeleteGlossaryMetadata. * @memberof google.cloud.translation.v3beta1 - * @interface IGetGlossaryRequest - * @property {string|null} [name] GetGlossaryRequest name + * @interface IDeleteGlossaryMetadata + * @property {string|null} [name] DeleteGlossaryMetadata name + * @property {google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|null} [state] DeleteGlossaryMetadata state + * @property {google.protobuf.ITimestamp|null} [submitTime] DeleteGlossaryMetadata submitTime */ /** - * Constructs a new GetGlossaryRequest. + * Constructs a new DeleteGlossaryMetadata. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a GetGlossaryRequest. - * @implements IGetGlossaryRequest + * @classdesc Represents a DeleteGlossaryMetadata. + * @implements IDeleteGlossaryMetadata * @constructor - * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryMetadata=} [properties] Properties to set */ - function GetGlossaryRequest(properties) { + function DeleteGlossaryMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13982,76 +16614,102 @@ } /** - * GetGlossaryRequest name. + * DeleteGlossaryMetadata name. * @member {string} name - * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata * @instance */ - GetGlossaryRequest.prototype.name = ""; + DeleteGlossaryMetadata.prototype.name = ""; /** - * Creates a new GetGlossaryRequest instance using the specified properties. + * DeleteGlossaryMetadata state. + * @member {google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State} state + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @instance + */ + DeleteGlossaryMetadata.prototype.state = 0; + + /** + * DeleteGlossaryMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @instance + */ + DeleteGlossaryMetadata.prototype.submitTime = null; + + /** + * Creates a new DeleteGlossaryMetadata instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata * @static - * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.GetGlossaryRequest} GetGlossaryRequest instance + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} DeleteGlossaryMetadata instance */ - GetGlossaryRequest.create = function create(properties) { - return new GetGlossaryRequest(properties); + DeleteGlossaryMetadata.create = function create(properties) { + return new DeleteGlossaryMetadata(properties); }; /** - * Encodes the specified GetGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.GetGlossaryRequest.verify|verify} messages. + * Encodes the specified DeleteGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata * @static - * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest} message GetGlossaryRequest message or plain object to encode + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryMetadata} message DeleteGlossaryMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetGlossaryRequest.encode = function encode(message, writer) { + DeleteGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.GetGlossaryRequest.verify|verify} messages. + * Encodes the specified DeleteGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata * @static - * @param {google.cloud.translation.v3beta1.IGetGlossaryRequest} message GetGlossaryRequest message or plain object to encode + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryMetadata} message DeleteGlossaryMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteGlossaryMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetGlossaryRequest message from the specified reader or buffer. + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.GetGlossaryRequest} GetGlossaryRequest + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} DeleteGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetGlossaryRequest.decode = function decode(reader, length) { + DeleteGlossaryMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.GetGlossaryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -14061,107 +16719,186 @@ }; /** - * Decodes a GetGlossaryRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.GetGlossaryRequest} GetGlossaryRequest + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} DeleteGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteGlossaryMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetGlossaryRequest message. + * Verifies a DeleteGlossaryMetadata message. * @function verify - * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetGlossaryRequest.verify = function verify(message) { + DeleteGlossaryMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } return null; }; /** - * Creates a GetGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteGlossaryMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.GetGlossaryRequest} GetGlossaryRequest + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} DeleteGlossaryMetadata */ - GetGlossaryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.GetGlossaryRequest) + DeleteGlossaryMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata) return object; - var message = new $root.google.cloud.translation.v3beta1.GetGlossaryRequest(); + var message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata(); if (object.name != null) message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.DeleteGlossaryMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } return message; }; /** - * Creates a plain object from a GetGlossaryRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteGlossaryMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata * @static - * @param {google.cloud.translation.v3beta1.GetGlossaryRequest} message GetGlossaryRequest + * @param {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} message DeleteGlossaryMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetGlossaryRequest.toObject = function toObject(message, options) { + DeleteGlossaryMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.submitTime = null; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State[message.state] : message.state; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); return object; }; /** - * Converts this GetGlossaryRequest to JSON. + * Converts this DeleteGlossaryMetadata to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata * @instance * @returns {Object.} JSON object */ - GetGlossaryRequest.prototype.toJSON = function toJSON() { + DeleteGlossaryMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetGlossaryRequest; + /** + * State enum. + * @name google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + DeleteGlossaryMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return DeleteGlossaryMetadata; })(); - v3beta1.DeleteGlossaryRequest = (function() { + v3beta1.DeleteGlossaryResponse = (function() { /** - * Properties of a DeleteGlossaryRequest. + * Properties of a DeleteGlossaryResponse. * @memberof google.cloud.translation.v3beta1 - * @interface IDeleteGlossaryRequest - * @property {string|null} [name] DeleteGlossaryRequest name + * @interface IDeleteGlossaryResponse + * @property {string|null} [name] DeleteGlossaryResponse name + * @property {google.protobuf.ITimestamp|null} [submitTime] DeleteGlossaryResponse submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] DeleteGlossaryResponse endTime */ /** - * Constructs a new DeleteGlossaryRequest. + * Constructs a new DeleteGlossaryResponse. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a DeleteGlossaryRequest. - * @implements IDeleteGlossaryRequest + * @classdesc Represents a DeleteGlossaryResponse. + * @implements IDeleteGlossaryResponse * @constructor - * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryResponse=} [properties] Properties to set */ - function DeleteGlossaryRequest(properties) { + function DeleteGlossaryResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14169,76 +16906,102 @@ } /** - * DeleteGlossaryRequest name. + * DeleteGlossaryResponse name. * @member {string} name - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse * @instance */ - DeleteGlossaryRequest.prototype.name = ""; + DeleteGlossaryResponse.prototype.name = ""; /** - * Creates a new DeleteGlossaryRequest instance using the specified properties. + * DeleteGlossaryResponse submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @instance + */ + DeleteGlossaryResponse.prototype.submitTime = null; + + /** + * DeleteGlossaryResponse endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @instance + */ + DeleteGlossaryResponse.prototype.endTime = null; + + /** + * Creates a new DeleteGlossaryResponse instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse * @static - * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.DeleteGlossaryRequest} DeleteGlossaryRequest instance + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryResponse} DeleteGlossaryResponse instance */ - DeleteGlossaryRequest.create = function create(properties) { - return new DeleteGlossaryRequest(properties); + DeleteGlossaryResponse.create = function create(properties) { + return new DeleteGlossaryResponse(properties); }; /** - * Encodes the specified DeleteGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryRequest.verify|verify} messages. + * Encodes the specified DeleteGlossaryResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse * @static - * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest} message DeleteGlossaryRequest message or plain object to encode + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryResponse} message DeleteGlossaryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGlossaryRequest.encode = function encode(message, writer) { + DeleteGlossaryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryRequest.verify|verify} messages. + * Encodes the specified DeleteGlossaryResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse * @static - * @param {google.cloud.translation.v3beta1.IDeleteGlossaryRequest} message DeleteGlossaryRequest message or plain object to encode + * @param {google.cloud.translation.v3beta1.IDeleteGlossaryResponse} message DeleteGlossaryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteGlossaryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteGlossaryRequest message from the specified reader or buffer. + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.DeleteGlossaryRequest} DeleteGlossaryRequest + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryResponse} DeleteGlossaryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGlossaryRequest.decode = function decode(reader, length) { + DeleteGlossaryResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; + case 2: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -14248,110 +17011,144 @@ }; /** - * Decodes a DeleteGlossaryRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.DeleteGlossaryRequest} DeleteGlossaryRequest + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryResponse} DeleteGlossaryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteGlossaryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteGlossaryRequest message. + * Verifies a DeleteGlossaryResponse message. * @function verify - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteGlossaryRequest.verify = function verify(message) { + DeleteGlossaryResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } return null; }; /** - * Creates a DeleteGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteGlossaryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.DeleteGlossaryRequest} DeleteGlossaryRequest + * @returns {google.cloud.translation.v3beta1.DeleteGlossaryResponse} DeleteGlossaryResponse */ - DeleteGlossaryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.DeleteGlossaryRequest) + DeleteGlossaryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.DeleteGlossaryResponse) return object; - var message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryRequest(); + var message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryResponse(); if (object.name != null) message.name = String(object.name); + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.DeleteGlossaryResponse.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.DeleteGlossaryResponse.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } return message; }; /** - * Creates a plain object from a DeleteGlossaryRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteGlossaryResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse * @static - * @param {google.cloud.translation.v3beta1.DeleteGlossaryRequest} message DeleteGlossaryRequest + * @param {google.cloud.translation.v3beta1.DeleteGlossaryResponse} message DeleteGlossaryResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteGlossaryRequest.toObject = function toObject(message, options) { + DeleteGlossaryResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.submitTime = null; + object.endTime = null; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); return object; }; /** - * Converts this DeleteGlossaryRequest to JSON. + * Converts this DeleteGlossaryResponse to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse * @instance * @returns {Object.} JSON object */ - DeleteGlossaryRequest.prototype.toJSON = function toJSON() { + DeleteGlossaryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteGlossaryRequest; + return DeleteGlossaryResponse; })(); - v3beta1.ListGlossariesRequest = (function() { + v3beta1.BatchTranslateDocumentRequest = (function() { /** - * Properties of a ListGlossariesRequest. + * Properties of a BatchTranslateDocumentRequest. * @memberof google.cloud.translation.v3beta1 - * @interface IListGlossariesRequest - * @property {string|null} [parent] ListGlossariesRequest parent - * @property {number|null} [pageSize] ListGlossariesRequest pageSize - * @property {string|null} [pageToken] ListGlossariesRequest pageToken - * @property {string|null} [filter] ListGlossariesRequest filter + * @interface IBatchTranslateDocumentRequest + * @property {string|null} [parent] BatchTranslateDocumentRequest parent + * @property {string|null} [sourceLanguageCode] BatchTranslateDocumentRequest sourceLanguageCode + * @property {Array.|null} [targetLanguageCodes] BatchTranslateDocumentRequest targetLanguageCodes + * @property {Array.|null} [inputConfigs] BatchTranslateDocumentRequest inputConfigs + * @property {google.cloud.translation.v3beta1.IBatchDocumentOutputConfig|null} [outputConfig] BatchTranslateDocumentRequest outputConfig + * @property {Object.|null} [models] BatchTranslateDocumentRequest models + * @property {Object.|null} [glossaries] BatchTranslateDocumentRequest glossaries */ /** - * Constructs a new ListGlossariesRequest. + * Constructs a new BatchTranslateDocumentRequest. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a ListGlossariesRequest. - * @implements IListGlossariesRequest + * @classdesc Represents a BatchTranslateDocumentRequest. + * @implements IBatchTranslateDocumentRequest * @constructor - * @param {google.cloud.translation.v3beta1.IListGlossariesRequest=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest=} [properties] Properties to set */ - function ListGlossariesRequest(properties) { + function BatchTranslateDocumentRequest(properties) { + this.targetLanguageCodes = []; + this.inputConfigs = []; + this.models = {}; + this.glossaries = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14359,100 +17156,136 @@ } /** - * ListGlossariesRequest parent. + * BatchTranslateDocumentRequest parent. * @member {string} parent - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @instance */ - ListGlossariesRequest.prototype.parent = ""; + BatchTranslateDocumentRequest.prototype.parent = ""; /** - * ListGlossariesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * BatchTranslateDocumentRequest sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @instance */ - ListGlossariesRequest.prototype.pageSize = 0; + BatchTranslateDocumentRequest.prototype.sourceLanguageCode = ""; /** - * ListGlossariesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * BatchTranslateDocumentRequest targetLanguageCodes. + * @member {Array.} targetLanguageCodes + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @instance */ - ListGlossariesRequest.prototype.pageToken = ""; + BatchTranslateDocumentRequest.prototype.targetLanguageCodes = $util.emptyArray; /** - * ListGlossariesRequest filter. - * @member {string} filter - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * BatchTranslateDocumentRequest inputConfigs. + * @member {Array.} inputConfigs + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @instance */ - ListGlossariesRequest.prototype.filter = ""; + BatchTranslateDocumentRequest.prototype.inputConfigs = $util.emptyArray; /** - * Creates a new ListGlossariesRequest instance using the specified properties. + * BatchTranslateDocumentRequest outputConfig. + * @member {google.cloud.translation.v3beta1.IBatchDocumentOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest + * @instance + */ + BatchTranslateDocumentRequest.prototype.outputConfig = null; + + /** + * BatchTranslateDocumentRequest models. + * @member {Object.} models + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest + * @instance + */ + BatchTranslateDocumentRequest.prototype.models = $util.emptyObject; + + /** + * BatchTranslateDocumentRequest glossaries. + * @member {Object.} glossaries + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest + * @instance + */ + BatchTranslateDocumentRequest.prototype.glossaries = $util.emptyObject; + + /** + * Creates a new BatchTranslateDocumentRequest instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @static - * @param {google.cloud.translation.v3beta1.IListGlossariesRequest=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.ListGlossariesRequest} ListGlossariesRequest instance + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.BatchTranslateDocumentRequest} BatchTranslateDocumentRequest instance */ - ListGlossariesRequest.create = function create(properties) { - return new ListGlossariesRequest(properties); + BatchTranslateDocumentRequest.create = function create(properties) { + return new BatchTranslateDocumentRequest(properties); }; /** - * Encodes the specified ListGlossariesRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesRequest.verify|verify} messages. + * Encodes the specified BatchTranslateDocumentRequest message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateDocumentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @static - * @param {google.cloud.translation.v3beta1.IListGlossariesRequest} message ListGlossariesRequest message or plain object to encode + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest} message BatchTranslateDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGlossariesRequest.encode = function encode(message, writer) { + BatchTranslateDocumentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) + for (var i = 0; i < message.targetLanguageCodes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); + if (message.inputConfigs != null && message.inputConfigs.length) + for (var i = 0; i < message.inputConfigs.length; ++i) + $root.google.cloud.translation.v3beta1.BatchDocumentInputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.translation.v3beta1.BatchDocumentOutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.models != null && Object.hasOwnProperty.call(message, "models")) + for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); + if (message.glossaries != null && Object.hasOwnProperty.call(message, "glossaries")) + for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified ListGlossariesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesRequest.verify|verify} messages. + * Encodes the specified BatchTranslateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateDocumentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @static - * @param {google.cloud.translation.v3beta1.IListGlossariesRequest} message ListGlossariesRequest message or plain object to encode + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest} message BatchTranslateDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGlossariesRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchTranslateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListGlossariesRequest message from the specified reader or buffer. + * Decodes a BatchTranslateDocumentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.ListGlossariesRequest} ListGlossariesRequest + * @returns {google.cloud.translation.v3beta1.BatchTranslateDocumentRequest} BatchTranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGlossariesRequest.decode = function decode(reader, length) { + BatchTranslateDocumentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.ListGlossariesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -14460,13 +17293,64 @@ message.parent = reader.string(); break; case 2: - message.pageSize = reader.int32(); + message.sourceLanguageCode = reader.string(); break; case 3: - message.pageToken = reader.string(); + if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) + message.targetLanguageCodes = []; + message.targetLanguageCodes.push(reader.string()); break; case 4: - message.filter = reader.string(); + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.translation.v3beta1.BatchDocumentInputConfig.decode(reader, reader.uint32())); + break; + case 5: + message.outputConfig = $root.google.cloud.translation.v3beta1.BatchDocumentOutputConfig.decode(reader, reader.uint32()); + break; + case 6: + if (message.models === $util.emptyObject) + message.models = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.models[key] = value; + break; + case 7: + if (message.glossaries === $util.emptyObject) + message.glossaries = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.glossaries[key] = value; break; default: reader.skipType(tag & 7); @@ -14477,134 +17361,226 @@ }; /** - * Decodes a ListGlossariesRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchTranslateDocumentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.ListGlossariesRequest} ListGlossariesRequest + * @returns {google.cloud.translation.v3beta1.BatchTranslateDocumentRequest} BatchTranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGlossariesRequest.decodeDelimited = function decodeDelimited(reader) { + BatchTranslateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListGlossariesRequest message. + * Verifies a BatchTranslateDocumentRequest message. * @function verify - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListGlossariesRequest.verify = function verify(message) { + BatchTranslateDocumentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCodes != null && message.hasOwnProperty("targetLanguageCodes")) { + if (!Array.isArray(message.targetLanguageCodes)) + return "targetLanguageCodes: array expected"; + for (var i = 0; i < message.targetLanguageCodes.length; ++i) + if (!$util.isString(message.targetLanguageCodes[i])) + return "targetLanguageCodes: string[] expected"; + } + if (message.inputConfigs != null && message.hasOwnProperty("inputConfigs")) { + if (!Array.isArray(message.inputConfigs)) + return "inputConfigs: array expected"; + for (var i = 0; i < message.inputConfigs.length; ++i) { + var error = $root.google.cloud.translation.v3beta1.BatchDocumentInputConfig.verify(message.inputConfigs[i]); + if (error) + return "inputConfigs." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.translation.v3beta1.BatchDocumentOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.models != null && message.hasOwnProperty("models")) { + if (!$util.isObject(message.models)) + return "models: object expected"; + var key = Object.keys(message.models); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.models[key[i]])) + return "models: string{k:string} expected"; + } + if (message.glossaries != null && message.hasOwnProperty("glossaries")) { + if (!$util.isObject(message.glossaries)) + return "glossaries: object expected"; + var key = Object.keys(message.glossaries); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.verify(message.glossaries[key[i]]); + if (error) + return "glossaries." + error; + } + } return null; }; /** - * Creates a ListGlossariesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchTranslateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.ListGlossariesRequest} ListGlossariesRequest + * @returns {google.cloud.translation.v3beta1.BatchTranslateDocumentRequest} BatchTranslateDocumentRequest */ - ListGlossariesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.ListGlossariesRequest) + BatchTranslateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest) return object; - var message = new $root.google.cloud.translation.v3beta1.ListGlossariesRequest(); + var message = new $root.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCodes) { + if (!Array.isArray(object.targetLanguageCodes)) + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateDocumentRequest.targetLanguageCodes: array expected"); + message.targetLanguageCodes = []; + for (var i = 0; i < object.targetLanguageCodes.length; ++i) + message.targetLanguageCodes[i] = String(object.targetLanguageCodes[i]); + } + if (object.inputConfigs) { + if (!Array.isArray(object.inputConfigs)) + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateDocumentRequest.inputConfigs: array expected"); + message.inputConfigs = []; + for (var i = 0; i < object.inputConfigs.length; ++i) { + if (typeof object.inputConfigs[i] !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateDocumentRequest.inputConfigs: object expected"); + message.inputConfigs[i] = $root.google.cloud.translation.v3beta1.BatchDocumentInputConfig.fromObject(object.inputConfigs[i]); + } + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateDocumentRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.translation.v3beta1.BatchDocumentOutputConfig.fromObject(object.outputConfig); + } + if (object.models) { + if (typeof object.models !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateDocumentRequest.models: object expected"); + message.models = {}; + for (var keys = Object.keys(object.models), i = 0; i < keys.length; ++i) + message.models[keys[i]] = String(object.models[keys[i]]); + } + if (object.glossaries) { + if (typeof object.glossaries !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateDocumentRequest.glossaries: object expected"); + message.glossaries = {}; + for (var keys = Object.keys(object.glossaries), i = 0; i < keys.length; ++i) { + if (typeof object.glossaries[keys[i]] !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateDocumentRequest.glossaries: object expected"); + message.glossaries[keys[i]] = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.fromObject(object.glossaries[keys[i]]); + } + } return message; }; /** - * Creates a plain object from a ListGlossariesRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchTranslateDocumentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @static - * @param {google.cloud.translation.v3beta1.ListGlossariesRequest} message ListGlossariesRequest + * @param {google.cloud.translation.v3beta1.BatchTranslateDocumentRequest} message BatchTranslateDocumentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListGlossariesRequest.toObject = function toObject(message, options) { + BatchTranslateDocumentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.targetLanguageCodes = []; + object.inputConfigs = []; + } + if (options.objects || options.defaults) { + object.models = {}; + object.glossaries = {}; + } if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; + object.sourceLanguageCode = ""; + object.outputConfig = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCodes && message.targetLanguageCodes.length) { + object.targetLanguageCodes = []; + for (var j = 0; j < message.targetLanguageCodes.length; ++j) + object.targetLanguageCodes[j] = message.targetLanguageCodes[j]; + } + if (message.inputConfigs && message.inputConfigs.length) { + object.inputConfigs = []; + for (var j = 0; j < message.inputConfigs.length; ++j) + object.inputConfigs[j] = $root.google.cloud.translation.v3beta1.BatchDocumentInputConfig.toObject(message.inputConfigs[j], options); + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.translation.v3beta1.BatchDocumentOutputConfig.toObject(message.outputConfig, options); + var keys2; + if (message.models && (keys2 = Object.keys(message.models)).length) { + object.models = {}; + for (var j = 0; j < keys2.length; ++j) + object.models[keys2[j]] = message.models[keys2[j]]; + } + if (message.glossaries && (keys2 = Object.keys(message.glossaries)).length) { + object.glossaries = {}; + for (var j = 0; j < keys2.length; ++j) + object.glossaries[keys2[j]] = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.toObject(message.glossaries[keys2[j]], options); + } return object; }; /** - * Converts this ListGlossariesRequest to JSON. + * Converts this BatchTranslateDocumentRequest to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest * @instance * @returns {Object.} JSON object */ - ListGlossariesRequest.prototype.toJSON = function toJSON() { + BatchTranslateDocumentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListGlossariesRequest; + return BatchTranslateDocumentRequest; })(); - v3beta1.ListGlossariesResponse = (function() { + v3beta1.BatchDocumentInputConfig = (function() { /** - * Properties of a ListGlossariesResponse. + * Properties of a BatchDocumentInputConfig. * @memberof google.cloud.translation.v3beta1 - * @interface IListGlossariesResponse - * @property {Array.|null} [glossaries] ListGlossariesResponse glossaries - * @property {string|null} [nextPageToken] ListGlossariesResponse nextPageToken + * @interface IBatchDocumentInputConfig + * @property {google.cloud.translation.v3beta1.IGcsSource|null} [gcsSource] BatchDocumentInputConfig gcsSource */ /** - * Constructs a new ListGlossariesResponse. + * Constructs a new BatchDocumentInputConfig. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a ListGlossariesResponse. - * @implements IListGlossariesResponse + * @classdesc Represents a BatchDocumentInputConfig. + * @implements IBatchDocumentInputConfig * @constructor - * @param {google.cloud.translation.v3beta1.IListGlossariesResponse=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.IBatchDocumentInputConfig=} [properties] Properties to set */ - function ListGlossariesResponse(properties) { - this.glossaries = []; + function BatchDocumentInputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14612,91 +17588,89 @@ } /** - * ListGlossariesResponse glossaries. - * @member {Array.} glossaries - * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * BatchDocumentInputConfig gcsSource. + * @member {google.cloud.translation.v3beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.translation.v3beta1.BatchDocumentInputConfig * @instance */ - ListGlossariesResponse.prototype.glossaries = $util.emptyArray; + BatchDocumentInputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ListGlossariesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * BatchDocumentInputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.translation.v3beta1.BatchDocumentInputConfig * @instance */ - ListGlossariesResponse.prototype.nextPageToken = ""; + Object.defineProperty(BatchDocumentInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ListGlossariesResponse instance using the specified properties. + * Creates a new BatchDocumentInputConfig instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @memberof google.cloud.translation.v3beta1.BatchDocumentInputConfig * @static - * @param {google.cloud.translation.v3beta1.IListGlossariesResponse=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.ListGlossariesResponse} ListGlossariesResponse instance + * @param {google.cloud.translation.v3beta1.IBatchDocumentInputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.BatchDocumentInputConfig} BatchDocumentInputConfig instance */ - ListGlossariesResponse.create = function create(properties) { - return new ListGlossariesResponse(properties); + BatchDocumentInputConfig.create = function create(properties) { + return new BatchDocumentInputConfig(properties); }; /** - * Encodes the specified ListGlossariesResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesResponse.verify|verify} messages. + * Encodes the specified BatchDocumentInputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchDocumentInputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @memberof google.cloud.translation.v3beta1.BatchDocumentInputConfig * @static - * @param {google.cloud.translation.v3beta1.IListGlossariesResponse} message ListGlossariesResponse message or plain object to encode + * @param {google.cloud.translation.v3beta1.IBatchDocumentInputConfig} message BatchDocumentInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGlossariesResponse.encode = function encode(message, writer) { + BatchDocumentInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.glossaries != null && message.glossaries.length) - for (var i = 0; i < message.glossaries.length; ++i) - $root.google.cloud.translation.v3beta1.Glossary.encode(message.glossaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.translation.v3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListGlossariesResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.ListGlossariesResponse.verify|verify} messages. + * Encodes the specified BatchDocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchDocumentInputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @memberof google.cloud.translation.v3beta1.BatchDocumentInputConfig * @static - * @param {google.cloud.translation.v3beta1.IListGlossariesResponse} message ListGlossariesResponse message or plain object to encode + * @param {google.cloud.translation.v3beta1.IBatchDocumentInputConfig} message BatchDocumentInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGlossariesResponse.encodeDelimited = function encodeDelimited(message, writer) { + BatchDocumentInputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListGlossariesResponse message from the specified reader or buffer. + * Decodes a BatchDocumentInputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @memberof google.cloud.translation.v3beta1.BatchDocumentInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.ListGlossariesResponse} ListGlossariesResponse + * @returns {google.cloud.translation.v3beta1.BatchDocumentInputConfig} BatchDocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGlossariesResponse.decode = function decode(reader, length) { + BatchDocumentInputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.ListGlossariesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchDocumentInputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.glossaries && message.glossaries.length)) - message.glossaries = []; - message.glossaries.push($root.google.cloud.translation.v3beta1.Glossary.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -14707,237 +17681,207 @@ }; /** - * Decodes a ListGlossariesResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchDocumentInputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @memberof google.cloud.translation.v3beta1.BatchDocumentInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.ListGlossariesResponse} ListGlossariesResponse + * @returns {google.cloud.translation.v3beta1.BatchDocumentInputConfig} BatchDocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGlossariesResponse.decodeDelimited = function decodeDelimited(reader) { + BatchDocumentInputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListGlossariesResponse message. + * Verifies a BatchDocumentInputConfig message. * @function verify - * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @memberof google.cloud.translation.v3beta1.BatchDocumentInputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListGlossariesResponse.verify = function verify(message) { + BatchDocumentInputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.glossaries != null && message.hasOwnProperty("glossaries")) { - if (!Array.isArray(message.glossaries)) - return "glossaries: array expected"; - for (var i = 0; i < message.glossaries.length; ++i) { - var error = $root.google.cloud.translation.v3beta1.Glossary.verify(message.glossaries[i]); + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.translation.v3beta1.GcsSource.verify(message.gcsSource); if (error) - return "glossaries." + error; + return "gcsSource." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListGlossariesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDocumentInputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @memberof google.cloud.translation.v3beta1.BatchDocumentInputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.ListGlossariesResponse} ListGlossariesResponse + * @returns {google.cloud.translation.v3beta1.BatchDocumentInputConfig} BatchDocumentInputConfig */ - ListGlossariesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.ListGlossariesResponse) + BatchDocumentInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.BatchDocumentInputConfig) return object; - var message = new $root.google.cloud.translation.v3beta1.ListGlossariesResponse(); - if (object.glossaries) { - if (!Array.isArray(object.glossaries)) - throw TypeError(".google.cloud.translation.v3beta1.ListGlossariesResponse.glossaries: array expected"); - message.glossaries = []; - for (var i = 0; i < object.glossaries.length; ++i) { - if (typeof object.glossaries[i] !== "object") - throw TypeError(".google.cloud.translation.v3beta1.ListGlossariesResponse.glossaries: object expected"); - message.glossaries[i] = $root.google.cloud.translation.v3beta1.Glossary.fromObject(object.glossaries[i]); - } + var message = new $root.google.cloud.translation.v3beta1.BatchDocumentInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchDocumentInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.fromObject(object.gcsSource); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListGlossariesResponse message. Also converts values to other types if specified. + * Creates a plain object from a BatchDocumentInputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @memberof google.cloud.translation.v3beta1.BatchDocumentInputConfig * @static - * @param {google.cloud.translation.v3beta1.ListGlossariesResponse} message ListGlossariesResponse + * @param {google.cloud.translation.v3beta1.BatchDocumentInputConfig} message BatchDocumentInputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListGlossariesResponse.toObject = function toObject(message, options) { + BatchDocumentInputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.glossaries = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.glossaries && message.glossaries.length) { - object.glossaries = []; - for (var j = 0; j < message.glossaries.length; ++j) - object.glossaries[j] = $root.google.cloud.translation.v3beta1.Glossary.toObject(message.glossaries[j], options); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ListGlossariesResponse to JSON. + * Converts this BatchDocumentInputConfig to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @memberof google.cloud.translation.v3beta1.BatchDocumentInputConfig * @instance * @returns {Object.} JSON object */ - ListGlossariesResponse.prototype.toJSON = function toJSON() { + BatchDocumentInputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListGlossariesResponse; + return BatchDocumentInputConfig; })(); - v3beta1.CreateGlossaryMetadata = (function() { + v3beta1.BatchDocumentOutputConfig = (function() { /** - * Properties of a CreateGlossaryMetadata. + * Properties of a BatchDocumentOutputConfig. * @memberof google.cloud.translation.v3beta1 - * @interface ICreateGlossaryMetadata - * @property {string|null} [name] CreateGlossaryMetadata name - * @property {google.cloud.translation.v3beta1.CreateGlossaryMetadata.State|null} [state] CreateGlossaryMetadata state - * @property {google.protobuf.ITimestamp|null} [submitTime] CreateGlossaryMetadata submitTime + * @interface IBatchDocumentOutputConfig + * @property {google.cloud.translation.v3beta1.IGcsDestination|null} [gcsDestination] BatchDocumentOutputConfig gcsDestination */ /** - * Constructs a new CreateGlossaryMetadata. + * Constructs a new BatchDocumentOutputConfig. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a CreateGlossaryMetadata. - * @implements ICreateGlossaryMetadata + * @classdesc Represents a BatchDocumentOutputConfig. + * @implements IBatchDocumentOutputConfig * @constructor - * @param {google.cloud.translation.v3beta1.ICreateGlossaryMetadata=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.IBatchDocumentOutputConfig=} [properties] Properties to set */ - function CreateGlossaryMetadata(properties) { + function BatchDocumentOutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - /** - * CreateGlossaryMetadata name. - * @member {string} name - * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata - * @instance - */ - CreateGlossaryMetadata.prototype.name = ""; - - /** - * CreateGlossaryMetadata state. - * @member {google.cloud.translation.v3beta1.CreateGlossaryMetadata.State} state - * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + /** + * BatchDocumentOutputConfig gcsDestination. + * @member {google.cloud.translation.v3beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.translation.v3beta1.BatchDocumentOutputConfig * @instance */ - CreateGlossaryMetadata.prototype.state = 0; + BatchDocumentOutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * CreateGlossaryMetadata submitTime. - * @member {google.protobuf.ITimestamp|null|undefined} submitTime - * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * BatchDocumentOutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.translation.v3beta1.BatchDocumentOutputConfig * @instance */ - CreateGlossaryMetadata.prototype.submitTime = null; + Object.defineProperty(BatchDocumentOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new CreateGlossaryMetadata instance using the specified properties. + * Creates a new BatchDocumentOutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchDocumentOutputConfig * @static - * @param {google.cloud.translation.v3beta1.ICreateGlossaryMetadata=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.CreateGlossaryMetadata} CreateGlossaryMetadata instance + * @param {google.cloud.translation.v3beta1.IBatchDocumentOutputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.BatchDocumentOutputConfig} BatchDocumentOutputConfig instance */ - CreateGlossaryMetadata.create = function create(properties) { - return new CreateGlossaryMetadata(properties); + BatchDocumentOutputConfig.create = function create(properties) { + return new BatchDocumentOutputConfig(properties); }; /** - * Encodes the specified CreateGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryMetadata.verify|verify} messages. + * Encodes the specified BatchDocumentOutputConfig message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchDocumentOutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchDocumentOutputConfig * @static - * @param {google.cloud.translation.v3beta1.ICreateGlossaryMetadata} message CreateGlossaryMetadata message or plain object to encode + * @param {google.cloud.translation.v3beta1.IBatchDocumentOutputConfig} message BatchDocumentOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateGlossaryMetadata.encode = function encode(message, writer) { + BatchDocumentOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) - $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.translation.v3beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.CreateGlossaryMetadata.verify|verify} messages. + * Encodes the specified BatchDocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchDocumentOutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchDocumentOutputConfig * @static - * @param {google.cloud.translation.v3beta1.ICreateGlossaryMetadata} message CreateGlossaryMetadata message or plain object to encode + * @param {google.cloud.translation.v3beta1.IBatchDocumentOutputConfig} message BatchDocumentOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateGlossaryMetadata.encodeDelimited = function encodeDelimited(message, writer) { + BatchDocumentOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateGlossaryMetadata message from the specified reader or buffer. + * Decodes a BatchDocumentOutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchDocumentOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.CreateGlossaryMetadata} CreateGlossaryMetadata + * @returns {google.cloud.translation.v3beta1.BatchDocumentOutputConfig} BatchDocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateGlossaryMetadata.decode = function decode(reader, length) { + BatchDocumentOutputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchDocumentOutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - message.state = reader.int32(); - break; - case 3: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -14948,186 +17892,126 @@ }; /** - * Decodes a CreateGlossaryMetadata message from the specified reader or buffer, length delimited. + * Decodes a BatchDocumentOutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchDocumentOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.CreateGlossaryMetadata} CreateGlossaryMetadata + * @returns {google.cloud.translation.v3beta1.BatchDocumentOutputConfig} BatchDocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateGlossaryMetadata.decodeDelimited = function decodeDelimited(reader) { + BatchDocumentOutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateGlossaryMetadata message. + * Verifies a BatchDocumentOutputConfig message. * @function verify - * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchDocumentOutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateGlossaryMetadata.verify = function verify(message) { + BatchDocumentOutputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.translation.v3beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; } - if (message.submitTime != null && message.hasOwnProperty("submitTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.submitTime); - if (error) - return "submitTime." + error; } return null; }; /** - * Creates a CreateGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDocumentOutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchDocumentOutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.CreateGlossaryMetadata} CreateGlossaryMetadata + * @returns {google.cloud.translation.v3beta1.BatchDocumentOutputConfig} BatchDocumentOutputConfig */ - CreateGlossaryMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata) + BatchDocumentOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.BatchDocumentOutputConfig) return object; - var message = new $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "RUNNING": - case 1: - message.state = 1; - break; - case "SUCCEEDED": - case 2: - message.state = 2; - break; - case "FAILED": - case 3: - message.state = 3; - break; - case "CANCELLING": - case 4: - message.state = 4; - break; - case "CANCELLED": - case 5: - message.state = 5; - break; - } - if (object.submitTime != null) { - if (typeof object.submitTime !== "object") - throw TypeError(".google.cloud.translation.v3beta1.CreateGlossaryMetadata.submitTime: object expected"); - message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + var message = new $root.google.cloud.translation.v3beta1.BatchDocumentOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchDocumentOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.fromObject(object.gcsDestination); } return message; }; /** - * Creates a plain object from a CreateGlossaryMetadata message. Also converts values to other types if specified. + * Creates a plain object from a BatchDocumentOutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchDocumentOutputConfig * @static - * @param {google.cloud.translation.v3beta1.CreateGlossaryMetadata} message CreateGlossaryMetadata + * @param {google.cloud.translation.v3beta1.BatchDocumentOutputConfig} message BatchDocumentOutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateGlossaryMetadata.toObject = function toObject(message, options) { + BatchDocumentOutputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.submitTime = null; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata.State[message.state] : message.state; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) - object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); return object; }; /** - * Converts this CreateGlossaryMetadata to JSON. + * Converts this BatchDocumentOutputConfig to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchDocumentOutputConfig * @instance * @returns {Object.} JSON object */ - CreateGlossaryMetadata.prototype.toJSON = function toJSON() { + BatchDocumentOutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.translation.v3beta1.CreateGlossaryMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} SUCCEEDED=2 SUCCEEDED value - * @property {number} FAILED=3 FAILED value - * @property {number} CANCELLING=4 CANCELLING value - * @property {number} CANCELLED=5 CANCELLED value - */ - CreateGlossaryMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "SUCCEEDED"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "CANCELLING"] = 4; - values[valuesById[5] = "CANCELLED"] = 5; - return values; - })(); - - return CreateGlossaryMetadata; + return BatchDocumentOutputConfig; })(); - v3beta1.DeleteGlossaryMetadata = (function() { + v3beta1.BatchTranslateDocumentResponse = (function() { /** - * Properties of a DeleteGlossaryMetadata. + * Properties of a BatchTranslateDocumentResponse. * @memberof google.cloud.translation.v3beta1 - * @interface IDeleteGlossaryMetadata - * @property {string|null} [name] DeleteGlossaryMetadata name - * @property {google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State|null} [state] DeleteGlossaryMetadata state - * @property {google.protobuf.ITimestamp|null} [submitTime] DeleteGlossaryMetadata submitTime + * @interface IBatchTranslateDocumentResponse + * @property {number|Long|null} [totalPages] BatchTranslateDocumentResponse totalPages + * @property {number|Long|null} [translatedPages] BatchTranslateDocumentResponse translatedPages + * @property {number|Long|null} [failedPages] BatchTranslateDocumentResponse failedPages + * @property {number|Long|null} [totalBillablePages] BatchTranslateDocumentResponse totalBillablePages + * @property {number|Long|null} [totalCharacters] BatchTranslateDocumentResponse totalCharacters + * @property {number|Long|null} [translatedCharacters] BatchTranslateDocumentResponse translatedCharacters + * @property {number|Long|null} [failedCharacters] BatchTranslateDocumentResponse failedCharacters + * @property {number|Long|null} [totalBillableCharacters] BatchTranslateDocumentResponse totalBillableCharacters + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateDocumentResponse submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] BatchTranslateDocumentResponse endTime */ /** - * Constructs a new DeleteGlossaryMetadata. + * Constructs a new BatchTranslateDocumentResponse. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a DeleteGlossaryMetadata. - * @implements IDeleteGlossaryMetadata + * @classdesc Represents a BatchTranslateDocumentResponse. + * @implements IBatchTranslateDocumentResponse * @constructor - * @param {google.cloud.translation.v3beta1.IDeleteGlossaryMetadata=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse=} [properties] Properties to set */ - function DeleteGlossaryMetadata(properties) { + function BatchTranslateDocumentResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15135,102 +18019,193 @@ } /** - * DeleteGlossaryMetadata name. - * @member {string} name - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * BatchTranslateDocumentResponse totalPages. + * @member {number|Long} totalPages + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse * @instance */ - DeleteGlossaryMetadata.prototype.name = ""; + BatchTranslateDocumentResponse.prototype.totalPages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * DeleteGlossaryMetadata state. - * @member {google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State} state - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * BatchTranslateDocumentResponse translatedPages. + * @member {number|Long} translatedPages + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse * @instance */ - DeleteGlossaryMetadata.prototype.state = 0; + BatchTranslateDocumentResponse.prototype.translatedPages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * DeleteGlossaryMetadata submitTime. + * BatchTranslateDocumentResponse failedPages. + * @member {number|Long} failedPages + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.failedPages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentResponse totalBillablePages. + * @member {number|Long} totalBillablePages + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.totalBillablePages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentResponse totalCharacters. + * @member {number|Long} totalCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentResponse translatedCharacters. + * @member {number|Long} translatedCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentResponse failedCharacters. + * @member {number|Long} failedCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentResponse totalBillableCharacters. + * @member {number|Long} totalBillableCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.totalBillableCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentResponse submitTime. * @member {google.protobuf.ITimestamp|null|undefined} submitTime - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse * @instance */ - DeleteGlossaryMetadata.prototype.submitTime = null; + BatchTranslateDocumentResponse.prototype.submitTime = null; /** - * Creates a new DeleteGlossaryMetadata instance using the specified properties. + * BatchTranslateDocumentResponse endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.endTime = null; + + /** + * Creates a new BatchTranslateDocumentResponse instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse * @static - * @param {google.cloud.translation.v3beta1.IDeleteGlossaryMetadata=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} DeleteGlossaryMetadata instance + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.BatchTranslateDocumentResponse} BatchTranslateDocumentResponse instance */ - DeleteGlossaryMetadata.create = function create(properties) { - return new DeleteGlossaryMetadata(properties); + BatchTranslateDocumentResponse.create = function create(properties) { + return new BatchTranslateDocumentResponse(properties); }; /** - * Encodes the specified DeleteGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryMetadata.verify|verify} messages. + * Encodes the specified BatchTranslateDocumentResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateDocumentResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse * @static - * @param {google.cloud.translation.v3beta1.IDeleteGlossaryMetadata} message DeleteGlossaryMetadata message or plain object to encode + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse} message BatchTranslateDocumentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGlossaryMetadata.encode = function encode(message, writer) { + BatchTranslateDocumentResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.totalPages != null && Object.hasOwnProperty.call(message, "totalPages")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalPages); + if (message.translatedPages != null && Object.hasOwnProperty.call(message, "translatedPages")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedPages); + if (message.failedPages != null && Object.hasOwnProperty.call(message, "failedPages")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedPages); + if (message.totalBillablePages != null && Object.hasOwnProperty.call(message, "totalBillablePages")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalBillablePages); + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalCharacters); + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.translatedCharacters); + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.failedCharacters); + if (message.totalBillableCharacters != null && Object.hasOwnProperty.call(message, "totalBillableCharacters")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.totalBillableCharacters); if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) - $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryMetadata.verify|verify} messages. + * Encodes the specified BatchTranslateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateDocumentResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse * @static - * @param {google.cloud.translation.v3beta1.IDeleteGlossaryMetadata} message DeleteGlossaryMetadata message or plain object to encode + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse} message BatchTranslateDocumentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGlossaryMetadata.encodeDelimited = function encodeDelimited(message, writer) { + BatchTranslateDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer. + * Decodes a BatchTranslateDocumentResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} DeleteGlossaryMetadata + * @returns {google.cloud.translation.v3beta1.BatchTranslateDocumentResponse} BatchTranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGlossaryMetadata.decode = function decode(reader, length) { + BatchTranslateDocumentResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateDocumentResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.totalPages = reader.int64(); + break; + case 2: + message.translatedPages = reader.int64(); + break; + case 3: + message.failedPages = reader.int64(); + break; + case 4: + message.totalBillablePages = reader.int64(); + break; + case 5: + message.totalCharacters = reader.int64(); break; - case 2: - message.state = reader.int32(); + case 6: + message.translatedCharacters = reader.int64(); break; - case 3: + case 7: + message.failedCharacters = reader.int64(); + break; + case 8: + message.totalBillableCharacters = reader.int64(); + break; + case 9: message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; + case 10: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -15240,186 +18215,311 @@ }; /** - * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer, length delimited. + * Decodes a BatchTranslateDocumentResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} DeleteGlossaryMetadata + * @returns {google.cloud.translation.v3beta1.BatchTranslateDocumentResponse} BatchTranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGlossaryMetadata.decodeDelimited = function decodeDelimited(reader) { + BatchTranslateDocumentResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteGlossaryMetadata message. + * Verifies a BatchTranslateDocumentResponse message. * @function verify - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteGlossaryMetadata.verify = function verify(message) { + BatchTranslateDocumentResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + if (!$util.isInteger(message.totalPages) && !(message.totalPages && $util.isInteger(message.totalPages.low) && $util.isInteger(message.totalPages.high))) + return "totalPages: integer|Long expected"; + if (message.translatedPages != null && message.hasOwnProperty("translatedPages")) + if (!$util.isInteger(message.translatedPages) && !(message.translatedPages && $util.isInteger(message.translatedPages.low) && $util.isInteger(message.translatedPages.high))) + return "translatedPages: integer|Long expected"; + if (message.failedPages != null && message.hasOwnProperty("failedPages")) + if (!$util.isInteger(message.failedPages) && !(message.failedPages && $util.isInteger(message.failedPages.low) && $util.isInteger(message.failedPages.high))) + return "failedPages: integer|Long expected"; + if (message.totalBillablePages != null && message.hasOwnProperty("totalBillablePages")) + if (!$util.isInteger(message.totalBillablePages) && !(message.totalBillablePages && $util.isInteger(message.totalBillablePages.low) && $util.isInteger(message.totalBillablePages.high))) + return "totalBillablePages: integer|Long expected"; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) + return "totalCharacters: integer|Long expected"; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) + return "translatedCharacters: integer|Long expected"; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) + return "failedCharacters: integer|Long expected"; + if (message.totalBillableCharacters != null && message.hasOwnProperty("totalBillableCharacters")) + if (!$util.isInteger(message.totalBillableCharacters) && !(message.totalBillableCharacters && $util.isInteger(message.totalBillableCharacters.low) && $util.isInteger(message.totalBillableCharacters.high))) + return "totalBillableCharacters: integer|Long expected"; if (message.submitTime != null && message.hasOwnProperty("submitTime")) { var error = $root.google.protobuf.Timestamp.verify(message.submitTime); if (error) return "submitTime." + error; } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } return null; }; /** - * Creates a DeleteGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a BatchTranslateDocumentResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} DeleteGlossaryMetadata + * @returns {google.cloud.translation.v3beta1.BatchTranslateDocumentResponse} BatchTranslateDocumentResponse */ - DeleteGlossaryMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata) + BatchTranslateDocumentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.BatchTranslateDocumentResponse) return object; - var message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "RUNNING": - case 1: - message.state = 1; - break; - case "SUCCEEDED": - case 2: - message.state = 2; - break; - case "FAILED": - case 3: - message.state = 3; - break; - case "CANCELLING": - case 4: - message.state = 4; - break; - case "CANCELLED": - case 5: - message.state = 5; - break; - } + var message = new $root.google.cloud.translation.v3beta1.BatchTranslateDocumentResponse(); + if (object.totalPages != null) + if ($util.Long) + (message.totalPages = $util.Long.fromValue(object.totalPages)).unsigned = false; + else if (typeof object.totalPages === "string") + message.totalPages = parseInt(object.totalPages, 10); + else if (typeof object.totalPages === "number") + message.totalPages = object.totalPages; + else if (typeof object.totalPages === "object") + message.totalPages = new $util.LongBits(object.totalPages.low >>> 0, object.totalPages.high >>> 0).toNumber(); + if (object.translatedPages != null) + if ($util.Long) + (message.translatedPages = $util.Long.fromValue(object.translatedPages)).unsigned = false; + else if (typeof object.translatedPages === "string") + message.translatedPages = parseInt(object.translatedPages, 10); + else if (typeof object.translatedPages === "number") + message.translatedPages = object.translatedPages; + else if (typeof object.translatedPages === "object") + message.translatedPages = new $util.LongBits(object.translatedPages.low >>> 0, object.translatedPages.high >>> 0).toNumber(); + if (object.failedPages != null) + if ($util.Long) + (message.failedPages = $util.Long.fromValue(object.failedPages)).unsigned = false; + else if (typeof object.failedPages === "string") + message.failedPages = parseInt(object.failedPages, 10); + else if (typeof object.failedPages === "number") + message.failedPages = object.failedPages; + else if (typeof object.failedPages === "object") + message.failedPages = new $util.LongBits(object.failedPages.low >>> 0, object.failedPages.high >>> 0).toNumber(); + if (object.totalBillablePages != null) + if ($util.Long) + (message.totalBillablePages = $util.Long.fromValue(object.totalBillablePages)).unsigned = false; + else if (typeof object.totalBillablePages === "string") + message.totalBillablePages = parseInt(object.totalBillablePages, 10); + else if (typeof object.totalBillablePages === "number") + message.totalBillablePages = object.totalBillablePages; + else if (typeof object.totalBillablePages === "object") + message.totalBillablePages = new $util.LongBits(object.totalBillablePages.low >>> 0, object.totalBillablePages.high >>> 0).toNumber(); + if (object.totalCharacters != null) + if ($util.Long) + (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; + else if (typeof object.totalCharacters === "string") + message.totalCharacters = parseInt(object.totalCharacters, 10); + else if (typeof object.totalCharacters === "number") + message.totalCharacters = object.totalCharacters; + else if (typeof object.totalCharacters === "object") + message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); + if (object.translatedCharacters != null) + if ($util.Long) + (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; + else if (typeof object.translatedCharacters === "string") + message.translatedCharacters = parseInt(object.translatedCharacters, 10); + else if (typeof object.translatedCharacters === "number") + message.translatedCharacters = object.translatedCharacters; + else if (typeof object.translatedCharacters === "object") + message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); + if (object.failedCharacters != null) + if ($util.Long) + (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; + else if (typeof object.failedCharacters === "string") + message.failedCharacters = parseInt(object.failedCharacters, 10); + else if (typeof object.failedCharacters === "number") + message.failedCharacters = object.failedCharacters; + else if (typeof object.failedCharacters === "object") + message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); + if (object.totalBillableCharacters != null) + if ($util.Long) + (message.totalBillableCharacters = $util.Long.fromValue(object.totalBillableCharacters)).unsigned = false; + else if (typeof object.totalBillableCharacters === "string") + message.totalBillableCharacters = parseInt(object.totalBillableCharacters, 10); + else if (typeof object.totalBillableCharacters === "number") + message.totalBillableCharacters = object.totalBillableCharacters; + else if (typeof object.totalBillableCharacters === "object") + message.totalBillableCharacters = new $util.LongBits(object.totalBillableCharacters.low >>> 0, object.totalBillableCharacters.high >>> 0).toNumber(); if (object.submitTime != null) { if (typeof object.submitTime !== "object") - throw TypeError(".google.cloud.translation.v3beta1.DeleteGlossaryMetadata.submitTime: object expected"); + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateDocumentResponse.submitTime: object expected"); message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateDocumentResponse.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } return message; }; /** - * Creates a plain object from a DeleteGlossaryMetadata message. Also converts values to other types if specified. + * Creates a plain object from a BatchTranslateDocumentResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse * @static - * @param {google.cloud.translation.v3beta1.DeleteGlossaryMetadata} message DeleteGlossaryMetadata + * @param {google.cloud.translation.v3beta1.BatchTranslateDocumentResponse} message BatchTranslateDocumentResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteGlossaryMetadata.toObject = function toObject(message, options) { + BatchTranslateDocumentResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalPages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalPages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedPages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedPages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedPages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedPages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalBillablePages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalBillablePages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalBillableCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalBillableCharacters = options.longs === String ? "0" : 0; object.submitTime = null; + object.endTime = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State[message.state] : message.state; + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + if (typeof message.totalPages === "number") + object.totalPages = options.longs === String ? String(message.totalPages) : message.totalPages; + else + object.totalPages = options.longs === String ? $util.Long.prototype.toString.call(message.totalPages) : options.longs === Number ? new $util.LongBits(message.totalPages.low >>> 0, message.totalPages.high >>> 0).toNumber() : message.totalPages; + if (message.translatedPages != null && message.hasOwnProperty("translatedPages")) + if (typeof message.translatedPages === "number") + object.translatedPages = options.longs === String ? String(message.translatedPages) : message.translatedPages; + else + object.translatedPages = options.longs === String ? $util.Long.prototype.toString.call(message.translatedPages) : options.longs === Number ? new $util.LongBits(message.translatedPages.low >>> 0, message.translatedPages.high >>> 0).toNumber() : message.translatedPages; + if (message.failedPages != null && message.hasOwnProperty("failedPages")) + if (typeof message.failedPages === "number") + object.failedPages = options.longs === String ? String(message.failedPages) : message.failedPages; + else + object.failedPages = options.longs === String ? $util.Long.prototype.toString.call(message.failedPages) : options.longs === Number ? new $util.LongBits(message.failedPages.low >>> 0, message.failedPages.high >>> 0).toNumber() : message.failedPages; + if (message.totalBillablePages != null && message.hasOwnProperty("totalBillablePages")) + if (typeof message.totalBillablePages === "number") + object.totalBillablePages = options.longs === String ? String(message.totalBillablePages) : message.totalBillablePages; + else + object.totalBillablePages = options.longs === String ? $util.Long.prototype.toString.call(message.totalBillablePages) : options.longs === Number ? new $util.LongBits(message.totalBillablePages.low >>> 0, message.totalBillablePages.high >>> 0).toNumber() : message.totalBillablePages; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (typeof message.totalCharacters === "number") + object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; + else + object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (typeof message.translatedCharacters === "number") + object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; + else + object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (typeof message.failedCharacters === "number") + object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; + else + object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; + if (message.totalBillableCharacters != null && message.hasOwnProperty("totalBillableCharacters")) + if (typeof message.totalBillableCharacters === "number") + object.totalBillableCharacters = options.longs === String ? String(message.totalBillableCharacters) : message.totalBillableCharacters; + else + object.totalBillableCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalBillableCharacters) : options.longs === Number ? new $util.LongBits(message.totalBillableCharacters.low >>> 0, message.totalBillableCharacters.high >>> 0).toNumber() : message.totalBillableCharacters; if (message.submitTime != null && message.hasOwnProperty("submitTime")) object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); return object; }; /** - * Converts this DeleteGlossaryMetadata to JSON. + * Converts this BatchTranslateDocumentResponse to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse * @instance * @returns {Object.} JSON object */ - DeleteGlossaryMetadata.prototype.toJSON = function toJSON() { + BatchTranslateDocumentResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} SUCCEEDED=2 SUCCEEDED value - * @property {number} FAILED=3 FAILED value - * @property {number} CANCELLING=4 CANCELLING value - * @property {number} CANCELLED=5 CANCELLED value - */ - DeleteGlossaryMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "SUCCEEDED"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "CANCELLING"] = 4; - values[valuesById[5] = "CANCELLED"] = 5; - return values; - })(); - - return DeleteGlossaryMetadata; + return BatchTranslateDocumentResponse; })(); - v3beta1.DeleteGlossaryResponse = (function() { + v3beta1.BatchTranslateDocumentMetadata = (function() { /** - * Properties of a DeleteGlossaryResponse. + * Properties of a BatchTranslateDocumentMetadata. * @memberof google.cloud.translation.v3beta1 - * @interface IDeleteGlossaryResponse - * @property {string|null} [name] DeleteGlossaryResponse name - * @property {google.protobuf.ITimestamp|null} [submitTime] DeleteGlossaryResponse submitTime - * @property {google.protobuf.ITimestamp|null} [endTime] DeleteGlossaryResponse endTime + * @interface IBatchTranslateDocumentMetadata + * @property {google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State|null} [state] BatchTranslateDocumentMetadata state + * @property {number|Long|null} [totalPages] BatchTranslateDocumentMetadata totalPages + * @property {number|Long|null} [translatedPages] BatchTranslateDocumentMetadata translatedPages + * @property {number|Long|null} [failedPages] BatchTranslateDocumentMetadata failedPages + * @property {number|Long|null} [totalBillablePages] BatchTranslateDocumentMetadata totalBillablePages + * @property {number|Long|null} [totalCharacters] BatchTranslateDocumentMetadata totalCharacters + * @property {number|Long|null} [translatedCharacters] BatchTranslateDocumentMetadata translatedCharacters + * @property {number|Long|null} [failedCharacters] BatchTranslateDocumentMetadata failedCharacters + * @property {number|Long|null} [totalBillableCharacters] BatchTranslateDocumentMetadata totalBillableCharacters + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateDocumentMetadata submitTime */ /** - * Constructs a new DeleteGlossaryResponse. + * Constructs a new BatchTranslateDocumentMetadata. * @memberof google.cloud.translation.v3beta1 - * @classdesc Represents a DeleteGlossaryResponse. - * @implements IDeleteGlossaryResponse + * @classdesc Represents a BatchTranslateDocumentMetadata. + * @implements IBatchTranslateDocumentMetadata * @constructor - * @param {google.cloud.translation.v3beta1.IDeleteGlossaryResponse=} [properties] Properties to set + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata=} [properties] Properties to set */ - function DeleteGlossaryResponse(properties) { + function BatchTranslateDocumentMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15427,101 +18527,192 @@ } /** - * DeleteGlossaryResponse name. - * @member {string} name - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * BatchTranslateDocumentMetadata state. + * @member {google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State} state + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.state = 0; + + /** + * BatchTranslateDocumentMetadata totalPages. + * @member {number|Long} totalPages + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.totalPages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentMetadata translatedPages. + * @member {number|Long} translatedPages + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.translatedPages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentMetadata failedPages. + * @member {number|Long} failedPages + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.failedPages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentMetadata totalBillablePages. + * @member {number|Long} totalBillablePages + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.totalBillablePages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentMetadata totalCharacters. + * @member {number|Long} totalCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentMetadata translatedCharacters. + * @member {number|Long} translatedCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentMetadata failedCharacters. + * @member {number|Long} failedCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata * @instance */ - DeleteGlossaryResponse.prototype.name = ""; + BatchTranslateDocumentMetadata.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * DeleteGlossaryResponse submitTime. - * @member {google.protobuf.ITimestamp|null|undefined} submitTime - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * BatchTranslateDocumentMetadata totalBillableCharacters. + * @member {number|Long} totalBillableCharacters + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata * @instance */ - DeleteGlossaryResponse.prototype.submitTime = null; + BatchTranslateDocumentMetadata.prototype.totalBillableCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * DeleteGlossaryResponse endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * BatchTranslateDocumentMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata * @instance */ - DeleteGlossaryResponse.prototype.endTime = null; + BatchTranslateDocumentMetadata.prototype.submitTime = null; /** - * Creates a new DeleteGlossaryResponse instance using the specified properties. + * Creates a new BatchTranslateDocumentMetadata instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata * @static - * @param {google.cloud.translation.v3beta1.IDeleteGlossaryResponse=} [properties] Properties to set - * @returns {google.cloud.translation.v3beta1.DeleteGlossaryResponse} DeleteGlossaryResponse instance + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata} BatchTranslateDocumentMetadata instance */ - DeleteGlossaryResponse.create = function create(properties) { - return new DeleteGlossaryResponse(properties); + BatchTranslateDocumentMetadata.create = function create(properties) { + return new BatchTranslateDocumentMetadata(properties); }; /** - * Encodes the specified DeleteGlossaryResponse message. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryResponse.verify|verify} messages. + * Encodes the specified BatchTranslateDocumentMetadata message. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata * @static - * @param {google.cloud.translation.v3beta1.IDeleteGlossaryResponse} message DeleteGlossaryResponse message or plain object to encode + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata} message BatchTranslateDocumentMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGlossaryResponse.encode = function encode(message, writer) { + BatchTranslateDocumentMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.totalPages != null && Object.hasOwnProperty.call(message, "totalPages")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.totalPages); + if (message.translatedPages != null && Object.hasOwnProperty.call(message, "translatedPages")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.translatedPages); + if (message.failedPages != null && Object.hasOwnProperty.call(message, "failedPages")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failedPages); + if (message.totalBillablePages != null && Object.hasOwnProperty.call(message, "totalBillablePages")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalBillablePages); + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.totalCharacters); + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.translatedCharacters); + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.failedCharacters); + if (message.totalBillableCharacters != null && Object.hasOwnProperty.call(message, "totalBillableCharacters")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.totalBillableCharacters); if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) - $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteGlossaryResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.DeleteGlossaryResponse.verify|verify} messages. + * Encodes the specified BatchTranslateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata * @static - * @param {google.cloud.translation.v3beta1.IDeleteGlossaryResponse} message DeleteGlossaryResponse message or plain object to encode + * @param {google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata} message BatchTranslateDocumentMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGlossaryResponse.encodeDelimited = function encodeDelimited(message, writer) { + BatchTranslateDocumentMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteGlossaryResponse message from the specified reader or buffer. + * Decodes a BatchTranslateDocumentMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3beta1.DeleteGlossaryResponse} DeleteGlossaryResponse + * @returns {google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata} BatchTranslateDocumentMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGlossaryResponse.decode = function decode(reader, length) { + BatchTranslateDocumentMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.state = reader.int32(); break; case 2: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.totalPages = reader.int64(); break; case 3: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.translatedPages = reader.int64(); + break; + case 4: + message.failedPages = reader.int64(); + break; + case 5: + message.totalBillablePages = reader.int64(); + break; + case 6: + message.totalCharacters = reader.int64(); + break; + case 7: + message.translatedCharacters = reader.int64(); + break; + case 8: + message.failedCharacters = reader.int64(); + break; + case 9: + message.totalBillableCharacters = reader.int64(); + break; + case 10: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -15532,114 +18723,332 @@ }; /** - * Decodes a DeleteGlossaryResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchTranslateDocumentMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3beta1.DeleteGlossaryResponse} DeleteGlossaryResponse + * @returns {google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata} BatchTranslateDocumentMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGlossaryResponse.decodeDelimited = function decodeDelimited(reader) { + BatchTranslateDocumentMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteGlossaryResponse message. + * Verifies a BatchTranslateDocumentMetadata message. * @function verify - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteGlossaryResponse.verify = function verify(message) { + BatchTranslateDocumentMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + if (!$util.isInteger(message.totalPages) && !(message.totalPages && $util.isInteger(message.totalPages.low) && $util.isInteger(message.totalPages.high))) + return "totalPages: integer|Long expected"; + if (message.translatedPages != null && message.hasOwnProperty("translatedPages")) + if (!$util.isInteger(message.translatedPages) && !(message.translatedPages && $util.isInteger(message.translatedPages.low) && $util.isInteger(message.translatedPages.high))) + return "translatedPages: integer|Long expected"; + if (message.failedPages != null && message.hasOwnProperty("failedPages")) + if (!$util.isInteger(message.failedPages) && !(message.failedPages && $util.isInteger(message.failedPages.low) && $util.isInteger(message.failedPages.high))) + return "failedPages: integer|Long expected"; + if (message.totalBillablePages != null && message.hasOwnProperty("totalBillablePages")) + if (!$util.isInteger(message.totalBillablePages) && !(message.totalBillablePages && $util.isInteger(message.totalBillablePages.low) && $util.isInteger(message.totalBillablePages.high))) + return "totalBillablePages: integer|Long expected"; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) + return "totalCharacters: integer|Long expected"; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) + return "translatedCharacters: integer|Long expected"; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) + return "failedCharacters: integer|Long expected"; + if (message.totalBillableCharacters != null && message.hasOwnProperty("totalBillableCharacters")) + if (!$util.isInteger(message.totalBillableCharacters) && !(message.totalBillableCharacters && $util.isInteger(message.totalBillableCharacters.low) && $util.isInteger(message.totalBillableCharacters.high))) + return "totalBillableCharacters: integer|Long expected"; if (message.submitTime != null && message.hasOwnProperty("submitTime")) { var error = $root.google.protobuf.Timestamp.verify(message.submitTime); if (error) return "submitTime." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } return null; }; /** - * Creates a DeleteGlossaryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchTranslateDocumentMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3beta1.DeleteGlossaryResponse} DeleteGlossaryResponse + * @returns {google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata} BatchTranslateDocumentMetadata */ - DeleteGlossaryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3beta1.DeleteGlossaryResponse) + BatchTranslateDocumentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata) return object; - var message = new $root.google.cloud.translation.v3beta1.DeleteGlossaryResponse(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.totalPages != null) + if ($util.Long) + (message.totalPages = $util.Long.fromValue(object.totalPages)).unsigned = false; + else if (typeof object.totalPages === "string") + message.totalPages = parseInt(object.totalPages, 10); + else if (typeof object.totalPages === "number") + message.totalPages = object.totalPages; + else if (typeof object.totalPages === "object") + message.totalPages = new $util.LongBits(object.totalPages.low >>> 0, object.totalPages.high >>> 0).toNumber(); + if (object.translatedPages != null) + if ($util.Long) + (message.translatedPages = $util.Long.fromValue(object.translatedPages)).unsigned = false; + else if (typeof object.translatedPages === "string") + message.translatedPages = parseInt(object.translatedPages, 10); + else if (typeof object.translatedPages === "number") + message.translatedPages = object.translatedPages; + else if (typeof object.translatedPages === "object") + message.translatedPages = new $util.LongBits(object.translatedPages.low >>> 0, object.translatedPages.high >>> 0).toNumber(); + if (object.failedPages != null) + if ($util.Long) + (message.failedPages = $util.Long.fromValue(object.failedPages)).unsigned = false; + else if (typeof object.failedPages === "string") + message.failedPages = parseInt(object.failedPages, 10); + else if (typeof object.failedPages === "number") + message.failedPages = object.failedPages; + else if (typeof object.failedPages === "object") + message.failedPages = new $util.LongBits(object.failedPages.low >>> 0, object.failedPages.high >>> 0).toNumber(); + if (object.totalBillablePages != null) + if ($util.Long) + (message.totalBillablePages = $util.Long.fromValue(object.totalBillablePages)).unsigned = false; + else if (typeof object.totalBillablePages === "string") + message.totalBillablePages = parseInt(object.totalBillablePages, 10); + else if (typeof object.totalBillablePages === "number") + message.totalBillablePages = object.totalBillablePages; + else if (typeof object.totalBillablePages === "object") + message.totalBillablePages = new $util.LongBits(object.totalBillablePages.low >>> 0, object.totalBillablePages.high >>> 0).toNumber(); + if (object.totalCharacters != null) + if ($util.Long) + (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; + else if (typeof object.totalCharacters === "string") + message.totalCharacters = parseInt(object.totalCharacters, 10); + else if (typeof object.totalCharacters === "number") + message.totalCharacters = object.totalCharacters; + else if (typeof object.totalCharacters === "object") + message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); + if (object.translatedCharacters != null) + if ($util.Long) + (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; + else if (typeof object.translatedCharacters === "string") + message.translatedCharacters = parseInt(object.translatedCharacters, 10); + else if (typeof object.translatedCharacters === "number") + message.translatedCharacters = object.translatedCharacters; + else if (typeof object.translatedCharacters === "object") + message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); + if (object.failedCharacters != null) + if ($util.Long) + (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; + else if (typeof object.failedCharacters === "string") + message.failedCharacters = parseInt(object.failedCharacters, 10); + else if (typeof object.failedCharacters === "number") + message.failedCharacters = object.failedCharacters; + else if (typeof object.failedCharacters === "object") + message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); + if (object.totalBillableCharacters != null) + if ($util.Long) + (message.totalBillableCharacters = $util.Long.fromValue(object.totalBillableCharacters)).unsigned = false; + else if (typeof object.totalBillableCharacters === "string") + message.totalBillableCharacters = parseInt(object.totalBillableCharacters, 10); + else if (typeof object.totalBillableCharacters === "number") + message.totalBillableCharacters = object.totalBillableCharacters; + else if (typeof object.totalBillableCharacters === "object") + message.totalBillableCharacters = new $util.LongBits(object.totalBillableCharacters.low >>> 0, object.totalBillableCharacters.high >>> 0).toNumber(); if (object.submitTime != null) { if (typeof object.submitTime !== "object") - throw TypeError(".google.cloud.translation.v3beta1.DeleteGlossaryResponse.submitTime: object expected"); + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.submitTime: object expected"); message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.translation.v3beta1.DeleteGlossaryResponse.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } return message; }; /** - * Creates a plain object from a DeleteGlossaryResponse message. Also converts values to other types if specified. + * Creates a plain object from a BatchTranslateDocumentMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata * @static - * @param {google.cloud.translation.v3beta1.DeleteGlossaryResponse} message DeleteGlossaryResponse + * @param {google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata} message BatchTranslateDocumentMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteGlossaryResponse.toObject = function toObject(message, options) { + BatchTranslateDocumentMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalPages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalPages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedPages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedPages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedPages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedPages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalBillablePages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalBillablePages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalBillableCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalBillableCharacters = options.longs === String ? "0" : 0; object.submitTime = null; - object.endTime = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State[message.state] : message.state; + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + if (typeof message.totalPages === "number") + object.totalPages = options.longs === String ? String(message.totalPages) : message.totalPages; + else + object.totalPages = options.longs === String ? $util.Long.prototype.toString.call(message.totalPages) : options.longs === Number ? new $util.LongBits(message.totalPages.low >>> 0, message.totalPages.high >>> 0).toNumber() : message.totalPages; + if (message.translatedPages != null && message.hasOwnProperty("translatedPages")) + if (typeof message.translatedPages === "number") + object.translatedPages = options.longs === String ? String(message.translatedPages) : message.translatedPages; + else + object.translatedPages = options.longs === String ? $util.Long.prototype.toString.call(message.translatedPages) : options.longs === Number ? new $util.LongBits(message.translatedPages.low >>> 0, message.translatedPages.high >>> 0).toNumber() : message.translatedPages; + if (message.failedPages != null && message.hasOwnProperty("failedPages")) + if (typeof message.failedPages === "number") + object.failedPages = options.longs === String ? String(message.failedPages) : message.failedPages; + else + object.failedPages = options.longs === String ? $util.Long.prototype.toString.call(message.failedPages) : options.longs === Number ? new $util.LongBits(message.failedPages.low >>> 0, message.failedPages.high >>> 0).toNumber() : message.failedPages; + if (message.totalBillablePages != null && message.hasOwnProperty("totalBillablePages")) + if (typeof message.totalBillablePages === "number") + object.totalBillablePages = options.longs === String ? String(message.totalBillablePages) : message.totalBillablePages; + else + object.totalBillablePages = options.longs === String ? $util.Long.prototype.toString.call(message.totalBillablePages) : options.longs === Number ? new $util.LongBits(message.totalBillablePages.low >>> 0, message.totalBillablePages.high >>> 0).toNumber() : message.totalBillablePages; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (typeof message.totalCharacters === "number") + object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; + else + object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (typeof message.translatedCharacters === "number") + object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; + else + object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (typeof message.failedCharacters === "number") + object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; + else + object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; + if (message.totalBillableCharacters != null && message.hasOwnProperty("totalBillableCharacters")) + if (typeof message.totalBillableCharacters === "number") + object.totalBillableCharacters = options.longs === String ? String(message.totalBillableCharacters) : message.totalBillableCharacters; + else + object.totalBillableCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalBillableCharacters) : options.longs === Number ? new $util.LongBits(message.totalBillableCharacters.low >>> 0, message.totalBillableCharacters.high >>> 0).toNumber() : message.totalBillableCharacters; if (message.submitTime != null && message.hasOwnProperty("submitTime")) object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); return object; }; /** - * Converts this DeleteGlossaryResponse to JSON. + * Converts this BatchTranslateDocumentMetadata to JSON. * @function toJSON - * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata * @instance * @returns {Object.} JSON object */ - DeleteGlossaryResponse.prototype.toJSON = function toJSON() { + BatchTranslateDocumentMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteGlossaryResponse; + /** + * State enum. + * @name google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + BatchTranslateDocumentMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return BatchTranslateDocumentMetadata; })(); return v3beta1; diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index 64b1cab3277..e2200eb4598 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -974,6 +974,22 @@ } ] }, + "TranslateDocument": { + "requestType": "TranslateDocumentRequest", + "responseType": "TranslateDocumentResponse", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}:translateDocument", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*}:translateDocument", + "body": "*" + } + } + ] + }, "BatchTranslateText": { "requestType": "BatchTranslateTextRequest", "responseType": "google.longrunning.Operation", @@ -998,6 +1014,30 @@ } ] }, + "BatchTranslateDocument": { + "requestType": "BatchTranslateDocumentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}:batchTranslateDocument", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "BatchTranslateDocumentResponse", + "(google.longrunning.operation_info).metadata_type": "BatchTranslateDocumentMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*}:batchTranslateDocument", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchTranslateDocumentResponse", + "metadata_type": "BatchTranslateDocumentMetadata" + } + } + ] + }, "CreateGlossary": { "requestType": "CreateGlossaryRequest", "responseType": "google.longrunning.Operation", @@ -1039,9 +1079,6 @@ "get": "/v3beta1/{parent=projects/*/locations/*}/glossaries" } }, - { - "(google.api.method_signature)": "parent" - }, { "(google.api.method_signature)": "parent,filter" } @@ -1246,7 +1283,10 @@ "labels": { "keyType": "string", "type": "string", - "id": 6 + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1385,6 +1425,153 @@ } } }, + "DocumentInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "content", + "gcsSource" + ] + } + }, + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "gcsSource": { + "type": "GcsSource", + "id": 2 + }, + "mimeType": { + "type": "string", + "id": 4 + } + } + }, + "DocumentOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mimeType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TranslateDocumentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceLanguageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "targetLanguageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "documentInputConfig": { + "type": "DocumentInputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "documentOutputConfig": { + "type": "DocumentOutputConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "model": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "glossaryConfig": { + "type": "TranslateTextGlossaryConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DocumentTranslation": { + "fields": { + "byteStreamOutputs": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + }, + "detectedLanguageCode": { + "type": "string", + "id": 3 + } + } + }, + "TranslateDocumentResponse": { + "fields": { + "documentTranslation": { + "type": "DocumentTranslation", + "id": 1 + }, + "glossaryDocumentTranslation": { + "type": "DocumentTranslation", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + }, + "glossaryConfig": { + "type": "TranslateTextGlossaryConfig", + "id": 4 + } + } + }, "BatchTranslateTextRequest": { "fields": { "parent": { @@ -1765,6 +1952,193 @@ "id": 3 } } + }, + "BatchTranslateDocumentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceLanguageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputConfigs": { + "rule": "repeated", + "type": "BatchDocumentInputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "BatchDocumentOutputConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "models": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "glossaries": { + "keyType": "string", + "type": "TranslateTextGlossaryConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchDocumentInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + } + } + }, + "BatchDocumentOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + } + } + }, + "BatchTranslateDocumentResponse": { + "fields": { + "totalPages": { + "type": "int64", + "id": 1 + }, + "translatedPages": { + "type": "int64", + "id": 2 + }, + "failedPages": { + "type": "int64", + "id": 3 + }, + "totalBillablePages": { + "type": "int64", + "id": 4 + }, + "totalCharacters": { + "type": "int64", + "id": 5 + }, + "translatedCharacters": { + "type": "int64", + "id": 6 + }, + "failedCharacters": { + "type": "int64", + "id": 7 + }, + "totalBillableCharacters": { + "type": "int64", + "id": 8 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + } + }, + "BatchTranslateDocumentMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "totalPages": { + "type": "int64", + "id": 2 + }, + "translatedPages": { + "type": "int64", + "id": 3 + }, + "failedPages": { + "type": "int64", + "id": 4 + }, + "totalBillablePages": { + "type": "int64", + "id": 5 + }, + "totalCharacters": { + "type": "int64", + "id": 6 + }, + "translatedCharacters": { + "type": "int64", + "id": 7 + }, + "failedCharacters": { + "type": "int64", + "id": 8 + }, + "totalBillableCharacters": { + "type": "int64", + "id": 9 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "SUCCEEDED": 2, + "FAILED": 3, + "CANCELLING": 4, + "CANCELLED": 5 + } + } + } } } } diff --git a/packages/google-cloud-translate/src/v3beta1/gapic_metadata.json b/packages/google-cloud-translate/src/v3beta1/gapic_metadata.json index 8a34399c0d1..4c7891e520f 100644 --- a/packages/google-cloud-translate/src/v3beta1/gapic_metadata.json +++ b/packages/google-cloud-translate/src/v3beta1/gapic_metadata.json @@ -25,6 +25,11 @@ "getSupportedLanguages" ] }, + "TranslateDocument": { + "methods": [ + "translateDocument" + ] + }, "GetGlossary": { "methods": [ "getGlossary" @@ -35,6 +40,11 @@ "batchTranslateText" ] }, + "BatchTranslateDocument": { + "methods": [ + "batchTranslateDocument" + ] + }, "CreateGlossary": { "methods": [ "createGlossary" @@ -72,6 +82,11 @@ "getSupportedLanguages" ] }, + "TranslateDocument": { + "methods": [ + "translateDocument" + ] + }, "GetGlossary": { "methods": [ "getGlossary" @@ -82,6 +97,11 @@ "batchTranslateText" ] }, + "BatchTranslateDocument": { + "methods": [ + "batchTranslateDocument" + ] + }, "CreateGlossary": { "methods": [ "createGlossary" diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 8cf11d89752..95b96cf5b77 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -209,6 +209,12 @@ export class TranslationServiceClient { const batchTranslateTextMetadata = protoFilesRoot.lookup( '.google.cloud.translation.v3beta1.BatchTranslateMetadata' ) as gax.protobuf.Type; + const batchTranslateDocumentResponse = protoFilesRoot.lookup( + '.google.cloud.translation.v3beta1.BatchTranslateDocumentResponse' + ) as gax.protobuf.Type; + const batchTranslateDocumentMetadata = protoFilesRoot.lookup( + '.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata' + ) as gax.protobuf.Type; const createGlossaryResponse = protoFilesRoot.lookup( '.google.cloud.translation.v3beta1.Glossary' ) as gax.protobuf.Type; @@ -228,6 +234,15 @@ export class TranslationServiceClient { batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) ), + batchTranslateDocument: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchTranslateDocumentResponse.decode.bind( + batchTranslateDocumentResponse + ), + batchTranslateDocumentMetadata.decode.bind( + batchTranslateDocumentMetadata + ) + ), createGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGlossaryResponse.decode.bind(createGlossaryResponse), @@ -290,7 +305,9 @@ export class TranslationServiceClient { 'translateText', 'detectLanguage', 'getSupportedLanguages', + 'translateDocument', 'batchTranslateText', + 'batchTranslateDocument', 'createGlossary', 'listGlossaries', 'getGlossary', @@ -420,7 +437,8 @@ export class TranslationServiceClient { * The request object that will be sent. * @param {string[]} request.contents * Required. The content of the input in string format. - * We recommend the total content be less than 30k codepoints. + * We recommend the total content be less than 30k codepoints. The max length + * of this field is 1024. * Use BatchTranslateText for larger text. * @param {string} [request.mimeType] * Optional. The format of the source text, for example, "text/html", @@ -438,11 +456,11 @@ export class TranslationServiceClient { * Required. Project or location to make a call. Must refer to a caller's * project. * - * Format: `projects/{project-id}` or - * `projects/{project-id}/locations/{location-id}`. + * Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. * - * For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. * * Non-global location is required for requests using AutoML models or * custom glossaries. @@ -455,16 +473,16 @@ export class TranslationServiceClient { * The format depends on model type: * * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * * * For global (non-regionalized) requests, use `location-id` `global`. * For example, - * `projects/{project-id}/locations/global/models/general/nmt`. + * `projects/{project-number-or-id}/locations/global/models/general/nmt`. * * If missing, the system decides which google base model to use. * @param {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} [request.glossaryConfig] @@ -577,22 +595,22 @@ export class TranslationServiceClient { * Required. Project or location to make a call. Must refer to a caller's * project. * - * Format: `projects/{project-id}/locations/{location-id}` or - * `projects/{project-id}`. + * Format: `projects/{project-number-or-id}/locations/{location-id}` or + * `projects/{project-number-or-id}`. * - * For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. * - * Only models within the same region (has same location-id) can be used. + * Only models within the same region, which have the same location-id, can be used. * Otherwise an INVALID_ARGUMENT (400) error is returned. * @param {string} [request.model] * Optional. The language detection model to be used. * * Format: - * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` * * Only one language detection model is currently supported: - * `projects/{project-id}/locations/{location-id}/models/language-detection/default`. + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. * * If not specified, the default model is used. * @param {string} request.content @@ -600,7 +618,7 @@ export class TranslationServiceClient { * @param {string} [request.mimeType] * Optional. The format of the source text, for example, "text/html", * "text/plain". If left blank, the MIME type defaults to "text/html". - * @param {number[]} request.labels + * @param {number[]} [request.labels] * Optional. The labels with user-defined metadata for the request. * * Label keys and values can be no longer than 63 characters @@ -709,11 +727,11 @@ export class TranslationServiceClient { * Required. Project or location to make a call. Must refer to a caller's * project. * - * Format: `projects/{project-id}` or - * `projects/{project-id}/locations/{location-id}`. + * Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. * - * For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. * * Non-global location is required for AutoML models. * @@ -729,11 +747,11 @@ export class TranslationServiceClient { * The format depends on model type: * * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * * * Returns languages supported by the specified model. @@ -795,6 +813,162 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.getSupportedLanguages(request, options, callback); } + translateDocument( + request: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, + ( + | protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest + | undefined + ), + {} | undefined + ] + >; + translateDocument( + request: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, + | protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + translateDocument( + request: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, + | protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Translates documents in synchronous mode. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Location to make a regional call. + * + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * + * Non-global location is required for requests using AutoML models or custom + * glossaries. + * + * Models and glossaries must be within the same region (have the same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.sourceLanguageCode] + * Optional. The BCP-47 language code of the input document if known, for + * example, "en-US" or "sr-Latn". Supported language codes are listed in + * Language Support. If the source language isn't specified, the API attempts + * to identify the source language automatically and returns the source + * language within the response. Source language must be specified if the + * request contains a glossary or a custom model. + * @param {string} request.targetLanguageCode + * Required. The BCP-47 language code to use for translation of the input + * document, set to one of the language codes listed in Language Support. + * @param {google.cloud.translation.v3beta1.DocumentInputConfig} request.documentInputConfig + * Required. Input configurations. + * @param {google.cloud.translation.v3beta1.DocumentOutputConfig} [request.documentOutputConfig] + * Optional. Output configurations. + * Defines if the output file should be stored within Cloud Storage as well + * as the desired output format. If not provided the translated file will + * only be returned through a byte-stream and its output mime type will be + * the same as the input file's mime type. + * @param {string} [request.model] + * Optional. The `model` type requested for this translation. + * + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * + * + * If not provided, the default Google model (NMT) will be used for + * translation. + * @param {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} [request.glossaryConfig] + * Optional. Glossary to be applied. The glossary must be within the same + * region (have the same location-id) as the model, otherwise an + * INVALID_ARGUMENT (400) error is returned. + * @param {number[]} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters (Unicode + * codepoints), can only contain lowercase letters, numeric characters, + * underscores and dashes. International characters are allowed. Label values + * are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TranslateDocumentResponse]{@link google.cloud.translation.v3beta1.TranslateDocumentResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.translateDocument(request); + */ + translateDocument( + request: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, + | protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, + | protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, + ( + | protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.translateDocument(request, options, callback); + } getGlossary( request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, options?: CallOptions @@ -939,7 +1113,7 @@ export class TranslationServiceClient { * @param {string} request.parent * Required. Location to make a call. Must refer to a caller's project. * - * Format: `projects/{project-id}/locations/{location-id}`. + * Format: `projects/{project-number-or-id}/locations/{location-id}`. * * The `global` location is not supported for batch translation. * @@ -952,24 +1126,24 @@ export class TranslationServiceClient { * Required. Specify up to 10 language codes here. * @param {number[]} [request.models] * Optional. The models to use for translation. Map's key is target language - * code. Map's value is model name. Value can be a built-in general model, + * code. Map's value is the model name. Value can be a built-in general model, * or an AutoML Translation model. * * The value format depends on model type: * * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * * * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @param {number[]} request.inputConfigs * Required. Input configurations. - * The total number of files matched should be <= 1000. + * The total number of files matched should be <= 100. * The total content size should be <= 100M Unicode codepoints. * The files must use UTF-8 encoding. * @param {google.cloud.translation.v3beta1.OutputConfig} request.outputConfig @@ -1087,6 +1261,201 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3beta1.BatchTranslateMetadata >; } + batchTranslateDocument( + request: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchTranslateDocument( + request: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchTranslateDocument( + request: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Translates a large volume of documents in asynchronous batch mode. + * This function provides real-time output as the inputs are being processed. + * If caller cancels a request, the partial results (for an input file, it's + * all or nothing) may still be available on the specified output location. + * + * This call returns immediately and you can use + * google.longrunning.Operation.name to poll the status of the call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Location to make a regional call. + * + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * + * The `global` location is not supported for batch translation. + * + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. + * @param {string} request.sourceLanguageCode + * Required. The BCP-47 language code of the input document if known, for + * example, "en-US" or "sr-Latn". Supported language codes are listed in + * Language Support (https://cloud.google.com/translate/docs/languages). + * @param {string[]} request.targetLanguageCodes + * Required. The BCP-47 language code to use for translation of the input + * document. Specify up to 10 language codes here. + * @param {number[]} request.inputConfigs + * Required. Input configurations. + * The total number of files matched should be <= 100. + * The total content size to translate should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + * @param {google.cloud.translation.v3beta1.BatchDocumentOutputConfig} request.outputConfig + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + * @param {number[]} [request.models] + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is the model name. Value can be a built-in general model, + * or an AutoML Translation model. + * + * The value format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * + * + * If the map is empty or a specific model is not requested for a language + * pair, then default google model (nmt) is used. + * @param {number[]} [request.glossaries] + * Optional. Glossaries to be applied. It's keyed by target language code. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.batchTranslateDocument(request); + * const [response] = await operation.promise(); + */ + batchTranslateDocument( + request: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchTranslateDocument( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `batchTranslateDocument()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkBatchTranslateDocumentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkBatchTranslateDocumentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.translation.v3beta1.BatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.batchTranslateDocument, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.translation.v3beta1.BatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata + >; + } createGlossary( request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, options?: CallOptions @@ -1425,7 +1794,20 @@ export class TranslationServiceClient { * The first page is returned if `page_token`is empty or missing. * @param {string} [request.filter] * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. + * Specify the constraint by the format of "key=value", where key must be + * "src" or "tgt", and the value must be a valid language code. + * For multiple restrictions, concatenate them by "AND" (uppercase only), + * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + * here, which means using 'en-US' and 'en' can lead to different results, + * which depends on the language code you used when you create the glossary. + * For the unidirectional glossaries, the "src" and "tgt" add restrictions + * on the source and target language code separately. + * For the equivalent term set glossaries, the "src" and/or "tgt" add + * restrictions on the term set. + * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + * glossaries which exactly match the source language code as "en-US" and the + * target language code "zh-CN", but all equivalent term set glossaries which + * contain "en-US" and "zh-CN" in their language set will be picked. * If missing, no filtering is performed. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1501,7 +1883,20 @@ export class TranslationServiceClient { * The first page is returned if `page_token`is empty or missing. * @param {string} [request.filter] * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. + * Specify the constraint by the format of "key=value", where key must be + * "src" or "tgt", and the value must be a valid language code. + * For multiple restrictions, concatenate them by "AND" (uppercase only), + * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + * here, which means using 'en-US' and 'en' can lead to different results, + * which depends on the language code you used when you create the glossary. + * For the unidirectional glossaries, the "src" and "tgt" add restrictions + * on the source and target language code separately. + * For the equivalent term set glossaries, the "src" and/or "tgt" add + * restrictions on the term set. + * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + * glossaries which exactly match the source language code as "en-US" and the + * target language code "zh-CN", but all equivalent term set glossaries which + * contain "en-US" and "zh-CN" in their language set will be picked. * If missing, no filtering is performed. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1555,7 +1950,20 @@ export class TranslationServiceClient { * The first page is returned if `page_token`is empty or missing. * @param {string} [request.filter] * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. + * Specify the constraint by the format of "key=value", where key must be + * "src" or "tgt", and the value must be a valid language code. + * For multiple restrictions, concatenate them by "AND" (uppercase only), + * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + * here, which means using 'en-US' and 'en' can lead to different results, + * which depends on the language code you used when you create the glossary. + * For the unidirectional glossaries, the "src" and "tgt" add restrictions + * on the source and target language code separately. + * For the equivalent term set glossaries, the "src" and/or "tgt" add + * restrictions on the term set. + * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + * glossaries which exactly match the source language code as "en-US" and the + * target language code "zh-CN", but all equivalent term set glossaries which + * contain "en-US" and "zh-CN" in their language set will be picked. * If missing, no filtering is performed. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json index 0e66a2202d9..bbf1a651f11 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client_config.json @@ -35,11 +35,21 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "TranslateDocument": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "BatchTranslateText": { "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "BatchTranslateDocument": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "CreateGlossary": { "timeout_millis": 600000, "retry_codes_name": "non_idempotent", diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata index ce126eb7426..79b05660722 100644 --- a/packages/google-cloud-translate/synth.metadata +++ b/packages/google-cloud-translate/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "a23635ac8bcf7ce9586785e387adc7925083f8f2" + "sha": "7c39b15c23e8f84ec682bb431ed2f48b5bb139e5" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", - "internalRef": "361273630" + "sha": "d6b4fb337caf6eccb606728ef727ac76364a4f14", + "internalRef": "364358156" } }, { diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts index 8453e2763c2..eec8ba4c25f 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -597,6 +597,124 @@ describe('v3beta1.TranslationServiceClient', () => { }); }); + describe('translateDocument', () => { + it('invokes translateDocument without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateDocumentResponse() + ); + client.innerApiCalls.translateDocument = stubSimpleCall(expectedResponse); + const [response] = await client.translateDocument(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.translateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes translateDocument without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateDocumentResponse() + ); + client.innerApiCalls.translateDocument = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.translateDocument( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.translateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes translateDocument with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.translateDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.translateDocument(request), expectedError); + assert( + (client.innerApiCalls.translateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getGlossary', () => { it('invokes getGlossary without error', async () => { const client = new translationserviceModule.v3beta1.TranslationServiceClient( @@ -923,6 +1041,217 @@ describe('v3beta1.TranslationServiceClient', () => { }); }); + describe('batchTranslateDocument', () => { + it('invokes batchTranslateDocument without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchTranslateDocument = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.batchTranslateDocument(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchTranslateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchTranslateDocument without error using callback', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchTranslateDocument = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.batchTranslateDocument( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchTranslateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes batchTranslateDocument with call error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateDocument = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.batchTranslateDocument(request), + expectedError + ); + assert( + (client.innerApiCalls.batchTranslateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchTranslateDocument with LRO error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateDocument = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchTranslateDocument(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.batchTranslateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkBatchTranslateDocumentProgress without error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchTranslateDocumentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchTranslateDocumentProgress with error', async () => { + const client = new translationserviceModule.v3beta1.TranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkBatchTranslateDocumentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('createGlossary', () => { it('invokes createGlossary without error', async () => { const client = new translationserviceModule.v3beta1.TranslationServiceClient( From c506edb8c55f082757847d23309ea6dda89e7e3e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 7 Apr 2021 17:24:04 +0000 Subject: [PATCH 424/513] chore: release 6.2.0 (#640) :robot: I have created a release \*beep\* \*boop\* --- ## [6.2.0](https://www.github.com/googleapis/nodejs-translate/compare/v6.1.0...v6.2.0) (2021-04-07) ### Features * added v3beta1 proto for online and batch document translation ([#639](https://www.github.com/googleapis/nodejs-translate/issues/639)) ([513c21a](https://www.github.com/googleapis/nodejs-translate/commit/513c21aabf2ece278708bca56a94bde33e80f072)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index dae3077cd99..14dd378a7b0 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [6.2.0](https://www.github.com/googleapis/nodejs-translate/compare/v6.1.0...v6.2.0) (2021-04-07) + + +### Features + +* added v3beta1 proto for online and batch document translation ([#639](https://www.github.com/googleapis/nodejs-translate/issues/639)) ([513c21a](https://www.github.com/googleapis/nodejs-translate/commit/513c21aabf2ece278708bca56a94bde33e80f072)) + ## [6.1.0](https://www.github.com/googleapis/nodejs-translate/compare/v6.0.5...v6.1.0) (2021-01-09) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 24619e30699..9faf948d98d 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.1.0", + "version": "6.2.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index c9c3a40134e..7787b1d5a25 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.1.0", + "@google-cloud/translate": "^6.2.0", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From bbf8d051b05192d0061627b16fecae77d691b602 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 23:08:04 +0200 Subject: [PATCH 425/513] chore(deps): update dependency @types/sinon to v10 (#643) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^9.0.0` -> `^10.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/9.0.11/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/compatibility-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/confidence-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 9faf948d98d..adb1e02ef6b 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -63,7 +63,7 @@ "@types/node": "^10.5.7", "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", - "@types/sinon": "^9.0.0", + "@types/sinon": "^10.0.0", "c8": "^7.0.0", "codecov": "^3.0.2", "google-auth-library": "^6.0.0", From 0b92bcd8fee4819ebc877e14d3a4bffac5299e07 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 20 Apr 2021 10:33:32 -0700 Subject: [PATCH 426/513] chore: migrate to owl bot (#647) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: migrate to owl bot * chore: copy files from googleapis-gen f43939eac6a0bb5998c1fa0f79063194e699230e * chore: run the post processor * 🦉 Updates from OwlBot Co-authored-by: Owl Bot --- .../.github/.OwlBot.yaml | 26 +++++++++++ .../.repo-metadata.json | 17 +++---- .../{synth.py => owlbot.py} | 21 +-------- .../google-cloud-translate/synth.metadata | 46 ------------------- 4 files changed, 36 insertions(+), 74 deletions(-) create mode 100644 packages/google-cloud-translate/.github/.OwlBot.yaml rename packages/google-cloud-translate/{synth.py => owlbot.py} (52%) delete mode 100644 packages/google-cloud-translate/synth.metadata diff --git a/packages/google-cloud-translate/.github/.OwlBot.yaml b/packages/google-cloud-translate/.github/.OwlBot.yaml new file mode 100644 index 00000000000..1700df3c382 --- /dev/null +++ b/packages/google-cloud-translate/.github/.OwlBot.yaml @@ -0,0 +1,26 @@ +# Copyright 2021 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. +docker: + image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/translate/(v.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: f43939eac6a0bb5998c1fa0f79063194e699230e + diff --git a/packages/google-cloud-translate/.repo-metadata.json b/packages/google-cloud-translate/.repo-metadata.json index 55e16431d8b..1d8916d2fdb 100644 --- a/packages/google-cloud-translate/.repo-metadata.json +++ b/packages/google-cloud-translate/.repo-metadata.json @@ -1,14 +1,15 @@ { - "name": "translate", - "name_pretty": "Cloud Translation", - "product_documentation": "https://cloud.google.com/translate/docs/", - "client_documentation": "https://googleapis.dev/nodejs/translate/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559749", + "distribution_name": "@google-cloud/translate", "release_level": "ga", - "language": "nodejs", + "product_documentation": "https://cloud.google.com/translate/docs/", "repo": "googleapis/nodejs-translate", - "distribution_name": "@google-cloud/translate", - "api_id": "translate.googleapis.com", + "default_version": "v3", + "language": "nodejs", "requires_billing": true, + "issue_tracker": "https://issuetracker.google.com/savedsearches/559749", + "client_documentation": "https://googleapis.dev/nodejs/translate/latest", + "name": "translate", + "name_pretty": "Cloud Translation", + "api_id": "translate.googleapis.com", "codeowner_team": "@googleapis/ml-apis" } diff --git a/packages/google-cloud-translate/synth.py b/packages/google-cloud-translate/owlbot.py similarity index 52% rename from packages/google-cloud-translate/synth.py rename to packages/google-cloud-translate/owlbot.py index b84718da7e1..d0a0d9ac3c8 100644 --- a/packages/google-cloud-translate/synth.py +++ b/packages/google-cloud-translate/owlbot.py @@ -14,25 +14,6 @@ """This script is used to synthesize generated parts of this library.""" -import synthtool as s -import synthtool.gcp as gcp import synthtool.languages.node as node -import logging -# Run the gapic generator -gapic = gcp.GAPICBazel() -versions = ['v3beta1', 'v3'] -name = 'translation' -for version in versions: - library = gapic.node_library(name, version, proto_path=f'google/cloud/translate/{version}') - s.copy(library, excludes=['README.md', 'package.json', 'src/index.ts']) - -logging.basicConfig(level=logging.DEBUG) - -AUTOSYNTH_MULTIPLE_COMMITS = True - -common_templates = gcp.CommonTemplates() -templates = common_templates.node_library(source_location='build/src') -s.copy(templates, excludes=[]) - -node.postprocess_gapic_library() +node.owlbot_main(templates_excludes=['src/index.ts']) diff --git a/packages/google-cloud-translate/synth.metadata b/packages/google-cloud-translate/synth.metadata deleted file mode 100644 index 79b05660722..00000000000 --- a/packages/google-cloud-translate/synth.metadata +++ /dev/null @@ -1,46 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-translate.git", - "sha": "7c39b15c23e8f84ec682bb431ed2f48b5bb139e5" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d6b4fb337caf6eccb606728ef727ac76364a4f14", - "internalRef": "364358156" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "translation", - "apiVersion": "v3beta1", - "language": "nodejs", - "generator": "bazel" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "translation", - "apiVersion": "v3", - "language": "nodejs", - "generator": "bazel" - } - } - ] -} \ No newline at end of file From 7a7970b5e2d5d5b792ad47643b53f554ca834abc Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 28 Apr 2021 20:58:26 -0400 Subject: [PATCH 427/513] chore: Add title back into Readme (#642) --- .../google-cloud-translate/.readme-partials.yml | 2 +- packages/google-cloud-translate/README.md | 13 ++++++------- packages/google-cloud-translate/samples/README.md | 11 +++++------ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-translate/.readme-partials.yml b/packages/google-cloud-translate/.readme-partials.yml index d4a8fcfe5d5..eb6c036f3b4 100644 --- a/packages/google-cloud-translate/.readme-partials.yml +++ b/packages/google-cloud-translate/.readme-partials.yml @@ -1,4 +1,4 @@ -title: |- +introduction: |- The [Cloud Translation API](https://cloud.google.com/translate/docs/), can dynamically translate text between thousands of language pairs. The Cloud Translation API lets websites and programs diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index f7059e061e8..674502e2d88 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -2,12 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -The [Cloud Translation API](https://cloud.google.com/translate/docs/), -can dynamically translate text between thousands -of language pairs. The Cloud Translation API lets websites and programs -integrate with the translation service programmatically. The Cloud Translation -API is part of the larger Cloud Machine Learning API family. - +# [Cloud Translation: Node.js Client](https://github.com/googleapis/nodejs-translate) [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/translate.svg)](https://www.npmjs.org/package/@google-cloud/translate) @@ -16,7 +11,11 @@ API is part of the larger Cloud Machine Learning API family. -Cloud Translation API Client Library for Node.js +The [Cloud Translation API](https://cloud.google.com/translate/docs/), +can dynamically translate text between thousands +of language pairs. The Cloud Translation API lets websites and programs +integrate with the translation service programmatically. The Cloud Translation +API is part of the larger Cloud Machine Learning API family. A comprehensive list of changes in each version may be found in diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 5dce327bfdf..5796f395683 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -2,16 +2,15 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo +# [Cloud Translation: Node.js Samples](https://github.com/googleapis/nodejs-translate) + +[![Open in Cloud Shell][shell_img]][shell_link] + The [Cloud Translation API](https://cloud.google.com/translate/docs/), can dynamically translate text between thousands of language pairs. The Cloud Translation API lets websites and programs integrate with the translation service programmatically. The Cloud Translation -API is part of the larger Cloud Machine Learning API family. Samples - - -[![Open in Cloud Shell][shell_img]][shell_link] - - +API is part of the larger Cloud Machine Learning API family. ## Table of Contents From 8808d647c30cb9fb1b4dc0a65662ceecb2fd1ed0 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 6 May 2021 18:04:04 -0700 Subject: [PATCH 428/513] fix(deps): require google-gax v2.12.0 (#657) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index adb1e02ef6b..616e6b0b3ae 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -53,7 +53,7 @@ "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^2.9.2", + "google-gax": "^2.12.0", "is-html": "^2.0.0", "protobufjs": "^6.8.8" }, From 7201827b8b956b7ad7eea571caf8173a17d9a631 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 17:00:19 +0000 Subject: [PATCH 429/513] chore: new owl bot post processor docker image (#660) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../google-cloud-translate/protos/protos.d.ts | 16 +- .../google-cloud-translate/protos/protos.js | 32 +- .../src/v3/translation_service_client.ts | 107 ++-- .../src/v3beta1/translation_service_client.ts | 125 ++--- .../test/gapic_translation_service_v3.ts | 127 ++--- .../test/gapic_translation_service_v3beta1.ts | 525 ++++++++---------- 6 files changed, 409 insertions(+), 523 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index 828d613de73..81abb38d1cd 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -685,7 +685,7 @@ export namespace google { public model: string; /** DetectLanguageRequest content. */ - public content: string; + public content?: (string|null); /** DetectLanguageRequest mimeType. */ public mimeType: string; @@ -3926,7 +3926,7 @@ export namespace google { public model: string; /** DetectLanguageRequest content. */ - public content: string; + public content?: (string|null); /** DetectLanguageRequest mimeType. */ public mimeType: string; @@ -4889,7 +4889,7 @@ export namespace google { constructor(properties?: google.cloud.translation.v3beta1.IDocumentInputConfig); /** DocumentInputConfig content. */ - public content: (Uint8Array|string); + public content?: (Uint8Array|string|null); /** DocumentInputConfig gcsSource. */ public gcsSource?: (google.cloud.translation.v3beta1.IGcsSource|null); @@ -7770,19 +7770,19 @@ export namespace google { public selector: string; /** HttpRule get. */ - public get: string; + public get?: (string|null); /** HttpRule put. */ - public put: string; + public put?: (string|null); /** HttpRule post. */ - public post: string; + public post?: (string|null); /** HttpRule delete. */ - public delete: string; + public delete?: (string|null); /** HttpRule patch. */ - public patch: string; + public patch?: (string|null); /** HttpRule custom. */ public custom?: (google.api.ICustomHttpPattern|null); diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index 5e4756b138b..e26dff40a5a 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -1533,11 +1533,11 @@ /** * DetectLanguageRequest content. - * @member {string} content + * @member {string|null|undefined} content * @memberof google.cloud.translation.v3.DetectLanguageRequest * @instance */ - DetectLanguageRequest.prototype.content = ""; + DetectLanguageRequest.prototype.content = null; /** * DetectLanguageRequest mimeType. @@ -9393,11 +9393,11 @@ /** * DetectLanguageRequest content. - * @member {string} content + * @member {string|null|undefined} content * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest * @instance */ - DetectLanguageRequest.prototype.content = ""; + DetectLanguageRequest.prototype.content = null; /** * DetectLanguageRequest mimeType. @@ -11636,11 +11636,11 @@ /** * DocumentInputConfig content. - * @member {Uint8Array} content + * @member {Uint8Array|null|undefined} content * @memberof google.cloud.translation.v3beta1.DocumentInputConfig * @instance */ - DocumentInputConfig.prototype.content = $util.newBuffer([]); + DocumentInputConfig.prototype.content = null; /** * DocumentInputConfig gcsSource. @@ -19344,43 +19344,43 @@ /** * HttpRule get. - * @member {string} get + * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.get = ""; + HttpRule.prototype.get = null; /** * HttpRule put. - * @member {string} put + * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.put = ""; + HttpRule.prototype.put = null; /** * HttpRule post. - * @member {string} post + * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.post = ""; + HttpRule.prototype.post = null; /** * HttpRule delete. - * @member {string} delete + * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype["delete"] = ""; + HttpRule.prototype["delete"] = null; /** * HttpRule patch. - * @member {string} patch + * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.patch = ""; + HttpRule.prototype.patch = null; /** * HttpRule custom. diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 99cd5d9f6d4..f9ece47319a 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -297,13 +297,14 @@ export class TranslationServiceClient { ]; for (const methodName of translationServiceStubMethods) { const callPromise = this.translationServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -525,11 +526,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.translateText(request, options, callback); } @@ -651,11 +651,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.detectLanguage(request, options, callback); } @@ -780,11 +779,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.getSupportedLanguages(request, options, callback); } @@ -867,11 +865,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getGlossary(request, options, callback); } @@ -1029,11 +1026,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.batchTranslateText(request, options, callback); } @@ -1174,11 +1170,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createGlossary(request, options, callback); } @@ -1318,11 +1313,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteGlossary(request, options, callback); } @@ -1463,11 +1457,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listGlossaries(request, options, callback); } @@ -1510,11 +1503,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGlossaries.createStream( @@ -1568,17 +1560,16 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGlossaries.asyncIterate( this.innerApiCalls['listGlossaries'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 95b96cf5b77..25fac756149 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -315,13 +315,14 @@ export class TranslationServiceClient { ]; for (const methodName of translationServiceStubMethods) { const callPromise = this.translationServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -544,11 +545,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.translateText(request, options, callback); } @@ -676,11 +676,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.detectLanguage(request, options, callback); } @@ -805,11 +804,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.getSupportedLanguages(request, options, callback); } @@ -961,11 +959,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.translateDocument(request, options, callback); } @@ -1054,11 +1051,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getGlossary(request, options, callback); } @@ -1216,11 +1212,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.batchTranslateText(request, options, callback); } @@ -1407,11 +1402,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.batchTranslateDocument( request, @@ -1556,11 +1550,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createGlossary(request, options, callback); } @@ -1700,11 +1693,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteGlossary(request, options, callback); } @@ -1858,11 +1850,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listGlossaries(request, options, callback); } @@ -1918,11 +1909,10 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGlossaries.createStream( @@ -1989,17 +1979,16 @@ export class TranslationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGlossaries.asyncIterate( this.innerApiCalls['listGlossaries'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts index b18f1caec96..028f63108ba 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -281,9 +280,8 @@ describe('v3.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateTextResponse() ); - client.innerApiCalls.translateText = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.translateText = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.translateText( request, @@ -393,9 +391,8 @@ describe('v3.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.DetectLanguageResponse() ); - client.innerApiCalls.detectLanguage = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.detectLanguage = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.detectLanguage( request, @@ -474,9 +471,8 @@ describe('v3.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.SupportedLanguages() ); - client.innerApiCalls.getSupportedLanguages = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getSupportedLanguages = + stubSimpleCall(expectedResponse); const [response] = await client.getSupportedLanguages(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -507,9 +503,8 @@ describe('v3.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.SupportedLanguages() ); - client.innerApiCalls.getSupportedLanguages = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getSupportedLanguages = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getSupportedLanguages( request, @@ -622,9 +617,8 @@ describe('v3.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.Glossary() ); - client.innerApiCalls.getGlossary = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getGlossary = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getGlossary( request, @@ -703,9 +697,8 @@ describe('v3.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchTranslateText = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.batchTranslateText = + stubLongRunningCall(expectedResponse); const [operation] = await client.batchTranslateText(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -737,9 +730,8 @@ describe('v3.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchTranslateText = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchTranslateText = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchTranslateText( request, @@ -899,9 +891,8 @@ describe('v3.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGlossary = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.createGlossary = + stubLongRunningCall(expectedResponse); const [operation] = await client.createGlossary(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -933,9 +924,8 @@ describe('v3.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGlossary = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createGlossary = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createGlossary( request, @@ -1095,9 +1085,8 @@ describe('v3.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGlossary = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.deleteGlossary = + stubLongRunningCall(expectedResponse); const [operation] = await client.deleteGlossary(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1129,9 +1118,8 @@ describe('v3.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGlossary = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteGlossary = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteGlossary( request, @@ -1338,9 +1326,8 @@ describe('v3.TranslationServiceClient', () => { new protos.google.cloud.translation.v3.Glossary() ), ]; - client.innerApiCalls.listGlossaries = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listGlossaries = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listGlossaries( request, @@ -1418,9 +1405,8 @@ describe('v3.TranslationServiceClient', () => { new protos.google.cloud.translation.v3.Glossary() ), ]; - client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listGlossaries.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listGlossariesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.translation.v3.Glossary[] = []; @@ -1445,10 +1431,9 @@ describe('v3.TranslationServiceClient', () => { .calledWith(client.innerApiCalls.listGlossaries, request) ); assert.strictEqual( - (client.descriptors.page.listGlossaries - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGlossaries.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1465,10 +1450,8 @@ describe('v3.TranslationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listGlossaries.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listGlossariesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.translation.v3.Glossary[] = []; @@ -1492,10 +1475,9 @@ describe('v3.TranslationServiceClient', () => { .calledWith(client.innerApiCalls.listGlossaries, request) ); assert.strictEqual( - (client.descriptors.page.listGlossaries - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGlossaries.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1522,9 +1504,8 @@ describe('v3.TranslationServiceClient', () => { new protos.google.cloud.translation.v3.Glossary() ), ]; - client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listGlossaries.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.translation.v3.IGlossary[] = []; const iterable = client.listGlossariesAsync(request); for await (const resource of iterable) { @@ -1532,15 +1513,15 @@ describe('v3.TranslationServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listGlossaries.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGlossaries.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1557,10 +1538,8 @@ describe('v3.TranslationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listGlossaries.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listGlossariesAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.translation.v3.IGlossary[] = []; @@ -1569,15 +1548,15 @@ describe('v3.TranslationServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listGlossaries.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGlossaries.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts index eec8ba4c25f..d5d7e7d5efd 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -165,49 +164,46 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('should create a client with no option', () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient(); + const client = + new translationserviceModule.v3beta1.TranslationServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ fallback: true, - } - ); + }); assert(client); }); it('has initialize method and supports deferred initialization', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); assert.strictEqual(client.translationServiceStub, undefined); await client.initialize(); assert(client.translationServiceStub); }); it('has close method', () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); const result = await client.getProjectId(); assert.strictEqual(result, fakeProjectId); @@ -216,12 +212,11 @@ describe('v3beta1.TranslationServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -240,12 +235,11 @@ describe('v3beta1.TranslationServiceClient', () => { describe('translateText', () => { it('invokes translateText without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateTextRequest() @@ -273,12 +267,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes translateText without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateTextRequest() @@ -295,9 +288,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateTextResponse() ); - client.innerApiCalls.translateText = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.translateText = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.translateText( request, @@ -323,12 +315,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes translateText with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateTextRequest() @@ -358,12 +349,11 @@ describe('v3beta1.TranslationServiceClient', () => { describe('detectLanguage', () => { it('invokes detectLanguage without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() @@ -391,12 +381,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes detectLanguage without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() @@ -413,9 +402,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DetectLanguageResponse() ); - client.innerApiCalls.detectLanguage = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.detectLanguage = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.detectLanguage( request, @@ -441,12 +429,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes detectLanguage with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() @@ -476,12 +463,11 @@ describe('v3beta1.TranslationServiceClient', () => { describe('getSupportedLanguages', () => { it('invokes getSupportedLanguages without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() @@ -498,9 +484,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.SupportedLanguages() ); - client.innerApiCalls.getSupportedLanguages = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getSupportedLanguages = + stubSimpleCall(expectedResponse); const [response] = await client.getSupportedLanguages(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -511,12 +496,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes getSupportedLanguages without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() @@ -533,9 +517,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.SupportedLanguages() ); - client.innerApiCalls.getSupportedLanguages = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getSupportedLanguages = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getSupportedLanguages( request, @@ -561,12 +544,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes getSupportedLanguages with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() @@ -599,12 +581,11 @@ describe('v3beta1.TranslationServiceClient', () => { describe('translateDocument', () => { it('invokes translateDocument without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateDocumentRequest() @@ -632,12 +613,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes translateDocument without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateDocumentRequest() @@ -654,9 +634,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateDocumentResponse() ); - client.innerApiCalls.translateDocument = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.translateDocument = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.translateDocument( request, @@ -682,12 +661,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes translateDocument with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateDocumentRequest() @@ -717,12 +695,11 @@ describe('v3beta1.TranslationServiceClient', () => { describe('getGlossary', () => { it('invokes getGlossary without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() @@ -750,12 +727,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes getGlossary without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() @@ -772,9 +748,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.Glossary() ); - client.innerApiCalls.getGlossary = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getGlossary = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getGlossary( request, @@ -800,12 +775,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes getGlossary with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() @@ -835,12 +809,11 @@ describe('v3beta1.TranslationServiceClient', () => { describe('batchTranslateText', () => { it('invokes batchTranslateText without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() @@ -857,9 +830,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchTranslateText = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.batchTranslateText = + stubLongRunningCall(expectedResponse); const [operation] = await client.batchTranslateText(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -871,12 +843,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes batchTranslateText without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() @@ -893,9 +864,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchTranslateText = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchTranslateText = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchTranslateText( request, @@ -928,12 +898,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes batchTranslateText with call error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() @@ -961,12 +930,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes batchTranslateText with LRO error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() @@ -996,12 +964,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes checkBatchTranslateTextProgress without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedResponse = generateSampleMessage( new operationsProtos.google.longrunning.Operation() @@ -1020,12 +987,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes checkBatchTranslateTextProgress with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedError = new Error('expected'); @@ -1043,12 +1009,11 @@ describe('v3beta1.TranslationServiceClient', () => { describe('batchTranslateDocument', () => { it('invokes batchTranslateDocument without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest() @@ -1065,9 +1030,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchTranslateDocument = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.batchTranslateDocument = + stubLongRunningCall(expectedResponse); const [operation] = await client.batchTranslateDocument(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1079,12 +1043,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes batchTranslateDocument without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest() @@ -1101,9 +1064,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchTranslateDocument = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchTranslateDocument = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchTranslateDocument( request, @@ -1136,12 +1098,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes batchTranslateDocument with call error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest() @@ -1172,12 +1133,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes batchTranslateDocument with LRO error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest() @@ -1207,12 +1167,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes checkBatchTranslateDocumentProgress without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedResponse = generateSampleMessage( new operationsProtos.google.longrunning.Operation() @@ -1231,12 +1190,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes checkBatchTranslateDocumentProgress with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedError = new Error('expected'); @@ -1254,12 +1212,11 @@ describe('v3beta1.TranslationServiceClient', () => { describe('createGlossary', () => { it('invokes createGlossary without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() @@ -1276,9 +1233,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGlossary = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.createGlossary = + stubLongRunningCall(expectedResponse); const [operation] = await client.createGlossary(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1290,12 +1246,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes createGlossary without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() @@ -1312,9 +1267,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGlossary = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createGlossary = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createGlossary( request, @@ -1347,12 +1301,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes createGlossary with call error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() @@ -1380,12 +1333,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes createGlossary with LRO error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() @@ -1415,12 +1367,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes checkCreateGlossaryProgress without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedResponse = generateSampleMessage( new operationsProtos.google.longrunning.Operation() @@ -1439,12 +1390,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes checkCreateGlossaryProgress with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedError = new Error('expected'); @@ -1462,12 +1412,11 @@ describe('v3beta1.TranslationServiceClient', () => { describe('deleteGlossary', () => { it('invokes deleteGlossary without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() @@ -1484,9 +1433,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGlossary = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.deleteGlossary = + stubLongRunningCall(expectedResponse); const [operation] = await client.deleteGlossary(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1498,12 +1446,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes deleteGlossary without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() @@ -1520,9 +1467,8 @@ describe('v3beta1.TranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGlossary = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteGlossary = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteGlossary( request, @@ -1555,12 +1501,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes deleteGlossary with call error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() @@ -1588,12 +1533,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes deleteGlossary with LRO error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() @@ -1623,12 +1567,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes checkDeleteGlossaryProgress without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedResponse = generateSampleMessage( new operationsProtos.google.longrunning.Operation() @@ -1647,12 +1590,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes checkDeleteGlossaryProgress with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedError = new Error('expected'); @@ -1670,12 +1612,11 @@ describe('v3beta1.TranslationServiceClient', () => { describe('listGlossaries', () => { it('invokes listGlossaries without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() @@ -1711,12 +1652,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes listGlossaries without error using callback', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() @@ -1741,9 +1681,8 @@ describe('v3beta1.TranslationServiceClient', () => { new protos.google.cloud.translation.v3beta1.Glossary() ), ]; - client.innerApiCalls.listGlossaries = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listGlossaries = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listGlossaries( request, @@ -1769,12 +1708,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes listGlossaries with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() @@ -1802,12 +1740,11 @@ describe('v3beta1.TranslationServiceClient', () => { }); it('invokes listGlossariesStream without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() @@ -1825,12 +1762,12 @@ describe('v3beta1.TranslationServiceClient', () => { new protos.google.cloud.translation.v3beta1.Glossary() ), ]; - client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listGlossaries.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listGlossariesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.translation.v3beta1.Glossary[] = []; + const responses: protos.google.cloud.translation.v3beta1.Glossary[] = + []; stream.on( 'data', (response: protos.google.cloud.translation.v3beta1.Glossary) => { @@ -1852,21 +1789,19 @@ describe('v3beta1.TranslationServiceClient', () => { .calledWith(client.innerApiCalls.listGlossaries, request) ); assert.strictEqual( - (client.descriptors.page.listGlossaries - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGlossaries.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listGlossariesStream with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() @@ -1874,13 +1809,12 @@ describe('v3beta1.TranslationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listGlossaries.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listGlossariesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.translation.v3beta1.Glossary[] = []; + const responses: protos.google.cloud.translation.v3beta1.Glossary[] = + []; stream.on( 'data', (response: protos.google.cloud.translation.v3beta1.Glossary) => { @@ -1901,21 +1835,19 @@ describe('v3beta1.TranslationServiceClient', () => { .calledWith(client.innerApiCalls.listGlossaries, request) ); assert.strictEqual( - (client.descriptors.page.listGlossaries - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGlossaries.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listGlossaries without error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() @@ -1933,9 +1865,8 @@ describe('v3beta1.TranslationServiceClient', () => { new protos.google.cloud.translation.v3beta1.Glossary() ), ]; - client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listGlossaries.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; const iterable = client.listGlossariesAsync(request); for await (const resource of iterable) { @@ -1943,26 +1874,25 @@ describe('v3beta1.TranslationServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listGlossaries.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGlossaries.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listGlossaries with error', async () => { - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() @@ -1970,27 +1900,26 @@ describe('v3beta1.TranslationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listGlossaries.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listGlossariesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = []; + const responses: protos.google.cloud.translation.v3beta1.IGlossary[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listGlossaries.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGlossaries - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGlossaries.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2004,12 +1933,11 @@ describe('v3beta1.TranslationServiceClient', () => { location: 'locationValue', glossary: 'glossaryValue', }; - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.glossaryPathTemplate.render = sinon .stub() @@ -2069,12 +1997,11 @@ describe('v3beta1.TranslationServiceClient', () => { project: 'projectValue', location: 'locationValue', }; - const client = new translationserviceModule.v3beta1.TranslationServiceClient( - { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.locationPathTemplate.render = sinon .stub() From 1add1e7897492ff8ffab979accb22e8550db834f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 09:14:45 -0700 Subject: [PATCH 430/513] fix: use require() to load JSON protos (#661) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: use require() to load JSON protos The library is regenerated with gapic-generator-typescript v1.3.1. Committer: @alexander-fenster PiperOrigin-RevId: 372468161 Source-Link: https://github.com/googleapis/googleapis/commit/75880c3e6a6aa2597400582848e81bbbfac51dea Source-Link: https://github.com/googleapis/googleapis-gen/commit/77b18044813d4c8c415ff9ea68e76e307eb8e904 * 🦉 Updates from OwlBot Co-authored-by: Owl Bot --- .../src/v3/translation_service_client.ts | 26 +++---------------- .../src/v3beta1/translation_service_client.ts | 26 +++---------------- 2 files changed, 8 insertions(+), 44 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index f9ece47319a..490e1053f86 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -32,6 +32,7 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v3/translation_service_client_config.json`. @@ -147,22 +148,7 @@ export class TranslationServiceClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -187,15 +173,11 @@ export class TranslationServiceClient { ), }; + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - const protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 25fac756149..b4aa0cac5fb 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -32,6 +32,7 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v3beta1/translation_service_client_config.json`. @@ -147,22 +148,7 @@ export class TranslationServiceClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -187,15 +173,11 @@ export class TranslationServiceClient { ), }; + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - const protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ From c0c0b84fe90526180714f5440a4b67995be10640 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 10:36:43 -0700 Subject: [PATCH 431/513] chore: update gapic-generator-typescript to v1.3.2 (#662) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update gapic-generator-typescript to v1.3.2 Committer: @alexander-fenster PiperOrigin-RevId: 372656503 Source-Link: https://github.com/googleapis/googleapis/commit/6fa858c6489b1bbc505a7d7afe39f2dc45819c38 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d7c95df3ab1ea1b4c22a4542bad4924cc46d1388 * 🦉 Updates from OwlBot Co-authored-by: Owl Bot Co-authored-by: Alexander Fenster --- .../google-cloud-translate/src/v3/translation_service_client.ts | 1 - .../src/v3beta1/translation_service_client.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 490e1053f86..569da40ef46 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -27,7 +27,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index b4aa0cac5fb..40a152ce120 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -27,7 +27,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; From c33fe59bc6b0ef65b4a7dec54f60733e43892f3c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 11:00:04 -0700 Subject: [PATCH 432/513] chore: release 6.2.1 (#658) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Alexander Fenster --- packages/google-cloud-translate/CHANGELOG.md | 8 ++++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 14dd378a7b0..1debd426c4c 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.2.1](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.0...v6.2.1) (2021-05-11) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#657](https://www.github.com/googleapis/nodejs-translate/issues/657)) ([71d695d](https://www.github.com/googleapis/nodejs-translate/commit/71d695d5e217b96e688b4bb71887b19ebedae1ff)) +* use require() to load JSON protos ([#661](https://www.github.com/googleapis/nodejs-translate/issues/661)) ([5294080](https://www.github.com/googleapis/nodejs-translate/commit/529408087d68461651f1ce80b5fba460bde0f5bc)) + ## [6.2.0](https://www.github.com/googleapis/nodejs-translate/compare/v6.1.0...v6.2.0) (2021-04-07) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 616e6b0b3ae..1e5afda8c88 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.2.0", + "version": "6.2.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 7787b1d5a25..0a792e5e32e 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.2.0", + "@google-cloud/translate": "^6.2.1", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From 7ebe20398ba32022d9f4467445c2b679d4c5b1fc Mon Sep 17 00:00:00 2001 From: Mike <45373284+munkhuushmgl@users.noreply.github.com> Date: Mon, 17 May 2021 16:28:04 -0700 Subject: [PATCH 433/513] =?UTF-8?q?chore:=20refactored=20all=20glossaries?= =?UTF-8?q?=20samples=20to=20use=20predefined=20glossary=20i=E2=80=A6=20(#?= =?UTF-8?q?665)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/google-cloud-translate/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 1e5afda8c88..41a88864f87 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -58,6 +58,8 @@ "protobufjs": "^6.8.8" }, "devDependencies": { + "@microsoft/api-documenter": "^7.8.10", + "@microsoft/api-extractor": "^7.8.10", "@types/extend": "^3.0.0", "@types/mocha": "^8.0.0", "@types/node": "^10.5.7", @@ -77,8 +79,6 @@ "pack-n-play": "^1.0.0-2", "proxyquire": "^2.0.1", "sinon": "^10.0.0", - "typescript": "^3.8.3", - "@microsoft/api-documenter": "^7.8.10", - "@microsoft/api-extractor": "^7.8.10" + "typescript": "^3.8.3" } } From b11c6b275a69812caeac22d0e73d93ec1148fda3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 May 2021 19:04:21 +0200 Subject: [PATCH 434/513] chore(deps): update dependency @types/node to v14 (#667) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^10.5.7` -> `^14.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/10.17.60/14.17.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/compatibility-slim/10.17.60)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/confidence-slim/10.17.60)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 41a88864f87..b62dd601cbb 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -62,7 +62,7 @@ "@microsoft/api-extractor": "^7.8.10", "@types/extend": "^3.0.0", "@types/mocha": "^8.0.0", - "@types/node": "^10.5.7", + "@types/node": "^14.0.0", "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", "@types/sinon": "^10.0.0", From 9a7ae2ce96f89a0f936890bc42594c607e6cb24f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 17:54:33 +0200 Subject: [PATCH 435/513] chore(deps): update dependency sinon to v11 (#671) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^10.0.0` -> `^11.0.0`](https://renovatebot.com/diffs/npm/sinon/10.0.0/11.1.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/compatibility-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/confidence-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v11.1.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1110--2021-05-25) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.0.0...31be9a5d5a4762ef01cb195f29024616dfee9ce8) \================== - Add sinon.promise() implementation ([#​2369](https://togithub.com/sinonjs/sinon/issues/2369)) - Set wrappedMethod on getters/setters ([#​2378](https://togithub.com/sinonjs/sinon/issues/2378)) - \[Docs] Update fake-server usage & descriptions ([#​2365](https://togithub.com/sinonjs/sinon/issues/2365)) - Fake docs improvement ([#​2360](https://togithub.com/sinonjs/sinon/issues/2360)) - Update nise to 5.1.0 (fixed [#​2318](https://togithub.com/sinonjs/sinon/issues/2318)) ### [`v11.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1100--2021-05-24) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.1...v11.0.0) \================== - Explicitly use samsam 6.0.2 with fix for [#​2345](https://togithub.com/sinonjs/sinon/issues/2345) - Update most packages ([#​2371](https://togithub.com/sinonjs/sinon/issues/2371)) - Update compatibility docs ([#​2366](https://togithub.com/sinonjs/sinon/issues/2366)) - Update packages (includes breaking fake-timers change, see [#​2352](https://togithub.com/sinonjs/sinon/issues/2352)) - Warn of potential memory leaks ([#​2357](https://togithub.com/sinonjs/sinon/issues/2357)) - Fix clock test errors ### [`v10.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1001--2021-04-08) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.0...v10.0.1) \================== - Upgrade sinon components (bumps y18n to 4.0.1) - Bump y18n from 4.0.0 to 4.0.1
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index b62dd601cbb..aa3c086eccc 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -78,7 +78,7 @@ "mocha": "^8.0.0", "pack-n-play": "^1.0.0-2", "proxyquire": "^2.0.1", - "sinon": "^10.0.0", + "sinon": "^11.0.0", "typescript": "^3.8.3" } } From 0f20512f0731771784d679e36c8209cf4fa4730f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 25 May 2021 20:48:39 +0000 Subject: [PATCH 436/513] fix: GoogleAdsError missing using generator version after 1.3.0 (#672) [PR](https://github.com/googleapis/gapic-generator-typescript/pull/878) within updated gapic-generator-typescript version 1.4.0 Committer: @summer-ji-eng PiperOrigin-RevId: 375759421 Source-Link: https://github.com/googleapis/googleapis/commit/95fa72fdd0d69b02d72c33b37d1e4cc66d4b1446 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f40a34377ad488a7c2bc3992b3c8d5faf5a15c46 --- .../google-cloud-translate/src/v3/translation_service_client.ts | 2 ++ .../src/v3beta1/translation_service_client.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 569da40ef46..e2608cf4b51 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -142,6 +142,8 @@ export class TranslationServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 40a152ce120..1bd668fccdc 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -142,6 +142,8 @@ export class TranslationServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); From 4f9782e24d1b73f3823c2d8bf9750ed6fc68124a Mon Sep 17 00:00:00 2001 From: Mike <45373284+munkhuushmgl@users.noreply.github.com> Date: Wed, 26 May 2021 10:36:36 -0700 Subject: [PATCH 437/513] docs: clarify how to choose between v3 and v2 variants of the API (#674) --- packages/google-cloud-translate/.readme-partials.yml | 6 ++++++ packages/google-cloud-translate/samples/README.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/packages/google-cloud-translate/.readme-partials.yml b/packages/google-cloud-translate/.readme-partials.yml index eb6c036f3b4..8aa2b4edd78 100644 --- a/packages/google-cloud-translate/.readme-partials.yml +++ b/packages/google-cloud-translate/.readme-partials.yml @@ -5,6 +5,12 @@ introduction: |- integrate with the translation service programmatically. The Cloud Translation API is part of the larger Cloud Machine Learning API family. samples_body: |- + ### Choosing between Advanced v3 and Basic v2 + + Basic supports language detection and text translation [Cloud Translation - Basic v2](https://cloud.google.com/translate/docs/editions#basic). + + The advanced edition of [Cloud Translation - V3](https://cloud.google.com/translate/docs/editions#advanced) is optimized for customization and long form content use cases including glossary, batch, and model selection. + ### Translate V3 Beta Samples #### Install Dependencies diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 5796f395683..d2048a7321c 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -25,6 +25,12 @@ API is part of the larger Cloud Machine Learning API family. Before running the samples, make sure you've followed the steps outlined in [Using the client library](https://github.com/googleapis/nodejs-translate#using-the-client-library). +### Choosing between Advanced v3 and Basic v2 + +Basic supports language detection and text translation [Cloud Translation - Basic v2](https://cloud.google.com/translate/docs/editions#basic). + +The advanced edition of [Cloud Translation - V3](https://cloud.google.com/translate/docs/editions#advanced) is optimized for customization and long form content use cases including glossary, batch, and model selection. + ### Translate V3 Beta Samples #### Install Dependencies From a7c96fe12aac02bec1640070a8183dde4027b9e7 Mon Sep 17 00:00:00 2001 From: Mike <45373284+munkhuushmgl@users.noreply.github.com> Date: Tue, 1 Jun 2021 09:16:51 -0700 Subject: [PATCH 438/513] chore: Increase timeout mocha (#675) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 0a792e5e32e..dfab369c133 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -11,7 +11,7 @@ "node": ">=8" }, "scripts": { - "test": "mocha --recursive --timeout 150000" + "test": "mocha --recursive --timeout 240000" }, "dependencies": { "@google-cloud/automl": "^2.0.0", From 12b6b71404672664a8084d191dc68fc1c032c8af Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Jun 2021 18:09:00 -0700 Subject: [PATCH 439/513] chore: release 6.2.2 (#673) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 1debd426c4c..65c2e5e1da5 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.2.2](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.1...v6.2.2) (2021-06-01) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#672](https://www.github.com/googleapis/nodejs-translate/issues/672)) ([55ca7e7](https://www.github.com/googleapis/nodejs-translate/commit/55ca7e7acd102fb6590a8440c403df8600109357)) + ### [6.2.1](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.0...v6.2.1) (2021-05-11) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index aa3c086eccc..b057b284bb1 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.2.1", + "version": "6.2.2", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index dfab369c133..88c97229f0d 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.2.1", + "@google-cloud/translate": "^6.2.2", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From a919f72e4a2ac7c6d38cfdc29b81e6b3cbbdc657 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 10 Jun 2021 23:54:06 +0200 Subject: [PATCH 440/513] chore(nodejs): remove api-extractor dependencies (#682) --- packages/google-cloud-translate/package.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index b057b284bb1..872441822ab 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -44,9 +44,7 @@ "predocs-test": "npm run docs", "prelint": "cd samples; npm link ../; npm install", "clean": "gts clean", - "precompile": "gts clean", - "api-extractor": "api-extractor run --local", - "api-documenter": "api-documenter yaml --input-folder=temp" + "precompile": "gts clean" }, "dependencies": { "@google-cloud/common": "^3.0.0", @@ -58,8 +56,6 @@ "protobufjs": "^6.8.8" }, "devDependencies": { - "@microsoft/api-documenter": "^7.8.10", - "@microsoft/api-extractor": "^7.8.10", "@types/extend": "^3.0.0", "@types/mocha": "^8.0.0", "@types/node": "^14.0.0", From 5b3e6d15c0720e89eed94ee34342d9f533812428 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:22:32 +0000 Subject: [PATCH 441/513] fix: make request optional in all cases (#687) ... chore: update gapic-generator-ruby to the latest commit chore: release gapic-generator-typescript 1.5.0 Committer: @miraleung PiperOrigin-RevId: 380641501 Source-Link: https://github.com/googleapis/googleapis/commit/076f7e9f0b258bdb54338895d7251b202e8f0de3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/27e4c88b4048e5f56508d4e1aa417d60a3380892 --- .../src/v3/translation_service_client.ts | 32 +++++++-------- .../src/v3beta1/translation_service_client.ts | 40 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index e2608cf4b51..a0e6ad72c97 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -366,7 +366,7 @@ export class TranslationServiceClient { // -- Service calls -- // ------------------- translateText( - request: protos.google.cloud.translation.v3.ITranslateTextRequest, + request?: protos.google.cloud.translation.v3.ITranslateTextRequest, options?: CallOptions ): Promise< [ @@ -474,7 +474,7 @@ export class TranslationServiceClient { * const [response] = await client.translateText(request); */ translateText( - request: protos.google.cloud.translation.v3.ITranslateTextRequest, + request?: protos.google.cloud.translation.v3.ITranslateTextRequest, optionsOrCallback?: | CallOptions | Callback< @@ -517,7 +517,7 @@ export class TranslationServiceClient { return this.innerApiCalls.translateText(request, options, callback); } detectLanguage( - request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + request?: protos.google.cloud.translation.v3.IDetectLanguageRequest, options?: CallOptions ): Promise< [ @@ -599,7 +599,7 @@ export class TranslationServiceClient { * const [response] = await client.detectLanguage(request); */ detectLanguage( - request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + request?: protos.google.cloud.translation.v3.IDetectLanguageRequest, optionsOrCallback?: | CallOptions | Callback< @@ -642,7 +642,7 @@ export class TranslationServiceClient { return this.innerApiCalls.detectLanguage(request, options, callback); } getSupportedLanguages( - request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + request?: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, options?: CallOptions ): Promise< [ @@ -724,7 +724,7 @@ export class TranslationServiceClient { * const [response] = await client.getSupportedLanguages(request); */ getSupportedLanguages( - request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + request?: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, optionsOrCallback?: | CallOptions | Callback< @@ -770,7 +770,7 @@ export class TranslationServiceClient { return this.innerApiCalls.getSupportedLanguages(request, options, callback); } getGlossary( - request: protos.google.cloud.translation.v3.IGetGlossaryRequest, + request?: protos.google.cloud.translation.v3.IGetGlossaryRequest, options?: CallOptions ): Promise< [ @@ -815,7 +815,7 @@ export class TranslationServiceClient { * const [response] = await client.getGlossary(request); */ getGlossary( - request: protos.google.cloud.translation.v3.IGetGlossaryRequest, + request?: protos.google.cloud.translation.v3.IGetGlossaryRequest, optionsOrCallback?: | CallOptions | Callback< @@ -857,7 +857,7 @@ export class TranslationServiceClient { } batchTranslateText( - request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + request?: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, options?: CallOptions ): Promise< [ @@ -969,7 +969,7 @@ export class TranslationServiceClient { * const [response] = await operation.promise(); */ batchTranslateText( - request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + request?: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1054,7 +1054,7 @@ export class TranslationServiceClient { >; } createGlossary( - request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, + request?: protos.google.cloud.translation.v3.ICreateGlossaryRequest, options?: CallOptions ): Promise< [ @@ -1113,7 +1113,7 @@ export class TranslationServiceClient { * const [response] = await operation.promise(); */ createGlossary( - request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, + request?: protos.google.cloud.translation.v3.ICreateGlossaryRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1198,7 +1198,7 @@ export class TranslationServiceClient { >; } deleteGlossary( - request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, + request?: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, options?: CallOptions ): Promise< [ @@ -1256,7 +1256,7 @@ export class TranslationServiceClient { * const [response] = await operation.promise(); */ deleteGlossary( - request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, + request?: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1341,7 +1341,7 @@ export class TranslationServiceClient { >; } listGlossaries( - request: protos.google.cloud.translation.v3.IListGlossariesRequest, + request?: protos.google.cloud.translation.v3.IListGlossariesRequest, options?: CallOptions ): Promise< [ @@ -1405,7 +1405,7 @@ export class TranslationServiceClient { * for more details and examples. */ listGlossaries( - request: protos.google.cloud.translation.v3.IListGlossariesRequest, + request?: protos.google.cloud.translation.v3.IListGlossariesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 1bd668fccdc..306547a17e6 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -384,7 +384,7 @@ export class TranslationServiceClient { // -- Service calls -- // ------------------- translateText( - request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + request?: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, options?: CallOptions ): Promise< [ @@ -493,7 +493,7 @@ export class TranslationServiceClient { * const [response] = await client.translateText(request); */ translateText( - request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + request?: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, optionsOrCallback?: | CallOptions | Callback< @@ -536,7 +536,7 @@ export class TranslationServiceClient { return this.innerApiCalls.translateText(request, options, callback); } detectLanguage( - request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + request?: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, options?: CallOptions ): Promise< [ @@ -621,7 +621,7 @@ export class TranslationServiceClient { * const [response] = await client.detectLanguage(request); */ detectLanguage( - request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + request?: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, optionsOrCallback?: | CallOptions | Callback< @@ -667,7 +667,7 @@ export class TranslationServiceClient { return this.innerApiCalls.detectLanguage(request, options, callback); } getSupportedLanguages( - request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + request?: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, options?: CallOptions ): Promise< [ @@ -749,7 +749,7 @@ export class TranslationServiceClient { * const [response] = await client.getSupportedLanguages(request); */ getSupportedLanguages( - request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + request?: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, optionsOrCallback?: | CallOptions | Callback< @@ -795,7 +795,7 @@ export class TranslationServiceClient { return this.innerApiCalls.getSupportedLanguages(request, options, callback); } translateDocument( - request: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, + request?: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, options?: CallOptions ): Promise< [ @@ -904,7 +904,7 @@ export class TranslationServiceClient { * const [response] = await client.translateDocument(request); */ translateDocument( - request: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, + request?: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -950,7 +950,7 @@ export class TranslationServiceClient { return this.innerApiCalls.translateDocument(request, options, callback); } getGlossary( - request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, + request?: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, options?: CallOptions ): Promise< [ @@ -999,7 +999,7 @@ export class TranslationServiceClient { * const [response] = await client.getGlossary(request); */ getGlossary( - request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, + request?: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1043,7 +1043,7 @@ export class TranslationServiceClient { } batchTranslateText( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + request?: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, options?: CallOptions ): Promise< [ @@ -1155,7 +1155,7 @@ export class TranslationServiceClient { * const [response] = await operation.promise(); */ batchTranslateText( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + request?: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1240,7 +1240,7 @@ export class TranslationServiceClient { >; } batchTranslateDocument( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, + request?: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, options?: CallOptions ): Promise< [ @@ -1345,7 +1345,7 @@ export class TranslationServiceClient { * const [response] = await operation.promise(); */ batchTranslateDocument( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, + request?: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1434,7 +1434,7 @@ export class TranslationServiceClient { >; } createGlossary( - request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + request?: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, options?: CallOptions ): Promise< [ @@ -1493,7 +1493,7 @@ export class TranslationServiceClient { * const [response] = await operation.promise(); */ createGlossary( - request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, + request?: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1578,7 +1578,7 @@ export class TranslationServiceClient { >; } deleteGlossary( - request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + request?: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, options?: CallOptions ): Promise< [ @@ -1636,7 +1636,7 @@ export class TranslationServiceClient { * const [response] = await operation.promise(); */ deleteGlossary( - request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, + request?: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1721,7 +1721,7 @@ export class TranslationServiceClient { >; } listGlossaries( - request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, options?: CallOptions ): Promise< [ @@ -1798,7 +1798,7 @@ export class TranslationServiceClient { * for more details and examples. */ listGlossaries( - request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< From 3b8c8a7b2fe48aa667908f2c2f3a8c7d545fdc6b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 24 Jun 2021 18:28:37 +0000 Subject: [PATCH 442/513] chore: release 6.2.3 (#688) :robot: I have created a release \*beep\* \*boop\* --- ### [6.2.3](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.2...v6.2.3) (2021-06-24) ### Bug Fixes * make request optional in all cases ([#687](https://www.github.com/googleapis/nodejs-translate/issues/687)) ([621dc99](https://www.github.com/googleapis/nodejs-translate/commit/621dc99db8de832328731c3176e7bf44842062db)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 65c2e5e1da5..4dcbe09ed53 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.2.3](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.2...v6.2.3) (2021-06-24) + + +### Bug Fixes + +* make request optional in all cases ([#687](https://www.github.com/googleapis/nodejs-translate/issues/687)) ([621dc99](https://www.github.com/googleapis/nodejs-translate/commit/621dc99db8de832328731c3176e7bf44842062db)) + ### [6.2.2](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.1...v6.2.2) (2021-06-01) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 872441822ab..62ef45c6cd3 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.2.2", + "version": "6.2.3", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 88c97229f0d..8b9540ac38a 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.2.2", + "@google-cloud/translate": "^6.2.3", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From c5fc8bbd02d9d3de3cfd681acd73efb943d146b4 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 29 Jun 2021 11:24:33 -0400 Subject: [PATCH 443/513] fix(deps): google-gax v2.17.0 with mTLS (#691) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 62ef45c6cd3..c9d29c51163 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -51,7 +51,7 @@ "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^2.12.0", + "google-gax": "^2.17.0", "is-html": "^2.0.0", "protobufjs": "^6.8.8" }, From ab3a2bcef598dac2065c2daa1932ddcddc256a2e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 15:50:40 +0000 Subject: [PATCH 444/513] chore: release 6.2.4 (#692) :robot: I have created a release \*beep\* \*boop\* --- ### [6.2.4](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.3...v6.2.4) (2021-06-29) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#691](https://www.github.com/googleapis/nodejs-translate/issues/691)) ([5de0327](https://www.github.com/googleapis/nodejs-translate/commit/5de03274c69ae1e0be252e32d42b4fc4554d8e64)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 4dcbe09ed53..2a675512f6b 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.2.4](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.3...v6.2.4) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#691](https://www.github.com/googleapis/nodejs-translate/issues/691)) ([5de0327](https://www.github.com/googleapis/nodejs-translate/commit/5de03274c69ae1e0be252e32d42b4fc4554d8e64)) + ### [6.2.3](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.2...v6.2.3) (2021-06-24) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c9d29c51163..4d03c8f21f6 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.2.3", + "version": "6.2.4", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 8b9540ac38a..ff0a0b39c0d 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.2.3", + "@google-cloud/translate": "^6.2.4", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From ae4529cff03451638aa920de87a92df9587eb319 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 12 Jul 2021 17:56:12 -0400 Subject: [PATCH 445/513] fix(deps): google-gax v2.17.1 (#695) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 4d03c8f21f6..236676d4dd3 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -51,7 +51,7 @@ "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^2.17.0", + "google-gax": "^2.17.1", "is-html": "^2.0.0", "protobufjs": "^6.8.8" }, From aa7ba2e904014588ccbb75f04ba2184009856204 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 Jul 2021 22:52:18 +0000 Subject: [PATCH 446/513] chore: release 6.2.5 (#696) :robot: I have created a release \*beep\* \*boop\* --- ### [6.2.5](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.4...v6.2.5) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#695](https://www.github.com/googleapis/nodejs-translate/issues/695)) ([20bac38](https://www.github.com/googleapis/nodejs-translate/commit/20bac38c89480e4e221419bab13e3f10d626df6c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 2a675512f6b..4ad5e391054 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.2.5](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.4...v6.2.5) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#695](https://www.github.com/googleapis/nodejs-translate/issues/695)) ([20bac38](https://www.github.com/googleapis/nodejs-translate/commit/20bac38c89480e4e221419bab13e3f10d626df6c)) + ### [6.2.4](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.3...v6.2.4) (2021-06-29) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 236676d4dd3..4bcddcf2453 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.2.4", + "version": "6.2.5", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index ff0a0b39c0d..a176cd4da33 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.2.4", + "@google-cloud/translate": "^6.2.5", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From 95b027a892c09712a40d4cdb0da926567c9f810e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 19:08:11 +0000 Subject: [PATCH 447/513] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#699) Also removing the explicit generator tag for the IAMPolicy mixin for the kms and pubsub APIS as the generator will now read it from the .yaml file. PiperOrigin-RevId: 385101839 Source-Link: https://github.com/googleapis/googleapis/commit/80f404215a9346259db760d80d0671f28c433453 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d3509d2520fb8db862129633f1cf8406d17454e1 --- .../src/v3/translation_service_client.ts | 11 ++++++++++- .../src/v3beta1/translation_service_client.ts | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index a0e6ad72c97..6bcda4cd449 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class TranslationServiceClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -60,6 +61,7 @@ export class TranslationServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class TranslationServiceClient { const staticMembers = this.constructor as typeof TranslationServiceClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -235,6 +240,9 @@ export class TranslationServiceClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -263,7 +271,8 @@ export class TranslationServiceClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.translation.v3.TranslationService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 306547a17e6..065fd1046b9 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class TranslationServiceClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -60,6 +61,7 @@ export class TranslationServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class TranslationServiceClient { const staticMembers = this.constructor as typeof TranslationServiceClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -250,6 +255,9 @@ export class TranslationServiceClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -279,7 +287,8 @@ export class TranslationServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.translation.v3beta1 .TranslationService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides From 1c9d45db1c2e6b779f8c11482f490e3e32c62127 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 01:26:26 +0000 Subject: [PATCH 448/513] chore: release 6.2.6 (#700) :robot: I have created a release \*beep\* \*boop\* --- ### [6.2.6](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.5...v6.2.6) (2021-07-21) ### Bug Fixes * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#699](https://www.github.com/googleapis/nodejs-translate/issues/699)) ([41e7ba3](https://www.github.com/googleapis/nodejs-translate/commit/41e7ba31041a2138c7068ce0e14528d044cb3606)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 4ad5e391054..6d6be60ea85 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.2.6](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.5...v6.2.6) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#699](https://www.github.com/googleapis/nodejs-translate/issues/699)) ([41e7ba3](https://www.github.com/googleapis/nodejs-translate/commit/41e7ba31041a2138c7068ce0e14528d044cb3606)) + ### [6.2.5](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.4...v6.2.5) (2021-07-12) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 4bcddcf2453..1481d65efef 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.2.5", + "version": "6.2.6", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index a176cd4da33..149f87e6933 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.2.5", + "@google-cloud/translate": "^6.2.6", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From 99c57381bb193133da780f029e2b1ff3c9d6273f Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Fri, 13 Aug 2021 17:54:48 -0400 Subject: [PATCH 449/513] chore(nodejs): update client ref docs link in metadata (#709) --- packages/google-cloud-translate/.repo-metadata.json | 2 +- packages/google-cloud-translate/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/.repo-metadata.json b/packages/google-cloud-translate/.repo-metadata.json index 1d8916d2fdb..1a6d26e6752 100644 --- a/packages/google-cloud-translate/.repo-metadata.json +++ b/packages/google-cloud-translate/.repo-metadata.json @@ -7,7 +7,7 @@ "language": "nodejs", "requires_billing": true, "issue_tracker": "https://issuetracker.google.com/savedsearches/559749", - "client_documentation": "https://googleapis.dev/nodejs/translate/latest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/translate/latest", "name": "translate", "name_pretty": "Cloud Translation", "api_id": "translate.googleapis.com", diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 674502e2d88..a378b08305f 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -163,7 +163,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-translate/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/translate/latest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/translate/latest [product-docs]: https://cloud.google.com/translate/docs/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From cdd0b3e8f48ca9591e909c1d19f99ad3203047bd Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 16 Aug 2021 22:42:36 -0400 Subject: [PATCH 450/513] fix(deps): google-gax v2.24.1 (#711) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 1481d65efef..a6ed8af92f2 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -51,7 +51,7 @@ "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^2.17.1", + "google-gax": "^2.24.1", "is-html": "^2.0.0", "protobufjs": "^6.8.8" }, From 5c0dda1599a5253072f7a84185cb6a1eaf72e3da Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 03:30:32 +0000 Subject: [PATCH 451/513] chore: release 6.2.7 (#710) :robot: I have created a release \*beep\* \*boop\* --- ### [6.2.7](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.6...v6.2.7) (2021-08-17) ### Bug Fixes * **deps:** google-gax v2.24.1 ([#711](https://www.github.com/googleapis/nodejs-translate/issues/711)) ([87604a3](https://www.github.com/googleapis/nodejs-translate/commit/87604a30f57186c90e8edfe7a3259c41da8c03d2)) * increase timeout for batch translate document ([#708](https://www.github.com/googleapis/nodejs-translate/issues/708)) ([ef154ad](https://www.github.com/googleapis/nodejs-translate/commit/ef154ad287820890a4aaedbf40e91b1cb2f798cc)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-translate/CHANGELOG.md | 8 ++++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 6d6be60ea85..a6e34d00ca8 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.2.7](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.6...v6.2.7) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#711](https://www.github.com/googleapis/nodejs-translate/issues/711)) ([87604a3](https://www.github.com/googleapis/nodejs-translate/commit/87604a30f57186c90e8edfe7a3259c41da8c03d2)) +* increase timeout for batch translate document ([#708](https://www.github.com/googleapis/nodejs-translate/issues/708)) ([ef154ad](https://www.github.com/googleapis/nodejs-translate/commit/ef154ad287820890a4aaedbf40e91b1cb2f798cc)) + ### [6.2.6](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.5...v6.2.6) (2021-07-21) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index a6ed8af92f2..50ed6dbe0e1 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.2.6", + "version": "6.2.7", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 149f87e6933..7dca6870a34 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.2.6", + "@google-cloud/translate": "^6.2.7", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From 2fef650a54175d5aa4ac09a6c519f495b9a9b7bb Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:28:22 +0000 Subject: [PATCH 452/513] feat: turns on self-signed JWT feature flag (#713) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 392067151 Source-Link: https://github.com/googleapis/googleapis/commit/06345f7b95c4b4a3ffe4303f1f2984ccc304b2e0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/95882b37970e41e4cd51b22fa507cfd46dc7c4b6 --- .../src/v3/translation_service_client.ts | 7 +++++++ .../src/v3beta1/translation_service_client.ts | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 6bcda4cd449..a630052c890 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -133,6 +133,12 @@ export class TranslationServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -1666,6 +1672,7 @@ export class TranslationServiceClient { return this.translationServiceStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 065fd1046b9..1831f005415 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -133,6 +133,12 @@ export class TranslationServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -2085,6 +2091,7 @@ export class TranslationServiceClient { return this.translationServiceStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); From 57789dd9b2527dfd7cf278c821537a97b24dbfc0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 22:32:25 +0000 Subject: [PATCH 453/513] fix: add missing annotation for batch document translation (#715) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 392949968 Source-Link: https://github.com/googleapis/googleapis/commit/41e44ac10040bf2801c9a5c7e846e55029a02243 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2a89e1166976d1d910103bc9a967e2596123a19f --- .../v3beta1/translation_service.proto | 43 ++++++++++--------- .../google-cloud-translate/protos/protos.json | 3 +- .../src/v3beta1/translation_service_client.ts | 16 +++---- 3 files changed, 29 insertions(+), 33 deletions(-) diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto index 6c10de0fce0..878af796289 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto @@ -239,14 +239,13 @@ message TranslateTextRequest { // // - General (built-in) models: // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // For global (non-regionalized) requests, use `location-id` `global`. // For example, // `projects/{project-number-or-id}/locations/global/models/general/nmt`. // - // If missing, the system decides which google base model to use. + // If not provided, the default Google model (NMT) will be used string model = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. Glossary to be applied. The glossary must be @@ -283,6 +282,8 @@ message TranslateTextResponse { // A single translation response. message Translation { // Text translated into the target language. + // If an error occurs during translation, this field might be excluded from + // the response. string translated_text = 1; // Only present when `model` is present in the request. @@ -316,7 +317,7 @@ message DetectLanguageRequest { // For global calls, use `projects/{project-number-or-id}/locations/global` or // `projects/{project-number-or-id}`. // - // Only models within the same region, which have the same location-id, can be used. + // Only models within the same region (has same location-id) can be used. // Otherwise an INVALID_ARGUMENT (400) error is returned. string parent = 5 [ (google.api.field_behavior) = REQUIRED, @@ -410,11 +411,10 @@ message GetSupportedLanguagesRequest { // // - General (built-in) models: // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // Returns languages supported by the specified model. - // If missing, we get supported languages of Google general base (PBMT) model. + // If missing, we get supported languages of Google general NMT model. string model = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -523,13 +523,13 @@ message OutputConfig { // content to output. // // Once a row is present in index.csv, the input/output matching never - // changes. Callers should also expect the contents in the input_file are + // changes. Callers should also expect all the content in input_file are // processed and ready to be consumed (that is, no partial output file is // written). // - // Since index.csv will be updated during the process, please make + // Since index.csv will be keeping updated during the process, please make // sure there is no custom retention policy applied on the output bucket - // that may prevent file updating. + // that may avoid file updating. // (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) // // The format of translations_file (for target language code 'trg') is: @@ -674,8 +674,7 @@ message TranslateDocumentRequest { // // Format: `projects/{project-number-or-id}/locations/{location-id}`. // - // For global calls, use `projects/{project-number-or-id}/locations/global` or - // `projects/{project-number-or-id}`. + // For global calls, use `projects/{project-number-or-id}/locations/global`. // // Non-global location is required for requests using AutoML models or custom // glossaries. @@ -717,7 +716,6 @@ message TranslateDocumentRequest { // // - General (built-in) models: // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // If not provided, the default Google model (NMT) will be used for @@ -810,7 +808,7 @@ message BatchTranslateTextRequest { [(google.api.field_behavior) = REQUIRED]; // Optional. The models to use for translation. Map's key is target language - // code. Map's value is the model name. Value can be a built-in general model, + // code. Map's value is model name. Value can be a built-in general model, // or an AutoML Translation model. // // The value format depends on model type: @@ -820,7 +818,6 @@ message BatchTranslateTextRequest { // // - General (built-in) models: // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // If the map is empty or a specific model is @@ -1194,7 +1191,12 @@ message BatchTranslateDocumentRequest { // Only AutoML Translation models or glossaries within the same region (have // the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) // error is returned. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // Required. The BCP-47 language code of the input document if known, for // example, "en-US" or "sr-Latn". Supported language codes are listed in @@ -1230,7 +1232,6 @@ message BatchTranslateDocumentRequest { // // - General (built-in) models: // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // If the map is empty or a specific model is not requested for a language @@ -1261,10 +1262,10 @@ message BatchDocumentInputConfig { // - `xlsx`, // application/vnd.openxmlformats-officedocument.spreadsheetml.sheet // - // The max file size supported for `.docx`, `.pptx` and `.xlsx` is 100MB. - // The max file size supported for `.pdf` is 1GB and the max page limit is + // The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB. + // The max file size to support for `.pdf` is 1GB and the max page limit is // 1000 pages. - // The max file size supported for all input documents is 1GB. + // The max file size to support for all input documents is 1GB. GcsSource gcs_source = 1; } } @@ -1328,16 +1329,16 @@ message BatchDocumentOutputConfig { // field returned by BatchTranslateDocument if at least one document is // translated successfully. message BatchTranslateDocumentResponse { - // Total number of pages to translate in all documents. Documents without a + // Total number of pages to translate in all documents. Documents without // clear page definition (such as XLSX) are not counted. int64 total_pages = 1; // Number of successfully translated pages in all documents. Documents without - // a clear page definition (such as XLSX) are not counted. + // clear page definition (such as XLSX) are not counted. int64 translated_pages = 2; // Number of pages that failed to process in all documents. Documents without - // a clear page definition (such as XLSX) are not counted. + // clear page definition (such as XLSX) are not counted. int64 failed_pages = 3; // Number of billable pages in documents with clear page definition (such as diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index e2200eb4598..965ef085212 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -1959,7 +1959,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" } }, "sourceLanguageCode": { diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 1831f005415..7fa706de3dc 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -476,14 +476,13 @@ export class TranslationServiceClient { * * - General (built-in) models: * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * * * For global (non-regionalized) requests, use `location-id` `global`. * For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. * - * If missing, the system decides which google base model to use. + * If not provided, the default Google model (NMT) will be used * @param {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} [request.glossaryConfig] * Optional. Glossary to be applied. The glossary must be * within the same region (have the same location-id) as the model, otherwise @@ -599,7 +598,7 @@ export class TranslationServiceClient { * For global calls, use `projects/{project-number-or-id}/locations/global` or * `projects/{project-number-or-id}`. * - * Only models within the same region, which have the same location-id, can be used. + * Only models within the same region (has same location-id) can be used. * Otherwise an INVALID_ARGUMENT (400) error is returned. * @param {string} [request.model] * Optional. The language detection model to be used. @@ -748,11 +747,10 @@ export class TranslationServiceClient { * * - General (built-in) models: * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * * * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. + * If missing, we get supported languages of Google general NMT model. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -853,8 +851,7 @@ export class TranslationServiceClient { * * Format: `projects/{project-number-or-id}/locations/{location-id}`. * - * For global calls, use `projects/{project-number-or-id}/locations/global` or - * `projects/{project-number-or-id}`. + * For global calls, use `projects/{project-number-or-id}/locations/global`. * * Non-global location is required for requests using AutoML models or custom * glossaries. @@ -889,7 +886,6 @@ export class TranslationServiceClient { * * - General (built-in) models: * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * * * If not provided, the default Google model (NMT) will be used for @@ -1120,7 +1116,7 @@ export class TranslationServiceClient { * Required. Specify up to 10 language codes here. * @param {number[]} [request.models] * Optional. The models to use for translation. Map's key is target language - * code. Map's value is the model name. Value can be a built-in general model, + * code. Map's value is model name. Value can be a built-in general model, * or an AutoML Translation model. * * The value format depends on model type: @@ -1130,7 +1126,6 @@ export class TranslationServiceClient { * * - General (built-in) models: * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * * * If the map is empty or a specific model is @@ -1339,7 +1334,6 @@ export class TranslationServiceClient { * * - General (built-in) models: * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * * * If the map is empty or a specific model is not requested for a language From 005b07d39fbba34fe51e9827e328a7c1af06f336 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 23:58:26 +0000 Subject: [PATCH 454/513] chore: disable renovate dependency dashboard (#1194) (#718) --- packages/google-cloud-translate/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index a378b08305f..bc800b436e2 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -154,8 +154,8 @@ Contributions welcome! See the [Contributing Guide](https://github.com/googleapi Please note that this `README.md`, the `samples/README.md`, and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) are generated from a central template. To edit one of these files, make an edit -to its template in this -[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). +to its templates in +[directory](https://github.com/googleapis/synthtool). ## License From bc9460de0e242d8accc4a073cddc94181238a2ac Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 10 Sep 2021 13:41:29 -0400 Subject: [PATCH 455/513] fix(build): set default branch to main (#722) --- packages/google-cloud-translate/README.md | 16 ++++++++-------- .../google-cloud-translate/samples/README.md | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index bc800b436e2..1b90c889c4f 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -6,7 +6,7 @@ [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/translate.svg)](https://www.npmjs.org/package/@google-cloud/translate) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-translate/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-translate) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-translate/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-translate) @@ -19,7 +19,7 @@ API is part of the larger Cloud Machine Learning API family. A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-translate/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-translate/blob/main/CHANGELOG.md). * [Cloud Translation Node.js Client API Reference][client-docs] * [Cloud Translation Documentation][product-docs] @@ -94,13 +94,13 @@ quickStart(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-translate/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-translate/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Hybrid Glossaries | [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/hybridGlossaries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/hybridGlossaries.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Translate | [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/translate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/translate.js,samples/README.md) | +| Hybrid Glossaries | [source code](https://github.com/googleapis/nodejs-translate/blob/main/samples/hybridGlossaries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/hybridGlossaries.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-translate/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Translate | [source code](https://github.com/googleapis/nodejs-translate/blob/main/samples/translate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/translate.js,samples/README.md) | @@ -149,7 +149,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-translate/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-translate/blob/main/CONTRIBUTING.md). Please note that this `README.md`, the `samples/README.md`, and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) @@ -161,7 +161,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-translate/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-translate/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/translate/latest [product-docs]: https://cloud.google.com/translate/docs/ diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index d2048a7321c..1bc6651dd1e 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -99,7 +99,7 @@ node v3beta1/translate_list_codes_beta.js "your_project_id" ### Hybrid Glossaries -View the [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/hybridGlossaries.js). +View the [source code](https://github.com/googleapis/nodejs-translate/blob/main/samples/hybridGlossaries.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/hybridGlossaries.js,samples/README.md) @@ -116,7 +116,7 @@ __Usage:__ ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-translate/blob/main/samples/quickstart.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) @@ -133,7 +133,7 @@ __Usage:__ ### Translate -View the [source code](https://github.com/googleapis/nodejs-translate/blob/master/samples/translate.js). +View the [source code](https://github.com/googleapis/nodejs-translate/blob/main/samples/translate.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/translate.js,samples/README.md) From 8fe5a7d37844492a8ed8260a0dee1e41cb1717ab Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 10 Sep 2021 11:08:11 -0700 Subject: [PATCH 456/513] feat: added v3 proto for online/batch document translation and updated v3beta1 proto for format conversion (#719) PiperOrigin-RevId: 393656336 Source-Link: https://github.com/googleapis/googleapis/commit/17d3fb258cc9527ddcf910a72126de3a43fac440 Source-Link: https://github.com/googleapis/googleapis-gen/commit/00ca50bdde80906d6f62314ef4f7630b8cdb6e15 --- .../translate/v3/translation_service.proto | 594 +- .../v3beta1/translation_service.proto | 14 + .../google-cloud-translate/protos/protos.d.ts | 2751 ++++-- .../google-cloud-translate/protos/protos.js | 8033 ++++++++++++----- .../google-cloud-translate/protos/protos.json | 406 +- .../src/v3/gapic_metadata.json | 20 + .../src/v3/translation_service_client.ts | 435 +- .../v3/translation_service_client_config.json | 10 + .../src/v3beta1/translation_service_client.ts | 11 + .../test/gapic_translation_service_v3.ts | 308 + 10 files changed, 9511 insertions(+), 3071 deletions(-) diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto index 3e939a5d2c8..070786cef8e 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // 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. -// syntax = "proto3"; @@ -22,7 +21,9 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Translate.V3"; @@ -81,6 +82,15 @@ service TranslationService { option (google.api.method_signature) = "parent,model,display_language_code"; } + // Translates documents in synchronous mode. + rpc TranslateDocument(TranslateDocumentRequest) + returns (TranslateDocumentResponse) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*}:translateDocument" + body: "*" + }; + } + // Translates a large volume of text in asynchronous batch mode. // This function provides real-time output as the inputs are being processed. // If caller cancels a request, the partial results (for an input file, it's @@ -100,6 +110,25 @@ service TranslationService { }; } + // Translates a large volume of document in asynchronous batch mode. + // This function provides real-time output as the inputs are being processed. + // If caller cancels a request, the partial results (for an input file, it's + // all or nothing) may still be available on the specified output location. + // + // This call returns immediately and you can use + // google.longrunning.Operation.name to poll the status of the call. + rpc BatchTranslateDocument(BatchTranslateDocumentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*}:batchTranslateDocument" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "BatchTranslateDocumentResponse" + metadata_type: "BatchTranslateDocumentMetadata" + }; + } + // Creates a glossary and returns the long-running operation. Returns // NOT_FOUND, if the project doesn't exist. rpc CreateGlossary(CreateGlossaryRequest) @@ -152,8 +181,12 @@ service TranslationService { // Configures which glossary should be used for a specific target language, // and defines options for applying that glossary. message TranslateTextGlossaryConfig { - // Required. Specifies the glossary used for this translation. Use - // this format: projects/*/locations/*/glossaries/* + // Required. The `glossary` to be applied for this translation. + // + // The format depends on glossary: + // + // - User provided custom glossary: + // `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}` string glossary = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Indicates match is case-insensitive. @@ -164,7 +197,8 @@ message TranslateTextGlossaryConfig { // The request message for synchronous translation. message TranslateTextRequest { // Required. The content of the input in string format. - // We recommend the total content be less than 30k codepoints. + // We recommend the total content be less than 30k codepoints. The max length + // of this field is 1024. // Use BatchTranslateText for larger text. repeated string contents = 1 [(google.api.field_behavior) = REQUIRED]; @@ -213,14 +247,13 @@ message TranslateTextRequest { // // - General (built-in) models: // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // For global (non-regionalized) requests, use `location-id` `global`. // For example, // `projects/{project-number-or-id}/locations/global/models/general/nmt`. // - // If missing, the system decides which google base model to use. + // If not provided, the default Google model (NMT) will be used. string model = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. Glossary to be applied. The glossary must be @@ -236,7 +269,8 @@ message TranslateTextRequest { // characters, underscores and dashes. International characters are allowed. // Label values are optional. Label keys must start with a letter. // - // See https://cloud.google.com/translate/docs/labels for more information. + // See https://cloud.google.com/translate/docs/advanced/labels for more + // information. map labels = 10 [(google.api.field_behavior) = OPTIONAL]; } @@ -257,6 +291,8 @@ message TranslateTextResponse { // A single translation response. message Translation { // Text translated into the target language. + // If an error occurs during translation, this field might be excluded from + // the response. string translated_text = 1; // Only present when `model` is present in the request. @@ -327,7 +363,8 @@ message DetectLanguageRequest { // characters, underscores and dashes. International characters are allowed. // Label values are optional. Label keys must start with a letter. // - // See https://cloud.google.com/translate/docs/labels for more information. + // See https://cloud.google.com/translate/docs/advanced/labels for more + // information. map labels = 6 [(google.api.field_behavior) = OPTIONAL]; } @@ -343,8 +380,8 @@ message DetectedLanguage { // The response message for language detection. message DetectLanguageResponse { - // A list of detected languages sorted by detection confidence in descending - // order. The most probable language first. + // The most probable language detected by the Translation API. For each + // request, the Translation API will always return only one result. repeated DetectedLanguage languages = 1; } @@ -384,11 +421,10 @@ message GetSupportedLanguagesRequest { // // - General (built-in) models: // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // Returns languages supported by the specified model. - // If missing, we get supported languages of Google general base (PBMT) model. + // If missing, we get supported languages of Google general NMT model. string model = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -422,7 +458,7 @@ message SupportedLanguage { // The Google Cloud Storage location for the input content. message GcsSource { // Required. Source data URI. For example, `gs://my_bucket/my_object`. - string input_uri = 1; + string input_uri = 1 [(google.api.field_behavior) = REQUIRED]; } // Input configuration for BatchTranslateText request. @@ -459,10 +495,12 @@ message InputConfig { // The Google Cloud Storage location for the output content. message GcsDestination { - // Required. There must be no files under 'output_uri_prefix'. - // 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an - // INVALID_ARGUMENT (400) error is returned. - string output_uri_prefix = 1; + // Required. The bucket used in 'output_uri_prefix' must exist and there must + // be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with + // "/" and start with "gs://". One 'output_uri_prefix' can only be used by one + // batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error + // is returned. + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; } // Output configuration for BatchTranslateText request. @@ -501,8 +539,13 @@ message OutputConfig { // processed and ready to be consumed (that is, no partial output file is // written). // + // Since index.csv will be keeping updated during the process, please make + // sure there is no custom retention policy applied on the output bucket + // that may avoid file updating. + // (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + // // The format of translations_file (for target language code 'trg') is: - // `gs://translation_test/a_b_c_'trg'_translations.[extension]` + // gs://translation_test/a_b_c_'trg'_translations.[extension] // // If the input file extension is tsv, the output has the following // columns: @@ -519,10 +562,10 @@ message OutputConfig { // If input file extension is a txt or html, the translation is directly // written to the output file. If glossary is requested, a separate // glossary_translations_file has format of - // `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + // gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] // // The format of errors file (for target language code 'trg') is: - // `gs://translation_test/a_b_c_'trg'_errors.[extension]` + // gs://translation_test/a_b_c_'trg'_errors.[extension] // // If the input file extension is tsv, errors_file contains the following: // Column 1: ID of the request provided in the input, if it's not @@ -534,11 +577,224 @@ message OutputConfig { // // If the input file extension is txt or html, glossary_error_file will be // generated that contains error details. glossary_error_file has format of - // `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + // gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] GcsDestination gcs_destination = 1; } } +// A document translation request input config. +message DocumentInputConfig { + // Specifies the source for the document's content. + // The input file size should be <= 20MB for + // - application/vnd.openxmlformats-officedocument.wordprocessingml.document + // - application/vnd.openxmlformats-officedocument.presentationml.presentation + // - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + // The input file size should be <= 20MB and the maximum page limit is 20 for + // - application/pdf + oneof source { + // Document's content represented as a stream of bytes. + bytes content = 1; + + // Google Cloud Storage location. This must be a single file. + // For example: gs://example_bucket/example_file.pdf + GcsSource gcs_source = 2; + } + + // Specifies the input document's mime_type. + // + // If not specified it will be determined using the file extension for + // gcs_source provided files. For a file provided through bytes content the + // mime_type must be provided. + // Currently supported mime types are: + // - application/pdf + // - application/vnd.openxmlformats-officedocument.wordprocessingml.document + // - application/vnd.openxmlformats-officedocument.presentationml.presentation + // - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + string mime_type = 4; +} + +// A document translation request output config. +message DocumentOutputConfig { + // A URI destination for the translated document. + // It is optional to provide a destination. If provided the results from + // TranslateDocument will be stored in the destination. + // Whether a destination is provided or not, the translated documents will be + // returned within TranslateDocumentResponse.document_translation and + // TranslateDocumentResponse.glossary_document_translation. + oneof destination { + // Optional. Google Cloud Storage destination for the translation output, + // e.g., `gs://my_bucket/my_directory/`. + // + // The destination directory provided does not have to be empty, but the + // bucket must exist. If a file with the same name as the output file + // already exists in the destination an error will be returned. + // + // For a DocumentInputConfig.contents provided document, the output file + // will have the name "output_[trg]_translations.[ext]", where + // - [trg] corresponds to the translated file's language code, + // - [ext] corresponds to the translated file's extension according to its + // mime type. + // + // + // For a DocumentInputConfig.gcs_uri provided document, the output file will + // have a name according to its URI. For example: an input file with URI: + // "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name + // "my_bucket" will have an output URI: + // "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where + // - [trg] corresponds to the translated file's language code, + // - [ext] corresponds to the translated file's extension according to its + // mime type. + // + // + // If the document was directly provided through the request, then the + // output document will have the format: + // "gs://my_bucket/translated_document_[trg]_translations.[ext], where + // - [trg] corresponds to the translated file's language code, + // - [ext] corresponds to the translated file's extension according to its + // mime type. + // + // If a glossary was provided, then the output URI for the glossary + // translation will be equal to the default output URI but have + // `glossary_translations` instead of `translations`. For the previous + // example, its glossary URI would be: + // "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]". + // + // Thus the max number of output files will be 2 (Translated document, + // Glossary translated document). + // + // Callers should expect no partial outputs. If there is any error during + // document translation, no output will be stored in the Cloud Storage + // bucket. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Specifies the translated document's mime_type. + // If not specified, the translated file's mime type will be the same as the + // input file's mime type. + // Currently only support the output mime type to be the same as input mime + // type. + // - application/pdf + // - application/vnd.openxmlformats-officedocument.wordprocessingml.document + // - application/vnd.openxmlformats-officedocument.presentationml.presentation + // - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A document translation request. +message TranslateDocumentRequest { + // Required. Location to make a regional call. + // + // Format: `projects/{project-number-or-id}/locations/{location-id}`. + // + // For global calls, use `projects/{project-number-or-id}/locations/global` or + // `projects/{project-number-or-id}`. + // + // Non-global location is required for requests using AutoML models or custom + // glossaries. + // + // Models and glossaries must be within the same region (have the same + // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The BCP-47 language code of the input document if known, for + // example, "en-US" or "sr-Latn". Supported language codes are listed in + // Language Support. If the source language isn't specified, the API attempts + // to identify the source language automatically and returns the source + // language within the response. Source language must be specified if the + // request contains a glossary or a custom model. + string source_language_code = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The BCP-47 language code to use for translation of the input + // document, set to one of the language codes listed in Language Support. + string target_language_code = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input configurations. + DocumentInputConfig document_input_config = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Output configurations. + // Defines if the output file should be stored within Cloud Storage as well + // as the desired output format. If not provided the translated file will + // only be returned through a byte-stream and its output mime type will be + // the same as the input file's mime type. + DocumentOutputConfig document_output_config = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The `model` type requested for this translation. + // + // The format depends on model type: + // + // - AutoML Translation models: + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + // + // - General (built-in) models: + // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + // + // + // If not provided, the default Google model (NMT) will be used for + // translation. + string model = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Glossary to be applied. The glossary must be within the same + // region (have the same location-id) as the model, otherwise an + // INVALID_ARGUMENT (400) error is returned. + TranslateTextGlossaryConfig glossary_config = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels with user-defined metadata for the request. + // + // Label keys and values can be no longer than 63 characters (Unicode + // codepoints), can only contain lowercase letters, numeric characters, + // underscores and dashes. International characters are allowed. Label values + // are optional. Label keys must start with a letter. + // + // See https://cloud.google.com/translate/docs/advanced/labels for more + // information. + map labels = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// A translated document message. +message DocumentTranslation { + // The array of translated documents. It is expected to be size 1 for now. We + // may produce multiple translated documents in the future for other type of + // file formats. + repeated bytes byte_stream_outputs = 1; + + // The translated document's mime type. + string mime_type = 2; + + // The detected language for the input document. + // If the user did not provide the source language for the input document, + // this field will have the language code automatically detected. If the + // source language was passed, auto-detection of the language does not occur + // and this field is empty. + string detected_language_code = 3; +} + +// A translated document response message. +message TranslateDocumentResponse { + // Translated document. + DocumentTranslation document_translation = 1; + + // The document's translation output if a glossary is provided in the request. + // This can be the same as [TranslateDocumentResponse.document_translation] + // if no glossary terms apply. + DocumentTranslation glossary_document_translation = 2; + + // Only present when 'model' is present in the request. + // 'model' is normalized to have a project number. + // + // For example: + // If the 'model' field in TranslateDocumentRequest is: + // `projects/{project-id}/locations/{location-id}/models/general/nmt` then + // `model` here would be normalized to + // `projects/{project-number}/locations/{location-id}/models/general/nmt`. + string model = 3; + + // The `glossary_config` used for this translation. + TranslateTextGlossaryConfig glossary_config = 4; +} + // The batch translation request. message BatchTranslateTextRequest { // Required. Location to make a call. Must refer to a caller's project. @@ -575,7 +831,6 @@ message BatchTranslateTextRequest { // // - General (built-in) models: // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // If the map is empty or a specific model is @@ -583,7 +838,7 @@ message BatchTranslateTextRequest { map models = 4 [(google.api.field_behavior) = OPTIONAL]; // Required. Input configurations. - // The total number of files matched should be <= 1000. + // The total number of files matched should be <= 100. // The total content size should be <= 100M Unicode codepoints. // The files must use UTF-8 encoding. repeated InputConfig input_configs = 5 @@ -606,7 +861,8 @@ message BatchTranslateTextRequest { // characters, underscores and dashes. International characters are allowed. // Label values are optional. Label keys must start with a letter. // - // See https://cloud.google.com/translate/docs/labels for more information. + // See https://cloud.google.com/translate/docs/advanced/labels for more + // information. map labels = 9 [(google.api.field_behavior) = OPTIONAL]; } @@ -702,9 +958,8 @@ message GlossaryInputConfig { // For equivalent term sets glossaries: // // - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - // in multiple languages. The format is defined for Google Translation - // Toolkit and documented in [Use a - // glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + // in multiple languages. See documentation for more information - + // [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). GcsSource gcs_source = 1; } } @@ -737,7 +992,7 @@ message Glossary { // Required. The resource name of the glossary. Glossary names have the form // `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. - string name = 1; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // Languages supported by the glossary. oneof languages { @@ -821,7 +1076,20 @@ message ListGlossariesRequest { string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Filter specifying constraints of a list operation. - // Filtering is not supported yet, and the parameter currently has no effect. + // Specify the constraint by the format of "key=value", where key must be + // "src" or "tgt", and the value must be a valid language code. + // For multiple restrictions, concatenate them by "AND" (uppercase only), + // such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + // here, which means using 'en-US' and 'en' can lead to different results, + // which depends on the language code you used when you create the glossary. + // For the unidirectional glossaries, the "src" and "tgt" add restrictions + // on the source and target language code separately. + // For the equivalent term set glossaries, the "src" and/or "tgt" add + // restrictions on the term set. + // For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + // glossaries which exactly match the source language code as "en-US" and the + // target language code "zh-CN", but all equivalent term set glossaries which + // contain "en-US" and "zh-CN" in their language set will be picked. // If missing, no filtering is performed. string filter = 4 [(google.api.field_behavior) = OPTIONAL]; } @@ -924,3 +1192,269 @@ message DeleteGlossaryResponse { // set to true. google.protobuf.Timestamp end_time = 3; } + +// The BatchTranslateDocument request. +message BatchTranslateDocumentRequest { + // Required. Location to make a regional call. + // + // Format: `projects/{project-number-or-id}/locations/{location-id}`. + // + // The `global` location is not supported for batch translation. + // + // Only AutoML Translation models or glossaries within the same region (have + // the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + // error is returned. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The BCP-47 language code of the input document if known, for + // example, "en-US" or "sr-Latn". Supported language codes are listed in + // Language Support (https://cloud.google.com/translate/docs/languages). + string source_language_code = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BCP-47 language code to use for translation of the input + // document. Specify up to 10 language codes here. + repeated string target_language_codes = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Input configurations. + // The total number of files matched should be <= 100. + // The total content size to translate should be <= 100M Unicode codepoints. + // The files must use UTF-8 encoding. + repeated BatchDocumentInputConfig input_configs = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Output configuration. + // If 2 input configs match to the same file (that is, same input path), + // we don't generate output for duplicate inputs. + BatchDocumentOutputConfig output_config = 5 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The models to use for translation. Map's key is target language + // code. Map's value is the model name. Value can be a built-in general model, + // or an AutoML Translation model. + // + // The value format depends on model type: + // + // - AutoML Translation models: + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + // + // - General (built-in) models: + // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + // + // + // If the map is empty or a specific model is + // not requested for a language pair, then default google model (nmt) is used. + map models = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Glossaries to be applied. It's keyed by target language code. + map glossaries = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. File format conversion map to be applied to all input files. + // Map's key is the original mime_type. Map's value is the target mime_type of + // translated documents. + // + // Supported file format conversion includes: + // - `application/pdf` to + // `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + // + // If nothing specified, output files will be in the same format as the + // original file. + map format_conversions = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Input configuration for BatchTranslateDocument request. +message BatchDocumentInputConfig { + // Specify the input. + oneof source { + // Google Cloud Storage location for the source input. + // This can be a single file (for example, + // `gs://translation-test/input.docx`) or a wildcard (for example, + // `gs://translation-test/*`). + // + // File mime type is determined based on extension. Supported mime type + // includes: + // - `pdf`, application/pdf + // - `docx`, + // application/vnd.openxmlformats-officedocument.wordprocessingml.document + // - `pptx`, + // application/vnd.openxmlformats-officedocument.presentationml.presentation + // - `xlsx`, + // application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + // + // The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB. + // The max file size to support for `.pdf` is 1GB and the max page limit is + // 1000 pages. + // The max file size to support for all input documents is 1GB. + GcsSource gcs_source = 1; + } +} + +// Output configuration for BatchTranslateDocument request. +message BatchDocumentOutputConfig { + // The destination of output. The destination directory provided must exist + // and be empty. + oneof destination { + // Google Cloud Storage destination for output content. + // For every single input document (for example, gs://a/b/c.[extension]), we + // generate at most 2 * n output files. (n is the # of target_language_codes + // in the BatchTranslateDocumentRequest). + // + // While the input documents are being processed, we write/update an index + // file `index.csv` under `gcs_destination.output_uri_prefix` (for example, + // gs://translation_output/index.csv) The index file is generated/updated as + // new files are being translated. The format is: + // + // input_document,target_language_code,translation_output,error_output, + // glossary_translation_output,glossary_error_output + // + // `input_document` is one file we matched using gcs_source.input_uri. + // `target_language_code` is provided in the request. + // `translation_output` contains the translations. (details provided below) + // `error_output` contains the error message during processing of the file. + // Both translations_file and errors_file could be empty strings if we have + // no content to output. + // `glossary_translation_output` and `glossary_error_output` are the + // translated output/error when we apply glossaries. They could also be + // empty if we have no content to output. + // + // Once a row is present in index.csv, the input/output matching never + // changes. Callers should also expect all the content in input_file are + // processed and ready to be consumed (that is, no partial output file is + // written). + // + // Since index.csv will be keeping updated during the process, please make + // sure there is no custom retention policy applied on the output bucket + // that may avoid file updating. + // (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + // + // The naming format of translation output files follows (for target + // language code [trg]): `translation_output`: + // gs://translation_output/a_b_c_[trg]_translation.[extension] + // `glossary_translation_output`: + // gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The + // output document will maintain the same file format as the input document. + // + // The naming format of error output files follows (for target language code + // [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt + // `glossary_error_output`: + // gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error + // output is a txt file containing error details. + GcsDestination gcs_destination = 1; + } +} + +// Stored in the +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field returned by BatchTranslateDocument if at least one document is +// translated successfully. +message BatchTranslateDocumentResponse { + // Total number of pages to translate in all documents. Documents without + // clear page definition (such as XLSX) are not counted. + int64 total_pages = 1; + + // Number of successfully translated pages in all documents. Documents without + // clear page definition (such as XLSX) are not counted. + int64 translated_pages = 2; + + // Number of pages that failed to process in all documents. Documents without + // clear page definition (such as XLSX) are not counted. + int64 failed_pages = 3; + + // Number of billable pages in documents with clear page definition (such as + // PDF, DOCX, PPTX) + int64 total_billable_pages = 4; + + // Total number of characters (Unicode codepoints) in all documents. + int64 total_characters = 5; + + // Number of successfully translated characters (Unicode codepoints) in all + // documents. + int64 translated_characters = 6; + + // Number of characters that have failed to process (Unicode codepoints) in + // all documents. + int64 failed_characters = 7; + + // Number of billable characters (Unicode codepoints) in documents without + // clear page definition, such as XLSX. + int64 total_billable_characters = 8; + + // Time when the operation was submitted. + google.protobuf.Timestamp submit_time = 9; + + // The time when the operation is finished and + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is + // set to true. + google.protobuf.Timestamp end_time = 10; +} + +// State metadata for the batch translation operation. +message BatchTranslateDocumentMetadata { + // State of the job. + enum State { + // Invalid. + STATE_UNSPECIFIED = 0; + + // Request is being processed. + RUNNING = 1; + + // The batch is processed, and at least one item was successfully processed. + SUCCEEDED = 2; + + // The batch is done and no item was successfully processed. + FAILED = 3; + + // Request is in the process of being canceled after caller invoked + // longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4; + + // The batch is done after the user has called the + // longrunning.Operations.CancelOperation. Any records processed before the + // cancel command are output as specified in the request. + CANCELLED = 5; + } + + // The state of the operation. + State state = 1; + + // Total number of pages to translate in all documents so far. Documents + // without clear page definition (such as XLSX) are not counted. + int64 total_pages = 2; + + // Number of successfully translated pages in all documents so far. Documents + // without clear page definition (such as XLSX) are not counted. + int64 translated_pages = 3; + + // Number of pages that failed to process in all documents so far. Documents + // without clear page definition (such as XLSX) are not counted. + int64 failed_pages = 4; + + // Number of billable pages in documents with clear page definition (such as + // PDF, DOCX, PPTX) so far. + int64 total_billable_pages = 5; + + // Total number of characters (Unicode codepoints) in all documents so far. + int64 total_characters = 6; + + // Number of successfully translated characters (Unicode codepoints) in all + // documents so far. + int64 translated_characters = 7; + + // Number of characters that have failed to process (Unicode codepoints) in + // all documents so far. + int64 failed_characters = 8; + + // Number of billable characters (Unicode codepoints) in documents without + // clear page definition (such as XLSX) so far. + int64 total_billable_characters = 9; + + // Time when the operation was submitted. + google.protobuf.Timestamp submit_time = 10; +} diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto index 878af796289..03386518d8b 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Translate.V3Beta1"; @@ -1241,6 +1242,19 @@ message BatchTranslateDocumentRequest { // Optional. Glossaries to be applied. It's keyed by target language code. map glossaries = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. File format conversion map to be applied to all input files. + // Map's key is the original mime_type. Map's value is the target mime_type of + // translated documents. + // + // Supported file format conversion includes: + // - `application/pdf` to + // `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + // + // If nothing specified, output files will be in the same format as the + // original file. + map format_conversions = 8 + [(google.api.field_behavior) = OPTIONAL]; } // Input configuration for BatchTranslateDocument request. diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index 81abb38d1cd..da1115d1019 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -88,6 +88,20 @@ export namespace google { */ public getSupportedLanguages(request: google.cloud.translation.v3.IGetSupportedLanguagesRequest): Promise; + /** + * Calls TranslateDocument. + * @param request TranslateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TranslateDocumentResponse + */ + public translateDocument(request: google.cloud.translation.v3.ITranslateDocumentRequest, callback: google.cloud.translation.v3.TranslationService.TranslateDocumentCallback): void; + + /** + * Calls TranslateDocument. + * @param request TranslateDocumentRequest message or plain object + * @returns Promise + */ + public translateDocument(request: google.cloud.translation.v3.ITranslateDocumentRequest): Promise; + /** * Calls BatchTranslateText. * @param request BatchTranslateTextRequest message or plain object @@ -102,6 +116,20 @@ export namespace google { */ public batchTranslateText(request: google.cloud.translation.v3.IBatchTranslateTextRequest): Promise; + /** + * Calls BatchTranslateDocument. + * @param request BatchTranslateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchTranslateDocument(request: google.cloud.translation.v3.IBatchTranslateDocumentRequest, callback: google.cloud.translation.v3.TranslationService.BatchTranslateDocumentCallback): void; + + /** + * Calls BatchTranslateDocument. + * @param request BatchTranslateDocumentRequest message or plain object + * @returns Promise + */ + public batchTranslateDocument(request: google.cloud.translation.v3.IBatchTranslateDocumentRequest): Promise; + /** * Calls CreateGlossary. * @param request CreateGlossaryRequest message or plain object @@ -182,6 +210,13 @@ export namespace google { */ type GetSupportedLanguagesCallback = (error: (Error|null), response?: google.cloud.translation.v3.SupportedLanguages) => void; + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#translateDocument}. + * @param error Error, if any + * @param [response] TranslateDocumentResponse + */ + type TranslateDocumentCallback = (error: (Error|null), response?: google.cloud.translation.v3.TranslateDocumentResponse) => void; + /** * Callback as used by {@link google.cloud.translation.v3.TranslationService#batchTranslateText}. * @param error Error, if any @@ -189,6 +224,13 @@ export namespace google { */ type BatchTranslateTextCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#batchTranslateDocument}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchTranslateDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.translation.v3.TranslationService#createGlossary}. * @param error Error, if any @@ -1625,1601 +1667,2766 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a BatchTranslateTextRequest. */ - interface IBatchTranslateTextRequest { - - /** BatchTranslateTextRequest parent */ - parent?: (string|null); - - /** BatchTranslateTextRequest sourceLanguageCode */ - sourceLanguageCode?: (string|null); - - /** BatchTranslateTextRequest targetLanguageCodes */ - targetLanguageCodes?: (string[]|null); - - /** BatchTranslateTextRequest models */ - models?: ({ [k: string]: string }|null); - - /** BatchTranslateTextRequest inputConfigs */ - inputConfigs?: (google.cloud.translation.v3.IInputConfig[]|null); + /** Properties of a DocumentInputConfig. */ + interface IDocumentInputConfig { - /** BatchTranslateTextRequest outputConfig */ - outputConfig?: (google.cloud.translation.v3.IOutputConfig|null); + /** DocumentInputConfig content */ + content?: (Uint8Array|string|null); - /** BatchTranslateTextRequest glossaries */ - glossaries?: ({ [k: string]: google.cloud.translation.v3.ITranslateTextGlossaryConfig }|null); + /** DocumentInputConfig gcsSource */ + gcsSource?: (google.cloud.translation.v3.IGcsSource|null); - /** BatchTranslateTextRequest labels */ - labels?: ({ [k: string]: string }|null); + /** DocumentInputConfig mimeType */ + mimeType?: (string|null); } - /** Represents a BatchTranslateTextRequest. */ - class BatchTranslateTextRequest implements IBatchTranslateTextRequest { + /** Represents a DocumentInputConfig. */ + class DocumentInputConfig implements IDocumentInputConfig { /** - * Constructs a new BatchTranslateTextRequest. + * Constructs a new DocumentInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.IBatchTranslateTextRequest); - - /** BatchTranslateTextRequest parent. */ - public parent: string; - - /** BatchTranslateTextRequest sourceLanguageCode. */ - public sourceLanguageCode: string; - - /** BatchTranslateTextRequest targetLanguageCodes. */ - public targetLanguageCodes: string[]; - - /** BatchTranslateTextRequest models. */ - public models: { [k: string]: string }; + constructor(properties?: google.cloud.translation.v3.IDocumentInputConfig); - /** BatchTranslateTextRequest inputConfigs. */ - public inputConfigs: google.cloud.translation.v3.IInputConfig[]; + /** DocumentInputConfig content. */ + public content?: (Uint8Array|string|null); - /** BatchTranslateTextRequest outputConfig. */ - public outputConfig?: (google.cloud.translation.v3.IOutputConfig|null); + /** DocumentInputConfig gcsSource. */ + public gcsSource?: (google.cloud.translation.v3.IGcsSource|null); - /** BatchTranslateTextRequest glossaries. */ - public glossaries: { [k: string]: google.cloud.translation.v3.ITranslateTextGlossaryConfig }; + /** DocumentInputConfig mimeType. */ + public mimeType: string; - /** BatchTranslateTextRequest labels. */ - public labels: { [k: string]: string }; + /** DocumentInputConfig source. */ + public source?: ("content"|"gcsSource"); /** - * Creates a new BatchTranslateTextRequest instance using the specified properties. + * Creates a new DocumentInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns BatchTranslateTextRequest instance + * @returns DocumentInputConfig instance */ - public static create(properties?: google.cloud.translation.v3.IBatchTranslateTextRequest): google.cloud.translation.v3.BatchTranslateTextRequest; + public static create(properties?: google.cloud.translation.v3.IDocumentInputConfig): google.cloud.translation.v3.DocumentInputConfig; /** - * Encodes the specified BatchTranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateTextRequest.verify|verify} messages. - * @param message BatchTranslateTextRequest message or plain object to encode + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.translation.v3.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.IBatchTranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchTranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateTextRequest.verify|verify} messages. - * @param message BatchTranslateTextRequest message or plain object to encode + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.IBatchTranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchTranslateTextRequest message from the specified reader or buffer. + * Decodes a DocumentInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchTranslateTextRequest + * @returns DocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchTranslateTextRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DocumentInputConfig; /** - * Decodes a BatchTranslateTextRequest message from the specified reader or buffer, length delimited. + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchTranslateTextRequest + * @returns DocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchTranslateTextRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DocumentInputConfig; /** - * Verifies a BatchTranslateTextRequest message. + * Verifies a DocumentInputConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchTranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchTranslateTextRequest + * @returns DocumentInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchTranslateTextRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DocumentInputConfig; /** - * Creates a plain object from a BatchTranslateTextRequest message. Also converts values to other types if specified. - * @param message BatchTranslateTextRequest + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. + * @param message DocumentInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.BatchTranslateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.DocumentInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchTranslateTextRequest to JSON. + * Converts this DocumentInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchTranslateMetadata. */ - interface IBatchTranslateMetadata { - - /** BatchTranslateMetadata state */ - state?: (google.cloud.translation.v3.BatchTranslateMetadata.State|keyof typeof google.cloud.translation.v3.BatchTranslateMetadata.State|null); - - /** BatchTranslateMetadata translatedCharacters */ - translatedCharacters?: (number|Long|string|null); - - /** BatchTranslateMetadata failedCharacters */ - failedCharacters?: (number|Long|string|null); + /** Properties of a DocumentOutputConfig. */ + interface IDocumentOutputConfig { - /** BatchTranslateMetadata totalCharacters */ - totalCharacters?: (number|Long|string|null); + /** DocumentOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.translation.v3.IGcsDestination|null); - /** BatchTranslateMetadata submitTime */ - submitTime?: (google.protobuf.ITimestamp|null); + /** DocumentOutputConfig mimeType */ + mimeType?: (string|null); } - /** Represents a BatchTranslateMetadata. */ - class BatchTranslateMetadata implements IBatchTranslateMetadata { + /** Represents a DocumentOutputConfig. */ + class DocumentOutputConfig implements IDocumentOutputConfig { /** - * Constructs a new BatchTranslateMetadata. + * Constructs a new DocumentOutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.IBatchTranslateMetadata); - - /** BatchTranslateMetadata state. */ - public state: (google.cloud.translation.v3.BatchTranslateMetadata.State|keyof typeof google.cloud.translation.v3.BatchTranslateMetadata.State); - - /** BatchTranslateMetadata translatedCharacters. */ - public translatedCharacters: (number|Long|string); + constructor(properties?: google.cloud.translation.v3.IDocumentOutputConfig); - /** BatchTranslateMetadata failedCharacters. */ - public failedCharacters: (number|Long|string); + /** DocumentOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.translation.v3.IGcsDestination|null); - /** BatchTranslateMetadata totalCharacters. */ - public totalCharacters: (number|Long|string); + /** DocumentOutputConfig mimeType. */ + public mimeType: string; - /** BatchTranslateMetadata submitTime. */ - public submitTime?: (google.protobuf.ITimestamp|null); + /** DocumentOutputConfig destination. */ + public destination?: "gcsDestination"; /** - * Creates a new BatchTranslateMetadata instance using the specified properties. + * Creates a new DocumentOutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns BatchTranslateMetadata instance + * @returns DocumentOutputConfig instance */ - public static create(properties?: google.cloud.translation.v3.IBatchTranslateMetadata): google.cloud.translation.v3.BatchTranslateMetadata; + public static create(properties?: google.cloud.translation.v3.IDocumentOutputConfig): google.cloud.translation.v3.DocumentOutputConfig; /** - * Encodes the specified BatchTranslateMetadata message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateMetadata.verify|verify} messages. - * @param message BatchTranslateMetadata message or plain object to encode + * Encodes the specified DocumentOutputConfig message. Does not implicitly {@link google.cloud.translation.v3.DocumentOutputConfig.verify|verify} messages. + * @param message DocumentOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.IBatchTranslateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.IDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchTranslateMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateMetadata.verify|verify} messages. - * @param message BatchTranslateMetadata message or plain object to encode + * Encodes the specified DocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DocumentOutputConfig.verify|verify} messages. + * @param message DocumentOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.IBatchTranslateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.IDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchTranslateMetadata message from the specified reader or buffer. + * Decodes a DocumentOutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchTranslateMetadata + * @returns DocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchTranslateMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DocumentOutputConfig; /** - * Decodes a BatchTranslateMetadata message from the specified reader or buffer, length delimited. + * Decodes a DocumentOutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchTranslateMetadata + * @returns DocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchTranslateMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DocumentOutputConfig; /** - * Verifies a BatchTranslateMetadata message. + * Verifies a DocumentOutputConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchTranslateMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentOutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchTranslateMetadata + * @returns DocumentOutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchTranslateMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DocumentOutputConfig; /** - * Creates a plain object from a BatchTranslateMetadata message. Also converts values to other types if specified. - * @param message BatchTranslateMetadata + * Creates a plain object from a DocumentOutputConfig message. Also converts values to other types if specified. + * @param message DocumentOutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.BatchTranslateMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.DocumentOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchTranslateMetadata to JSON. + * Converts this DocumentOutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace BatchTranslateMetadata { + /** Properties of a TranslateDocumentRequest. */ + interface ITranslateDocumentRequest { - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - RUNNING = 1, - SUCCEEDED = 2, - FAILED = 3, - CANCELLING = 4, - CANCELLED = 5 - } - } + /** TranslateDocumentRequest parent */ + parent?: (string|null); - /** Properties of a BatchTranslateResponse. */ - interface IBatchTranslateResponse { + /** TranslateDocumentRequest sourceLanguageCode */ + sourceLanguageCode?: (string|null); - /** BatchTranslateResponse totalCharacters */ - totalCharacters?: (number|Long|string|null); + /** TranslateDocumentRequest targetLanguageCode */ + targetLanguageCode?: (string|null); - /** BatchTranslateResponse translatedCharacters */ - translatedCharacters?: (number|Long|string|null); + /** TranslateDocumentRequest documentInputConfig */ + documentInputConfig?: (google.cloud.translation.v3.IDocumentInputConfig|null); - /** BatchTranslateResponse failedCharacters */ - failedCharacters?: (number|Long|string|null); + /** TranslateDocumentRequest documentOutputConfig */ + documentOutputConfig?: (google.cloud.translation.v3.IDocumentOutputConfig|null); - /** BatchTranslateResponse submitTime */ - submitTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentRequest model */ + model?: (string|null); - /** BatchTranslateResponse endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentRequest glossaryConfig */ + glossaryConfig?: (google.cloud.translation.v3.ITranslateTextGlossaryConfig|null); + + /** TranslateDocumentRequest labels */ + labels?: ({ [k: string]: string }|null); } - /** Represents a BatchTranslateResponse. */ - class BatchTranslateResponse implements IBatchTranslateResponse { + /** Represents a TranslateDocumentRequest. */ + class TranslateDocumentRequest implements ITranslateDocumentRequest { /** - * Constructs a new BatchTranslateResponse. + * Constructs a new TranslateDocumentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.IBatchTranslateResponse); + constructor(properties?: google.cloud.translation.v3.ITranslateDocumentRequest); - /** BatchTranslateResponse totalCharacters. */ - public totalCharacters: (number|Long|string); + /** TranslateDocumentRequest parent. */ + public parent: string; - /** BatchTranslateResponse translatedCharacters. */ - public translatedCharacters: (number|Long|string); + /** TranslateDocumentRequest sourceLanguageCode. */ + public sourceLanguageCode: string; - /** BatchTranslateResponse failedCharacters. */ - public failedCharacters: (number|Long|string); + /** TranslateDocumentRequest targetLanguageCode. */ + public targetLanguageCode: string; - /** BatchTranslateResponse submitTime. */ - public submitTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentRequest documentInputConfig. */ + public documentInputConfig?: (google.cloud.translation.v3.IDocumentInputConfig|null); - /** BatchTranslateResponse endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentRequest documentOutputConfig. */ + public documentOutputConfig?: (google.cloud.translation.v3.IDocumentOutputConfig|null); + + /** TranslateDocumentRequest model. */ + public model: string; + + /** TranslateDocumentRequest glossaryConfig. */ + public glossaryConfig?: (google.cloud.translation.v3.ITranslateTextGlossaryConfig|null); + + /** TranslateDocumentRequest labels. */ + public labels: { [k: string]: string }; /** - * Creates a new BatchTranslateResponse instance using the specified properties. + * Creates a new TranslateDocumentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchTranslateResponse instance + * @returns TranslateDocumentRequest instance */ - public static create(properties?: google.cloud.translation.v3.IBatchTranslateResponse): google.cloud.translation.v3.BatchTranslateResponse; + public static create(properties?: google.cloud.translation.v3.ITranslateDocumentRequest): google.cloud.translation.v3.TranslateDocumentRequest; /** - * Encodes the specified BatchTranslateResponse message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateResponse.verify|verify} messages. - * @param message BatchTranslateResponse message or plain object to encode + * Encodes the specified TranslateDocumentRequest message. Does not implicitly {@link google.cloud.translation.v3.TranslateDocumentRequest.verify|verify} messages. + * @param message TranslateDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.IBatchTranslateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.ITranslateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchTranslateResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateResponse.verify|verify} messages. - * @param message BatchTranslateResponse message or plain object to encode + * Encodes the specified TranslateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.TranslateDocumentRequest.verify|verify} messages. + * @param message TranslateDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.IBatchTranslateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.ITranslateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchTranslateResponse message from the specified reader or buffer. + * Decodes a TranslateDocumentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchTranslateResponse + * @returns TranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchTranslateResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.TranslateDocumentRequest; /** - * Decodes a BatchTranslateResponse message from the specified reader or buffer, length delimited. + * Decodes a TranslateDocumentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchTranslateResponse + * @returns TranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchTranslateResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.TranslateDocumentRequest; /** - * Verifies a BatchTranslateResponse message. + * Verifies a TranslateDocumentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchTranslateResponse message from a plain object. Also converts values to their respective internal types. + * Creates a TranslateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchTranslateResponse + * @returns TranslateDocumentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchTranslateResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.TranslateDocumentRequest; /** - * Creates a plain object from a BatchTranslateResponse message. Also converts values to other types if specified. - * @param message BatchTranslateResponse + * Creates a plain object from a TranslateDocumentRequest message. Also converts values to other types if specified. + * @param message TranslateDocumentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.BatchTranslateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.TranslateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchTranslateResponse to JSON. + * Converts this TranslateDocumentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GlossaryInputConfig. */ - interface IGlossaryInputConfig { + /** Properties of a DocumentTranslation. */ + interface IDocumentTranslation { - /** GlossaryInputConfig gcsSource */ - gcsSource?: (google.cloud.translation.v3.IGcsSource|null); + /** DocumentTranslation byteStreamOutputs */ + byteStreamOutputs?: (Uint8Array[]|null); + + /** DocumentTranslation mimeType */ + mimeType?: (string|null); + + /** DocumentTranslation detectedLanguageCode */ + detectedLanguageCode?: (string|null); } - /** Represents a GlossaryInputConfig. */ - class GlossaryInputConfig implements IGlossaryInputConfig { + /** Represents a DocumentTranslation. */ + class DocumentTranslation implements IDocumentTranslation { /** - * Constructs a new GlossaryInputConfig. + * Constructs a new DocumentTranslation. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.IGlossaryInputConfig); + constructor(properties?: google.cloud.translation.v3.IDocumentTranslation); - /** GlossaryInputConfig gcsSource. */ - public gcsSource?: (google.cloud.translation.v3.IGcsSource|null); + /** DocumentTranslation byteStreamOutputs. */ + public byteStreamOutputs: Uint8Array[]; - /** GlossaryInputConfig source. */ - public source?: "gcsSource"; + /** DocumentTranslation mimeType. */ + public mimeType: string; + + /** DocumentTranslation detectedLanguageCode. */ + public detectedLanguageCode: string; /** - * Creates a new GlossaryInputConfig instance using the specified properties. + * Creates a new DocumentTranslation instance using the specified properties. * @param [properties] Properties to set - * @returns GlossaryInputConfig instance + * @returns DocumentTranslation instance */ - public static create(properties?: google.cloud.translation.v3.IGlossaryInputConfig): google.cloud.translation.v3.GlossaryInputConfig; + public static create(properties?: google.cloud.translation.v3.IDocumentTranslation): google.cloud.translation.v3.DocumentTranslation; /** - * Encodes the specified GlossaryInputConfig message. Does not implicitly {@link google.cloud.translation.v3.GlossaryInputConfig.verify|verify} messages. - * @param message GlossaryInputConfig message or plain object to encode + * Encodes the specified DocumentTranslation message. Does not implicitly {@link google.cloud.translation.v3.DocumentTranslation.verify|verify} messages. + * @param message DocumentTranslation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.IGlossaryInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.IDocumentTranslation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GlossaryInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GlossaryInputConfig.verify|verify} messages. - * @param message GlossaryInputConfig message or plain object to encode + * Encodes the specified DocumentTranslation message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DocumentTranslation.verify|verify} messages. + * @param message DocumentTranslation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.IGlossaryInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.IDocumentTranslation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GlossaryInputConfig message from the specified reader or buffer. + * Decodes a DocumentTranslation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GlossaryInputConfig + * @returns DocumentTranslation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.GlossaryInputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DocumentTranslation; /** - * Decodes a GlossaryInputConfig message from the specified reader or buffer, length delimited. + * Decodes a DocumentTranslation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GlossaryInputConfig + * @returns DocumentTranslation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.GlossaryInputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DocumentTranslation; /** - * Verifies a GlossaryInputConfig message. + * Verifies a DocumentTranslation message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GlossaryInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentTranslation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GlossaryInputConfig + * @returns DocumentTranslation */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.GlossaryInputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DocumentTranslation; /** - * Creates a plain object from a GlossaryInputConfig message. Also converts values to other types if specified. - * @param message GlossaryInputConfig + * Creates a plain object from a DocumentTranslation message. Also converts values to other types if specified. + * @param message DocumentTranslation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.GlossaryInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.DocumentTranslation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GlossaryInputConfig to JSON. + * Converts this DocumentTranslation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Glossary. */ - interface IGlossary { - - /** Glossary name */ - name?: (string|null); - - /** Glossary languagePair */ - languagePair?: (google.cloud.translation.v3.Glossary.ILanguageCodePair|null); - - /** Glossary languageCodesSet */ - languageCodesSet?: (google.cloud.translation.v3.Glossary.ILanguageCodesSet|null); + /** Properties of a TranslateDocumentResponse. */ + interface ITranslateDocumentResponse { - /** Glossary inputConfig */ - inputConfig?: (google.cloud.translation.v3.IGlossaryInputConfig|null); + /** TranslateDocumentResponse documentTranslation */ + documentTranslation?: (google.cloud.translation.v3.IDocumentTranslation|null); - /** Glossary entryCount */ - entryCount?: (number|null); + /** TranslateDocumentResponse glossaryDocumentTranslation */ + glossaryDocumentTranslation?: (google.cloud.translation.v3.IDocumentTranslation|null); - /** Glossary submitTime */ - submitTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentResponse model */ + model?: (string|null); - /** Glossary endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentResponse glossaryConfig */ + glossaryConfig?: (google.cloud.translation.v3.ITranslateTextGlossaryConfig|null); } - /** Represents a Glossary. */ - class Glossary implements IGlossary { + /** Represents a TranslateDocumentResponse. */ + class TranslateDocumentResponse implements ITranslateDocumentResponse { /** - * Constructs a new Glossary. + * Constructs a new TranslateDocumentResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.IGlossary); - - /** Glossary name. */ - public name: string; - - /** Glossary languagePair. */ - public languagePair?: (google.cloud.translation.v3.Glossary.ILanguageCodePair|null); - - /** Glossary languageCodesSet. */ - public languageCodesSet?: (google.cloud.translation.v3.Glossary.ILanguageCodesSet|null); + constructor(properties?: google.cloud.translation.v3.ITranslateDocumentResponse); - /** Glossary inputConfig. */ - public inputConfig?: (google.cloud.translation.v3.IGlossaryInputConfig|null); - - /** Glossary entryCount. */ - public entryCount: number; + /** TranslateDocumentResponse documentTranslation. */ + public documentTranslation?: (google.cloud.translation.v3.IDocumentTranslation|null); - /** Glossary submitTime. */ - public submitTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentResponse glossaryDocumentTranslation. */ + public glossaryDocumentTranslation?: (google.cloud.translation.v3.IDocumentTranslation|null); - /** Glossary endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** TranslateDocumentResponse model. */ + public model: string; - /** Glossary languages. */ - public languages?: ("languagePair"|"languageCodesSet"); + /** TranslateDocumentResponse glossaryConfig. */ + public glossaryConfig?: (google.cloud.translation.v3.ITranslateTextGlossaryConfig|null); /** - * Creates a new Glossary instance using the specified properties. + * Creates a new TranslateDocumentResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Glossary instance + * @returns TranslateDocumentResponse instance */ - public static create(properties?: google.cloud.translation.v3.IGlossary): google.cloud.translation.v3.Glossary; + public static create(properties?: google.cloud.translation.v3.ITranslateDocumentResponse): google.cloud.translation.v3.TranslateDocumentResponse; /** - * Encodes the specified Glossary message. Does not implicitly {@link google.cloud.translation.v3.Glossary.verify|verify} messages. - * @param message Glossary message or plain object to encode + * Encodes the specified TranslateDocumentResponse message. Does not implicitly {@link google.cloud.translation.v3.TranslateDocumentResponse.verify|verify} messages. + * @param message TranslateDocumentResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.IGlossary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.ITranslateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Glossary message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.verify|verify} messages. - * @param message Glossary message or plain object to encode + * Encodes the specified TranslateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.TranslateDocumentResponse.verify|verify} messages. + * @param message TranslateDocumentResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.IGlossary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.ITranslateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Glossary message from the specified reader or buffer. + * Decodes a TranslateDocumentResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Glossary + * @returns TranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.Glossary; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.TranslateDocumentResponse; /** - * Decodes a Glossary message from the specified reader or buffer, length delimited. + * Decodes a TranslateDocumentResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Glossary + * @returns TranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.Glossary; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.TranslateDocumentResponse; /** - * Verifies a Glossary message. + * Verifies a TranslateDocumentResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Glossary message from a plain object. Also converts values to their respective internal types. + * Creates a TranslateDocumentResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Glossary + * @returns TranslateDocumentResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.Glossary; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.TranslateDocumentResponse; /** - * Creates a plain object from a Glossary message. Also converts values to other types if specified. - * @param message Glossary + * Creates a plain object from a TranslateDocumentResponse message. Also converts values to other types if specified. + * @param message TranslateDocumentResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.Glossary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.TranslateDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Glossary to JSON. + * Converts this TranslateDocumentResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Glossary { + /** Properties of a BatchTranslateTextRequest. */ + interface IBatchTranslateTextRequest { - /** Properties of a LanguageCodePair. */ - interface ILanguageCodePair { + /** BatchTranslateTextRequest parent */ + parent?: (string|null); - /** LanguageCodePair sourceLanguageCode */ - sourceLanguageCode?: (string|null); + /** BatchTranslateTextRequest sourceLanguageCode */ + sourceLanguageCode?: (string|null); - /** LanguageCodePair targetLanguageCode */ - targetLanguageCode?: (string|null); - } + /** BatchTranslateTextRequest targetLanguageCodes */ + targetLanguageCodes?: (string[]|null); - /** Represents a LanguageCodePair. */ - class LanguageCodePair implements ILanguageCodePair { + /** BatchTranslateTextRequest models */ + models?: ({ [k: string]: string }|null); - /** - * Constructs a new LanguageCodePair. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.translation.v3.Glossary.ILanguageCodePair); + /** BatchTranslateTextRequest inputConfigs */ + inputConfigs?: (google.cloud.translation.v3.IInputConfig[]|null); - /** LanguageCodePair sourceLanguageCode. */ - public sourceLanguageCode: string; + /** BatchTranslateTextRequest outputConfig */ + outputConfig?: (google.cloud.translation.v3.IOutputConfig|null); - /** LanguageCodePair targetLanguageCode. */ - public targetLanguageCode: string; + /** BatchTranslateTextRequest glossaries */ + glossaries?: ({ [k: string]: google.cloud.translation.v3.ITranslateTextGlossaryConfig }|null); - /** - * Creates a new LanguageCodePair instance using the specified properties. - * @param [properties] Properties to set - * @returns LanguageCodePair instance - */ - public static create(properties?: google.cloud.translation.v3.Glossary.ILanguageCodePair): google.cloud.translation.v3.Glossary.LanguageCodePair; + /** BatchTranslateTextRequest labels */ + labels?: ({ [k: string]: string }|null); + } - /** - * Encodes the specified LanguageCodePair message. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodePair.verify|verify} messages. - * @param message LanguageCodePair message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.translation.v3.Glossary.ILanguageCodePair, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a BatchTranslateTextRequest. */ + class BatchTranslateTextRequest implements IBatchTranslateTextRequest { - /** - * Encodes the specified LanguageCodePair message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodePair.verify|verify} messages. - * @param message LanguageCodePair message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.translation.v3.Glossary.ILanguageCodePair, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new BatchTranslateTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IBatchTranslateTextRequest); - /** - * Decodes a LanguageCodePair message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LanguageCodePair - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.Glossary.LanguageCodePair; + /** BatchTranslateTextRequest parent. */ + public parent: string; - /** - * Decodes a LanguageCodePair message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LanguageCodePair - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.Glossary.LanguageCodePair; + /** BatchTranslateTextRequest sourceLanguageCode. */ + public sourceLanguageCode: string; - /** - * Verifies a LanguageCodePair message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** BatchTranslateTextRequest targetLanguageCodes. */ + public targetLanguageCodes: string[]; - /** - * Creates a LanguageCodePair message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LanguageCodePair - */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.Glossary.LanguageCodePair; + /** BatchTranslateTextRequest models. */ + public models: { [k: string]: string }; - /** - * Creates a plain object from a LanguageCodePair message. Also converts values to other types if specified. - * @param message LanguageCodePair - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.translation.v3.Glossary.LanguageCodePair, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** BatchTranslateTextRequest inputConfigs. */ + public inputConfigs: google.cloud.translation.v3.IInputConfig[]; - /** - * Converts this LanguageCodePair to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** BatchTranslateTextRequest outputConfig. */ + public outputConfig?: (google.cloud.translation.v3.IOutputConfig|null); - /** Properties of a LanguageCodesSet. */ - interface ILanguageCodesSet { + /** BatchTranslateTextRequest glossaries. */ + public glossaries: { [k: string]: google.cloud.translation.v3.ITranslateTextGlossaryConfig }; - /** LanguageCodesSet languageCodes */ - languageCodes?: (string[]|null); - } + /** BatchTranslateTextRequest labels. */ + public labels: { [k: string]: string }; - /** Represents a LanguageCodesSet. */ - class LanguageCodesSet implements ILanguageCodesSet { + /** + * Creates a new BatchTranslateTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchTranslateTextRequest instance + */ + public static create(properties?: google.cloud.translation.v3.IBatchTranslateTextRequest): google.cloud.translation.v3.BatchTranslateTextRequest; - /** - * Constructs a new LanguageCodesSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.translation.v3.Glossary.ILanguageCodesSet); + /** + * Encodes the specified BatchTranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateTextRequest.verify|verify} messages. + * @param message BatchTranslateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IBatchTranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** LanguageCodesSet languageCodes. */ - public languageCodes: string[]; + /** + * Encodes the specified BatchTranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateTextRequest.verify|verify} messages. + * @param message BatchTranslateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IBatchTranslateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new LanguageCodesSet instance using the specified properties. - * @param [properties] Properties to set - * @returns LanguageCodesSet instance - */ - public static create(properties?: google.cloud.translation.v3.Glossary.ILanguageCodesSet): google.cloud.translation.v3.Glossary.LanguageCodesSet; + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchTranslateTextRequest; - /** - * Encodes the specified LanguageCodesSet message. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodesSet.verify|verify} messages. - * @param message LanguageCodesSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.translation.v3.Glossary.ILanguageCodesSet, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchTranslateTextRequest; - /** - * Encodes the specified LanguageCodesSet message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodesSet.verify|verify} messages. - * @param message LanguageCodesSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.translation.v3.Glossary.ILanguageCodesSet, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a BatchTranslateTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a LanguageCodesSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LanguageCodesSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.Glossary.LanguageCodesSet; + /** + * Creates a BatchTranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchTranslateTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchTranslateTextRequest; - /** - * Decodes a LanguageCodesSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LanguageCodesSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.Glossary.LanguageCodesSet; + /** + * Creates a plain object from a BatchTranslateTextRequest message. Also converts values to other types if specified. + * @param message BatchTranslateTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.BatchTranslateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a LanguageCodesSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this BatchTranslateTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a LanguageCodesSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LanguageCodesSet - */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.Glossary.LanguageCodesSet; + /** Properties of a BatchTranslateMetadata. */ + interface IBatchTranslateMetadata { + + /** BatchTranslateMetadata state */ + state?: (google.cloud.translation.v3.BatchTranslateMetadata.State|keyof typeof google.cloud.translation.v3.BatchTranslateMetadata.State|null); + + /** BatchTranslateMetadata translatedCharacters */ + translatedCharacters?: (number|Long|string|null); + + /** BatchTranslateMetadata failedCharacters */ + failedCharacters?: (number|Long|string|null); + + /** BatchTranslateMetadata totalCharacters */ + totalCharacters?: (number|Long|string|null); + + /** BatchTranslateMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchTranslateMetadata. */ + class BatchTranslateMetadata implements IBatchTranslateMetadata { + + /** + * Constructs a new BatchTranslateMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IBatchTranslateMetadata); + + /** BatchTranslateMetadata state. */ + public state: (google.cloud.translation.v3.BatchTranslateMetadata.State|keyof typeof google.cloud.translation.v3.BatchTranslateMetadata.State); + + /** BatchTranslateMetadata translatedCharacters. */ + public translatedCharacters: (number|Long|string); + + /** BatchTranslateMetadata failedCharacters. */ + public failedCharacters: (number|Long|string); + + /** BatchTranslateMetadata totalCharacters. */ + public totalCharacters: (number|Long|string); + + /** BatchTranslateMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchTranslateMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchTranslateMetadata instance + */ + public static create(properties?: google.cloud.translation.v3.IBatchTranslateMetadata): google.cloud.translation.v3.BatchTranslateMetadata; + + /** + * Encodes the specified BatchTranslateMetadata message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateMetadata.verify|verify} messages. + * @param message BatchTranslateMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IBatchTranslateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchTranslateMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateMetadata.verify|verify} messages. + * @param message BatchTranslateMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IBatchTranslateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchTranslateMetadata; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchTranslateMetadata; + + /** + * Verifies a BatchTranslateMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchTranslateMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchTranslateMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchTranslateMetadata; + + /** + * Creates a plain object from a BatchTranslateMetadata message. Also converts values to other types if specified. + * @param message BatchTranslateMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.BatchTranslateMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchTranslateMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BatchTranslateMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } + + /** Properties of a BatchTranslateResponse. */ + interface IBatchTranslateResponse { + + /** BatchTranslateResponse totalCharacters */ + totalCharacters?: (number|Long|string|null); + + /** BatchTranslateResponse translatedCharacters */ + translatedCharacters?: (number|Long|string|null); + + /** BatchTranslateResponse failedCharacters */ + failedCharacters?: (number|Long|string|null); + + /** BatchTranslateResponse submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchTranslateResponse endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchTranslateResponse. */ + class BatchTranslateResponse implements IBatchTranslateResponse { + + /** + * Constructs a new BatchTranslateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IBatchTranslateResponse); + + /** BatchTranslateResponse totalCharacters. */ + public totalCharacters: (number|Long|string); + + /** BatchTranslateResponse translatedCharacters. */ + public translatedCharacters: (number|Long|string); + + /** BatchTranslateResponse failedCharacters. */ + public failedCharacters: (number|Long|string); + + /** BatchTranslateResponse submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchTranslateResponse endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchTranslateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchTranslateResponse instance + */ + public static create(properties?: google.cloud.translation.v3.IBatchTranslateResponse): google.cloud.translation.v3.BatchTranslateResponse; + + /** + * Encodes the specified BatchTranslateResponse message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateResponse.verify|verify} messages. + * @param message BatchTranslateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IBatchTranslateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchTranslateResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateResponse.verify|verify} messages. + * @param message BatchTranslateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IBatchTranslateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchTranslateResponse; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchTranslateResponse; + + /** + * Verifies a BatchTranslateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchTranslateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchTranslateResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchTranslateResponse; + + /** + * Creates a plain object from a BatchTranslateResponse message. Also converts values to other types if specified. + * @param message BatchTranslateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.BatchTranslateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchTranslateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GlossaryInputConfig. */ + interface IGlossaryInputConfig { + + /** GlossaryInputConfig gcsSource */ + gcsSource?: (google.cloud.translation.v3.IGcsSource|null); + } + + /** Represents a GlossaryInputConfig. */ + class GlossaryInputConfig implements IGlossaryInputConfig { + + /** + * Constructs a new GlossaryInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IGlossaryInputConfig); + + /** GlossaryInputConfig gcsSource. */ + public gcsSource?: (google.cloud.translation.v3.IGcsSource|null); + + /** GlossaryInputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new GlossaryInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GlossaryInputConfig instance + */ + public static create(properties?: google.cloud.translation.v3.IGlossaryInputConfig): google.cloud.translation.v3.GlossaryInputConfig; + + /** + * Encodes the specified GlossaryInputConfig message. Does not implicitly {@link google.cloud.translation.v3.GlossaryInputConfig.verify|verify} messages. + * @param message GlossaryInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IGlossaryInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GlossaryInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GlossaryInputConfig.verify|verify} messages. + * @param message GlossaryInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IGlossaryInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.GlossaryInputConfig; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.GlossaryInputConfig; + + /** + * Verifies a GlossaryInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GlossaryInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GlossaryInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.GlossaryInputConfig; + + /** + * Creates a plain object from a GlossaryInputConfig message. Also converts values to other types if specified. + * @param message GlossaryInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.GlossaryInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GlossaryInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Glossary. */ + interface IGlossary { + + /** Glossary name */ + name?: (string|null); + + /** Glossary languagePair */ + languagePair?: (google.cloud.translation.v3.Glossary.ILanguageCodePair|null); + + /** Glossary languageCodesSet */ + languageCodesSet?: (google.cloud.translation.v3.Glossary.ILanguageCodesSet|null); + + /** Glossary inputConfig */ + inputConfig?: (google.cloud.translation.v3.IGlossaryInputConfig|null); + + /** Glossary entryCount */ + entryCount?: (number|null); + + /** Glossary submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** Glossary endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Glossary. */ + class Glossary implements IGlossary { + + /** + * Constructs a new Glossary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IGlossary); + + /** Glossary name. */ + public name: string; + + /** Glossary languagePair. */ + public languagePair?: (google.cloud.translation.v3.Glossary.ILanguageCodePair|null); + + /** Glossary languageCodesSet. */ + public languageCodesSet?: (google.cloud.translation.v3.Glossary.ILanguageCodesSet|null); + + /** Glossary inputConfig. */ + public inputConfig?: (google.cloud.translation.v3.IGlossaryInputConfig|null); + + /** Glossary entryCount. */ + public entryCount: number; + + /** Glossary submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** Glossary endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Glossary languages. */ + public languages?: ("languagePair"|"languageCodesSet"); + + /** + * Creates a new Glossary instance using the specified properties. + * @param [properties] Properties to set + * @returns Glossary instance + */ + public static create(properties?: google.cloud.translation.v3.IGlossary): google.cloud.translation.v3.Glossary; + + /** + * Encodes the specified Glossary message. Does not implicitly {@link google.cloud.translation.v3.Glossary.verify|verify} messages. + * @param message Glossary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IGlossary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Glossary message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.verify|verify} messages. + * @param message Glossary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IGlossary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Glossary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.Glossary; + + /** + * Decodes a Glossary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.Glossary; + + /** + * Verifies a Glossary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Glossary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Glossary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.Glossary; + + /** + * Creates a plain object from a Glossary message. Also converts values to other types if specified. + * @param message Glossary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.Glossary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Glossary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Glossary { + + /** Properties of a LanguageCodePair. */ + interface ILanguageCodePair { + + /** LanguageCodePair sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** LanguageCodePair targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a LanguageCodePair. */ + class LanguageCodePair implements ILanguageCodePair { + + /** + * Constructs a new LanguageCodePair. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.Glossary.ILanguageCodePair); + + /** LanguageCodePair sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** LanguageCodePair targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new LanguageCodePair instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageCodePair instance + */ + public static create(properties?: google.cloud.translation.v3.Glossary.ILanguageCodePair): google.cloud.translation.v3.Glossary.LanguageCodePair; + + /** + * Encodes the specified LanguageCodePair message. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodePair.verify|verify} messages. + * @param message LanguageCodePair message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.Glossary.ILanguageCodePair, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageCodePair message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodePair.verify|verify} messages. + * @param message LanguageCodePair message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.Glossary.ILanguageCodePair, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.Glossary.LanguageCodePair; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.Glossary.LanguageCodePair; + + /** + * Verifies a LanguageCodePair message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LanguageCodePair message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageCodePair + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.Glossary.LanguageCodePair; + + /** + * Creates a plain object from a LanguageCodePair message. Also converts values to other types if specified. + * @param message LanguageCodePair + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.Glossary.LanguageCodePair, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageCodePair to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LanguageCodesSet. */ + interface ILanguageCodesSet { + + /** LanguageCodesSet languageCodes */ + languageCodes?: (string[]|null); + } + + /** Represents a LanguageCodesSet. */ + class LanguageCodesSet implements ILanguageCodesSet { + + /** + * Constructs a new LanguageCodesSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.Glossary.ILanguageCodesSet); + + /** LanguageCodesSet languageCodes. */ + public languageCodes: string[]; + + /** + * Creates a new LanguageCodesSet instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageCodesSet instance + */ + public static create(properties?: google.cloud.translation.v3.Glossary.ILanguageCodesSet): google.cloud.translation.v3.Glossary.LanguageCodesSet; + + /** + * Encodes the specified LanguageCodesSet message. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodesSet.verify|verify} messages. + * @param message LanguageCodesSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.Glossary.ILanguageCodesSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageCodesSet message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodesSet.verify|verify} messages. + * @param message LanguageCodesSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.Glossary.ILanguageCodesSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.Glossary.LanguageCodesSet; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.Glossary.LanguageCodesSet; + + /** + * Verifies a LanguageCodesSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LanguageCodesSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageCodesSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.Glossary.LanguageCodesSet; + + /** + * Creates a plain object from a LanguageCodesSet message. Also converts values to other types if specified. + * @param message LanguageCodesSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.Glossary.LanguageCodesSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageCodesSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a CreateGlossaryRequest. */ + interface ICreateGlossaryRequest { + + /** CreateGlossaryRequest parent */ + parent?: (string|null); + + /** CreateGlossaryRequest glossary */ + glossary?: (google.cloud.translation.v3.IGlossary|null); + } + + /** Represents a CreateGlossaryRequest. */ + class CreateGlossaryRequest implements ICreateGlossaryRequest { + + /** + * Constructs a new CreateGlossaryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.ICreateGlossaryRequest); + + /** CreateGlossaryRequest parent. */ + public parent: string; + + /** CreateGlossaryRequest glossary. */ + public glossary?: (google.cloud.translation.v3.IGlossary|null); + + /** + * Creates a new CreateGlossaryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGlossaryRequest instance + */ + public static create(properties?: google.cloud.translation.v3.ICreateGlossaryRequest): google.cloud.translation.v3.CreateGlossaryRequest; + + /** + * Encodes the specified CreateGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryRequest.verify|verify} messages. + * @param message CreateGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.ICreateGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryRequest.verify|verify} messages. + * @param message CreateGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.ICreateGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.CreateGlossaryRequest; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.CreateGlossaryRequest; + + /** + * Verifies a CreateGlossaryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGlossaryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.CreateGlossaryRequest; + + /** + * Creates a plain object from a CreateGlossaryRequest message. Also converts values to other types if specified. + * @param message CreateGlossaryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.CreateGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGlossaryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetGlossaryRequest. */ + interface IGetGlossaryRequest { + + /** GetGlossaryRequest name */ + name?: (string|null); + } + + /** Represents a GetGlossaryRequest. */ + class GetGlossaryRequest implements IGetGlossaryRequest { + + /** + * Constructs a new GetGlossaryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IGetGlossaryRequest); + + /** GetGlossaryRequest name. */ + public name: string; + + /** + * Creates a new GetGlossaryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGlossaryRequest instance + */ + public static create(properties?: google.cloud.translation.v3.IGetGlossaryRequest): google.cloud.translation.v3.GetGlossaryRequest; + + /** + * Encodes the specified GetGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.GetGlossaryRequest.verify|verify} messages. + * @param message GetGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IGetGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GetGlossaryRequest.verify|verify} messages. + * @param message GetGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IGetGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.GetGlossaryRequest; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.GetGlossaryRequest; + + /** + * Verifies a GetGlossaryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGlossaryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.GetGlossaryRequest; + + /** + * Creates a plain object from a GetGlossaryRequest message. Also converts values to other types if specified. + * @param message GetGlossaryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.GetGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGlossaryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteGlossaryRequest. */ + interface IDeleteGlossaryRequest { + + /** DeleteGlossaryRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGlossaryRequest. */ + class DeleteGlossaryRequest implements IDeleteGlossaryRequest { + + /** + * Constructs a new DeleteGlossaryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IDeleteGlossaryRequest); + + /** DeleteGlossaryRequest name. */ + public name: string; + + /** + * Creates a new DeleteGlossaryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlossaryRequest instance + */ + public static create(properties?: google.cloud.translation.v3.IDeleteGlossaryRequest): google.cloud.translation.v3.DeleteGlossaryRequest; + + /** + * Encodes the specified DeleteGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryRequest.verify|verify} messages. + * @param message DeleteGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IDeleteGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryRequest.verify|verify} messages. + * @param message DeleteGlossaryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IDeleteGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DeleteGlossaryRequest; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DeleteGlossaryRequest; + + /** + * Verifies a DeleteGlossaryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlossaryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DeleteGlossaryRequest; + + /** + * Creates a plain object from a DeleteGlossaryRequest message. Also converts values to other types if specified. + * @param message DeleteGlossaryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.DeleteGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlossaryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlossariesRequest. */ + interface IListGlossariesRequest { + + /** ListGlossariesRequest parent */ + parent?: (string|null); + + /** ListGlossariesRequest pageSize */ + pageSize?: (number|null); + + /** ListGlossariesRequest pageToken */ + pageToken?: (string|null); + + /** ListGlossariesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListGlossariesRequest. */ + class ListGlossariesRequest implements IListGlossariesRequest { + + /** + * Constructs a new ListGlossariesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IListGlossariesRequest); + + /** ListGlossariesRequest parent. */ + public parent: string; + + /** ListGlossariesRequest pageSize. */ + public pageSize: number; + + /** ListGlossariesRequest pageToken. */ + public pageToken: string; + + /** ListGlossariesRequest filter. */ + public filter: string; + + /** + * Creates a new ListGlossariesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlossariesRequest instance + */ + public static create(properties?: google.cloud.translation.v3.IListGlossariesRequest): google.cloud.translation.v3.ListGlossariesRequest; + + /** + * Encodes the specified ListGlossariesRequest message. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesRequest.verify|verify} messages. + * @param message ListGlossariesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IListGlossariesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlossariesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesRequest.verify|verify} messages. + * @param message ListGlossariesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IListGlossariesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.ListGlossariesRequest; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.ListGlossariesRequest; + + /** + * Verifies a ListGlossariesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlossariesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlossariesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.ListGlossariesRequest; + + /** + * Creates a plain object from a ListGlossariesRequest message. Also converts values to other types if specified. + * @param message ListGlossariesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.ListGlossariesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlossariesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlossariesResponse. */ + interface IListGlossariesResponse { + + /** ListGlossariesResponse glossaries */ + glossaries?: (google.cloud.translation.v3.IGlossary[]|null); + + /** ListGlossariesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListGlossariesResponse. */ + class ListGlossariesResponse implements IListGlossariesResponse { + + /** + * Constructs a new ListGlossariesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.translation.v3.IListGlossariesResponse); + + /** ListGlossariesResponse glossaries. */ + public glossaries: google.cloud.translation.v3.IGlossary[]; + + /** ListGlossariesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListGlossariesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlossariesResponse instance + */ + public static create(properties?: google.cloud.translation.v3.IListGlossariesResponse): google.cloud.translation.v3.ListGlossariesResponse; + + /** + * Encodes the specified ListGlossariesResponse message. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesResponse.verify|verify} messages. + * @param message ListGlossariesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.translation.v3.IListGlossariesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlossariesResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesResponse.verify|verify} messages. + * @param message ListGlossariesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.translation.v3.IListGlossariesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.ListGlossariesResponse; + + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.ListGlossariesResponse; + + /** + * Verifies a ListGlossariesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a LanguageCodesSet message. Also converts values to other types if specified. - * @param message LanguageCodesSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.translation.v3.Glossary.LanguageCodesSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a ListGlossariesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlossariesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.ListGlossariesResponse; - /** - * Converts this LanguageCodesSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a ListGlossariesResponse message. Also converts values to other types if specified. + * @param message ListGlossariesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.translation.v3.ListGlossariesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlossariesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Properties of a CreateGlossaryRequest. */ - interface ICreateGlossaryRequest { + /** Properties of a CreateGlossaryMetadata. */ + interface ICreateGlossaryMetadata { - /** CreateGlossaryRequest parent */ - parent?: (string|null); + /** CreateGlossaryMetadata name */ + name?: (string|null); - /** CreateGlossaryRequest glossary */ - glossary?: (google.cloud.translation.v3.IGlossary|null); + /** CreateGlossaryMetadata state */ + state?: (google.cloud.translation.v3.CreateGlossaryMetadata.State|keyof typeof google.cloud.translation.v3.CreateGlossaryMetadata.State|null); + + /** CreateGlossaryMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); } - /** Represents a CreateGlossaryRequest. */ - class CreateGlossaryRequest implements ICreateGlossaryRequest { + /** Represents a CreateGlossaryMetadata. */ + class CreateGlossaryMetadata implements ICreateGlossaryMetadata { /** - * Constructs a new CreateGlossaryRequest. + * Constructs a new CreateGlossaryMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.ICreateGlossaryRequest); + constructor(properties?: google.cloud.translation.v3.ICreateGlossaryMetadata); - /** CreateGlossaryRequest parent. */ - public parent: string; + /** CreateGlossaryMetadata name. */ + public name: string; - /** CreateGlossaryRequest glossary. */ - public glossary?: (google.cloud.translation.v3.IGlossary|null); + /** CreateGlossaryMetadata state. */ + public state: (google.cloud.translation.v3.CreateGlossaryMetadata.State|keyof typeof google.cloud.translation.v3.CreateGlossaryMetadata.State); + + /** CreateGlossaryMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new CreateGlossaryRequest instance using the specified properties. + * Creates a new CreateGlossaryMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns CreateGlossaryRequest instance + * @returns CreateGlossaryMetadata instance */ - public static create(properties?: google.cloud.translation.v3.ICreateGlossaryRequest): google.cloud.translation.v3.CreateGlossaryRequest; + public static create(properties?: google.cloud.translation.v3.ICreateGlossaryMetadata): google.cloud.translation.v3.CreateGlossaryMetadata; /** - * Encodes the specified CreateGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryRequest.verify|verify} messages. - * @param message CreateGlossaryRequest message or plain object to encode + * Encodes the specified CreateGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryMetadata.verify|verify} messages. + * @param message CreateGlossaryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.ICreateGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.ICreateGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryRequest.verify|verify} messages. - * @param message CreateGlossaryRequest message or plain object to encode + * Encodes the specified CreateGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryMetadata.verify|verify} messages. + * @param message CreateGlossaryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.ICreateGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.ICreateGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateGlossaryRequest message from the specified reader or buffer. + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateGlossaryRequest + * @returns CreateGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.CreateGlossaryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.CreateGlossaryMetadata; /** - * Decodes a CreateGlossaryRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateGlossaryRequest + * @returns CreateGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.CreateGlossaryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.CreateGlossaryMetadata; /** - * Verifies a CreateGlossaryRequest message. + * Verifies a CreateGlossaryMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateGlossaryMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateGlossaryRequest + * @returns CreateGlossaryMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.CreateGlossaryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.CreateGlossaryMetadata; /** - * Creates a plain object from a CreateGlossaryRequest message. Also converts values to other types if specified. - * @param message CreateGlossaryRequest + * Creates a plain object from a CreateGlossaryMetadata message. Also converts values to other types if specified. + * @param message CreateGlossaryMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.CreateGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.CreateGlossaryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateGlossaryRequest to JSON. + * Converts this CreateGlossaryMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetGlossaryRequest. */ - interface IGetGlossaryRequest { + namespace CreateGlossaryMetadata { - /** GetGlossaryRequest name */ + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } + + /** Properties of a DeleteGlossaryMetadata. */ + interface IDeleteGlossaryMetadata { + + /** DeleteGlossaryMetadata name */ name?: (string|null); + + /** DeleteGlossaryMetadata state */ + state?: (google.cloud.translation.v3.DeleteGlossaryMetadata.State|keyof typeof google.cloud.translation.v3.DeleteGlossaryMetadata.State|null); + + /** DeleteGlossaryMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); } - /** Represents a GetGlossaryRequest. */ - class GetGlossaryRequest implements IGetGlossaryRequest { + /** Represents a DeleteGlossaryMetadata. */ + class DeleteGlossaryMetadata implements IDeleteGlossaryMetadata { /** - * Constructs a new GetGlossaryRequest. + * Constructs a new DeleteGlossaryMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.IGetGlossaryRequest); + constructor(properties?: google.cloud.translation.v3.IDeleteGlossaryMetadata); - /** GetGlossaryRequest name. */ + /** DeleteGlossaryMetadata name. */ public name: string; + /** DeleteGlossaryMetadata state. */ + public state: (google.cloud.translation.v3.DeleteGlossaryMetadata.State|keyof typeof google.cloud.translation.v3.DeleteGlossaryMetadata.State); + + /** DeleteGlossaryMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + /** - * Creates a new GetGlossaryRequest instance using the specified properties. + * Creates a new DeleteGlossaryMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns GetGlossaryRequest instance + * @returns DeleteGlossaryMetadata instance */ - public static create(properties?: google.cloud.translation.v3.IGetGlossaryRequest): google.cloud.translation.v3.GetGlossaryRequest; + public static create(properties?: google.cloud.translation.v3.IDeleteGlossaryMetadata): google.cloud.translation.v3.DeleteGlossaryMetadata; /** - * Encodes the specified GetGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.GetGlossaryRequest.verify|verify} messages. - * @param message GetGlossaryRequest message or plain object to encode + * Encodes the specified DeleteGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryMetadata.verify|verify} messages. + * @param message DeleteGlossaryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.IGetGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.IDeleteGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GetGlossaryRequest.verify|verify} messages. - * @param message GetGlossaryRequest message or plain object to encode + * Encodes the specified DeleteGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryMetadata.verify|verify} messages. + * @param message DeleteGlossaryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.IGetGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.IDeleteGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetGlossaryRequest message from the specified reader or buffer. + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetGlossaryRequest + * @returns DeleteGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.GetGlossaryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DeleteGlossaryMetadata; /** - * Decodes a GetGlossaryRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetGlossaryRequest + * @returns DeleteGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.GetGlossaryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DeleteGlossaryMetadata; /** - * Verifies a GetGlossaryRequest message. + * Verifies a DeleteGlossaryMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteGlossaryMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetGlossaryRequest + * @returns DeleteGlossaryMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.GetGlossaryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DeleteGlossaryMetadata; /** - * Creates a plain object from a GetGlossaryRequest message. Also converts values to other types if specified. - * @param message GetGlossaryRequest + * Creates a plain object from a DeleteGlossaryMetadata message. Also converts values to other types if specified. + * @param message DeleteGlossaryMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.GetGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.DeleteGlossaryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetGlossaryRequest to JSON. + * Converts this DeleteGlossaryMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteGlossaryRequest. */ - interface IDeleteGlossaryRequest { + namespace DeleteGlossaryMetadata { - /** DeleteGlossaryRequest name */ + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } + + /** Properties of a DeleteGlossaryResponse. */ + interface IDeleteGlossaryResponse { + + /** DeleteGlossaryResponse name */ name?: (string|null); + + /** DeleteGlossaryResponse submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** DeleteGlossaryResponse endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents a DeleteGlossaryRequest. */ - class DeleteGlossaryRequest implements IDeleteGlossaryRequest { + /** Represents a DeleteGlossaryResponse. */ + class DeleteGlossaryResponse implements IDeleteGlossaryResponse { /** - * Constructs a new DeleteGlossaryRequest. + * Constructs a new DeleteGlossaryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.IDeleteGlossaryRequest); + constructor(properties?: google.cloud.translation.v3.IDeleteGlossaryResponse); - /** DeleteGlossaryRequest name. */ + /** DeleteGlossaryResponse name. */ public name: string; + /** DeleteGlossaryResponse submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** DeleteGlossaryResponse endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + /** - * Creates a new DeleteGlossaryRequest instance using the specified properties. + * Creates a new DeleteGlossaryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteGlossaryRequest instance + * @returns DeleteGlossaryResponse instance */ - public static create(properties?: google.cloud.translation.v3.IDeleteGlossaryRequest): google.cloud.translation.v3.DeleteGlossaryRequest; + public static create(properties?: google.cloud.translation.v3.IDeleteGlossaryResponse): google.cloud.translation.v3.DeleteGlossaryResponse; /** - * Encodes the specified DeleteGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryRequest.verify|verify} messages. - * @param message DeleteGlossaryRequest message or plain object to encode + * Encodes the specified DeleteGlossaryResponse message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryResponse.verify|verify} messages. + * @param message DeleteGlossaryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.IDeleteGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.IDeleteGlossaryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DeleteGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryRequest.verify|verify} messages. - * @param message DeleteGlossaryRequest message or plain object to encode + /** + * Encodes the specified DeleteGlossaryResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryResponse.verify|verify} messages. + * @param message DeleteGlossaryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.IDeleteGlossaryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.IDeleteGlossaryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteGlossaryRequest message from the specified reader or buffer. + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteGlossaryRequest + * @returns DeleteGlossaryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DeleteGlossaryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DeleteGlossaryResponse; /** - * Decodes a DeleteGlossaryRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteGlossaryRequest + * @returns DeleteGlossaryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DeleteGlossaryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DeleteGlossaryResponse; /** - * Verifies a DeleteGlossaryRequest message. + * Verifies a DeleteGlossaryResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteGlossaryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteGlossaryRequest + * @returns DeleteGlossaryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DeleteGlossaryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DeleteGlossaryResponse; /** - * Creates a plain object from a DeleteGlossaryRequest message. Also converts values to other types if specified. - * @param message DeleteGlossaryRequest + * Creates a plain object from a DeleteGlossaryResponse message. Also converts values to other types if specified. + * @param message DeleteGlossaryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.DeleteGlossaryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.DeleteGlossaryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteGlossaryRequest to JSON. + * Converts this DeleteGlossaryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListGlossariesRequest. */ - interface IListGlossariesRequest { + /** Properties of a BatchTranslateDocumentRequest. */ + interface IBatchTranslateDocumentRequest { - /** ListGlossariesRequest parent */ + /** BatchTranslateDocumentRequest parent */ parent?: (string|null); - /** ListGlossariesRequest pageSize */ - pageSize?: (number|null); + /** BatchTranslateDocumentRequest sourceLanguageCode */ + sourceLanguageCode?: (string|null); - /** ListGlossariesRequest pageToken */ - pageToken?: (string|null); + /** BatchTranslateDocumentRequest targetLanguageCodes */ + targetLanguageCodes?: (string[]|null); - /** ListGlossariesRequest filter */ - filter?: (string|null); + /** BatchTranslateDocumentRequest inputConfigs */ + inputConfigs?: (google.cloud.translation.v3.IBatchDocumentInputConfig[]|null); + + /** BatchTranslateDocumentRequest outputConfig */ + outputConfig?: (google.cloud.translation.v3.IBatchDocumentOutputConfig|null); + + /** BatchTranslateDocumentRequest models */ + models?: ({ [k: string]: string }|null); + + /** BatchTranslateDocumentRequest glossaries */ + glossaries?: ({ [k: string]: google.cloud.translation.v3.ITranslateTextGlossaryConfig }|null); + + /** BatchTranslateDocumentRequest formatConversions */ + formatConversions?: ({ [k: string]: string }|null); } - /** Represents a ListGlossariesRequest. */ - class ListGlossariesRequest implements IListGlossariesRequest { + /** Represents a BatchTranslateDocumentRequest. */ + class BatchTranslateDocumentRequest implements IBatchTranslateDocumentRequest { /** - * Constructs a new ListGlossariesRequest. + * Constructs a new BatchTranslateDocumentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.IListGlossariesRequest); + constructor(properties?: google.cloud.translation.v3.IBatchTranslateDocumentRequest); - /** ListGlossariesRequest parent. */ + /** BatchTranslateDocumentRequest parent. */ public parent: string; - /** ListGlossariesRequest pageSize. */ - public pageSize: number; + /** BatchTranslateDocumentRequest sourceLanguageCode. */ + public sourceLanguageCode: string; - /** ListGlossariesRequest pageToken. */ - public pageToken: string; + /** BatchTranslateDocumentRequest targetLanguageCodes. */ + public targetLanguageCodes: string[]; - /** ListGlossariesRequest filter. */ - public filter: string; + /** BatchTranslateDocumentRequest inputConfigs. */ + public inputConfigs: google.cloud.translation.v3.IBatchDocumentInputConfig[]; + + /** BatchTranslateDocumentRequest outputConfig. */ + public outputConfig?: (google.cloud.translation.v3.IBatchDocumentOutputConfig|null); + + /** BatchTranslateDocumentRequest models. */ + public models: { [k: string]: string }; + + /** BatchTranslateDocumentRequest glossaries. */ + public glossaries: { [k: string]: google.cloud.translation.v3.ITranslateTextGlossaryConfig }; + + /** BatchTranslateDocumentRequest formatConversions. */ + public formatConversions: { [k: string]: string }; /** - * Creates a new ListGlossariesRequest instance using the specified properties. + * Creates a new BatchTranslateDocumentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListGlossariesRequest instance + * @returns BatchTranslateDocumentRequest instance */ - public static create(properties?: google.cloud.translation.v3.IListGlossariesRequest): google.cloud.translation.v3.ListGlossariesRequest; + public static create(properties?: google.cloud.translation.v3.IBatchTranslateDocumentRequest): google.cloud.translation.v3.BatchTranslateDocumentRequest; /** - * Encodes the specified ListGlossariesRequest message. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesRequest.verify|verify} messages. - * @param message ListGlossariesRequest message or plain object to encode + * Encodes the specified BatchTranslateDocumentRequest message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateDocumentRequest.verify|verify} messages. + * @param message BatchTranslateDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.IListGlossariesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.IBatchTranslateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListGlossariesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesRequest.verify|verify} messages. - * @param message ListGlossariesRequest message or plain object to encode + * Encodes the specified BatchTranslateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateDocumentRequest.verify|verify} messages. + * @param message BatchTranslateDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.IListGlossariesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.IBatchTranslateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListGlossariesRequest message from the specified reader or buffer. + * Decodes a BatchTranslateDocumentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListGlossariesRequest + * @returns BatchTranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.ListGlossariesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchTranslateDocumentRequest; /** - * Decodes a ListGlossariesRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchTranslateDocumentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListGlossariesRequest + * @returns BatchTranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.ListGlossariesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchTranslateDocumentRequest; /** - * Verifies a ListGlossariesRequest message. + * Verifies a BatchTranslateDocumentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListGlossariesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchTranslateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListGlossariesRequest + * @returns BatchTranslateDocumentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.ListGlossariesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchTranslateDocumentRequest; /** - * Creates a plain object from a ListGlossariesRequest message. Also converts values to other types if specified. - * @param message ListGlossariesRequest + * Creates a plain object from a BatchTranslateDocumentRequest message. Also converts values to other types if specified. + * @param message BatchTranslateDocumentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.ListGlossariesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.BatchTranslateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListGlossariesRequest to JSON. + * Converts this BatchTranslateDocumentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListGlossariesResponse. */ - interface IListGlossariesResponse { - - /** ListGlossariesResponse glossaries */ - glossaries?: (google.cloud.translation.v3.IGlossary[]|null); + /** Properties of a BatchDocumentInputConfig. */ + interface IBatchDocumentInputConfig { - /** ListGlossariesResponse nextPageToken */ - nextPageToken?: (string|null); + /** BatchDocumentInputConfig gcsSource */ + gcsSource?: (google.cloud.translation.v3.IGcsSource|null); } - /** Represents a ListGlossariesResponse. */ - class ListGlossariesResponse implements IListGlossariesResponse { + /** Represents a BatchDocumentInputConfig. */ + class BatchDocumentInputConfig implements IBatchDocumentInputConfig { /** - * Constructs a new ListGlossariesResponse. + * Constructs a new BatchDocumentInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.IListGlossariesResponse); + constructor(properties?: google.cloud.translation.v3.IBatchDocumentInputConfig); - /** ListGlossariesResponse glossaries. */ - public glossaries: google.cloud.translation.v3.IGlossary[]; + /** BatchDocumentInputConfig gcsSource. */ + public gcsSource?: (google.cloud.translation.v3.IGcsSource|null); - /** ListGlossariesResponse nextPageToken. */ - public nextPageToken: string; + /** BatchDocumentInputConfig source. */ + public source?: "gcsSource"; /** - * Creates a new ListGlossariesResponse instance using the specified properties. + * Creates a new BatchDocumentInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ListGlossariesResponse instance + * @returns BatchDocumentInputConfig instance */ - public static create(properties?: google.cloud.translation.v3.IListGlossariesResponse): google.cloud.translation.v3.ListGlossariesResponse; + public static create(properties?: google.cloud.translation.v3.IBatchDocumentInputConfig): google.cloud.translation.v3.BatchDocumentInputConfig; /** - * Encodes the specified ListGlossariesResponse message. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesResponse.verify|verify} messages. - * @param message ListGlossariesResponse message or plain object to encode + * Encodes the specified BatchDocumentInputConfig message. Does not implicitly {@link google.cloud.translation.v3.BatchDocumentInputConfig.verify|verify} messages. + * @param message BatchDocumentInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.IListGlossariesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.IBatchDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListGlossariesResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesResponse.verify|verify} messages. - * @param message ListGlossariesResponse message or plain object to encode + * Encodes the specified BatchDocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchDocumentInputConfig.verify|verify} messages. + * @param message BatchDocumentInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.IListGlossariesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.IBatchDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListGlossariesResponse message from the specified reader or buffer. + * Decodes a BatchDocumentInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListGlossariesResponse + * @returns BatchDocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.ListGlossariesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchDocumentInputConfig; /** - * Decodes a ListGlossariesResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchDocumentInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListGlossariesResponse + * @returns BatchDocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.ListGlossariesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchDocumentInputConfig; /** - * Verifies a ListGlossariesResponse message. + * Verifies a BatchDocumentInputConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListGlossariesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDocumentInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListGlossariesResponse + * @returns BatchDocumentInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.ListGlossariesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchDocumentInputConfig; /** - * Creates a plain object from a ListGlossariesResponse message. Also converts values to other types if specified. - * @param message ListGlossariesResponse + * Creates a plain object from a BatchDocumentInputConfig message. Also converts values to other types if specified. + * @param message BatchDocumentInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.ListGlossariesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.BatchDocumentInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListGlossariesResponse to JSON. + * Converts this BatchDocumentInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateGlossaryMetadata. */ - interface ICreateGlossaryMetadata { - - /** CreateGlossaryMetadata name */ - name?: (string|null); - - /** CreateGlossaryMetadata state */ - state?: (google.cloud.translation.v3.CreateGlossaryMetadata.State|keyof typeof google.cloud.translation.v3.CreateGlossaryMetadata.State|null); + /** Properties of a BatchDocumentOutputConfig. */ + interface IBatchDocumentOutputConfig { - /** CreateGlossaryMetadata submitTime */ - submitTime?: (google.protobuf.ITimestamp|null); + /** BatchDocumentOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.translation.v3.IGcsDestination|null); } - /** Represents a CreateGlossaryMetadata. */ - class CreateGlossaryMetadata implements ICreateGlossaryMetadata { + /** Represents a BatchDocumentOutputConfig. */ + class BatchDocumentOutputConfig implements IBatchDocumentOutputConfig { /** - * Constructs a new CreateGlossaryMetadata. + * Constructs a new BatchDocumentOutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.ICreateGlossaryMetadata); - - /** CreateGlossaryMetadata name. */ - public name: string; + constructor(properties?: google.cloud.translation.v3.IBatchDocumentOutputConfig); - /** CreateGlossaryMetadata state. */ - public state: (google.cloud.translation.v3.CreateGlossaryMetadata.State|keyof typeof google.cloud.translation.v3.CreateGlossaryMetadata.State); + /** BatchDocumentOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.translation.v3.IGcsDestination|null); - /** CreateGlossaryMetadata submitTime. */ - public submitTime?: (google.protobuf.ITimestamp|null); + /** BatchDocumentOutputConfig destination. */ + public destination?: "gcsDestination"; /** - * Creates a new CreateGlossaryMetadata instance using the specified properties. + * Creates a new BatchDocumentOutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns CreateGlossaryMetadata instance + * @returns BatchDocumentOutputConfig instance */ - public static create(properties?: google.cloud.translation.v3.ICreateGlossaryMetadata): google.cloud.translation.v3.CreateGlossaryMetadata; + public static create(properties?: google.cloud.translation.v3.IBatchDocumentOutputConfig): google.cloud.translation.v3.BatchDocumentOutputConfig; /** - * Encodes the specified CreateGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryMetadata.verify|verify} messages. - * @param message CreateGlossaryMetadata message or plain object to encode + * Encodes the specified BatchDocumentOutputConfig message. Does not implicitly {@link google.cloud.translation.v3.BatchDocumentOutputConfig.verify|verify} messages. + * @param message BatchDocumentOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.ICreateGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.IBatchDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryMetadata.verify|verify} messages. - * @param message CreateGlossaryMetadata message or plain object to encode + * Encodes the specified BatchDocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchDocumentOutputConfig.verify|verify} messages. + * @param message BatchDocumentOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.ICreateGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.IBatchDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateGlossaryMetadata message from the specified reader or buffer. + * Decodes a BatchDocumentOutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateGlossaryMetadata + * @returns BatchDocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.CreateGlossaryMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchDocumentOutputConfig; /** - * Decodes a CreateGlossaryMetadata message from the specified reader or buffer, length delimited. + * Decodes a BatchDocumentOutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateGlossaryMetadata + * @returns BatchDocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.CreateGlossaryMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchDocumentOutputConfig; /** - * Verifies a CreateGlossaryMetadata message. + * Verifies a BatchDocumentOutputConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDocumentOutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateGlossaryMetadata + * @returns BatchDocumentOutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.CreateGlossaryMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchDocumentOutputConfig; /** - * Creates a plain object from a CreateGlossaryMetadata message. Also converts values to other types if specified. - * @param message CreateGlossaryMetadata + * Creates a plain object from a BatchDocumentOutputConfig message. Also converts values to other types if specified. + * @param message BatchDocumentOutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.CreateGlossaryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.BatchDocumentOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateGlossaryMetadata to JSON. + * Converts this BatchDocumentOutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace CreateGlossaryMetadata { + /** Properties of a BatchTranslateDocumentResponse. */ + interface IBatchTranslateDocumentResponse { - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - RUNNING = 1, - SUCCEEDED = 2, - FAILED = 3, - CANCELLING = 4, - CANCELLED = 5 - } - } + /** BatchTranslateDocumentResponse totalPages */ + totalPages?: (number|Long|string|null); - /** Properties of a DeleteGlossaryMetadata. */ - interface IDeleteGlossaryMetadata { + /** BatchTranslateDocumentResponse translatedPages */ + translatedPages?: (number|Long|string|null); - /** DeleteGlossaryMetadata name */ - name?: (string|null); + /** BatchTranslateDocumentResponse failedPages */ + failedPages?: (number|Long|string|null); - /** DeleteGlossaryMetadata state */ - state?: (google.cloud.translation.v3.DeleteGlossaryMetadata.State|keyof typeof google.cloud.translation.v3.DeleteGlossaryMetadata.State|null); + /** BatchTranslateDocumentResponse totalBillablePages */ + totalBillablePages?: (number|Long|string|null); - /** DeleteGlossaryMetadata submitTime */ + /** BatchTranslateDocumentResponse totalCharacters */ + totalCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentResponse translatedCharacters */ + translatedCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentResponse failedCharacters */ + failedCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentResponse totalBillableCharacters */ + totalBillableCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentResponse submitTime */ submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchTranslateDocumentResponse endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents a DeleteGlossaryMetadata. */ - class DeleteGlossaryMetadata implements IDeleteGlossaryMetadata { + /** Represents a BatchTranslateDocumentResponse. */ + class BatchTranslateDocumentResponse implements IBatchTranslateDocumentResponse { /** - * Constructs a new DeleteGlossaryMetadata. + * Constructs a new BatchTranslateDocumentResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.IDeleteGlossaryMetadata); + constructor(properties?: google.cloud.translation.v3.IBatchTranslateDocumentResponse); - /** DeleteGlossaryMetadata name. */ - public name: string; + /** BatchTranslateDocumentResponse totalPages. */ + public totalPages: (number|Long|string); - /** DeleteGlossaryMetadata state. */ - public state: (google.cloud.translation.v3.DeleteGlossaryMetadata.State|keyof typeof google.cloud.translation.v3.DeleteGlossaryMetadata.State); + /** BatchTranslateDocumentResponse translatedPages. */ + public translatedPages: (number|Long|string); - /** DeleteGlossaryMetadata submitTime. */ + /** BatchTranslateDocumentResponse failedPages. */ + public failedPages: (number|Long|string); + + /** BatchTranslateDocumentResponse totalBillablePages. */ + public totalBillablePages: (number|Long|string); + + /** BatchTranslateDocumentResponse totalCharacters. */ + public totalCharacters: (number|Long|string); + + /** BatchTranslateDocumentResponse translatedCharacters. */ + public translatedCharacters: (number|Long|string); + + /** BatchTranslateDocumentResponse failedCharacters. */ + public failedCharacters: (number|Long|string); + + /** BatchTranslateDocumentResponse totalBillableCharacters. */ + public totalBillableCharacters: (number|Long|string); + + /** BatchTranslateDocumentResponse submitTime. */ public submitTime?: (google.protobuf.ITimestamp|null); + /** BatchTranslateDocumentResponse endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + /** - * Creates a new DeleteGlossaryMetadata instance using the specified properties. + * Creates a new BatchTranslateDocumentResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteGlossaryMetadata instance + * @returns BatchTranslateDocumentResponse instance */ - public static create(properties?: google.cloud.translation.v3.IDeleteGlossaryMetadata): google.cloud.translation.v3.DeleteGlossaryMetadata; + public static create(properties?: google.cloud.translation.v3.IBatchTranslateDocumentResponse): google.cloud.translation.v3.BatchTranslateDocumentResponse; /** - * Encodes the specified DeleteGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryMetadata.verify|verify} messages. - * @param message DeleteGlossaryMetadata message or plain object to encode + * Encodes the specified BatchTranslateDocumentResponse message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateDocumentResponse.verify|verify} messages. + * @param message BatchTranslateDocumentResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.IDeleteGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.IBatchTranslateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryMetadata.verify|verify} messages. - * @param message DeleteGlossaryMetadata message or plain object to encode + * Encodes the specified BatchTranslateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateDocumentResponse.verify|verify} messages. + * @param message BatchTranslateDocumentResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.IDeleteGlossaryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.IBatchTranslateDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer. + * Decodes a BatchTranslateDocumentResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteGlossaryMetadata + * @returns BatchTranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DeleteGlossaryMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchTranslateDocumentResponse; /** - * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer, length delimited. + * Decodes a BatchTranslateDocumentResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteGlossaryMetadata + * @returns BatchTranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DeleteGlossaryMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchTranslateDocumentResponse; /** - * Verifies a DeleteGlossaryMetadata message. + * Verifies a BatchTranslateDocumentResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a BatchTranslateDocumentResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteGlossaryMetadata + * @returns BatchTranslateDocumentResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DeleteGlossaryMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchTranslateDocumentResponse; /** - * Creates a plain object from a DeleteGlossaryMetadata message. Also converts values to other types if specified. - * @param message DeleteGlossaryMetadata + * Creates a plain object from a BatchTranslateDocumentResponse message. Also converts values to other types if specified. + * @param message BatchTranslateDocumentResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.DeleteGlossaryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.BatchTranslateDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteGlossaryMetadata to JSON. + * Converts this BatchTranslateDocumentResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace DeleteGlossaryMetadata { + /** Properties of a BatchTranslateDocumentMetadata. */ + interface IBatchTranslateDocumentMetadata { - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - RUNNING = 1, - SUCCEEDED = 2, - FAILED = 3, - CANCELLING = 4, - CANCELLED = 5 - } - } + /** BatchTranslateDocumentMetadata state */ + state?: (google.cloud.translation.v3.BatchTranslateDocumentMetadata.State|keyof typeof google.cloud.translation.v3.BatchTranslateDocumentMetadata.State|null); - /** Properties of a DeleteGlossaryResponse. */ - interface IDeleteGlossaryResponse { + /** BatchTranslateDocumentMetadata totalPages */ + totalPages?: (number|Long|string|null); - /** DeleteGlossaryResponse name */ - name?: (string|null); + /** BatchTranslateDocumentMetadata translatedPages */ + translatedPages?: (number|Long|string|null); - /** DeleteGlossaryResponse submitTime */ - submitTime?: (google.protobuf.ITimestamp|null); + /** BatchTranslateDocumentMetadata failedPages */ + failedPages?: (number|Long|string|null); - /** DeleteGlossaryResponse endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** BatchTranslateDocumentMetadata totalBillablePages */ + totalBillablePages?: (number|Long|string|null); + + /** BatchTranslateDocumentMetadata totalCharacters */ + totalCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentMetadata translatedCharacters */ + translatedCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentMetadata failedCharacters */ + failedCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentMetadata totalBillableCharacters */ + totalBillableCharacters?: (number|Long|string|null); + + /** BatchTranslateDocumentMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); } - /** Represents a DeleteGlossaryResponse. */ - class DeleteGlossaryResponse implements IDeleteGlossaryResponse { + /** Represents a BatchTranslateDocumentMetadata. */ + class BatchTranslateDocumentMetadata implements IBatchTranslateDocumentMetadata { /** - * Constructs a new DeleteGlossaryResponse. + * Constructs a new BatchTranslateDocumentMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.translation.v3.IDeleteGlossaryResponse); + constructor(properties?: google.cloud.translation.v3.IBatchTranslateDocumentMetadata); - /** DeleteGlossaryResponse name. */ - public name: string; + /** BatchTranslateDocumentMetadata state. */ + public state: (google.cloud.translation.v3.BatchTranslateDocumentMetadata.State|keyof typeof google.cloud.translation.v3.BatchTranslateDocumentMetadata.State); - /** DeleteGlossaryResponse submitTime. */ - public submitTime?: (google.protobuf.ITimestamp|null); + /** BatchTranslateDocumentMetadata totalPages. */ + public totalPages: (number|Long|string); - /** DeleteGlossaryResponse endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** BatchTranslateDocumentMetadata translatedPages. */ + public translatedPages: (number|Long|string); + + /** BatchTranslateDocumentMetadata failedPages. */ + public failedPages: (number|Long|string); + + /** BatchTranslateDocumentMetadata totalBillablePages. */ + public totalBillablePages: (number|Long|string); + + /** BatchTranslateDocumentMetadata totalCharacters. */ + public totalCharacters: (number|Long|string); + + /** BatchTranslateDocumentMetadata translatedCharacters. */ + public translatedCharacters: (number|Long|string); + + /** BatchTranslateDocumentMetadata failedCharacters. */ + public failedCharacters: (number|Long|string); + + /** BatchTranslateDocumentMetadata totalBillableCharacters. */ + public totalBillableCharacters: (number|Long|string); + + /** BatchTranslateDocumentMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new DeleteGlossaryResponse instance using the specified properties. + * Creates a new BatchTranslateDocumentMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteGlossaryResponse instance + * @returns BatchTranslateDocumentMetadata instance */ - public static create(properties?: google.cloud.translation.v3.IDeleteGlossaryResponse): google.cloud.translation.v3.DeleteGlossaryResponse; + public static create(properties?: google.cloud.translation.v3.IBatchTranslateDocumentMetadata): google.cloud.translation.v3.BatchTranslateDocumentMetadata; /** - * Encodes the specified DeleteGlossaryResponse message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryResponse.verify|verify} messages. - * @param message DeleteGlossaryResponse message or plain object to encode + * Encodes the specified BatchTranslateDocumentMetadata message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateDocumentMetadata.verify|verify} messages. + * @param message BatchTranslateDocumentMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.translation.v3.IDeleteGlossaryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.translation.v3.IBatchTranslateDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteGlossaryResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryResponse.verify|verify} messages. - * @param message DeleteGlossaryResponse message or plain object to encode + * Encodes the specified BatchTranslateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateDocumentMetadata.verify|verify} messages. + * @param message BatchTranslateDocumentMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.translation.v3.IDeleteGlossaryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.translation.v3.IBatchTranslateDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteGlossaryResponse message from the specified reader or buffer. + * Decodes a BatchTranslateDocumentMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteGlossaryResponse + * @returns BatchTranslateDocumentMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.DeleteGlossaryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.translation.v3.BatchTranslateDocumentMetadata; /** - * Decodes a DeleteGlossaryResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchTranslateDocumentMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteGlossaryResponse + * @returns BatchTranslateDocumentMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.DeleteGlossaryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.translation.v3.BatchTranslateDocumentMetadata; /** - * Verifies a DeleteGlossaryResponse message. + * Verifies a BatchTranslateDocumentMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteGlossaryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchTranslateDocumentMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteGlossaryResponse + * @returns BatchTranslateDocumentMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.DeleteGlossaryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.translation.v3.BatchTranslateDocumentMetadata; /** - * Creates a plain object from a DeleteGlossaryResponse message. Also converts values to other types if specified. - * @param message DeleteGlossaryResponse + * Creates a plain object from a BatchTranslateDocumentMetadata message. Also converts values to other types if specified. + * @param message BatchTranslateDocumentMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.translation.v3.DeleteGlossaryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.translation.v3.BatchTranslateDocumentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteGlossaryResponse to JSON. + * Converts this BatchTranslateDocumentMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + + namespace BatchTranslateDocumentMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLING = 4, + CANCELLED = 5 + } + } } /** Namespace v3beta1. */ @@ -7031,6 +8238,9 @@ export namespace google { /** BatchTranslateDocumentRequest glossaries */ glossaries?: ({ [k: string]: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig }|null); + + /** BatchTranslateDocumentRequest formatConversions */ + formatConversions?: ({ [k: string]: string }|null); } /** Represents a BatchTranslateDocumentRequest. */ @@ -7063,6 +8273,9 @@ export namespace google { /** BatchTranslateDocumentRequest glossaries. */ public glossaries: { [k: string]: google.cloud.translation.v3beta1.ITranslateTextGlossaryConfig }; + /** BatchTranslateDocumentRequest formatConversions. */ + public formatConversions: { [k: string]: string }; + /** * Creates a new BatchTranslateDocumentRequest instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index e26dff40a5a..19bd110eadc 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -197,6 +197,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#translateDocument}. + * @memberof google.cloud.translation.v3.TranslationService + * @typedef TranslateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.translation.v3.TranslateDocumentResponse} [response] TranslateDocumentResponse + */ + + /** + * Calls TranslateDocument. + * @function translateDocument + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.ITranslateDocumentRequest} request TranslateDocumentRequest message or plain object + * @param {google.cloud.translation.v3.TranslationService.TranslateDocumentCallback} callback Node-style callback called with the error, if any, and TranslateDocumentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.translateDocument = function translateDocument(request, callback) { + return this.rpcCall(translateDocument, $root.google.cloud.translation.v3.TranslateDocumentRequest, $root.google.cloud.translation.v3.TranslateDocumentResponse, request, callback); + }, "name", { value: "TranslateDocument" }); + + /** + * Calls TranslateDocument. + * @function translateDocument + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.ITranslateDocumentRequest} request TranslateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.translation.v3.TranslationService#batchTranslateText}. * @memberof google.cloud.translation.v3.TranslationService @@ -230,6 +263,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.translation.v3.TranslationService#batchTranslateDocument}. + * @memberof google.cloud.translation.v3.TranslationService + * @typedef BatchTranslateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchTranslateDocument. + * @function batchTranslateDocument + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IBatchTranslateDocumentRequest} request BatchTranslateDocumentRequest message or plain object + * @param {google.cloud.translation.v3.TranslationService.BatchTranslateDocumentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranslationService.prototype.batchTranslateDocument = function batchTranslateDocument(request, callback) { + return this.rpcCall(batchTranslateDocument, $root.google.cloud.translation.v3.BatchTranslateDocumentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchTranslateDocument" }); + + /** + * Calls BatchTranslateDocument. + * @function batchTranslateDocument + * @memberof google.cloud.translation.v3.TranslationService + * @instance + * @param {google.cloud.translation.v3.IBatchTranslateDocumentRequest} request BatchTranslateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.translation.v3.TranslationService#createGlossary}. * @memberof google.cloud.translation.v3.TranslationService @@ -3748,36 +3814,26 @@ return OutputConfig; })(); - v3.BatchTranslateTextRequest = (function() { + v3.DocumentInputConfig = (function() { /** - * Properties of a BatchTranslateTextRequest. + * Properties of a DocumentInputConfig. * @memberof google.cloud.translation.v3 - * @interface IBatchTranslateTextRequest - * @property {string|null} [parent] BatchTranslateTextRequest parent - * @property {string|null} [sourceLanguageCode] BatchTranslateTextRequest sourceLanguageCode - * @property {Array.|null} [targetLanguageCodes] BatchTranslateTextRequest targetLanguageCodes - * @property {Object.|null} [models] BatchTranslateTextRequest models - * @property {Array.|null} [inputConfigs] BatchTranslateTextRequest inputConfigs - * @property {google.cloud.translation.v3.IOutputConfig|null} [outputConfig] BatchTranslateTextRequest outputConfig - * @property {Object.|null} [glossaries] BatchTranslateTextRequest glossaries - * @property {Object.|null} [labels] BatchTranslateTextRequest labels + * @interface IDocumentInputConfig + * @property {Uint8Array|null} [content] DocumentInputConfig content + * @property {google.cloud.translation.v3.IGcsSource|null} [gcsSource] DocumentInputConfig gcsSource + * @property {string|null} [mimeType] DocumentInputConfig mimeType */ /** - * Constructs a new BatchTranslateTextRequest. + * Constructs a new DocumentInputConfig. * @memberof google.cloud.translation.v3 - * @classdesc Represents a BatchTranslateTextRequest. - * @implements IBatchTranslateTextRequest + * @classdesc Represents a DocumentInputConfig. + * @implements IDocumentInputConfig * @constructor - * @param {google.cloud.translation.v3.IBatchTranslateTextRequest=} [properties] Properties to set + * @param {google.cloud.translation.v3.IDocumentInputConfig=} [properties] Properties to set */ - function BatchTranslateTextRequest(properties) { - this.targetLanguageCodes = []; - this.models = {}; - this.inputConfigs = []; - this.glossaries = {}; - this.labels = {}; + function DocumentInputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3785,237 +3841,118 @@ } /** - * BatchTranslateTextRequest parent. - * @member {string} parent - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest - * @instance - */ - BatchTranslateTextRequest.prototype.parent = ""; - - /** - * BatchTranslateTextRequest sourceLanguageCode. - * @member {string} sourceLanguageCode - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest - * @instance - */ - BatchTranslateTextRequest.prototype.sourceLanguageCode = ""; - - /** - * BatchTranslateTextRequest targetLanguageCodes. - * @member {Array.} targetLanguageCodes - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest - * @instance - */ - BatchTranslateTextRequest.prototype.targetLanguageCodes = $util.emptyArray; - - /** - * BatchTranslateTextRequest models. - * @member {Object.} models - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * DocumentInputConfig content. + * @member {Uint8Array|null|undefined} content + * @memberof google.cloud.translation.v3.DocumentInputConfig * @instance */ - BatchTranslateTextRequest.prototype.models = $util.emptyObject; + DocumentInputConfig.prototype.content = null; /** - * BatchTranslateTextRequest inputConfigs. - * @member {Array.} inputConfigs - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * DocumentInputConfig gcsSource. + * @member {google.cloud.translation.v3.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.translation.v3.DocumentInputConfig * @instance */ - BatchTranslateTextRequest.prototype.inputConfigs = $util.emptyArray; + DocumentInputConfig.prototype.gcsSource = null; /** - * BatchTranslateTextRequest outputConfig. - * @member {google.cloud.translation.v3.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * DocumentInputConfig mimeType. + * @member {string} mimeType + * @memberof google.cloud.translation.v3.DocumentInputConfig * @instance */ - BatchTranslateTextRequest.prototype.outputConfig = null; + DocumentInputConfig.prototype.mimeType = ""; - /** - * BatchTranslateTextRequest glossaries. - * @member {Object.} glossaries - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest - * @instance - */ - BatchTranslateTextRequest.prototype.glossaries = $util.emptyObject; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * BatchTranslateTextRequest labels. - * @member {Object.} labels - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * DocumentInputConfig source. + * @member {"content"|"gcsSource"|undefined} source + * @memberof google.cloud.translation.v3.DocumentInputConfig * @instance */ - BatchTranslateTextRequest.prototype.labels = $util.emptyObject; + Object.defineProperty(DocumentInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["content", "gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new BatchTranslateTextRequest instance using the specified properties. + * Creates a new DocumentInputConfig instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3.DocumentInputConfig * @static - * @param {google.cloud.translation.v3.IBatchTranslateTextRequest=} [properties] Properties to set - * @returns {google.cloud.translation.v3.BatchTranslateTextRequest} BatchTranslateTextRequest instance + * @param {google.cloud.translation.v3.IDocumentInputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3.DocumentInputConfig} DocumentInputConfig instance */ - BatchTranslateTextRequest.create = function create(properties) { - return new BatchTranslateTextRequest(properties); + DocumentInputConfig.create = function create(properties) { + return new DocumentInputConfig(properties); }; /** - * Encodes the specified BatchTranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateTextRequest.verify|verify} messages. + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.translation.v3.DocumentInputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3.DocumentInputConfig * @static - * @param {google.cloud.translation.v3.IBatchTranslateTextRequest} message BatchTranslateTextRequest message or plain object to encode + * @param {google.cloud.translation.v3.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchTranslateTextRequest.encode = function encode(message, writer) { + DocumentInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); - if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) - for (var i = 0; i < message.targetLanguageCodes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); - if (message.models != null && Object.hasOwnProperty.call(message, "models")) - for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); - if (message.inputConfigs != null && message.inputConfigs.length) - for (var i = 0; i < message.inputConfigs.length; ++i) - $root.google.cloud.translation.v3.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) - $root.google.cloud.translation.v3.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.glossaries != null && Object.hasOwnProperty.call(message, "glossaries")) - for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.translation.v3.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mimeType); return writer; }; /** - * Encodes the specified BatchTranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateTextRequest.verify|verify} messages. + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DocumentInputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3.DocumentInputConfig * @static - * @param {google.cloud.translation.v3.IBatchTranslateTextRequest} message BatchTranslateTextRequest message or plain object to encode + * @param {google.cloud.translation.v3.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchTranslateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + DocumentInputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchTranslateTextRequest message from the specified reader or buffer. + * Decodes a DocumentInputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3.DocumentInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.BatchTranslateTextRequest} BatchTranslateTextRequest + * @returns {google.cloud.translation.v3.DocumentInputConfig} DocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchTranslateTextRequest.decode = function decode(reader, length) { + DocumentInputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateTextRequest(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DocumentInputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.content = reader.bytes(); break; case 2: - message.sourceLanguageCode = reader.string(); - break; - case 3: - if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) - message.targetLanguageCodes = []; - message.targetLanguageCodes.push(reader.string()); + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); break; case 4: - if (message.models === $util.emptyObject) - message.models = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.models[key] = value; - break; - case 5: - if (!(message.inputConfigs && message.inputConfigs.length)) - message.inputConfigs = []; - message.inputConfigs.push($root.google.cloud.translation.v3.InputConfig.decode(reader, reader.uint32())); + message.mimeType = reader.string(); break; - case 6: - message.outputConfig = $root.google.cloud.translation.v3.OutputConfig.decode(reader, reader.uint32()); - break; - case 7: - if (message.glossaries === $util.emptyObject) - message.glossaries = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.glossaries[key] = value; - break; - case 9: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - default: - reader.skipType(tag & 7); + default: + reader.skipType(tag & 7); break; } } @@ -4023,251 +3960,144 @@ }; /** - * Decodes a BatchTranslateTextRequest message from the specified reader or buffer, length delimited. + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3.DocumentInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.BatchTranslateTextRequest} BatchTranslateTextRequest + * @returns {google.cloud.translation.v3.DocumentInputConfig} DocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchTranslateTextRequest.decodeDelimited = function decodeDelimited(reader) { + DocumentInputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchTranslateTextRequest message. + * Verifies a DocumentInputConfig message. * @function verify - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3.DocumentInputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchTranslateTextRequest.verify = function verify(message) { + DocumentInputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - if (!$util.isString(message.sourceLanguageCode)) - return "sourceLanguageCode: string expected"; - if (message.targetLanguageCodes != null && message.hasOwnProperty("targetLanguageCodes")) { - if (!Array.isArray(message.targetLanguageCodes)) - return "targetLanguageCodes: array expected"; - for (var i = 0; i < message.targetLanguageCodes.length; ++i) - if (!$util.isString(message.targetLanguageCodes[i])) - return "targetLanguageCodes: string[] expected"; - } - if (message.models != null && message.hasOwnProperty("models")) { - if (!$util.isObject(message.models)) - return "models: object expected"; - var key = Object.keys(message.models); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.models[key[i]])) - return "models: string{k:string} expected"; - } - if (message.inputConfigs != null && message.hasOwnProperty("inputConfigs")) { - if (!Array.isArray(message.inputConfigs)) - return "inputConfigs: array expected"; - for (var i = 0; i < message.inputConfigs.length; ++i) { - var error = $root.google.cloud.translation.v3.InputConfig.verify(message.inputConfigs[i]); - if (error) - return "inputConfigs." + error; - } - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.translation.v3.OutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; + var properties = {}; + if (message.content != null && message.hasOwnProperty("content")) { + properties.source = 1; + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; } - if (message.glossaries != null && message.hasOwnProperty("glossaries")) { - if (!$util.isObject(message.glossaries)) - return "glossaries: object expected"; - var key = Object.keys(message.glossaries); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.verify(message.glossaries[key[i]]); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.translation.v3.GcsSource.verify(message.gcsSource); if (error) - return "glossaries." + error; + return "gcsSource." + error; } } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; return null; }; /** - * Creates a BatchTranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3.DocumentInputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.BatchTranslateTextRequest} BatchTranslateTextRequest + * @returns {google.cloud.translation.v3.DocumentInputConfig} DocumentInputConfig */ - BatchTranslateTextRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.BatchTranslateTextRequest) + DocumentInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.DocumentInputConfig) return object; - var message = new $root.google.cloud.translation.v3.BatchTranslateTextRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.sourceLanguageCode != null) - message.sourceLanguageCode = String(object.sourceLanguageCode); - if (object.targetLanguageCodes) { - if (!Array.isArray(object.targetLanguageCodes)) - throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.targetLanguageCodes: array expected"); - message.targetLanguageCodes = []; - for (var i = 0; i < object.targetLanguageCodes.length; ++i) - message.targetLanguageCodes[i] = String(object.targetLanguageCodes[i]); - } - if (object.models) { - if (typeof object.models !== "object") - throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.models: object expected"); - message.models = {}; - for (var keys = Object.keys(object.models), i = 0; i < keys.length; ++i) - message.models[keys[i]] = String(object.models[keys[i]]); - } - if (object.inputConfigs) { - if (!Array.isArray(object.inputConfigs)) - throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.inputConfigs: array expected"); - message.inputConfigs = []; - for (var i = 0; i < object.inputConfigs.length; ++i) { - if (typeof object.inputConfigs[i] !== "object") - throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.inputConfigs: object expected"); - message.inputConfigs[i] = $root.google.cloud.translation.v3.InputConfig.fromObject(object.inputConfigs[i]); - } - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.translation.v3.OutputConfig.fromObject(object.outputConfig); - } - if (object.glossaries) { - if (typeof object.glossaries !== "object") - throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.glossaries: object expected"); - message.glossaries = {}; - for (var keys = Object.keys(object.glossaries), i = 0; i < keys.length; ++i) { - if (typeof object.glossaries[keys[i]] !== "object") - throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.glossaries: object expected"); - message.glossaries[keys[i]] = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.fromObject(object.glossaries[keys[i]]); - } - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); + var message = new $root.google.cloud.translation.v3.DocumentInputConfig(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length) + message.content = object.content; + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.translation.v3.DocumentInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.fromObject(object.gcsSource); } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); return message; }; /** - * Creates a plain object from a BatchTranslateTextRequest message. Also converts values to other types if specified. + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3.DocumentInputConfig * @static - * @param {google.cloud.translation.v3.BatchTranslateTextRequest} message BatchTranslateTextRequest + * @param {google.cloud.translation.v3.DocumentInputConfig} message DocumentInputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchTranslateTextRequest.toObject = function toObject(message, options) { + DocumentInputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.targetLanguageCodes = []; - object.inputConfigs = []; - } - if (options.objects || options.defaults) { - object.models = {}; - object.glossaries = {}; - object.labels = {}; - } - if (options.defaults) { - object.parent = ""; - object.sourceLanguageCode = ""; - object.outputConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - object.sourceLanguageCode = message.sourceLanguageCode; - if (message.targetLanguageCodes && message.targetLanguageCodes.length) { - object.targetLanguageCodes = []; - for (var j = 0; j < message.targetLanguageCodes.length; ++j) - object.targetLanguageCodes[j] = message.targetLanguageCodes[j]; - } - var keys2; - if (message.models && (keys2 = Object.keys(message.models)).length) { - object.models = {}; - for (var j = 0; j < keys2.length; ++j) - object.models[keys2[j]] = message.models[keys2[j]]; - } - if (message.inputConfigs && message.inputConfigs.length) { - object.inputConfigs = []; - for (var j = 0; j < message.inputConfigs.length; ++j) - object.inputConfigs[j] = $root.google.cloud.translation.v3.InputConfig.toObject(message.inputConfigs[j], options); - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.translation.v3.OutputConfig.toObject(message.outputConfig, options); - if (message.glossaries && (keys2 = Object.keys(message.glossaries)).length) { - object.glossaries = {}; - for (var j = 0; j < keys2.length; ++j) - object.glossaries[keys2[j]] = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.toObject(message.glossaries[keys2[j]], options); + if (options.defaults) + object.mimeType = ""; + if (message.content != null && message.hasOwnProperty("content")) { + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (options.oneofs) + object.source = "content"; } - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.translation.v3.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; return object; }; /** - * Converts this BatchTranslateTextRequest to JSON. + * Converts this DocumentInputConfig to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @memberof google.cloud.translation.v3.DocumentInputConfig * @instance * @returns {Object.} JSON object */ - BatchTranslateTextRequest.prototype.toJSON = function toJSON() { + DocumentInputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchTranslateTextRequest; + return DocumentInputConfig; })(); - v3.BatchTranslateMetadata = (function() { + v3.DocumentOutputConfig = (function() { /** - * Properties of a BatchTranslateMetadata. + * Properties of a DocumentOutputConfig. * @memberof google.cloud.translation.v3 - * @interface IBatchTranslateMetadata - * @property {google.cloud.translation.v3.BatchTranslateMetadata.State|null} [state] BatchTranslateMetadata state - * @property {number|Long|null} [translatedCharacters] BatchTranslateMetadata translatedCharacters - * @property {number|Long|null} [failedCharacters] BatchTranslateMetadata failedCharacters - * @property {number|Long|null} [totalCharacters] BatchTranslateMetadata totalCharacters - * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateMetadata submitTime + * @interface IDocumentOutputConfig + * @property {google.cloud.translation.v3.IGcsDestination|null} [gcsDestination] DocumentOutputConfig gcsDestination + * @property {string|null} [mimeType] DocumentOutputConfig mimeType */ /** - * Constructs a new BatchTranslateMetadata. + * Constructs a new DocumentOutputConfig. * @memberof google.cloud.translation.v3 - * @classdesc Represents a BatchTranslateMetadata. - * @implements IBatchTranslateMetadata + * @classdesc Represents a DocumentOutputConfig. + * @implements IDocumentOutputConfig * @constructor - * @param {google.cloud.translation.v3.IBatchTranslateMetadata=} [properties] Properties to set + * @param {google.cloud.translation.v3.IDocumentOutputConfig=} [properties] Properties to set */ - function BatchTranslateMetadata(properties) { + function DocumentOutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4275,127 +4105,102 @@ } /** - * BatchTranslateMetadata state. - * @member {google.cloud.translation.v3.BatchTranslateMetadata.State} state - * @memberof google.cloud.translation.v3.BatchTranslateMetadata - * @instance - */ - BatchTranslateMetadata.prototype.state = 0; - - /** - * BatchTranslateMetadata translatedCharacters. - * @member {number|Long} translatedCharacters - * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * DocumentOutputConfig gcsDestination. + * @member {google.cloud.translation.v3.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.translation.v3.DocumentOutputConfig * @instance */ - BatchTranslateMetadata.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DocumentOutputConfig.prototype.gcsDestination = null; /** - * BatchTranslateMetadata failedCharacters. - * @member {number|Long} failedCharacters - * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * DocumentOutputConfig mimeType. + * @member {string} mimeType + * @memberof google.cloud.translation.v3.DocumentOutputConfig * @instance */ - BatchTranslateMetadata.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DocumentOutputConfig.prototype.mimeType = ""; - /** - * BatchTranslateMetadata totalCharacters. - * @member {number|Long} totalCharacters - * @memberof google.cloud.translation.v3.BatchTranslateMetadata - * @instance - */ - BatchTranslateMetadata.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * BatchTranslateMetadata submitTime. - * @member {google.protobuf.ITimestamp|null|undefined} submitTime - * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * DocumentOutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.translation.v3.DocumentOutputConfig * @instance */ - BatchTranslateMetadata.prototype.submitTime = null; + Object.defineProperty(DocumentOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new BatchTranslateMetadata instance using the specified properties. + * Creates a new DocumentOutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @memberof google.cloud.translation.v3.DocumentOutputConfig * @static - * @param {google.cloud.translation.v3.IBatchTranslateMetadata=} [properties] Properties to set - * @returns {google.cloud.translation.v3.BatchTranslateMetadata} BatchTranslateMetadata instance + * @param {google.cloud.translation.v3.IDocumentOutputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3.DocumentOutputConfig} DocumentOutputConfig instance */ - BatchTranslateMetadata.create = function create(properties) { - return new BatchTranslateMetadata(properties); + DocumentOutputConfig.create = function create(properties) { + return new DocumentOutputConfig(properties); }; /** - * Encodes the specified BatchTranslateMetadata message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateMetadata.verify|verify} messages. + * Encodes the specified DocumentOutputConfig message. Does not implicitly {@link google.cloud.translation.v3.DocumentOutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @memberof google.cloud.translation.v3.DocumentOutputConfig * @static - * @param {google.cloud.translation.v3.IBatchTranslateMetadata} message BatchTranslateMetadata message or plain object to encode + * @param {google.cloud.translation.v3.IDocumentOutputConfig} message DocumentOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchTranslateMetadata.encode = function encode(message, writer) { + DocumentOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalCharacters); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) - $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.translation.v3.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); return writer; }; /** - * Encodes the specified BatchTranslateMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateMetadata.verify|verify} messages. + * Encodes the specified DocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DocumentOutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @memberof google.cloud.translation.v3.DocumentOutputConfig * @static - * @param {google.cloud.translation.v3.IBatchTranslateMetadata} message BatchTranslateMetadata message or plain object to encode + * @param {google.cloud.translation.v3.IDocumentOutputConfig} message DocumentOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchTranslateMetadata.encodeDelimited = function encodeDelimited(message, writer) { + DocumentOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchTranslateMetadata message from the specified reader or buffer. + * Decodes a DocumentOutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @memberof google.cloud.translation.v3.DocumentOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.BatchTranslateMetadata} BatchTranslateMetadata + * @returns {google.cloud.translation.v3.DocumentOutputConfig} DocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchTranslateMetadata.decode = function decode(reader, length) { + DocumentOutputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DocumentOutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.state = reader.int32(); - break; - case 2: - message.translatedCharacters = reader.int64(); + message.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.decode(reader, reader.uint32()); break; case 3: - message.failedCharacters = reader.int64(); - break; - case 4: - message.totalCharacters = reader.int64(); - break; - case 5: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.mimeType = reader.string(); break; default: reader.skipType(tag & 7); @@ -4406,246 +4211,134 @@ }; /** - * Decodes a BatchTranslateMetadata message from the specified reader or buffer, length delimited. + * Decodes a DocumentOutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @memberof google.cloud.translation.v3.DocumentOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.BatchTranslateMetadata} BatchTranslateMetadata + * @returns {google.cloud.translation.v3.DocumentOutputConfig} DocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchTranslateMetadata.decodeDelimited = function decodeDelimited(reader) { + DocumentOutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchTranslateMetadata message. + * Verifies a DocumentOutputConfig message. * @function verify - * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @memberof google.cloud.translation.v3.DocumentOutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchTranslateMetadata.verify = function verify(message) { + DocumentOutputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.translation.v3.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; } - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) - if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) - return "translatedCharacters: integer|Long expected"; - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) - if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) - return "failedCharacters: integer|Long expected"; - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) - if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) - return "totalCharacters: integer|Long expected"; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.submitTime); - if (error) - return "submitTime." + error; } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; return null; }; /** - * Creates a BatchTranslateMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentOutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @memberof google.cloud.translation.v3.DocumentOutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.BatchTranslateMetadata} BatchTranslateMetadata + * @returns {google.cloud.translation.v3.DocumentOutputConfig} DocumentOutputConfig */ - BatchTranslateMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.BatchTranslateMetadata) + DocumentOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.DocumentOutputConfig) return object; - var message = new $root.google.cloud.translation.v3.BatchTranslateMetadata(); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "RUNNING": - case 1: - message.state = 1; - break; - case "SUCCEEDED": - case 2: - message.state = 2; - break; - case "FAILED": - case 3: - message.state = 3; - break; - case "CANCELLING": - case 4: - message.state = 4; - break; - case "CANCELLED": - case 5: - message.state = 5; - break; - } - if (object.translatedCharacters != null) - if ($util.Long) - (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; - else if (typeof object.translatedCharacters === "string") - message.translatedCharacters = parseInt(object.translatedCharacters, 10); - else if (typeof object.translatedCharacters === "number") - message.translatedCharacters = object.translatedCharacters; - else if (typeof object.translatedCharacters === "object") - message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); - if (object.failedCharacters != null) - if ($util.Long) - (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; - else if (typeof object.failedCharacters === "string") - message.failedCharacters = parseInt(object.failedCharacters, 10); - else if (typeof object.failedCharacters === "number") - message.failedCharacters = object.failedCharacters; - else if (typeof object.failedCharacters === "object") - message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); - if (object.totalCharacters != null) - if ($util.Long) - (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; - else if (typeof object.totalCharacters === "string") - message.totalCharacters = parseInt(object.totalCharacters, 10); - else if (typeof object.totalCharacters === "number") - message.totalCharacters = object.totalCharacters; - else if (typeof object.totalCharacters === "object") - message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); - if (object.submitTime != null) { - if (typeof object.submitTime !== "object") - throw TypeError(".google.cloud.translation.v3.BatchTranslateMetadata.submitTime: object expected"); - message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + var message = new $root.google.cloud.translation.v3.DocumentOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.translation.v3.DocumentOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.fromObject(object.gcsDestination); } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); return message; }; /** - * Creates a plain object from a BatchTranslateMetadata message. Also converts values to other types if specified. + * Creates a plain object from a DocumentOutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @memberof google.cloud.translation.v3.DocumentOutputConfig * @static - * @param {google.cloud.translation.v3.BatchTranslateMetadata} message BatchTranslateMetadata + * @param {google.cloud.translation.v3.DocumentOutputConfig} message DocumentOutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchTranslateMetadata.toObject = function toObject(message, options) { + DocumentOutputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.translatedCharacters = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.failedCharacters = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalCharacters = options.longs === String ? "0" : 0; - object.submitTime = null; + if (options.defaults) + object.mimeType = ""; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3.BatchTranslateMetadata.State[message.state] : message.state; - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) - if (typeof message.translatedCharacters === "number") - object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; - else - object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) - if (typeof message.failedCharacters === "number") - object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; - else - object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) - if (typeof message.totalCharacters === "number") - object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; - else - object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) - object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; return object; }; /** - * Converts this BatchTranslateMetadata to JSON. + * Converts this DocumentOutputConfig to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @memberof google.cloud.translation.v3.DocumentOutputConfig * @instance * @returns {Object.} JSON object */ - BatchTranslateMetadata.prototype.toJSON = function toJSON() { + DocumentOutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.translation.v3.BatchTranslateMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} SUCCEEDED=2 SUCCEEDED value - * @property {number} FAILED=3 FAILED value - * @property {number} CANCELLING=4 CANCELLING value - * @property {number} CANCELLED=5 CANCELLED value - */ - BatchTranslateMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "SUCCEEDED"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "CANCELLING"] = 4; - values[valuesById[5] = "CANCELLED"] = 5; - return values; - })(); - - return BatchTranslateMetadata; + return DocumentOutputConfig; })(); - v3.BatchTranslateResponse = (function() { + v3.TranslateDocumentRequest = (function() { /** - * Properties of a BatchTranslateResponse. + * Properties of a TranslateDocumentRequest. * @memberof google.cloud.translation.v3 - * @interface IBatchTranslateResponse - * @property {number|Long|null} [totalCharacters] BatchTranslateResponse totalCharacters - * @property {number|Long|null} [translatedCharacters] BatchTranslateResponse translatedCharacters - * @property {number|Long|null} [failedCharacters] BatchTranslateResponse failedCharacters - * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateResponse submitTime - * @property {google.protobuf.ITimestamp|null} [endTime] BatchTranslateResponse endTime + * @interface ITranslateDocumentRequest + * @property {string|null} [parent] TranslateDocumentRequest parent + * @property {string|null} [sourceLanguageCode] TranslateDocumentRequest sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslateDocumentRequest targetLanguageCode + * @property {google.cloud.translation.v3.IDocumentInputConfig|null} [documentInputConfig] TranslateDocumentRequest documentInputConfig + * @property {google.cloud.translation.v3.IDocumentOutputConfig|null} [documentOutputConfig] TranslateDocumentRequest documentOutputConfig + * @property {string|null} [model] TranslateDocumentRequest model + * @property {google.cloud.translation.v3.ITranslateTextGlossaryConfig|null} [glossaryConfig] TranslateDocumentRequest glossaryConfig + * @property {Object.|null} [labels] TranslateDocumentRequest labels */ /** - * Constructs a new BatchTranslateResponse. + * Constructs a new TranslateDocumentRequest. * @memberof google.cloud.translation.v3 - * @classdesc Represents a BatchTranslateResponse. - * @implements IBatchTranslateResponse + * @classdesc Represents a TranslateDocumentRequest. + * @implements ITranslateDocumentRequest * @constructor - * @param {google.cloud.translation.v3.IBatchTranslateResponse=} [properties] Properties to set + * @param {google.cloud.translation.v3.ITranslateDocumentRequest=} [properties] Properties to set */ - function BatchTranslateResponse(properties) { + function TranslateDocumentRequest(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4653,127 +4346,186 @@ } /** - * BatchTranslateResponse totalCharacters. - * @member {number|Long} totalCharacters - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * TranslateDocumentRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @instance */ - BatchTranslateResponse.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + TranslateDocumentRequest.prototype.parent = ""; /** - * BatchTranslateResponse translatedCharacters. - * @member {number|Long} translatedCharacters - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * TranslateDocumentRequest sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @instance */ - BatchTranslateResponse.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + TranslateDocumentRequest.prototype.sourceLanguageCode = ""; /** - * BatchTranslateResponse failedCharacters. - * @member {number|Long} failedCharacters - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * TranslateDocumentRequest targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @instance */ - BatchTranslateResponse.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + TranslateDocumentRequest.prototype.targetLanguageCode = ""; /** - * BatchTranslateResponse submitTime. - * @member {google.protobuf.ITimestamp|null|undefined} submitTime - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * TranslateDocumentRequest documentInputConfig. + * @member {google.cloud.translation.v3.IDocumentInputConfig|null|undefined} documentInputConfig + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @instance */ - BatchTranslateResponse.prototype.submitTime = null; + TranslateDocumentRequest.prototype.documentInputConfig = null; /** - * BatchTranslateResponse endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * TranslateDocumentRequest documentOutputConfig. + * @member {google.cloud.translation.v3.IDocumentOutputConfig|null|undefined} documentOutputConfig + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @instance */ - BatchTranslateResponse.prototype.endTime = null; + TranslateDocumentRequest.prototype.documentOutputConfig = null; /** - * Creates a new BatchTranslateResponse instance using the specified properties. + * TranslateDocumentRequest model. + * @member {string} model + * @memberof google.cloud.translation.v3.TranslateDocumentRequest + * @instance + */ + TranslateDocumentRequest.prototype.model = ""; + + /** + * TranslateDocumentRequest glossaryConfig. + * @member {google.cloud.translation.v3.ITranslateTextGlossaryConfig|null|undefined} glossaryConfig + * @memberof google.cloud.translation.v3.TranslateDocumentRequest + * @instance + */ + TranslateDocumentRequest.prototype.glossaryConfig = null; + + /** + * TranslateDocumentRequest labels. + * @member {Object.} labels + * @memberof google.cloud.translation.v3.TranslateDocumentRequest + * @instance + */ + TranslateDocumentRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new TranslateDocumentRequest instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @static - * @param {google.cloud.translation.v3.IBatchTranslateResponse=} [properties] Properties to set - * @returns {google.cloud.translation.v3.BatchTranslateResponse} BatchTranslateResponse instance + * @param {google.cloud.translation.v3.ITranslateDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.TranslateDocumentRequest} TranslateDocumentRequest instance */ - BatchTranslateResponse.create = function create(properties) { - return new BatchTranslateResponse(properties); + TranslateDocumentRequest.create = function create(properties) { + return new TranslateDocumentRequest(properties); }; /** - * Encodes the specified BatchTranslateResponse message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateResponse.verify|verify} messages. + * Encodes the specified TranslateDocumentRequest message. Does not implicitly {@link google.cloud.translation.v3.TranslateDocumentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @static - * @param {google.cloud.translation.v3.IBatchTranslateResponse} message BatchTranslateResponse message or plain object to encode + * @param {google.cloud.translation.v3.ITranslateDocumentRequest} message TranslateDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchTranslateResponse.encode = function encode(message, writer) { + TranslateDocumentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalCharacters); - if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); - if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) - $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCode); + if (message.documentInputConfig != null && Object.hasOwnProperty.call(message, "documentInputConfig")) + $root.google.cloud.translation.v3.DocumentInputConfig.encode(message.documentInputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.documentOutputConfig != null && Object.hasOwnProperty.call(message, "documentOutputConfig")) + $root.google.cloud.translation.v3.DocumentOutputConfig.encode(message.documentOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.model); + if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) + $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified BatchTranslateResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateResponse.verify|verify} messages. + * Encodes the specified TranslateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.TranslateDocumentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @static - * @param {google.cloud.translation.v3.IBatchTranslateResponse} message BatchTranslateResponse message or plain object to encode + * @param {google.cloud.translation.v3.ITranslateDocumentRequest} message TranslateDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchTranslateResponse.encodeDelimited = function encodeDelimited(message, writer) { + TranslateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchTranslateResponse message from the specified reader or buffer. + * Decodes a TranslateDocumentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.BatchTranslateResponse} BatchTranslateResponse + * @returns {google.cloud.translation.v3.TranslateDocumentRequest} TranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchTranslateResponse.decode = function decode(reader, length) { + TranslateDocumentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.TranslateDocumentRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.totalCharacters = reader.int64(); + message.parent = reader.string(); break; case 2: - message.translatedCharacters = reader.int64(); + message.sourceLanguageCode = reader.string(); break; case 3: - message.failedCharacters = reader.int64(); + message.targetLanguageCode = reader.string(); break; case 4: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.documentInputConfig = $root.google.cloud.translation.v3.DocumentInputConfig.decode(reader, reader.uint32()); break; case 5: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.documentOutputConfig = $root.google.cloud.translation.v3.DocumentOutputConfig.decode(reader, reader.uint32()); + break; + case 6: + message.model = reader.string(); + break; + case 7: + message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + case 8: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; break; default: reader.skipType(tag & 7); @@ -4784,192 +4536,197 @@ }; /** - * Decodes a BatchTranslateResponse message from the specified reader or buffer, length delimited. + * Decodes a TranslateDocumentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.BatchTranslateResponse} BatchTranslateResponse + * @returns {google.cloud.translation.v3.TranslateDocumentRequest} TranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchTranslateResponse.decodeDelimited = function decodeDelimited(reader) { + TranslateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchTranslateResponse message. + * Verifies a TranslateDocumentRequest message. * @function verify - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchTranslateResponse.verify = function verify(message) { + TranslateDocumentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) - if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) - return "totalCharacters: integer|Long expected"; - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) - if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) - return "translatedCharacters: integer|Long expected"; - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) - if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) - return "failedCharacters: integer|Long expected"; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + if (message.documentInputConfig != null && message.hasOwnProperty("documentInputConfig")) { + var error = $root.google.cloud.translation.v3.DocumentInputConfig.verify(message.documentInputConfig); if (error) - return "submitTime." + error; + return "documentInputConfig." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) { + var error = $root.google.cloud.translation.v3.DocumentOutputConfig.verify(message.documentOutputConfig); if (error) - return "endTime." + error; + return "documentOutputConfig." + error; } - return null; - }; - - /** - * Creates a BatchTranslateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.translation.v3.BatchTranslateResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.BatchTranslateResponse} BatchTranslateResponse - */ - BatchTranslateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.BatchTranslateResponse) + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) { + var error = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.verify(message.glossaryConfig); + if (error) + return "glossaryConfig." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a TranslateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.TranslateDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.TranslateDocumentRequest} TranslateDocumentRequest + */ + TranslateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.TranslateDocumentRequest) return object; - var message = new $root.google.cloud.translation.v3.BatchTranslateResponse(); - if (object.totalCharacters != null) - if ($util.Long) - (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; - else if (typeof object.totalCharacters === "string") - message.totalCharacters = parseInt(object.totalCharacters, 10); - else if (typeof object.totalCharacters === "number") - message.totalCharacters = object.totalCharacters; - else if (typeof object.totalCharacters === "object") - message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); - if (object.translatedCharacters != null) - if ($util.Long) - (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; - else if (typeof object.translatedCharacters === "string") - message.translatedCharacters = parseInt(object.translatedCharacters, 10); - else if (typeof object.translatedCharacters === "number") - message.translatedCharacters = object.translatedCharacters; - else if (typeof object.translatedCharacters === "object") - message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); - if (object.failedCharacters != null) - if ($util.Long) - (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; - else if (typeof object.failedCharacters === "string") - message.failedCharacters = parseInt(object.failedCharacters, 10); - else if (typeof object.failedCharacters === "number") - message.failedCharacters = object.failedCharacters; - else if (typeof object.failedCharacters === "object") - message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); - if (object.submitTime != null) { - if (typeof object.submitTime !== "object") - throw TypeError(".google.cloud.translation.v3.BatchTranslateResponse.submitTime: object expected"); - message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + var message = new $root.google.cloud.translation.v3.TranslateDocumentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + if (object.documentInputConfig != null) { + if (typeof object.documentInputConfig !== "object") + throw TypeError(".google.cloud.translation.v3.TranslateDocumentRequest.documentInputConfig: object expected"); + message.documentInputConfig = $root.google.cloud.translation.v3.DocumentInputConfig.fromObject(object.documentInputConfig); } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.translation.v3.BatchTranslateResponse.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + if (object.documentOutputConfig != null) { + if (typeof object.documentOutputConfig !== "object") + throw TypeError(".google.cloud.translation.v3.TranslateDocumentRequest.documentOutputConfig: object expected"); + message.documentOutputConfig = $root.google.cloud.translation.v3.DocumentOutputConfig.fromObject(object.documentOutputConfig); + } + if (object.model != null) + message.model = String(object.model); + if (object.glossaryConfig != null) { + if (typeof object.glossaryConfig !== "object") + throw TypeError(".google.cloud.translation.v3.TranslateDocumentRequest.glossaryConfig: object expected"); + message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.fromObject(object.glossaryConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.translation.v3.TranslateDocumentRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); } return message; }; /** - * Creates a plain object from a BatchTranslateResponse message. Also converts values to other types if specified. + * Creates a plain object from a TranslateDocumentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @static - * @param {google.cloud.translation.v3.BatchTranslateResponse} message BatchTranslateResponse + * @param {google.cloud.translation.v3.TranslateDocumentRequest} message TranslateDocumentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchTranslateResponse.toObject = function toObject(message, options) { + TranslateDocumentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.labels = {}; if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalCharacters = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.translatedCharacters = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.failedCharacters = options.longs === String ? "0" : 0; - object.submitTime = null; - object.endTime = null; + object.parent = ""; + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + object.documentInputConfig = null; + object.documentOutputConfig = null; + object.model = ""; + object.glossaryConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + if (message.documentInputConfig != null && message.hasOwnProperty("documentInputConfig")) + object.documentInputConfig = $root.google.cloud.translation.v3.DocumentInputConfig.toObject(message.documentInputConfig, options); + if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) + object.documentOutputConfig = $root.google.cloud.translation.v3.DocumentOutputConfig.toObject(message.documentOutputConfig, options); + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + object.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.toObject(message.glossaryConfig, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; } - if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) - if (typeof message.totalCharacters === "number") - object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; - else - object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; - if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) - if (typeof message.translatedCharacters === "number") - object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; - else - object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; - if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) - if (typeof message.failedCharacters === "number") - object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; - else - object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) - object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); return object; }; /** - * Converts this BatchTranslateResponse to JSON. + * Converts this TranslateDocumentRequest to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @memberof google.cloud.translation.v3.TranslateDocumentRequest * @instance * @returns {Object.} JSON object */ - BatchTranslateResponse.prototype.toJSON = function toJSON() { + TranslateDocumentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchTranslateResponse; + return TranslateDocumentRequest; })(); - v3.GlossaryInputConfig = (function() { + v3.DocumentTranslation = (function() { /** - * Properties of a GlossaryInputConfig. + * Properties of a DocumentTranslation. * @memberof google.cloud.translation.v3 - * @interface IGlossaryInputConfig - * @property {google.cloud.translation.v3.IGcsSource|null} [gcsSource] GlossaryInputConfig gcsSource + * @interface IDocumentTranslation + * @property {Array.|null} [byteStreamOutputs] DocumentTranslation byteStreamOutputs + * @property {string|null} [mimeType] DocumentTranslation mimeType + * @property {string|null} [detectedLanguageCode] DocumentTranslation detectedLanguageCode */ /** - * Constructs a new GlossaryInputConfig. + * Constructs a new DocumentTranslation. * @memberof google.cloud.translation.v3 - * @classdesc Represents a GlossaryInputConfig. - * @implements IGlossaryInputConfig + * @classdesc Represents a DocumentTranslation. + * @implements IDocumentTranslation * @constructor - * @param {google.cloud.translation.v3.IGlossaryInputConfig=} [properties] Properties to set + * @param {google.cloud.translation.v3.IDocumentTranslation=} [properties] Properties to set */ - function GlossaryInputConfig(properties) { + function DocumentTranslation(properties) { + this.byteStreamOutputs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4977,89 +4734,104 @@ } /** - * GlossaryInputConfig gcsSource. - * @member {google.cloud.translation.v3.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.translation.v3.GlossaryInputConfig + * DocumentTranslation byteStreamOutputs. + * @member {Array.} byteStreamOutputs + * @memberof google.cloud.translation.v3.DocumentTranslation * @instance */ - GlossaryInputConfig.prototype.gcsSource = null; + DocumentTranslation.prototype.byteStreamOutputs = $util.emptyArray; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * DocumentTranslation mimeType. + * @member {string} mimeType + * @memberof google.cloud.translation.v3.DocumentTranslation + * @instance + */ + DocumentTranslation.prototype.mimeType = ""; /** - * GlossaryInputConfig source. - * @member {"gcsSource"|undefined} source - * @memberof google.cloud.translation.v3.GlossaryInputConfig + * DocumentTranslation detectedLanguageCode. + * @member {string} detectedLanguageCode + * @memberof google.cloud.translation.v3.DocumentTranslation * @instance */ - Object.defineProperty(GlossaryInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), - set: $util.oneOfSetter($oneOfFields) - }); + DocumentTranslation.prototype.detectedLanguageCode = ""; /** - * Creates a new GlossaryInputConfig instance using the specified properties. + * Creates a new DocumentTranslation instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @memberof google.cloud.translation.v3.DocumentTranslation * @static - * @param {google.cloud.translation.v3.IGlossaryInputConfig=} [properties] Properties to set - * @returns {google.cloud.translation.v3.GlossaryInputConfig} GlossaryInputConfig instance + * @param {google.cloud.translation.v3.IDocumentTranslation=} [properties] Properties to set + * @returns {google.cloud.translation.v3.DocumentTranslation} DocumentTranslation instance */ - GlossaryInputConfig.create = function create(properties) { - return new GlossaryInputConfig(properties); + DocumentTranslation.create = function create(properties) { + return new DocumentTranslation(properties); }; /** - * Encodes the specified GlossaryInputConfig message. Does not implicitly {@link google.cloud.translation.v3.GlossaryInputConfig.verify|verify} messages. + * Encodes the specified DocumentTranslation message. Does not implicitly {@link google.cloud.translation.v3.DocumentTranslation.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @memberof google.cloud.translation.v3.DocumentTranslation * @static - * @param {google.cloud.translation.v3.IGlossaryInputConfig} message GlossaryInputConfig message or plain object to encode + * @param {google.cloud.translation.v3.IDocumentTranslation} message DocumentTranslation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GlossaryInputConfig.encode = function encode(message, writer) { + DocumentTranslation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - $root.google.cloud.translation.v3.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.byteStreamOutputs != null && message.byteStreamOutputs.length) + for (var i = 0; i < message.byteStreamOutputs.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.byteStreamOutputs[i]); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.detectedLanguageCode != null && Object.hasOwnProperty.call(message, "detectedLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.detectedLanguageCode); return writer; }; /** - * Encodes the specified GlossaryInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GlossaryInputConfig.verify|verify} messages. + * Encodes the specified DocumentTranslation message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DocumentTranslation.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @memberof google.cloud.translation.v3.DocumentTranslation * @static - * @param {google.cloud.translation.v3.IGlossaryInputConfig} message GlossaryInputConfig message or plain object to encode + * @param {google.cloud.translation.v3.IDocumentTranslation} message DocumentTranslation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GlossaryInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + DocumentTranslation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GlossaryInputConfig message from the specified reader or buffer. + * Decodes a DocumentTranslation message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @memberof google.cloud.translation.v3.DocumentTranslation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.GlossaryInputConfig} GlossaryInputConfig + * @returns {google.cloud.translation.v3.DocumentTranslation} DocumentTranslation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GlossaryInputConfig.decode = function decode(reader, length) { + DocumentTranslation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.GlossaryInputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DocumentTranslation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); + if (!(message.byteStreamOutputs && message.byteStreamOutputs.length)) + message.byteStreamOutputs = []; + message.byteStreamOutputs.push(reader.bytes()); + break; + case 2: + message.mimeType = reader.string(); + break; + case 3: + message.detectedLanguageCode = reader.string(); break; default: reader.skipType(tag & 7); @@ -5070,123 +4842,143 @@ }; /** - * Decodes a GlossaryInputConfig message from the specified reader or buffer, length delimited. + * Decodes a DocumentTranslation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @memberof google.cloud.translation.v3.DocumentTranslation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.GlossaryInputConfig} GlossaryInputConfig + * @returns {google.cloud.translation.v3.DocumentTranslation} DocumentTranslation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GlossaryInputConfig.decodeDelimited = function decodeDelimited(reader) { + DocumentTranslation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GlossaryInputConfig message. + * Verifies a DocumentTranslation message. * @function verify - * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @memberof google.cloud.translation.v3.DocumentTranslation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GlossaryInputConfig.verify = function verify(message) { + DocumentTranslation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - properties.source = 1; - { - var error = $root.google.cloud.translation.v3.GcsSource.verify(message.gcsSource); - if (error) - return "gcsSource." + error; - } + if (message.byteStreamOutputs != null && message.hasOwnProperty("byteStreamOutputs")) { + if (!Array.isArray(message.byteStreamOutputs)) + return "byteStreamOutputs: array expected"; + for (var i = 0; i < message.byteStreamOutputs.length; ++i) + if (!(message.byteStreamOutputs[i] && typeof message.byteStreamOutputs[i].length === "number" || $util.isString(message.byteStreamOutputs[i]))) + return "byteStreamOutputs: buffer[] expected"; } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + if (!$util.isString(message.detectedLanguageCode)) + return "detectedLanguageCode: string expected"; return null; }; /** - * Creates a GlossaryInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentTranslation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @memberof google.cloud.translation.v3.DocumentTranslation * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.GlossaryInputConfig} GlossaryInputConfig + * @returns {google.cloud.translation.v3.DocumentTranslation} DocumentTranslation */ - GlossaryInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.GlossaryInputConfig) + DocumentTranslation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.DocumentTranslation) return object; - var message = new $root.google.cloud.translation.v3.GlossaryInputConfig(); - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.translation.v3.GlossaryInputConfig.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.translation.v3.GcsSource.fromObject(object.gcsSource); + var message = new $root.google.cloud.translation.v3.DocumentTranslation(); + if (object.byteStreamOutputs) { + if (!Array.isArray(object.byteStreamOutputs)) + throw TypeError(".google.cloud.translation.v3.DocumentTranslation.byteStreamOutputs: array expected"); + message.byteStreamOutputs = []; + for (var i = 0; i < object.byteStreamOutputs.length; ++i) + if (typeof object.byteStreamOutputs[i] === "string") + $util.base64.decode(object.byteStreamOutputs[i], message.byteStreamOutputs[i] = $util.newBuffer($util.base64.length(object.byteStreamOutputs[i])), 0); + else if (object.byteStreamOutputs[i].length) + message.byteStreamOutputs[i] = object.byteStreamOutputs[i]; } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.detectedLanguageCode != null) + message.detectedLanguageCode = String(object.detectedLanguageCode); return message; }; /** - * Creates a plain object from a GlossaryInputConfig message. Also converts values to other types if specified. + * Creates a plain object from a DocumentTranslation message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @memberof google.cloud.translation.v3.DocumentTranslation * @static - * @param {google.cloud.translation.v3.GlossaryInputConfig} message GlossaryInputConfig + * @param {google.cloud.translation.v3.DocumentTranslation} message DocumentTranslation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GlossaryInputConfig.toObject = function toObject(message, options) { + DocumentTranslation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.translation.v3.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; + if (options.arrays || options.defaults) + object.byteStreamOutputs = []; + if (options.defaults) { + object.mimeType = ""; + object.detectedLanguageCode = ""; + } + if (message.byteStreamOutputs && message.byteStreamOutputs.length) { + object.byteStreamOutputs = []; + for (var j = 0; j < message.byteStreamOutputs.length; ++j) + object.byteStreamOutputs[j] = options.bytes === String ? $util.base64.encode(message.byteStreamOutputs[j], 0, message.byteStreamOutputs[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.byteStreamOutputs[j]) : message.byteStreamOutputs[j]; } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.detectedLanguageCode != null && message.hasOwnProperty("detectedLanguageCode")) + object.detectedLanguageCode = message.detectedLanguageCode; return object; }; /** - * Converts this GlossaryInputConfig to JSON. + * Converts this DocumentTranslation to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @memberof google.cloud.translation.v3.DocumentTranslation * @instance * @returns {Object.} JSON object */ - GlossaryInputConfig.prototype.toJSON = function toJSON() { + DocumentTranslation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GlossaryInputConfig; + return DocumentTranslation; })(); - v3.Glossary = (function() { + v3.TranslateDocumentResponse = (function() { /** - * Properties of a Glossary. + * Properties of a TranslateDocumentResponse. * @memberof google.cloud.translation.v3 - * @interface IGlossary - * @property {string|null} [name] Glossary name - * @property {google.cloud.translation.v3.Glossary.ILanguageCodePair|null} [languagePair] Glossary languagePair - * @property {google.cloud.translation.v3.Glossary.ILanguageCodesSet|null} [languageCodesSet] Glossary languageCodesSet - * @property {google.cloud.translation.v3.IGlossaryInputConfig|null} [inputConfig] Glossary inputConfig - * @property {number|null} [entryCount] Glossary entryCount - * @property {google.protobuf.ITimestamp|null} [submitTime] Glossary submitTime - * @property {google.protobuf.ITimestamp|null} [endTime] Glossary endTime + * @interface ITranslateDocumentResponse + * @property {google.cloud.translation.v3.IDocumentTranslation|null} [documentTranslation] TranslateDocumentResponse documentTranslation + * @property {google.cloud.translation.v3.IDocumentTranslation|null} [glossaryDocumentTranslation] TranslateDocumentResponse glossaryDocumentTranslation + * @property {string|null} [model] TranslateDocumentResponse model + * @property {google.cloud.translation.v3.ITranslateTextGlossaryConfig|null} [glossaryConfig] TranslateDocumentResponse glossaryConfig */ /** - * Constructs a new Glossary. + * Constructs a new TranslateDocumentResponse. * @memberof google.cloud.translation.v3 - * @classdesc Represents a Glossary. - * @implements IGlossary + * @classdesc Represents a TranslateDocumentResponse. + * @implements ITranslateDocumentResponse * @constructor - * @param {google.cloud.translation.v3.IGlossary=} [properties] Properties to set + * @param {google.cloud.translation.v3.ITranslateDocumentResponse=} [properties] Properties to set */ - function Glossary(properties) { + function TranslateDocumentResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5194,167 +4986,114 @@ } /** - * Glossary name. - * @member {string} name - * @memberof google.cloud.translation.v3.Glossary - * @instance - */ - Glossary.prototype.name = ""; - - /** - * Glossary languagePair. - * @member {google.cloud.translation.v3.Glossary.ILanguageCodePair|null|undefined} languagePair - * @memberof google.cloud.translation.v3.Glossary - * @instance - */ - Glossary.prototype.languagePair = null; - - /** - * Glossary languageCodesSet. - * @member {google.cloud.translation.v3.Glossary.ILanguageCodesSet|null|undefined} languageCodesSet - * @memberof google.cloud.translation.v3.Glossary - * @instance - */ - Glossary.prototype.languageCodesSet = null; - - /** - * Glossary inputConfig. - * @member {google.cloud.translation.v3.IGlossaryInputConfig|null|undefined} inputConfig - * @memberof google.cloud.translation.v3.Glossary - * @instance - */ - Glossary.prototype.inputConfig = null; - - /** - * Glossary entryCount. - * @member {number} entryCount - * @memberof google.cloud.translation.v3.Glossary + * TranslateDocumentResponse documentTranslation. + * @member {google.cloud.translation.v3.IDocumentTranslation|null|undefined} documentTranslation + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @instance */ - Glossary.prototype.entryCount = 0; + TranslateDocumentResponse.prototype.documentTranslation = null; /** - * Glossary submitTime. - * @member {google.protobuf.ITimestamp|null|undefined} submitTime - * @memberof google.cloud.translation.v3.Glossary + * TranslateDocumentResponse glossaryDocumentTranslation. + * @member {google.cloud.translation.v3.IDocumentTranslation|null|undefined} glossaryDocumentTranslation + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @instance */ - Glossary.prototype.submitTime = null; + TranslateDocumentResponse.prototype.glossaryDocumentTranslation = null; /** - * Glossary endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.translation.v3.Glossary + * TranslateDocumentResponse model. + * @member {string} model + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @instance */ - Glossary.prototype.endTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + TranslateDocumentResponse.prototype.model = ""; /** - * Glossary languages. - * @member {"languagePair"|"languageCodesSet"|undefined} languages - * @memberof google.cloud.translation.v3.Glossary + * TranslateDocumentResponse glossaryConfig. + * @member {google.cloud.translation.v3.ITranslateTextGlossaryConfig|null|undefined} glossaryConfig + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @instance */ - Object.defineProperty(Glossary.prototype, "languages", { - get: $util.oneOfGetter($oneOfFields = ["languagePair", "languageCodesSet"]), - set: $util.oneOfSetter($oneOfFields) - }); + TranslateDocumentResponse.prototype.glossaryConfig = null; /** - * Creates a new Glossary instance using the specified properties. + * Creates a new TranslateDocumentResponse instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.Glossary + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @static - * @param {google.cloud.translation.v3.IGlossary=} [properties] Properties to set - * @returns {google.cloud.translation.v3.Glossary} Glossary instance + * @param {google.cloud.translation.v3.ITranslateDocumentResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3.TranslateDocumentResponse} TranslateDocumentResponse instance */ - Glossary.create = function create(properties) { - return new Glossary(properties); + TranslateDocumentResponse.create = function create(properties) { + return new TranslateDocumentResponse(properties); }; /** - * Encodes the specified Glossary message. Does not implicitly {@link google.cloud.translation.v3.Glossary.verify|verify} messages. + * Encodes the specified TranslateDocumentResponse message. Does not implicitly {@link google.cloud.translation.v3.TranslateDocumentResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.Glossary + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @static - * @param {google.cloud.translation.v3.IGlossary} message Glossary message or plain object to encode + * @param {google.cloud.translation.v3.ITranslateDocumentResponse} message TranslateDocumentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Glossary.encode = function encode(message, writer) { + TranslateDocumentResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.languagePair != null && Object.hasOwnProperty.call(message, "languagePair")) - $root.google.cloud.translation.v3.Glossary.LanguageCodePair.encode(message.languagePair, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.languageCodesSet != null && Object.hasOwnProperty.call(message, "languageCodesSet")) - $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.encode(message.languageCodesSet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) - $root.google.cloud.translation.v3.GlossaryInputConfig.encode(message.inputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.entryCount != null && Object.hasOwnProperty.call(message, "entryCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.entryCount); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) - $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.documentTranslation != null && Object.hasOwnProperty.call(message, "documentTranslation")) + $root.google.cloud.translation.v3.DocumentTranslation.encode(message.documentTranslation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.glossaryDocumentTranslation != null && Object.hasOwnProperty.call(message, "glossaryDocumentTranslation")) + $root.google.cloud.translation.v3.DocumentTranslation.encode(message.glossaryDocumentTranslation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + if (message.glossaryConfig != null && Object.hasOwnProperty.call(message, "glossaryConfig")) + $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaryConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified Glossary message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.verify|verify} messages. + * Encodes the specified TranslateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.TranslateDocumentResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.Glossary + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @static - * @param {google.cloud.translation.v3.IGlossary} message Glossary message or plain object to encode + * @param {google.cloud.translation.v3.ITranslateDocumentResponse} message TranslateDocumentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Glossary.encodeDelimited = function encodeDelimited(message, writer) { + TranslateDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Glossary message from the specified reader or buffer. + * Decodes a TranslateDocumentResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.Glossary + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.Glossary} Glossary + * @returns {google.cloud.translation.v3.TranslateDocumentResponse} TranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Glossary.decode = function decode(reader, length) { + TranslateDocumentResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.Glossary(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.TranslateDocumentResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.documentTranslation = $root.google.cloud.translation.v3.DocumentTranslation.decode(reader, reader.uint32()); + break; + case 2: + message.glossaryDocumentTranslation = $root.google.cloud.translation.v3.DocumentTranslation.decode(reader, reader.uint32()); break; case 3: - message.languagePair = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.decode(reader, reader.uint32()); + message.model = reader.string(); break; case 4: - message.languageCodesSet = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.decode(reader, reader.uint32()); - break; - case 5: - message.inputConfig = $root.google.cloud.translation.v3.GlossaryInputConfig.decode(reader, reader.uint32()); - break; - case 6: - message.entryCount = reader.int32(); - break; - case 7: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 8: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -5365,608 +5104,3423 @@ }; /** - * Decodes a Glossary message from the specified reader or buffer, length delimited. + * Decodes a TranslateDocumentResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.Glossary + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.Glossary} Glossary + * @returns {google.cloud.translation.v3.TranslateDocumentResponse} TranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Glossary.decodeDelimited = function decodeDelimited(reader) { + TranslateDocumentResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Glossary message. + * Verifies a TranslateDocumentResponse message. * @function verify - * @memberof google.cloud.translation.v3.Glossary + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Glossary.verify = function verify(message) { + TranslateDocumentResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.languagePair != null && message.hasOwnProperty("languagePair")) { - properties.languages = 1; - { - var error = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.verify(message.languagePair); - if (error) - return "languagePair." + error; - } + if (message.documentTranslation != null && message.hasOwnProperty("documentTranslation")) { + var error = $root.google.cloud.translation.v3.DocumentTranslation.verify(message.documentTranslation); + if (error) + return "documentTranslation." + error; } - if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) { - if (properties.languages === 1) - return "languages: multiple values"; - properties.languages = 1; - { - var error = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.verify(message.languageCodesSet); - if (error) - return "languageCodesSet." + error; - } - } - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { - var error = $root.google.cloud.translation.v3.GlossaryInputConfig.verify(message.inputConfig); - if (error) - return "inputConfig." + error; - } - if (message.entryCount != null && message.hasOwnProperty("entryCount")) - if (!$util.isInteger(message.entryCount)) - return "entryCount: integer expected"; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (message.glossaryDocumentTranslation != null && message.hasOwnProperty("glossaryDocumentTranslation")) { + var error = $root.google.cloud.translation.v3.DocumentTranslation.verify(message.glossaryDocumentTranslation); if (error) - return "submitTime." + error; + return "glossaryDocumentTranslation." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) { + var error = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.verify(message.glossaryConfig); if (error) - return "endTime." + error; + return "glossaryConfig." + error; } return null; }; /** - * Creates a Glossary message from a plain object. Also converts values to their respective internal types. + * Creates a TranslateDocumentResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3.Glossary + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.Glossary} Glossary + * @returns {google.cloud.translation.v3.TranslateDocumentResponse} TranslateDocumentResponse */ - Glossary.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.Glossary) + TranslateDocumentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.TranslateDocumentResponse) return object; - var message = new $root.google.cloud.translation.v3.Glossary(); - if (object.name != null) - message.name = String(object.name); - if (object.languagePair != null) { - if (typeof object.languagePair !== "object") - throw TypeError(".google.cloud.translation.v3.Glossary.languagePair: object expected"); - message.languagePair = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.fromObject(object.languagePair); - } - if (object.languageCodesSet != null) { - if (typeof object.languageCodesSet !== "object") - throw TypeError(".google.cloud.translation.v3.Glossary.languageCodesSet: object expected"); - message.languageCodesSet = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.fromObject(object.languageCodesSet); - } - if (object.inputConfig != null) { - if (typeof object.inputConfig !== "object") - throw TypeError(".google.cloud.translation.v3.Glossary.inputConfig: object expected"); - message.inputConfig = $root.google.cloud.translation.v3.GlossaryInputConfig.fromObject(object.inputConfig); + var message = new $root.google.cloud.translation.v3.TranslateDocumentResponse(); + if (object.documentTranslation != null) { + if (typeof object.documentTranslation !== "object") + throw TypeError(".google.cloud.translation.v3.TranslateDocumentResponse.documentTranslation: object expected"); + message.documentTranslation = $root.google.cloud.translation.v3.DocumentTranslation.fromObject(object.documentTranslation); } - if (object.entryCount != null) - message.entryCount = object.entryCount | 0; - if (object.submitTime != null) { - if (typeof object.submitTime !== "object") - throw TypeError(".google.cloud.translation.v3.Glossary.submitTime: object expected"); - message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + if (object.glossaryDocumentTranslation != null) { + if (typeof object.glossaryDocumentTranslation !== "object") + throw TypeError(".google.cloud.translation.v3.TranslateDocumentResponse.glossaryDocumentTranslation: object expected"); + message.glossaryDocumentTranslation = $root.google.cloud.translation.v3.DocumentTranslation.fromObject(object.glossaryDocumentTranslation); } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.translation.v3.Glossary.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + if (object.model != null) + message.model = String(object.model); + if (object.glossaryConfig != null) { + if (typeof object.glossaryConfig !== "object") + throw TypeError(".google.cloud.translation.v3.TranslateDocumentResponse.glossaryConfig: object expected"); + message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.fromObject(object.glossaryConfig); } return message; }; /** - * Creates a plain object from a Glossary message. Also converts values to other types if specified. + * Creates a plain object from a TranslateDocumentResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.Glossary + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @static - * @param {google.cloud.translation.v3.Glossary} message Glossary + * @param {google.cloud.translation.v3.TranslateDocumentResponse} message TranslateDocumentResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Glossary.toObject = function toObject(message, options) { + TranslateDocumentResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.inputConfig = null; - object.entryCount = 0; - object.submitTime = null; - object.endTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.languagePair != null && message.hasOwnProperty("languagePair")) { - object.languagePair = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.toObject(message.languagePair, options); - if (options.oneofs) - object.languages = "languagePair"; - } - if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) { - object.languageCodesSet = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.toObject(message.languageCodesSet, options); - if (options.oneofs) - object.languages = "languageCodesSet"; + object.documentTranslation = null; + object.glossaryDocumentTranslation = null; + object.model = ""; + object.glossaryConfig = null; } - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - object.inputConfig = $root.google.cloud.translation.v3.GlossaryInputConfig.toObject(message.inputConfig, options); - if (message.entryCount != null && message.hasOwnProperty("entryCount")) - object.entryCount = message.entryCount; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) - object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.documentTranslation != null && message.hasOwnProperty("documentTranslation")) + object.documentTranslation = $root.google.cloud.translation.v3.DocumentTranslation.toObject(message.documentTranslation, options); + if (message.glossaryDocumentTranslation != null && message.hasOwnProperty("glossaryDocumentTranslation")) + object.glossaryDocumentTranslation = $root.google.cloud.translation.v3.DocumentTranslation.toObject(message.glossaryDocumentTranslation, options); + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.glossaryConfig != null && message.hasOwnProperty("glossaryConfig")) + object.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.toObject(message.glossaryConfig, options); return object; }; /** - * Converts this Glossary to JSON. + * Converts this TranslateDocumentResponse to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.Glossary + * @memberof google.cloud.translation.v3.TranslateDocumentResponse * @instance * @returns {Object.} JSON object */ - Glossary.prototype.toJSON = function toJSON() { + TranslateDocumentResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Glossary.LanguageCodePair = (function() { - - /** - * Properties of a LanguageCodePair. - * @memberof google.cloud.translation.v3.Glossary - * @interface ILanguageCodePair - * @property {string|null} [sourceLanguageCode] LanguageCodePair sourceLanguageCode - * @property {string|null} [targetLanguageCode] LanguageCodePair targetLanguageCode - */ + return TranslateDocumentResponse; + })(); - /** - * Constructs a new LanguageCodePair. - * @memberof google.cloud.translation.v3.Glossary - * @classdesc Represents a LanguageCodePair. - * @implements ILanguageCodePair - * @constructor - * @param {google.cloud.translation.v3.Glossary.ILanguageCodePair=} [properties] Properties to set - */ - function LanguageCodePair(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v3.BatchTranslateTextRequest = (function() { - /** - * LanguageCodePair sourceLanguageCode. - * @member {string} sourceLanguageCode - * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair - * @instance - */ - LanguageCodePair.prototype.sourceLanguageCode = ""; + /** + * Properties of a BatchTranslateTextRequest. + * @memberof google.cloud.translation.v3 + * @interface IBatchTranslateTextRequest + * @property {string|null} [parent] BatchTranslateTextRequest parent + * @property {string|null} [sourceLanguageCode] BatchTranslateTextRequest sourceLanguageCode + * @property {Array.|null} [targetLanguageCodes] BatchTranslateTextRequest targetLanguageCodes + * @property {Object.|null} [models] BatchTranslateTextRequest models + * @property {Array.|null} [inputConfigs] BatchTranslateTextRequest inputConfigs + * @property {google.cloud.translation.v3.IOutputConfig|null} [outputConfig] BatchTranslateTextRequest outputConfig + * @property {Object.|null} [glossaries] BatchTranslateTextRequest glossaries + * @property {Object.|null} [labels] BatchTranslateTextRequest labels + */ - /** - * LanguageCodePair targetLanguageCode. - * @member {string} targetLanguageCode - * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair - * @instance - */ - LanguageCodePair.prototype.targetLanguageCode = ""; + /** + * Constructs a new BatchTranslateTextRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a BatchTranslateTextRequest. + * @implements IBatchTranslateTextRequest + * @constructor + * @param {google.cloud.translation.v3.IBatchTranslateTextRequest=} [properties] Properties to set + */ + function BatchTranslateTextRequest(properties) { + this.targetLanguageCodes = []; + this.models = {}; + this.inputConfigs = []; + this.glossaries = {}; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new LanguageCodePair instance using the specified properties. - * @function create - * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair - * @static - * @param {google.cloud.translation.v3.Glossary.ILanguageCodePair=} [properties] Properties to set - * @returns {google.cloud.translation.v3.Glossary.LanguageCodePair} LanguageCodePair instance - */ - LanguageCodePair.create = function create(properties) { - return new LanguageCodePair(properties); - }; + /** + * BatchTranslateTextRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.parent = ""; - /** - * Encodes the specified LanguageCodePair message. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodePair.verify|verify} messages. - * @function encode - * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair - * @static - * @param {google.cloud.translation.v3.Glossary.ILanguageCodePair} message LanguageCodePair message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LanguageCodePair.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); - return writer; - }; + /** + * BatchTranslateTextRequest sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.sourceLanguageCode = ""; - /** - * Encodes the specified LanguageCodePair message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodePair.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair - * @static - * @param {google.cloud.translation.v3.Glossary.ILanguageCodePair} message LanguageCodePair message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LanguageCodePair.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * BatchTranslateTextRequest targetLanguageCodes. + * @member {Array.} targetLanguageCodes + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.targetLanguageCodes = $util.emptyArray; - /** - * Decodes a LanguageCodePair message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.Glossary.LanguageCodePair} LanguageCodePair - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LanguageCodePair.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.Glossary.LanguageCodePair(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sourceLanguageCode = reader.string(); - break; - case 2: - message.targetLanguageCode = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * BatchTranslateTextRequest models. + * @member {Object.} models + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.models = $util.emptyObject; + + /** + * BatchTranslateTextRequest inputConfigs. + * @member {Array.} inputConfigs + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.inputConfigs = $util.emptyArray; + + /** + * BatchTranslateTextRequest outputConfig. + * @member {google.cloud.translation.v3.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.outputConfig = null; + + /** + * BatchTranslateTextRequest glossaries. + * @member {Object.} glossaries + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.glossaries = $util.emptyObject; + + /** + * BatchTranslateTextRequest labels. + * @member {Object.} labels + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + */ + BatchTranslateTextRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new BatchTranslateTextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3.IBatchTranslateTextRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.BatchTranslateTextRequest} BatchTranslateTextRequest instance + */ + BatchTranslateTextRequest.create = function create(properties) { + return new BatchTranslateTextRequest(properties); + }; + + /** + * Encodes the specified BatchTranslateTextRequest message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateTextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3.IBatchTranslateTextRequest} message BatchTranslateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) + for (var i = 0; i < message.targetLanguageCodes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); + if (message.models != null && Object.hasOwnProperty.call(message, "models")) + for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); + if (message.inputConfigs != null && message.inputConfigs.length) + for (var i = 0; i < message.inputConfigs.length; ++i) + $root.google.cloud.translation.v3.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.translation.v3.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.glossaries != null && Object.hasOwnProperty.call(message, "glossaries")) + for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchTranslateTextRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3.IBatchTranslateTextRequest} message BatchTranslateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.BatchTranslateTextRequest} BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateTextRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.sourceLanguageCode = reader.string(); + break; + case 3: + if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) + message.targetLanguageCodes = []; + message.targetLanguageCodes.push(reader.string()); + break; + case 4: + if (message.models === $util.emptyObject) + message.models = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.models[key] = value; + break; + case 5: + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.translation.v3.InputConfig.decode(reader, reader.uint32())); + break; + case 6: + message.outputConfig = $root.google.cloud.translation.v3.OutputConfig.decode(reader, reader.uint32()); + break; + case 7: + if (message.glossaries === $util.emptyObject) + message.glossaries = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.glossaries[key] = value; + break; + case 9: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; + + /** + * Decodes a BatchTranslateTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.BatchTranslateTextRequest} BatchTranslateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchTranslateTextRequest message. + * @function verify + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchTranslateTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCodes != null && message.hasOwnProperty("targetLanguageCodes")) { + if (!Array.isArray(message.targetLanguageCodes)) + return "targetLanguageCodes: array expected"; + for (var i = 0; i < message.targetLanguageCodes.length; ++i) + if (!$util.isString(message.targetLanguageCodes[i])) + return "targetLanguageCodes: string[] expected"; + } + if (message.models != null && message.hasOwnProperty("models")) { + if (!$util.isObject(message.models)) + return "models: object expected"; + var key = Object.keys(message.models); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.models[key[i]])) + return "models: string{k:string} expected"; + } + if (message.inputConfigs != null && message.hasOwnProperty("inputConfigs")) { + if (!Array.isArray(message.inputConfigs)) + return "inputConfigs: array expected"; + for (var i = 0; i < message.inputConfigs.length; ++i) { + var error = $root.google.cloud.translation.v3.InputConfig.verify(message.inputConfigs[i]); + if (error) + return "inputConfigs." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.translation.v3.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.glossaries != null && message.hasOwnProperty("glossaries")) { + if (!$util.isObject(message.glossaries)) + return "glossaries: object expected"; + var key = Object.keys(message.glossaries); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.verify(message.glossaries[key[i]]); + if (error) + return "glossaries." + error; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchTranslateTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.BatchTranslateTextRequest} BatchTranslateTextRequest + */ + BatchTranslateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.BatchTranslateTextRequest) + return object; + var message = new $root.google.cloud.translation.v3.BatchTranslateTextRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCodes) { + if (!Array.isArray(object.targetLanguageCodes)) + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.targetLanguageCodes: array expected"); + message.targetLanguageCodes = []; + for (var i = 0; i < object.targetLanguageCodes.length; ++i) + message.targetLanguageCodes[i] = String(object.targetLanguageCodes[i]); + } + if (object.models) { + if (typeof object.models !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.models: object expected"); + message.models = {}; + for (var keys = Object.keys(object.models), i = 0; i < keys.length; ++i) + message.models[keys[i]] = String(object.models[keys[i]]); + } + if (object.inputConfigs) { + if (!Array.isArray(object.inputConfigs)) + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.inputConfigs: array expected"); + message.inputConfigs = []; + for (var i = 0; i < object.inputConfigs.length; ++i) { + if (typeof object.inputConfigs[i] !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.inputConfigs: object expected"); + message.inputConfigs[i] = $root.google.cloud.translation.v3.InputConfig.fromObject(object.inputConfigs[i]); + } + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.translation.v3.OutputConfig.fromObject(object.outputConfig); + } + if (object.glossaries) { + if (typeof object.glossaries !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.glossaries: object expected"); + message.glossaries = {}; + for (var keys = Object.keys(object.glossaries), i = 0; i < keys.length; ++i) { + if (typeof object.glossaries[keys[i]] !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.glossaries: object expected"); + message.glossaries[keys[i]] = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.fromObject(object.glossaries[keys[i]]); + } + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateTextRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchTranslateTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {google.cloud.translation.v3.BatchTranslateTextRequest} message BatchTranslateTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchTranslateTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targetLanguageCodes = []; + object.inputConfigs = []; + } + if (options.objects || options.defaults) { + object.models = {}; + object.glossaries = {}; + object.labels = {}; + } + if (options.defaults) { + object.parent = ""; + object.sourceLanguageCode = ""; + object.outputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCodes && message.targetLanguageCodes.length) { + object.targetLanguageCodes = []; + for (var j = 0; j < message.targetLanguageCodes.length; ++j) + object.targetLanguageCodes[j] = message.targetLanguageCodes[j]; + } + var keys2; + if (message.models && (keys2 = Object.keys(message.models)).length) { + object.models = {}; + for (var j = 0; j < keys2.length; ++j) + object.models[keys2[j]] = message.models[keys2[j]]; + } + if (message.inputConfigs && message.inputConfigs.length) { + object.inputConfigs = []; + for (var j = 0; j < message.inputConfigs.length; ++j) + object.inputConfigs[j] = $root.google.cloud.translation.v3.InputConfig.toObject(message.inputConfigs[j], options); + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.translation.v3.OutputConfig.toObject(message.outputConfig, options); + if (message.glossaries && (keys2 = Object.keys(message.glossaries)).length) { + object.glossaries = {}; + for (var j = 0; j < keys2.length; ++j) + object.glossaries[keys2[j]] = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.toObject(message.glossaries[keys2[j]], options); + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchTranslateTextRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @instance + * @returns {Object.} JSON object + */ + BatchTranslateTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchTranslateTextRequest; + })(); + + v3.BatchTranslateMetadata = (function() { + + /** + * Properties of a BatchTranslateMetadata. + * @memberof google.cloud.translation.v3 + * @interface IBatchTranslateMetadata + * @property {google.cloud.translation.v3.BatchTranslateMetadata.State|null} [state] BatchTranslateMetadata state + * @property {number|Long|null} [translatedCharacters] BatchTranslateMetadata translatedCharacters + * @property {number|Long|null} [failedCharacters] BatchTranslateMetadata failedCharacters + * @property {number|Long|null} [totalCharacters] BatchTranslateMetadata totalCharacters + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateMetadata submitTime + */ + + /** + * Constructs a new BatchTranslateMetadata. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a BatchTranslateMetadata. + * @implements IBatchTranslateMetadata + * @constructor + * @param {google.cloud.translation.v3.IBatchTranslateMetadata=} [properties] Properties to set + */ + function BatchTranslateMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchTranslateMetadata state. + * @member {google.cloud.translation.v3.BatchTranslateMetadata.State} state + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.state = 0; + + /** + * BatchTranslateMetadata translatedCharacters. + * @member {number|Long} translatedCharacters + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateMetadata failedCharacters. + * @member {number|Long} failedCharacters + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateMetadata totalCharacters. + * @member {number|Long} totalCharacters + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @instance + */ + BatchTranslateMetadata.prototype.submitTime = null; + + /** + * Creates a new BatchTranslateMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3.IBatchTranslateMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3.BatchTranslateMetadata} BatchTranslateMetadata instance + */ + BatchTranslateMetadata.create = function create(properties) { + return new BatchTranslateMetadata(properties); + }; + + /** + * Encodes the specified BatchTranslateMetadata message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3.IBatchTranslateMetadata} message BatchTranslateMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalCharacters); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchTranslateMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3.IBatchTranslateMetadata} message BatchTranslateMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.BatchTranslateMetadata} BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.translatedCharacters = reader.int64(); + break; + case 3: + message.failedCharacters = reader.int64(); + break; + case 4: + message.totalCharacters = reader.int64(); + break; + case 5: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchTranslateMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.BatchTranslateMetadata} BatchTranslateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchTranslateMetadata message. + * @function verify + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchTranslateMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) + return "translatedCharacters: integer|Long expected"; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) + return "failedCharacters: integer|Long expected"; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) + return "totalCharacters: integer|Long expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + return null; + }; + + /** + * Creates a BatchTranslateMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.BatchTranslateMetadata} BatchTranslateMetadata + */ + BatchTranslateMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.BatchTranslateMetadata) + return object; + var message = new $root.google.cloud.translation.v3.BatchTranslateMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.translatedCharacters != null) + if ($util.Long) + (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; + else if (typeof object.translatedCharacters === "string") + message.translatedCharacters = parseInt(object.translatedCharacters, 10); + else if (typeof object.translatedCharacters === "number") + message.translatedCharacters = object.translatedCharacters; + else if (typeof object.translatedCharacters === "object") + message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); + if (object.failedCharacters != null) + if ($util.Long) + (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; + else if (typeof object.failedCharacters === "string") + message.failedCharacters = parseInt(object.failedCharacters, 10); + else if (typeof object.failedCharacters === "number") + message.failedCharacters = object.failedCharacters; + else if (typeof object.failedCharacters === "object") + message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); + if (object.totalCharacters != null) + if ($util.Long) + (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; + else if (typeof object.totalCharacters === "string") + message.totalCharacters = parseInt(object.totalCharacters, 10); + else if (typeof object.totalCharacters === "number") + message.totalCharacters = object.totalCharacters; + else if (typeof object.totalCharacters === "object") + message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchTranslateMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {google.cloud.translation.v3.BatchTranslateMetadata} message BatchTranslateMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchTranslateMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCharacters = options.longs === String ? "0" : 0; + object.submitTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3.BatchTranslateMetadata.State[message.state] : message.state; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (typeof message.translatedCharacters === "number") + object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; + else + object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (typeof message.failedCharacters === "number") + object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; + else + object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (typeof message.totalCharacters === "number") + object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; + else + object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + return object; + }; + + /** + * Converts this BatchTranslateMetadata to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchTranslateMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.translation.v3.BatchTranslateMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + BatchTranslateMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return BatchTranslateMetadata; + })(); + + v3.BatchTranslateResponse = (function() { + + /** + * Properties of a BatchTranslateResponse. + * @memberof google.cloud.translation.v3 + * @interface IBatchTranslateResponse + * @property {number|Long|null} [totalCharacters] BatchTranslateResponse totalCharacters + * @property {number|Long|null} [translatedCharacters] BatchTranslateResponse translatedCharacters + * @property {number|Long|null} [failedCharacters] BatchTranslateResponse failedCharacters + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateResponse submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] BatchTranslateResponse endTime + */ + + /** + * Constructs a new BatchTranslateResponse. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a BatchTranslateResponse. + * @implements IBatchTranslateResponse + * @constructor + * @param {google.cloud.translation.v3.IBatchTranslateResponse=} [properties] Properties to set + */ + function BatchTranslateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchTranslateResponse totalCharacters. + * @member {number|Long} totalCharacters + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateResponse translatedCharacters. + * @member {number|Long} translatedCharacters + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateResponse failedCharacters. + * @member {number|Long} failedCharacters + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateResponse submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.submitTime = null; + + /** + * BatchTranslateResponse endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @instance + */ + BatchTranslateResponse.prototype.endTime = null; + + /** + * Creates a new BatchTranslateResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3.IBatchTranslateResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3.BatchTranslateResponse} BatchTranslateResponse instance + */ + BatchTranslateResponse.create = function create(properties) { + return new BatchTranslateResponse(properties); + }; + + /** + * Encodes the specified BatchTranslateResponse message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3.IBatchTranslateResponse} message BatchTranslateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalCharacters); + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedCharacters); + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCharacters); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchTranslateResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3.IBatchTranslateResponse} message BatchTranslateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchTranslateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.BatchTranslateResponse} BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalCharacters = reader.int64(); + break; + case 2: + message.translatedCharacters = reader.int64(); + break; + case 3: + message.failedCharacters = reader.int64(); + break; + case 4: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchTranslateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.BatchTranslateResponse} BatchTranslateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchTranslateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchTranslateResponse message. + * @function verify + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchTranslateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) + return "totalCharacters: integer|Long expected"; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) + return "translatedCharacters: integer|Long expected"; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) + return "failedCharacters: integer|Long expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a BatchTranslateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.BatchTranslateResponse} BatchTranslateResponse + */ + BatchTranslateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.BatchTranslateResponse) + return object; + var message = new $root.google.cloud.translation.v3.BatchTranslateResponse(); + if (object.totalCharacters != null) + if ($util.Long) + (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; + else if (typeof object.totalCharacters === "string") + message.totalCharacters = parseInt(object.totalCharacters, 10); + else if (typeof object.totalCharacters === "number") + message.totalCharacters = object.totalCharacters; + else if (typeof object.totalCharacters === "object") + message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); + if (object.translatedCharacters != null) + if ($util.Long) + (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; + else if (typeof object.translatedCharacters === "string") + message.translatedCharacters = parseInt(object.translatedCharacters, 10); + else if (typeof object.translatedCharacters === "number") + message.translatedCharacters = object.translatedCharacters; + else if (typeof object.translatedCharacters === "object") + message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); + if (object.failedCharacters != null) + if ($util.Long) + (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; + else if (typeof object.failedCharacters === "string") + message.failedCharacters = parseInt(object.failedCharacters, 10); + else if (typeof object.failedCharacters === "number") + message.failedCharacters = object.failedCharacters; + else if (typeof object.failedCharacters === "object") + message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateResponse.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateResponse.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchTranslateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {google.cloud.translation.v3.BatchTranslateResponse} message BatchTranslateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchTranslateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCharacters = options.longs === String ? "0" : 0; + object.submitTime = null; + object.endTime = null; + } + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (typeof message.totalCharacters === "number") + object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; + else + object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (typeof message.translatedCharacters === "number") + object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; + else + object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (typeof message.failedCharacters === "number") + object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; + else + object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this BatchTranslateResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @instance + * @returns {Object.} JSON object + */ + BatchTranslateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchTranslateResponse; + })(); + + v3.GlossaryInputConfig = (function() { + + /** + * Properties of a GlossaryInputConfig. + * @memberof google.cloud.translation.v3 + * @interface IGlossaryInputConfig + * @property {google.cloud.translation.v3.IGcsSource|null} [gcsSource] GlossaryInputConfig gcsSource + */ + + /** + * Constructs a new GlossaryInputConfig. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a GlossaryInputConfig. + * @implements IGlossaryInputConfig + * @constructor + * @param {google.cloud.translation.v3.IGlossaryInputConfig=} [properties] Properties to set + */ + function GlossaryInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GlossaryInputConfig gcsSource. + * @member {google.cloud.translation.v3.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @instance + */ + GlossaryInputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GlossaryInputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @instance + */ + Object.defineProperty(GlossaryInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GlossaryInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3.IGlossaryInputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3.GlossaryInputConfig} GlossaryInputConfig instance + */ + GlossaryInputConfig.create = function create(properties) { + return new GlossaryInputConfig(properties); + }; + + /** + * Encodes the specified GlossaryInputConfig message. Does not implicitly {@link google.cloud.translation.v3.GlossaryInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3.IGlossaryInputConfig} message GlossaryInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlossaryInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.translation.v3.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GlossaryInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GlossaryInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3.IGlossaryInputConfig} message GlossaryInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlossaryInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.GlossaryInputConfig} GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlossaryInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.GlossaryInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GlossaryInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.GlossaryInputConfig} GlossaryInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlossaryInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GlossaryInputConfig message. + * @function verify + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GlossaryInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.translation.v3.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + return null; + }; + + /** + * Creates a GlossaryInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.GlossaryInputConfig} GlossaryInputConfig + */ + GlossaryInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.GlossaryInputConfig) + return object; + var message = new $root.google.cloud.translation.v3.GlossaryInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.translation.v3.GlossaryInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from a GlossaryInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {google.cloud.translation.v3.GlossaryInputConfig} message GlossaryInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GlossaryInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.translation.v3.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this GlossaryInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @instance + * @returns {Object.} JSON object + */ + GlossaryInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GlossaryInputConfig; + })(); + + v3.Glossary = (function() { + + /** + * Properties of a Glossary. + * @memberof google.cloud.translation.v3 + * @interface IGlossary + * @property {string|null} [name] Glossary name + * @property {google.cloud.translation.v3.Glossary.ILanguageCodePair|null} [languagePair] Glossary languagePair + * @property {google.cloud.translation.v3.Glossary.ILanguageCodesSet|null} [languageCodesSet] Glossary languageCodesSet + * @property {google.cloud.translation.v3.IGlossaryInputConfig|null} [inputConfig] Glossary inputConfig + * @property {number|null} [entryCount] Glossary entryCount + * @property {google.protobuf.ITimestamp|null} [submitTime] Glossary submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] Glossary endTime + */ + + /** + * Constructs a new Glossary. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a Glossary. + * @implements IGlossary + * @constructor + * @param {google.cloud.translation.v3.IGlossary=} [properties] Properties to set + */ + function Glossary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Glossary name. + * @member {string} name + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.name = ""; + + /** + * Glossary languagePair. + * @member {google.cloud.translation.v3.Glossary.ILanguageCodePair|null|undefined} languagePair + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.languagePair = null; + + /** + * Glossary languageCodesSet. + * @member {google.cloud.translation.v3.Glossary.ILanguageCodesSet|null|undefined} languageCodesSet + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.languageCodesSet = null; + + /** + * Glossary inputConfig. + * @member {google.cloud.translation.v3.IGlossaryInputConfig|null|undefined} inputConfig + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.inputConfig = null; + + /** + * Glossary entryCount. + * @member {number} entryCount + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.entryCount = 0; + + /** + * Glossary submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.submitTime = null; + + /** + * Glossary endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Glossary.prototype.endTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Glossary languages. + * @member {"languagePair"|"languageCodesSet"|undefined} languages + * @memberof google.cloud.translation.v3.Glossary + * @instance + */ + Object.defineProperty(Glossary.prototype, "languages", { + get: $util.oneOfGetter($oneOfFields = ["languagePair", "languageCodesSet"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Glossary instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {google.cloud.translation.v3.IGlossary=} [properties] Properties to set + * @returns {google.cloud.translation.v3.Glossary} Glossary instance + */ + Glossary.create = function create(properties) { + return new Glossary(properties); + }; + + /** + * Encodes the specified Glossary message. Does not implicitly {@link google.cloud.translation.v3.Glossary.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {google.cloud.translation.v3.IGlossary} message Glossary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Glossary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.languagePair != null && Object.hasOwnProperty.call(message, "languagePair")) + $root.google.cloud.translation.v3.Glossary.LanguageCodePair.encode(message.languagePair, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.languageCodesSet != null && Object.hasOwnProperty.call(message, "languageCodesSet")) + $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.encode(message.languageCodesSet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.translation.v3.GlossaryInputConfig.encode(message.inputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.entryCount != null && Object.hasOwnProperty.call(message, "entryCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.entryCount); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Glossary message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {google.cloud.translation.v3.IGlossary} message Glossary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Glossary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Glossary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.Glossary} Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Glossary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.Glossary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.languagePair = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.decode(reader, reader.uint32()); + break; + case 4: + message.languageCodesSet = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.decode(reader, reader.uint32()); + break; + case 5: + message.inputConfig = $root.google.cloud.translation.v3.GlossaryInputConfig.decode(reader, reader.uint32()); + break; + case 6: + message.entryCount = reader.int32(); + break; + case 7: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Glossary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.Glossary} Glossary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Glossary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Glossary message. + * @function verify + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Glossary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languagePair != null && message.hasOwnProperty("languagePair")) { + properties.languages = 1; + { + var error = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.verify(message.languagePair); + if (error) + return "languagePair." + error; + } + } + if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) { + if (properties.languages === 1) + return "languages: multiple values"; + properties.languages = 1; + { + var error = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.verify(message.languageCodesSet); + if (error) + return "languageCodesSet." + error; + } + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.translation.v3.GlossaryInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + if (!$util.isInteger(message.entryCount)) + return "entryCount: integer expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a Glossary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.Glossary} Glossary + */ + Glossary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.Glossary) + return object; + var message = new $root.google.cloud.translation.v3.Glossary(); + if (object.name != null) + message.name = String(object.name); + if (object.languagePair != null) { + if (typeof object.languagePair !== "object") + throw TypeError(".google.cloud.translation.v3.Glossary.languagePair: object expected"); + message.languagePair = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.fromObject(object.languagePair); + } + if (object.languageCodesSet != null) { + if (typeof object.languageCodesSet !== "object") + throw TypeError(".google.cloud.translation.v3.Glossary.languageCodesSet: object expected"); + message.languageCodesSet = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.fromObject(object.languageCodesSet); + } + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.translation.v3.Glossary.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.translation.v3.GlossaryInputConfig.fromObject(object.inputConfig); + } + if (object.entryCount != null) + message.entryCount = object.entryCount | 0; + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3.Glossary.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3.Glossary.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a Glossary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {google.cloud.translation.v3.Glossary} message Glossary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Glossary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputConfig = null; + object.entryCount = 0; + object.submitTime = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languagePair != null && message.hasOwnProperty("languagePair")) { + object.languagePair = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.toObject(message.languagePair, options); + if (options.oneofs) + object.languages = "languagePair"; + } + if (message.languageCodesSet != null && message.hasOwnProperty("languageCodesSet")) { + object.languageCodesSet = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.toObject(message.languageCodesSet, options); + if (options.oneofs) + object.languages = "languageCodesSet"; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.translation.v3.GlossaryInputConfig.toObject(message.inputConfig, options); + if (message.entryCount != null && message.hasOwnProperty("entryCount")) + object.entryCount = message.entryCount; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this Glossary to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.Glossary + * @instance + * @returns {Object.} JSON object + */ + Glossary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Glossary.LanguageCodePair = (function() { + + /** + * Properties of a LanguageCodePair. + * @memberof google.cloud.translation.v3.Glossary + * @interface ILanguageCodePair + * @property {string|null} [sourceLanguageCode] LanguageCodePair sourceLanguageCode + * @property {string|null} [targetLanguageCode] LanguageCodePair targetLanguageCode + */ + + /** + * Constructs a new LanguageCodePair. + * @memberof google.cloud.translation.v3.Glossary + * @classdesc Represents a LanguageCodePair. + * @implements ILanguageCodePair + * @constructor + * @param {google.cloud.translation.v3.Glossary.ILanguageCodePair=} [properties] Properties to set + */ + function LanguageCodePair(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageCodePair sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @instance + */ + LanguageCodePair.prototype.sourceLanguageCode = ""; + + /** + * LanguageCodePair targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @instance + */ + LanguageCodePair.prototype.targetLanguageCode = ""; + + /** + * Creates a new LanguageCodePair instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3.Glossary.ILanguageCodePair=} [properties] Properties to set + * @returns {google.cloud.translation.v3.Glossary.LanguageCodePair} LanguageCodePair instance + */ + LanguageCodePair.create = function create(properties) { + return new LanguageCodePair(properties); + }; + + /** + * Encodes the specified LanguageCodePair message. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodePair.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3.Glossary.ILanguageCodePair} message LanguageCodePair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodePair.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified LanguageCodePair message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodePair.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3.Glossary.ILanguageCodePair} message LanguageCodePair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodePair.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.Glossary.LanguageCodePair} LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodePair.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.Glossary.LanguageCodePair(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourceLanguageCode = reader.string(); + break; + case 2: + message.targetLanguageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageCodePair message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.Glossary.LanguageCodePair} LanguageCodePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodePair.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageCodePair message. + * @function verify + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageCodePair.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a LanguageCodePair message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.Glossary.LanguageCodePair} LanguageCodePair + */ + LanguageCodePair.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.Glossary.LanguageCodePair) + return object; + var message = new $root.google.cloud.translation.v3.Glossary.LanguageCodePair(); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a LanguageCodePair message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {google.cloud.translation.v3.Glossary.LanguageCodePair} message LanguageCodePair + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageCodePair.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this LanguageCodePair to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @instance + * @returns {Object.} JSON object + */ + LanguageCodePair.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LanguageCodePair; + })(); + + Glossary.LanguageCodesSet = (function() { + + /** + * Properties of a LanguageCodesSet. + * @memberof google.cloud.translation.v3.Glossary + * @interface ILanguageCodesSet + * @property {Array.|null} [languageCodes] LanguageCodesSet languageCodes + */ + + /** + * Constructs a new LanguageCodesSet. + * @memberof google.cloud.translation.v3.Glossary + * @classdesc Represents a LanguageCodesSet. + * @implements ILanguageCodesSet + * @constructor + * @param {google.cloud.translation.v3.Glossary.ILanguageCodesSet=} [properties] Properties to set + */ + function LanguageCodesSet(properties) { + this.languageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageCodesSet languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @instance + */ + LanguageCodesSet.prototype.languageCodes = $util.emptyArray; + + /** + * Creates a new LanguageCodesSet instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3.Glossary.ILanguageCodesSet=} [properties] Properties to set + * @returns {google.cloud.translation.v3.Glossary.LanguageCodesSet} LanguageCodesSet instance + */ + LanguageCodesSet.create = function create(properties) { + return new LanguageCodesSet(properties); + }; + + /** + * Encodes the specified LanguageCodesSet message. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodesSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3.Glossary.ILanguageCodesSet} message LanguageCodesSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodesSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCodes[i]); + return writer; + }; + + /** + * Encodes the specified LanguageCodesSet message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodesSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3.Glossary.ILanguageCodesSet} message LanguageCodesSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageCodesSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.Glossary.LanguageCodesSet} LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodesSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.Glossary.LanguageCodesSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageCodesSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.Glossary.LanguageCodesSet} LanguageCodesSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageCodesSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageCodesSet message. + * @function verify + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageCodesSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + return null; + }; + + /** + * Creates a LanguageCodesSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.Glossary.LanguageCodesSet} LanguageCodesSet + */ + LanguageCodesSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.Glossary.LanguageCodesSet) + return object; + var message = new $root.google.cloud.translation.v3.Glossary.LanguageCodesSet(); + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.translation.v3.Glossary.LanguageCodesSet.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + return message; + }; + + /** + * Creates a plain object from a LanguageCodesSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {google.cloud.translation.v3.Glossary.LanguageCodesSet} message LanguageCodesSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageCodesSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageCodes = []; + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + return object; + }; + + /** + * Converts this LanguageCodesSet to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @instance + * @returns {Object.} JSON object + */ + LanguageCodesSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LanguageCodesSet; + })(); + + return Glossary; + })(); + + v3.CreateGlossaryRequest = (function() { + + /** + * Properties of a CreateGlossaryRequest. + * @memberof google.cloud.translation.v3 + * @interface ICreateGlossaryRequest + * @property {string|null} [parent] CreateGlossaryRequest parent + * @property {google.cloud.translation.v3.IGlossary|null} [glossary] CreateGlossaryRequest glossary + */ + + /** + * Constructs a new CreateGlossaryRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a CreateGlossaryRequest. + * @implements ICreateGlossaryRequest + * @constructor + * @param {google.cloud.translation.v3.ICreateGlossaryRequest=} [properties] Properties to set + */ + function CreateGlossaryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGlossaryRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @instance + */ + CreateGlossaryRequest.prototype.parent = ""; + + /** + * CreateGlossaryRequest glossary. + * @member {google.cloud.translation.v3.IGlossary|null|undefined} glossary + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @instance + */ + CreateGlossaryRequest.prototype.glossary = null; + + /** + * Creates a new CreateGlossaryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3.ICreateGlossaryRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.CreateGlossaryRequest} CreateGlossaryRequest instance + */ + CreateGlossaryRequest.create = function create(properties) { + return new CreateGlossaryRequest(properties); + }; + + /** + * Encodes the specified CreateGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3.ICreateGlossaryRequest} message CreateGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGlossaryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) + $root.google.cloud.translation.v3.Glossary.encode(message.glossary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3.ICreateGlossaryRequest} message CreateGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.CreateGlossaryRequest} CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGlossaryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.CreateGlossaryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.glossary = $root.google.cloud.translation.v3.Glossary.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGlossaryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.CreateGlossaryRequest} CreateGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGlossaryRequest message. + * @function verify + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGlossaryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.glossary != null && message.hasOwnProperty("glossary")) { + var error = $root.google.cloud.translation.v3.Glossary.verify(message.glossary); + if (error) + return "glossary." + error; + } + return null; + }; + + /** + * Creates a CreateGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.CreateGlossaryRequest} CreateGlossaryRequest + */ + CreateGlossaryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.CreateGlossaryRequest) + return object; + var message = new $root.google.cloud.translation.v3.CreateGlossaryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.glossary != null) { + if (typeof object.glossary !== "object") + throw TypeError(".google.cloud.translation.v3.CreateGlossaryRequest.glossary: object expected"); + message.glossary = $root.google.cloud.translation.v3.Glossary.fromObject(object.glossary); + } + return message; + }; + + /** + * Creates a plain object from a CreateGlossaryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {google.cloud.translation.v3.CreateGlossaryRequest} message CreateGlossaryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGlossaryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.glossary = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.glossary != null && message.hasOwnProperty("glossary")) + object.glossary = $root.google.cloud.translation.v3.Glossary.toObject(message.glossary, options); + return object; + }; + + /** + * Converts this CreateGlossaryRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGlossaryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateGlossaryRequest; + })(); + + v3.GetGlossaryRequest = (function() { + + /** + * Properties of a GetGlossaryRequest. + * @memberof google.cloud.translation.v3 + * @interface IGetGlossaryRequest + * @property {string|null} [name] GetGlossaryRequest name + */ + + /** + * Constructs a new GetGlossaryRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a GetGlossaryRequest. + * @implements IGetGlossaryRequest + * @constructor + * @param {google.cloud.translation.v3.IGetGlossaryRequest=} [properties] Properties to set + */ + function GetGlossaryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGlossaryRequest name. + * @member {string} name + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @instance + */ + GetGlossaryRequest.prototype.name = ""; + + /** + * Creates a new GetGlossaryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3.IGetGlossaryRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.GetGlossaryRequest} GetGlossaryRequest instance + */ + GetGlossaryRequest.create = function create(properties) { + return new GetGlossaryRequest(properties); + }; + + /** + * Encodes the specified GetGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.GetGlossaryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3.IGetGlossaryRequest} message GetGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlossaryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GetGlossaryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3.IGetGlossaryRequest} message GetGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.GetGlossaryRequest} GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlossaryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.GetGlossaryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGlossaryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.GetGlossaryRequest} GetGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGlossaryRequest message. + * @function verify + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGlossaryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.GetGlossaryRequest} GetGlossaryRequest + */ + GetGlossaryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.GetGlossaryRequest) + return object; + var message = new $root.google.cloud.translation.v3.GetGlossaryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGlossaryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {google.cloud.translation.v3.GetGlossaryRequest} message GetGlossaryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGlossaryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetGlossaryRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @instance + * @returns {Object.} JSON object + */ + GetGlossaryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGlossaryRequest; + })(); + + v3.DeleteGlossaryRequest = (function() { + + /** + * Properties of a DeleteGlossaryRequest. + * @memberof google.cloud.translation.v3 + * @interface IDeleteGlossaryRequest + * @property {string|null} [name] DeleteGlossaryRequest name + */ + + /** + * Constructs a new DeleteGlossaryRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a DeleteGlossaryRequest. + * @implements IDeleteGlossaryRequest + * @constructor + * @param {google.cloud.translation.v3.IDeleteGlossaryRequest=} [properties] Properties to set + */ + function DeleteGlossaryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlossaryRequest name. + * @member {string} name + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @instance + */ + DeleteGlossaryRequest.prototype.name = ""; + + /** + * Creates a new DeleteGlossaryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3.IDeleteGlossaryRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.DeleteGlossaryRequest} DeleteGlossaryRequest instance + */ + DeleteGlossaryRequest.create = function create(properties) { + return new DeleteGlossaryRequest(properties); + }; + + /** + * Encodes the specified DeleteGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3.IDeleteGlossaryRequest} message DeleteGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3.IDeleteGlossaryRequest} message DeleteGlossaryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.DeleteGlossaryRequest} DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DeleteGlossaryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlossaryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.DeleteGlossaryRequest} DeleteGlossaryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlossaryRequest message. + * @function verify + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlossaryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.DeleteGlossaryRequest} DeleteGlossaryRequest + */ + DeleteGlossaryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.DeleteGlossaryRequest) + return object; + var message = new $root.google.cloud.translation.v3.DeleteGlossaryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGlossaryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {google.cloud.translation.v3.DeleteGlossaryRequest} message DeleteGlossaryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlossaryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Decodes a LanguageCodePair message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.Glossary.LanguageCodePair} LanguageCodePair - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LanguageCodePair.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this DeleteGlossaryRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGlossaryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a LanguageCodePair message. - * @function verify - * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LanguageCodePair.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - if (!$util.isString(message.sourceLanguageCode)) - return "sourceLanguageCode: string expected"; - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) - if (!$util.isString(message.targetLanguageCode)) - return "targetLanguageCode: string expected"; - return null; - }; + return DeleteGlossaryRequest; + })(); - /** - * Creates a LanguageCodePair message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.Glossary.LanguageCodePair} LanguageCodePair - */ - LanguageCodePair.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.Glossary.LanguageCodePair) - return object; - var message = new $root.google.cloud.translation.v3.Glossary.LanguageCodePair(); - if (object.sourceLanguageCode != null) - message.sourceLanguageCode = String(object.sourceLanguageCode); - if (object.targetLanguageCode != null) - message.targetLanguageCode = String(object.targetLanguageCode); - return message; - }; + v3.ListGlossariesRequest = (function() { + + /** + * Properties of a ListGlossariesRequest. + * @memberof google.cloud.translation.v3 + * @interface IListGlossariesRequest + * @property {string|null} [parent] ListGlossariesRequest parent + * @property {number|null} [pageSize] ListGlossariesRequest pageSize + * @property {string|null} [pageToken] ListGlossariesRequest pageToken + * @property {string|null} [filter] ListGlossariesRequest filter + */ + + /** + * Constructs a new ListGlossariesRequest. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a ListGlossariesRequest. + * @implements IListGlossariesRequest + * @constructor + * @param {google.cloud.translation.v3.IListGlossariesRequest=} [properties] Properties to set + */ + function ListGlossariesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGlossariesRequest parent. + * @member {string} parent + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.parent = ""; + + /** + * ListGlossariesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.pageSize = 0; + + /** + * ListGlossariesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.pageToken = ""; + + /** + * ListGlossariesRequest filter. + * @member {string} filter + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @instance + */ + ListGlossariesRequest.prototype.filter = ""; + + /** + * Creates a new ListGlossariesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3.IListGlossariesRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.ListGlossariesRequest} ListGlossariesRequest instance + */ + ListGlossariesRequest.create = function create(properties) { + return new ListGlossariesRequest(properties); + }; + + /** + * Encodes the specified ListGlossariesRequest message. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3.IListGlossariesRequest} message ListGlossariesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListGlossariesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3.IListGlossariesRequest} message ListGlossariesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.ListGlossariesRequest} ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.ListGlossariesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGlossariesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.ListGlossariesRequest} ListGlossariesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlossariesRequest message. + * @function verify + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlossariesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; - /** - * Creates a plain object from a LanguageCodePair message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair - * @static - * @param {google.cloud.translation.v3.Glossary.LanguageCodePair} message LanguageCodePair - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LanguageCodePair.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sourceLanguageCode = ""; - object.targetLanguageCode = ""; - } - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - object.sourceLanguageCode = message.sourceLanguageCode; - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) - object.targetLanguageCode = message.targetLanguageCode; + /** + * Creates a ListGlossariesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.ListGlossariesRequest} ListGlossariesRequest + */ + ListGlossariesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.ListGlossariesRequest) return object; - }; + var message = new $root.google.cloud.translation.v3.ListGlossariesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; - /** - * Converts this LanguageCodePair to JSON. - * @function toJSON - * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair - * @instance - * @returns {Object.} JSON object - */ - LanguageCodePair.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ListGlossariesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {google.cloud.translation.v3.ListGlossariesRequest} message ListGlossariesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlossariesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; - return LanguageCodePair; - })(); + /** + * Converts this ListGlossariesRequest to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @instance + * @returns {Object.} JSON object + */ + ListGlossariesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - Glossary.LanguageCodesSet = (function() { + return ListGlossariesRequest; + })(); - /** - * Properties of a LanguageCodesSet. - * @memberof google.cloud.translation.v3.Glossary - * @interface ILanguageCodesSet - * @property {Array.|null} [languageCodes] LanguageCodesSet languageCodes - */ + v3.ListGlossariesResponse = (function() { - /** - * Constructs a new LanguageCodesSet. - * @memberof google.cloud.translation.v3.Glossary - * @classdesc Represents a LanguageCodesSet. - * @implements ILanguageCodesSet - * @constructor - * @param {google.cloud.translation.v3.Glossary.ILanguageCodesSet=} [properties] Properties to set - */ - function LanguageCodesSet(properties) { - this.languageCodes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a ListGlossariesResponse. + * @memberof google.cloud.translation.v3 + * @interface IListGlossariesResponse + * @property {Array.|null} [glossaries] ListGlossariesResponse glossaries + * @property {string|null} [nextPageToken] ListGlossariesResponse nextPageToken + */ - /** - * LanguageCodesSet languageCodes. - * @member {Array.} languageCodes - * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet - * @instance - */ - LanguageCodesSet.prototype.languageCodes = $util.emptyArray; + /** + * Constructs a new ListGlossariesResponse. + * @memberof google.cloud.translation.v3 + * @classdesc Represents a ListGlossariesResponse. + * @implements IListGlossariesResponse + * @constructor + * @param {google.cloud.translation.v3.IListGlossariesResponse=} [properties] Properties to set + */ + function ListGlossariesResponse(properties) { + this.glossaries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new LanguageCodesSet instance using the specified properties. - * @function create - * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet - * @static - * @param {google.cloud.translation.v3.Glossary.ILanguageCodesSet=} [properties] Properties to set - * @returns {google.cloud.translation.v3.Glossary.LanguageCodesSet} LanguageCodesSet instance - */ - LanguageCodesSet.create = function create(properties) { - return new LanguageCodesSet(properties); - }; + /** + * ListGlossariesResponse glossaries. + * @member {Array.} glossaries + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @instance + */ + ListGlossariesResponse.prototype.glossaries = $util.emptyArray; - /** - * Encodes the specified LanguageCodesSet message. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodesSet.verify|verify} messages. - * @function encode - * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet - * @static - * @param {google.cloud.translation.v3.Glossary.ILanguageCodesSet} message LanguageCodesSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LanguageCodesSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.languageCodes != null && message.languageCodes.length) - for (var i = 0; i < message.languageCodes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCodes[i]); - return writer; - }; + /** + * ListGlossariesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @instance + */ + ListGlossariesResponse.prototype.nextPageToken = ""; - /** - * Encodes the specified LanguageCodesSet message, length delimited. Does not implicitly {@link google.cloud.translation.v3.Glossary.LanguageCodesSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet - * @static - * @param {google.cloud.translation.v3.Glossary.ILanguageCodesSet} message LanguageCodesSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LanguageCodesSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new ListGlossariesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3.IListGlossariesResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3.ListGlossariesResponse} ListGlossariesResponse instance + */ + ListGlossariesResponse.create = function create(properties) { + return new ListGlossariesResponse(properties); + }; - /** - * Decodes a LanguageCodesSet message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.Glossary.LanguageCodesSet} LanguageCodesSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LanguageCodesSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.Glossary.LanguageCodesSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.languageCodes && message.languageCodes.length)) - message.languageCodes = []; - message.languageCodes.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified ListGlossariesResponse message. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3.IListGlossariesResponse} message ListGlossariesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.glossaries != null && message.glossaries.length) + for (var i = 0; i < message.glossaries.length; ++i) + $root.google.cloud.translation.v3.Glossary.encode(message.glossaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; - /** - * Decodes a LanguageCodesSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.Glossary.LanguageCodesSet} LanguageCodesSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LanguageCodesSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified ListGlossariesResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3.IListGlossariesResponse} message ListGlossariesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlossariesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a LanguageCodesSet message. - * @function verify - * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LanguageCodesSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { - if (!Array.isArray(message.languageCodes)) - return "languageCodes: array expected"; - for (var i = 0; i < message.languageCodes.length; ++i) - if (!$util.isString(message.languageCodes[i])) - return "languageCodes: string[] expected"; + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.translation.v3.ListGlossariesResponse} ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.ListGlossariesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.glossaries && message.glossaries.length)) + message.glossaries = []; + message.glossaries.push($root.google.cloud.translation.v3.Glossary.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - return null; - }; + } + return message; + }; - /** - * Creates a LanguageCodesSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.Glossary.LanguageCodesSet} LanguageCodesSet - */ - LanguageCodesSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.Glossary.LanguageCodesSet) - return object; - var message = new $root.google.cloud.translation.v3.Glossary.LanguageCodesSet(); - if (object.languageCodes) { - if (!Array.isArray(object.languageCodes)) - throw TypeError(".google.cloud.translation.v3.Glossary.LanguageCodesSet.languageCodes: array expected"); - message.languageCodes = []; - for (var i = 0; i < object.languageCodes.length; ++i) - message.languageCodes[i] = String(object.languageCodes[i]); - } - return message; - }; + /** + * Decodes a ListGlossariesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.translation.v3.ListGlossariesResponse} ListGlossariesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlossariesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a LanguageCodesSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet - * @static - * @param {google.cloud.translation.v3.Glossary.LanguageCodesSet} message LanguageCodesSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LanguageCodesSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.languageCodes = []; - if (message.languageCodes && message.languageCodes.length) { - object.languageCodes = []; - for (var j = 0; j < message.languageCodes.length; ++j) - object.languageCodes[j] = message.languageCodes[j]; + /** + * Verifies a ListGlossariesResponse message. + * @function verify + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlossariesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.glossaries != null && message.hasOwnProperty("glossaries")) { + if (!Array.isArray(message.glossaries)) + return "glossaries: array expected"; + for (var i = 0; i < message.glossaries.length; ++i) { + var error = $root.google.cloud.translation.v3.Glossary.verify(message.glossaries[i]); + if (error) + return "glossaries." + error; } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListGlossariesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.ListGlossariesResponse} ListGlossariesResponse + */ + ListGlossariesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.ListGlossariesResponse) return object; - }; + var message = new $root.google.cloud.translation.v3.ListGlossariesResponse(); + if (object.glossaries) { + if (!Array.isArray(object.glossaries)) + throw TypeError(".google.cloud.translation.v3.ListGlossariesResponse.glossaries: array expected"); + message.glossaries = []; + for (var i = 0; i < object.glossaries.length; ++i) { + if (typeof object.glossaries[i] !== "object") + throw TypeError(".google.cloud.translation.v3.ListGlossariesResponse.glossaries: object expected"); + message.glossaries[i] = $root.google.cloud.translation.v3.Glossary.fromObject(object.glossaries[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Converts this LanguageCodesSet to JSON. - * @function toJSON - * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet - * @instance - * @returns {Object.} JSON object - */ - LanguageCodesSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ListGlossariesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {google.cloud.translation.v3.ListGlossariesResponse} message ListGlossariesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlossariesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.glossaries = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.glossaries && message.glossaries.length) { + object.glossaries = []; + for (var j = 0; j < message.glossaries.length; ++j) + object.glossaries[j] = $root.google.cloud.translation.v3.Glossary.toObject(message.glossaries[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - return LanguageCodesSet; - })(); + /** + * Converts this ListGlossariesResponse to JSON. + * @function toJSON + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @instance + * @returns {Object.} JSON object + */ + ListGlossariesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Glossary; + return ListGlossariesResponse; })(); - v3.CreateGlossaryRequest = (function() { + v3.CreateGlossaryMetadata = (function() { /** - * Properties of a CreateGlossaryRequest. + * Properties of a CreateGlossaryMetadata. * @memberof google.cloud.translation.v3 - * @interface ICreateGlossaryRequest - * @property {string|null} [parent] CreateGlossaryRequest parent - * @property {google.cloud.translation.v3.IGlossary|null} [glossary] CreateGlossaryRequest glossary + * @interface ICreateGlossaryMetadata + * @property {string|null} [name] CreateGlossaryMetadata name + * @property {google.cloud.translation.v3.CreateGlossaryMetadata.State|null} [state] CreateGlossaryMetadata state + * @property {google.protobuf.ITimestamp|null} [submitTime] CreateGlossaryMetadata submitTime */ /** - * Constructs a new CreateGlossaryRequest. + * Constructs a new CreateGlossaryMetadata. * @memberof google.cloud.translation.v3 - * @classdesc Represents a CreateGlossaryRequest. - * @implements ICreateGlossaryRequest + * @classdesc Represents a CreateGlossaryMetadata. + * @implements ICreateGlossaryMetadata * @constructor - * @param {google.cloud.translation.v3.ICreateGlossaryRequest=} [properties] Properties to set + * @param {google.cloud.translation.v3.ICreateGlossaryMetadata=} [properties] Properties to set */ - function CreateGlossaryRequest(properties) { + function CreateGlossaryMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5974,88 +8528,101 @@ } /** - * CreateGlossaryRequest parent. - * @member {string} parent - * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * CreateGlossaryMetadata name. + * @member {string} name + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata * @instance */ - CreateGlossaryRequest.prototype.parent = ""; + CreateGlossaryMetadata.prototype.name = ""; /** - * CreateGlossaryRequest glossary. - * @member {google.cloud.translation.v3.IGlossary|null|undefined} glossary - * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * CreateGlossaryMetadata state. + * @member {google.cloud.translation.v3.CreateGlossaryMetadata.State} state + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata * @instance */ - CreateGlossaryRequest.prototype.glossary = null; + CreateGlossaryMetadata.prototype.state = 0; /** - * Creates a new CreateGlossaryRequest instance using the specified properties. + * CreateGlossaryMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @instance + */ + CreateGlossaryMetadata.prototype.submitTime = null; + + /** + * Creates a new CreateGlossaryMetadata instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata * @static - * @param {google.cloud.translation.v3.ICreateGlossaryRequest=} [properties] Properties to set - * @returns {google.cloud.translation.v3.CreateGlossaryRequest} CreateGlossaryRequest instance + * @param {google.cloud.translation.v3.ICreateGlossaryMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3.CreateGlossaryMetadata} CreateGlossaryMetadata instance */ - CreateGlossaryRequest.create = function create(properties) { - return new CreateGlossaryRequest(properties); + CreateGlossaryMetadata.create = function create(properties) { + return new CreateGlossaryMetadata(properties); }; /** - * Encodes the specified CreateGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryRequest.verify|verify} messages. + * Encodes the specified CreateGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata * @static - * @param {google.cloud.translation.v3.ICreateGlossaryRequest} message CreateGlossaryRequest message or plain object to encode + * @param {google.cloud.translation.v3.ICreateGlossaryMetadata} message CreateGlossaryMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateGlossaryRequest.encode = function encode(message, writer) { + CreateGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.glossary != null && Object.hasOwnProperty.call(message, "glossary")) - $root.google.cloud.translation.v3.Glossary.encode(message.glossary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryRequest.verify|verify} messages. + * Encodes the specified CreateGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata * @static - * @param {google.cloud.translation.v3.ICreateGlossaryRequest} message CreateGlossaryRequest message or plain object to encode + * @param {google.cloud.translation.v3.ICreateGlossaryMetadata} message CreateGlossaryMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateGlossaryMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateGlossaryRequest message from the specified reader or buffer. + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.CreateGlossaryRequest} CreateGlossaryRequest + * @returns {google.cloud.translation.v3.CreateGlossaryMetadata} CreateGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateGlossaryRequest.decode = function decode(reader, length) { + CreateGlossaryMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.CreateGlossaryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.CreateGlossaryMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.glossary = $root.google.cloud.translation.v3.Glossary.decode(reader, reader.uint32()); + message.state = reader.int32(); + break; + case 3: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6066,121 +8633,186 @@ }; /** - * Decodes a CreateGlossaryRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateGlossaryMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.CreateGlossaryRequest} CreateGlossaryRequest + * @returns {google.cloud.translation.v3.CreateGlossaryMetadata} CreateGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + CreateGlossaryMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateGlossaryRequest message. + * Verifies a CreateGlossaryMetadata message. * @function verify - * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateGlossaryRequest.verify = function verify(message) { + CreateGlossaryMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.glossary != null && message.hasOwnProperty("glossary")) { - var error = $root.google.cloud.translation.v3.Glossary.verify(message.glossary); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); if (error) - return "glossary." + error; + return "submitTime." + error; } return null; }; /** - * Creates a CreateGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateGlossaryMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.CreateGlossaryRequest} CreateGlossaryRequest + * @returns {google.cloud.translation.v3.CreateGlossaryMetadata} CreateGlossaryMetadata */ - CreateGlossaryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.CreateGlossaryRequest) + CreateGlossaryMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.CreateGlossaryMetadata) return object; - var message = new $root.google.cloud.translation.v3.CreateGlossaryRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.glossary != null) { - if (typeof object.glossary !== "object") - throw TypeError(".google.cloud.translation.v3.CreateGlossaryRequest.glossary: object expected"); - message.glossary = $root.google.cloud.translation.v3.Glossary.fromObject(object.glossary); + var message = new $root.google.cloud.translation.v3.CreateGlossaryMetadata(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3.CreateGlossaryMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); } return message; }; /** - * Creates a plain object from a CreateGlossaryRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateGlossaryMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata * @static - * @param {google.cloud.translation.v3.CreateGlossaryRequest} message CreateGlossaryRequest + * @param {google.cloud.translation.v3.CreateGlossaryMetadata} message CreateGlossaryMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateGlossaryRequest.toObject = function toObject(message, options) { + CreateGlossaryMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.glossary = null; + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.submitTime = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.glossary != null && message.hasOwnProperty("glossary")) - object.glossary = $root.google.cloud.translation.v3.Glossary.toObject(message.glossary, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3.CreateGlossaryMetadata.State[message.state] : message.state; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); return object; }; /** - * Converts this CreateGlossaryRequest to JSON. + * Converts this CreateGlossaryMetadata to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata * @instance * @returns {Object.} JSON object */ - CreateGlossaryRequest.prototype.toJSON = function toJSON() { + CreateGlossaryMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateGlossaryRequest; + /** + * State enum. + * @name google.cloud.translation.v3.CreateGlossaryMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + CreateGlossaryMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return CreateGlossaryMetadata; })(); - v3.GetGlossaryRequest = (function() { + v3.DeleteGlossaryMetadata = (function() { /** - * Properties of a GetGlossaryRequest. + * Properties of a DeleteGlossaryMetadata. * @memberof google.cloud.translation.v3 - * @interface IGetGlossaryRequest - * @property {string|null} [name] GetGlossaryRequest name + * @interface IDeleteGlossaryMetadata + * @property {string|null} [name] DeleteGlossaryMetadata name + * @property {google.cloud.translation.v3.DeleteGlossaryMetadata.State|null} [state] DeleteGlossaryMetadata state + * @property {google.protobuf.ITimestamp|null} [submitTime] DeleteGlossaryMetadata submitTime */ /** - * Constructs a new GetGlossaryRequest. + * Constructs a new DeleteGlossaryMetadata. * @memberof google.cloud.translation.v3 - * @classdesc Represents a GetGlossaryRequest. - * @implements IGetGlossaryRequest + * @classdesc Represents a DeleteGlossaryMetadata. + * @implements IDeleteGlossaryMetadata * @constructor - * @param {google.cloud.translation.v3.IGetGlossaryRequest=} [properties] Properties to set + * @param {google.cloud.translation.v3.IDeleteGlossaryMetadata=} [properties] Properties to set */ - function GetGlossaryRequest(properties) { + function DeleteGlossaryMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6188,76 +8820,102 @@ } /** - * GetGlossaryRequest name. - * @member {string} name - * @memberof google.cloud.translation.v3.GetGlossaryRequest + * DeleteGlossaryMetadata name. + * @member {string} name + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @instance + */ + DeleteGlossaryMetadata.prototype.name = ""; + + /** + * DeleteGlossaryMetadata state. + * @member {google.cloud.translation.v3.DeleteGlossaryMetadata.State} state + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @instance + */ + DeleteGlossaryMetadata.prototype.state = 0; + + /** + * DeleteGlossaryMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata * @instance */ - GetGlossaryRequest.prototype.name = ""; + DeleteGlossaryMetadata.prototype.submitTime = null; /** - * Creates a new GetGlossaryRequest instance using the specified properties. + * Creates a new DeleteGlossaryMetadata instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata * @static - * @param {google.cloud.translation.v3.IGetGlossaryRequest=} [properties] Properties to set - * @returns {google.cloud.translation.v3.GetGlossaryRequest} GetGlossaryRequest instance + * @param {google.cloud.translation.v3.IDeleteGlossaryMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3.DeleteGlossaryMetadata} DeleteGlossaryMetadata instance */ - GetGlossaryRequest.create = function create(properties) { - return new GetGlossaryRequest(properties); + DeleteGlossaryMetadata.create = function create(properties) { + return new DeleteGlossaryMetadata(properties); }; /** - * Encodes the specified GetGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.GetGlossaryRequest.verify|verify} messages. + * Encodes the specified DeleteGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata * @static - * @param {google.cloud.translation.v3.IGetGlossaryRequest} message GetGlossaryRequest message or plain object to encode + * @param {google.cloud.translation.v3.IDeleteGlossaryMetadata} message DeleteGlossaryMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetGlossaryRequest.encode = function encode(message, writer) { + DeleteGlossaryMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.GetGlossaryRequest.verify|verify} messages. + * Encodes the specified DeleteGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata * @static - * @param {google.cloud.translation.v3.IGetGlossaryRequest} message GetGlossaryRequest message or plain object to encode + * @param {google.cloud.translation.v3.IDeleteGlossaryMetadata} message DeleteGlossaryMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteGlossaryMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetGlossaryRequest message from the specified reader or buffer. + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.GetGlossaryRequest} GetGlossaryRequest + * @returns {google.cloud.translation.v3.DeleteGlossaryMetadata} DeleteGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetGlossaryRequest.decode = function decode(reader, length) { + DeleteGlossaryMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.GetGlossaryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DeleteGlossaryMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -6267,107 +8925,186 @@ }; /** - * Decodes a GetGlossaryRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.GetGlossaryRequest} GetGlossaryRequest + * @returns {google.cloud.translation.v3.DeleteGlossaryMetadata} DeleteGlossaryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteGlossaryMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetGlossaryRequest message. + * Verifies a DeleteGlossaryMetadata message. * @function verify - * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetGlossaryRequest.verify = function verify(message) { + DeleteGlossaryMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } return null; }; /** - * Creates a GetGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteGlossaryMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.GetGlossaryRequest} GetGlossaryRequest + * @returns {google.cloud.translation.v3.DeleteGlossaryMetadata} DeleteGlossaryMetadata */ - GetGlossaryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.GetGlossaryRequest) + DeleteGlossaryMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.DeleteGlossaryMetadata) return object; - var message = new $root.google.cloud.translation.v3.GetGlossaryRequest(); + var message = new $root.google.cloud.translation.v3.DeleteGlossaryMetadata(); if (object.name != null) message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3.DeleteGlossaryMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } return message; }; /** - * Creates a plain object from a GetGlossaryRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteGlossaryMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata * @static - * @param {google.cloud.translation.v3.GetGlossaryRequest} message GetGlossaryRequest + * @param {google.cloud.translation.v3.DeleteGlossaryMetadata} message DeleteGlossaryMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetGlossaryRequest.toObject = function toObject(message, options) { + DeleteGlossaryMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.submitTime = null; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3.DeleteGlossaryMetadata.State[message.state] : message.state; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); return object; }; /** - * Converts this GetGlossaryRequest to JSON. + * Converts this DeleteGlossaryMetadata to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata * @instance * @returns {Object.} JSON object */ - GetGlossaryRequest.prototype.toJSON = function toJSON() { + DeleteGlossaryMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetGlossaryRequest; + /** + * State enum. + * @name google.cloud.translation.v3.DeleteGlossaryMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + DeleteGlossaryMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return DeleteGlossaryMetadata; })(); - v3.DeleteGlossaryRequest = (function() { + v3.DeleteGlossaryResponse = (function() { /** - * Properties of a DeleteGlossaryRequest. + * Properties of a DeleteGlossaryResponse. * @memberof google.cloud.translation.v3 - * @interface IDeleteGlossaryRequest - * @property {string|null} [name] DeleteGlossaryRequest name + * @interface IDeleteGlossaryResponse + * @property {string|null} [name] DeleteGlossaryResponse name + * @property {google.protobuf.ITimestamp|null} [submitTime] DeleteGlossaryResponse submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] DeleteGlossaryResponse endTime */ /** - * Constructs a new DeleteGlossaryRequest. + * Constructs a new DeleteGlossaryResponse. * @memberof google.cloud.translation.v3 - * @classdesc Represents a DeleteGlossaryRequest. - * @implements IDeleteGlossaryRequest + * @classdesc Represents a DeleteGlossaryResponse. + * @implements IDeleteGlossaryResponse * @constructor - * @param {google.cloud.translation.v3.IDeleteGlossaryRequest=} [properties] Properties to set + * @param {google.cloud.translation.v3.IDeleteGlossaryResponse=} [properties] Properties to set */ - function DeleteGlossaryRequest(properties) { + function DeleteGlossaryResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6375,76 +9112,102 @@ } /** - * DeleteGlossaryRequest name. + * DeleteGlossaryResponse name. * @member {string} name - * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse * @instance */ - DeleteGlossaryRequest.prototype.name = ""; + DeleteGlossaryResponse.prototype.name = ""; /** - * Creates a new DeleteGlossaryRequest instance using the specified properties. + * DeleteGlossaryResponse submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @instance + */ + DeleteGlossaryResponse.prototype.submitTime = null; + + /** + * DeleteGlossaryResponse endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @instance + */ + DeleteGlossaryResponse.prototype.endTime = null; + + /** + * Creates a new DeleteGlossaryResponse instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse * @static - * @param {google.cloud.translation.v3.IDeleteGlossaryRequest=} [properties] Properties to set - * @returns {google.cloud.translation.v3.DeleteGlossaryRequest} DeleteGlossaryRequest instance + * @param {google.cloud.translation.v3.IDeleteGlossaryResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3.DeleteGlossaryResponse} DeleteGlossaryResponse instance */ - DeleteGlossaryRequest.create = function create(properties) { - return new DeleteGlossaryRequest(properties); + DeleteGlossaryResponse.create = function create(properties) { + return new DeleteGlossaryResponse(properties); }; /** - * Encodes the specified DeleteGlossaryRequest message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryRequest.verify|verify} messages. + * Encodes the specified DeleteGlossaryResponse message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse * @static - * @param {google.cloud.translation.v3.IDeleteGlossaryRequest} message DeleteGlossaryRequest message or plain object to encode + * @param {google.cloud.translation.v3.IDeleteGlossaryResponse} message DeleteGlossaryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGlossaryRequest.encode = function encode(message, writer) { + DeleteGlossaryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteGlossaryRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryRequest.verify|verify} messages. + * Encodes the specified DeleteGlossaryResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse * @static - * @param {google.cloud.translation.v3.IDeleteGlossaryRequest} message DeleteGlossaryRequest message or plain object to encode + * @param {google.cloud.translation.v3.IDeleteGlossaryResponse} message DeleteGlossaryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGlossaryRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteGlossaryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteGlossaryRequest message from the specified reader or buffer. + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.DeleteGlossaryRequest} DeleteGlossaryRequest + * @returns {google.cloud.translation.v3.DeleteGlossaryResponse} DeleteGlossaryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGlossaryRequest.decode = function decode(reader, length) { + DeleteGlossaryResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DeleteGlossaryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DeleteGlossaryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; + case 2: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -6454,110 +9217,146 @@ }; /** - * Decodes a DeleteGlossaryRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteGlossaryResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.DeleteGlossaryRequest} DeleteGlossaryRequest + * @returns {google.cloud.translation.v3.DeleteGlossaryResponse} DeleteGlossaryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGlossaryRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteGlossaryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteGlossaryRequest message. + * Verifies a DeleteGlossaryResponse message. * @function verify - * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteGlossaryRequest.verify = function verify(message) { + DeleteGlossaryResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } return null; }; /** - * Creates a DeleteGlossaryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteGlossaryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.DeleteGlossaryRequest} DeleteGlossaryRequest + * @returns {google.cloud.translation.v3.DeleteGlossaryResponse} DeleteGlossaryResponse */ - DeleteGlossaryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.DeleteGlossaryRequest) + DeleteGlossaryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.DeleteGlossaryResponse) return object; - var message = new $root.google.cloud.translation.v3.DeleteGlossaryRequest(); + var message = new $root.google.cloud.translation.v3.DeleteGlossaryResponse(); if (object.name != null) message.name = String(object.name); + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.translation.v3.DeleteGlossaryResponse.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3.DeleteGlossaryResponse.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } return message; }; /** - * Creates a plain object from a DeleteGlossaryRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteGlossaryResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse * @static - * @param {google.cloud.translation.v3.DeleteGlossaryRequest} message DeleteGlossaryRequest + * @param {google.cloud.translation.v3.DeleteGlossaryResponse} message DeleteGlossaryResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteGlossaryRequest.toObject = function toObject(message, options) { + DeleteGlossaryResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.submitTime = null; + object.endTime = null; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); return object; }; /** - * Converts this DeleteGlossaryRequest to JSON. + * Converts this DeleteGlossaryResponse to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse * @instance * @returns {Object.} JSON object */ - DeleteGlossaryRequest.prototype.toJSON = function toJSON() { + DeleteGlossaryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteGlossaryRequest; + return DeleteGlossaryResponse; })(); - v3.ListGlossariesRequest = (function() { + v3.BatchTranslateDocumentRequest = (function() { /** - * Properties of a ListGlossariesRequest. + * Properties of a BatchTranslateDocumentRequest. * @memberof google.cloud.translation.v3 - * @interface IListGlossariesRequest - * @property {string|null} [parent] ListGlossariesRequest parent - * @property {number|null} [pageSize] ListGlossariesRequest pageSize - * @property {string|null} [pageToken] ListGlossariesRequest pageToken - * @property {string|null} [filter] ListGlossariesRequest filter + * @interface IBatchTranslateDocumentRequest + * @property {string|null} [parent] BatchTranslateDocumentRequest parent + * @property {string|null} [sourceLanguageCode] BatchTranslateDocumentRequest sourceLanguageCode + * @property {Array.|null} [targetLanguageCodes] BatchTranslateDocumentRequest targetLanguageCodes + * @property {Array.|null} [inputConfigs] BatchTranslateDocumentRequest inputConfigs + * @property {google.cloud.translation.v3.IBatchDocumentOutputConfig|null} [outputConfig] BatchTranslateDocumentRequest outputConfig + * @property {Object.|null} [models] BatchTranslateDocumentRequest models + * @property {Object.|null} [glossaries] BatchTranslateDocumentRequest glossaries + * @property {Object.|null} [formatConversions] BatchTranslateDocumentRequest formatConversions */ /** - * Constructs a new ListGlossariesRequest. + * Constructs a new BatchTranslateDocumentRequest. * @memberof google.cloud.translation.v3 - * @classdesc Represents a ListGlossariesRequest. - * @implements IListGlossariesRequest + * @classdesc Represents a BatchTranslateDocumentRequest. + * @implements IBatchTranslateDocumentRequest * @constructor - * @param {google.cloud.translation.v3.IListGlossariesRequest=} [properties] Properties to set + * @param {google.cloud.translation.v3.IBatchTranslateDocumentRequest=} [properties] Properties to set */ - function ListGlossariesRequest(properties) { + function BatchTranslateDocumentRequest(properties) { + this.targetLanguageCodes = []; + this.inputConfigs = []; + this.models = {}; + this.glossaries = {}; + this.formatConversions = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6565,100 +9364,147 @@ } /** - * ListGlossariesRequest parent. + * BatchTranslateDocumentRequest parent. * @member {string} parent - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @instance */ - ListGlossariesRequest.prototype.parent = ""; + BatchTranslateDocumentRequest.prototype.parent = ""; /** - * ListGlossariesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * BatchTranslateDocumentRequest sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @instance */ - ListGlossariesRequest.prototype.pageSize = 0; + BatchTranslateDocumentRequest.prototype.sourceLanguageCode = ""; /** - * ListGlossariesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * BatchTranslateDocumentRequest targetLanguageCodes. + * @member {Array.} targetLanguageCodes + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @instance */ - ListGlossariesRequest.prototype.pageToken = ""; + BatchTranslateDocumentRequest.prototype.targetLanguageCodes = $util.emptyArray; /** - * ListGlossariesRequest filter. - * @member {string} filter - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * BatchTranslateDocumentRequest inputConfigs. + * @member {Array.} inputConfigs + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @instance */ - ListGlossariesRequest.prototype.filter = ""; + BatchTranslateDocumentRequest.prototype.inputConfigs = $util.emptyArray; /** - * Creates a new ListGlossariesRequest instance using the specified properties. + * BatchTranslateDocumentRequest outputConfig. + * @member {google.cloud.translation.v3.IBatchDocumentOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest + * @instance + */ + BatchTranslateDocumentRequest.prototype.outputConfig = null; + + /** + * BatchTranslateDocumentRequest models. + * @member {Object.} models + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest + * @instance + */ + BatchTranslateDocumentRequest.prototype.models = $util.emptyObject; + + /** + * BatchTranslateDocumentRequest glossaries. + * @member {Object.} glossaries + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest + * @instance + */ + BatchTranslateDocumentRequest.prototype.glossaries = $util.emptyObject; + + /** + * BatchTranslateDocumentRequest formatConversions. + * @member {Object.} formatConversions + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest + * @instance + */ + BatchTranslateDocumentRequest.prototype.formatConversions = $util.emptyObject; + + /** + * Creates a new BatchTranslateDocumentRequest instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @static - * @param {google.cloud.translation.v3.IListGlossariesRequest=} [properties] Properties to set - * @returns {google.cloud.translation.v3.ListGlossariesRequest} ListGlossariesRequest instance + * @param {google.cloud.translation.v3.IBatchTranslateDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.translation.v3.BatchTranslateDocumentRequest} BatchTranslateDocumentRequest instance */ - ListGlossariesRequest.create = function create(properties) { - return new ListGlossariesRequest(properties); + BatchTranslateDocumentRequest.create = function create(properties) { + return new BatchTranslateDocumentRequest(properties); }; /** - * Encodes the specified ListGlossariesRequest message. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesRequest.verify|verify} messages. + * Encodes the specified BatchTranslateDocumentRequest message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateDocumentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @static - * @param {google.cloud.translation.v3.IListGlossariesRequest} message ListGlossariesRequest message or plain object to encode + * @param {google.cloud.translation.v3.IBatchTranslateDocumentRequest} message BatchTranslateDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGlossariesRequest.encode = function encode(message, writer) { + BatchTranslateDocumentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCodes != null && message.targetLanguageCodes.length) + for (var i = 0; i < message.targetLanguageCodes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCodes[i]); + if (message.inputConfigs != null && message.inputConfigs.length) + for (var i = 0; i < message.inputConfigs.length; ++i) + $root.google.cloud.translation.v3.BatchDocumentInputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.translation.v3.BatchDocumentOutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.models != null && Object.hasOwnProperty.call(message, "models")) + for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.models[keys[i]]).ldelim(); + if (message.glossaries != null && Object.hasOwnProperty.call(message, "glossaries")) + for (var keys = Object.keys(message.glossaries), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.formatConversions != null && Object.hasOwnProperty.call(message, "formatConversions")) + for (var keys = Object.keys(message.formatConversions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.formatConversions[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified ListGlossariesRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesRequest.verify|verify} messages. + * Encodes the specified BatchTranslateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateDocumentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @static - * @param {google.cloud.translation.v3.IListGlossariesRequest} message ListGlossariesRequest message or plain object to encode + * @param {google.cloud.translation.v3.IBatchTranslateDocumentRequest} message BatchTranslateDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGlossariesRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchTranslateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListGlossariesRequest message from the specified reader or buffer. + * Decodes a BatchTranslateDocumentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.ListGlossariesRequest} ListGlossariesRequest + * @returns {google.cloud.translation.v3.BatchTranslateDocumentRequest} BatchTranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGlossariesRequest.decode = function decode(reader, length) { + BatchTranslateDocumentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.ListGlossariesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateDocumentRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -6666,13 +9512,86 @@ message.parent = reader.string(); break; case 2: - message.pageSize = reader.int32(); + message.sourceLanguageCode = reader.string(); break; case 3: - message.pageToken = reader.string(); + if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) + message.targetLanguageCodes = []; + message.targetLanguageCodes.push(reader.string()); + break; + case 4: + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.translation.v3.BatchDocumentInputConfig.decode(reader, reader.uint32())); + break; + case 5: + message.outputConfig = $root.google.cloud.translation.v3.BatchDocumentOutputConfig.decode(reader, reader.uint32()); + break; + case 6: + if (message.models === $util.emptyObject) + message.models = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.models[key] = value; + break; + case 7: + if (message.glossaries === $util.emptyObject) + message.glossaries = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.glossaries[key] = value; break; - case 4: - message.filter = reader.string(); + case 8: + if (message.formatConversions === $util.emptyObject) + message.formatConversions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.formatConversions[key] = value; break; default: reader.skipType(tag & 7); @@ -6683,134 +9602,247 @@ }; /** - * Decodes a ListGlossariesRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchTranslateDocumentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.ListGlossariesRequest} ListGlossariesRequest + * @returns {google.cloud.translation.v3.BatchTranslateDocumentRequest} BatchTranslateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGlossariesRequest.decodeDelimited = function decodeDelimited(reader) { + BatchTranslateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListGlossariesRequest message. + * Verifies a BatchTranslateDocumentRequest message. * @function verify - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListGlossariesRequest.verify = function verify(message) { + BatchTranslateDocumentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCodes != null && message.hasOwnProperty("targetLanguageCodes")) { + if (!Array.isArray(message.targetLanguageCodes)) + return "targetLanguageCodes: array expected"; + for (var i = 0; i < message.targetLanguageCodes.length; ++i) + if (!$util.isString(message.targetLanguageCodes[i])) + return "targetLanguageCodes: string[] expected"; + } + if (message.inputConfigs != null && message.hasOwnProperty("inputConfigs")) { + if (!Array.isArray(message.inputConfigs)) + return "inputConfigs: array expected"; + for (var i = 0; i < message.inputConfigs.length; ++i) { + var error = $root.google.cloud.translation.v3.BatchDocumentInputConfig.verify(message.inputConfigs[i]); + if (error) + return "inputConfigs." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.translation.v3.BatchDocumentOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.models != null && message.hasOwnProperty("models")) { + if (!$util.isObject(message.models)) + return "models: object expected"; + var key = Object.keys(message.models); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.models[key[i]])) + return "models: string{k:string} expected"; + } + if (message.glossaries != null && message.hasOwnProperty("glossaries")) { + if (!$util.isObject(message.glossaries)) + return "glossaries: object expected"; + var key = Object.keys(message.glossaries); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.verify(message.glossaries[key[i]]); + if (error) + return "glossaries." + error; + } + } + if (message.formatConversions != null && message.hasOwnProperty("formatConversions")) { + if (!$util.isObject(message.formatConversions)) + return "formatConversions: object expected"; + var key = Object.keys(message.formatConversions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.formatConversions[key[i]])) + return "formatConversions: string{k:string} expected"; + } return null; }; /** - * Creates a ListGlossariesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchTranslateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.ListGlossariesRequest} ListGlossariesRequest + * @returns {google.cloud.translation.v3.BatchTranslateDocumentRequest} BatchTranslateDocumentRequest */ - ListGlossariesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.ListGlossariesRequest) + BatchTranslateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.BatchTranslateDocumentRequest) return object; - var message = new $root.google.cloud.translation.v3.ListGlossariesRequest(); + var message = new $root.google.cloud.translation.v3.BatchTranslateDocumentRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCodes) { + if (!Array.isArray(object.targetLanguageCodes)) + throw TypeError(".google.cloud.translation.v3.BatchTranslateDocumentRequest.targetLanguageCodes: array expected"); + message.targetLanguageCodes = []; + for (var i = 0; i < object.targetLanguageCodes.length; ++i) + message.targetLanguageCodes[i] = String(object.targetLanguageCodes[i]); + } + if (object.inputConfigs) { + if (!Array.isArray(object.inputConfigs)) + throw TypeError(".google.cloud.translation.v3.BatchTranslateDocumentRequest.inputConfigs: array expected"); + message.inputConfigs = []; + for (var i = 0; i < object.inputConfigs.length; ++i) { + if (typeof object.inputConfigs[i] !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateDocumentRequest.inputConfigs: object expected"); + message.inputConfigs[i] = $root.google.cloud.translation.v3.BatchDocumentInputConfig.fromObject(object.inputConfigs[i]); + } + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateDocumentRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.translation.v3.BatchDocumentOutputConfig.fromObject(object.outputConfig); + } + if (object.models) { + if (typeof object.models !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateDocumentRequest.models: object expected"); + message.models = {}; + for (var keys = Object.keys(object.models), i = 0; i < keys.length; ++i) + message.models[keys[i]] = String(object.models[keys[i]]); + } + if (object.glossaries) { + if (typeof object.glossaries !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateDocumentRequest.glossaries: object expected"); + message.glossaries = {}; + for (var keys = Object.keys(object.glossaries), i = 0; i < keys.length; ++i) { + if (typeof object.glossaries[keys[i]] !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateDocumentRequest.glossaries: object expected"); + message.glossaries[keys[i]] = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.fromObject(object.glossaries[keys[i]]); + } + } + if (object.formatConversions) { + if (typeof object.formatConversions !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateDocumentRequest.formatConversions: object expected"); + message.formatConversions = {}; + for (var keys = Object.keys(object.formatConversions), i = 0; i < keys.length; ++i) + message.formatConversions[keys[i]] = String(object.formatConversions[keys[i]]); + } return message; }; /** - * Creates a plain object from a ListGlossariesRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchTranslateDocumentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @static - * @param {google.cloud.translation.v3.ListGlossariesRequest} message ListGlossariesRequest + * @param {google.cloud.translation.v3.BatchTranslateDocumentRequest} message BatchTranslateDocumentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListGlossariesRequest.toObject = function toObject(message, options) { + BatchTranslateDocumentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.targetLanguageCodes = []; + object.inputConfigs = []; + } + if (options.objects || options.defaults) { + object.models = {}; + object.glossaries = {}; + object.formatConversions = {}; + } if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; + object.sourceLanguageCode = ""; + object.outputConfig = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCodes && message.targetLanguageCodes.length) { + object.targetLanguageCodes = []; + for (var j = 0; j < message.targetLanguageCodes.length; ++j) + object.targetLanguageCodes[j] = message.targetLanguageCodes[j]; + } + if (message.inputConfigs && message.inputConfigs.length) { + object.inputConfigs = []; + for (var j = 0; j < message.inputConfigs.length; ++j) + object.inputConfigs[j] = $root.google.cloud.translation.v3.BatchDocumentInputConfig.toObject(message.inputConfigs[j], options); + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.translation.v3.BatchDocumentOutputConfig.toObject(message.outputConfig, options); + var keys2; + if (message.models && (keys2 = Object.keys(message.models)).length) { + object.models = {}; + for (var j = 0; j < keys2.length; ++j) + object.models[keys2[j]] = message.models[keys2[j]]; + } + if (message.glossaries && (keys2 = Object.keys(message.glossaries)).length) { + object.glossaries = {}; + for (var j = 0; j < keys2.length; ++j) + object.glossaries[keys2[j]] = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.toObject(message.glossaries[keys2[j]], options); + } + if (message.formatConversions && (keys2 = Object.keys(message.formatConversions)).length) { + object.formatConversions = {}; + for (var j = 0; j < keys2.length; ++j) + object.formatConversions[keys2[j]] = message.formatConversions[keys2[j]]; + } return object; }; /** - * Converts this ListGlossariesRequest to JSON. + * Converts this BatchTranslateDocumentRequest to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest * @instance * @returns {Object.} JSON object */ - ListGlossariesRequest.prototype.toJSON = function toJSON() { + BatchTranslateDocumentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListGlossariesRequest; + return BatchTranslateDocumentRequest; })(); - v3.ListGlossariesResponse = (function() { + v3.BatchDocumentInputConfig = (function() { /** - * Properties of a ListGlossariesResponse. + * Properties of a BatchDocumentInputConfig. * @memberof google.cloud.translation.v3 - * @interface IListGlossariesResponse - * @property {Array.|null} [glossaries] ListGlossariesResponse glossaries - * @property {string|null} [nextPageToken] ListGlossariesResponse nextPageToken + * @interface IBatchDocumentInputConfig + * @property {google.cloud.translation.v3.IGcsSource|null} [gcsSource] BatchDocumentInputConfig gcsSource */ /** - * Constructs a new ListGlossariesResponse. + * Constructs a new BatchDocumentInputConfig. * @memberof google.cloud.translation.v3 - * @classdesc Represents a ListGlossariesResponse. - * @implements IListGlossariesResponse + * @classdesc Represents a BatchDocumentInputConfig. + * @implements IBatchDocumentInputConfig * @constructor - * @param {google.cloud.translation.v3.IListGlossariesResponse=} [properties] Properties to set + * @param {google.cloud.translation.v3.IBatchDocumentInputConfig=} [properties] Properties to set */ - function ListGlossariesResponse(properties) { - this.glossaries = []; + function BatchDocumentInputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6818,91 +9850,89 @@ } /** - * ListGlossariesResponse glossaries. - * @member {Array.} glossaries - * @memberof google.cloud.translation.v3.ListGlossariesResponse + * BatchDocumentInputConfig gcsSource. + * @member {google.cloud.translation.v3.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.translation.v3.BatchDocumentInputConfig * @instance */ - ListGlossariesResponse.prototype.glossaries = $util.emptyArray; + BatchDocumentInputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ListGlossariesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.translation.v3.ListGlossariesResponse + * BatchDocumentInputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.translation.v3.BatchDocumentInputConfig * @instance */ - ListGlossariesResponse.prototype.nextPageToken = ""; + Object.defineProperty(BatchDocumentInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ListGlossariesResponse instance using the specified properties. + * Creates a new BatchDocumentInputConfig instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @memberof google.cloud.translation.v3.BatchDocumentInputConfig * @static - * @param {google.cloud.translation.v3.IListGlossariesResponse=} [properties] Properties to set - * @returns {google.cloud.translation.v3.ListGlossariesResponse} ListGlossariesResponse instance + * @param {google.cloud.translation.v3.IBatchDocumentInputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3.BatchDocumentInputConfig} BatchDocumentInputConfig instance */ - ListGlossariesResponse.create = function create(properties) { - return new ListGlossariesResponse(properties); + BatchDocumentInputConfig.create = function create(properties) { + return new BatchDocumentInputConfig(properties); }; /** - * Encodes the specified ListGlossariesResponse message. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesResponse.verify|verify} messages. + * Encodes the specified BatchDocumentInputConfig message. Does not implicitly {@link google.cloud.translation.v3.BatchDocumentInputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @memberof google.cloud.translation.v3.BatchDocumentInputConfig * @static - * @param {google.cloud.translation.v3.IListGlossariesResponse} message ListGlossariesResponse message or plain object to encode + * @param {google.cloud.translation.v3.IBatchDocumentInputConfig} message BatchDocumentInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGlossariesResponse.encode = function encode(message, writer) { + BatchDocumentInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.glossaries != null && message.glossaries.length) - for (var i = 0; i < message.glossaries.length; ++i) - $root.google.cloud.translation.v3.Glossary.encode(message.glossaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.translation.v3.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListGlossariesResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.ListGlossariesResponse.verify|verify} messages. + * Encodes the specified BatchDocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchDocumentInputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @memberof google.cloud.translation.v3.BatchDocumentInputConfig * @static - * @param {google.cloud.translation.v3.IListGlossariesResponse} message ListGlossariesResponse message or plain object to encode + * @param {google.cloud.translation.v3.IBatchDocumentInputConfig} message BatchDocumentInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGlossariesResponse.encodeDelimited = function encodeDelimited(message, writer) { + BatchDocumentInputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListGlossariesResponse message from the specified reader or buffer. + * Decodes a BatchDocumentInputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @memberof google.cloud.translation.v3.BatchDocumentInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.ListGlossariesResponse} ListGlossariesResponse + * @returns {google.cloud.translation.v3.BatchDocumentInputConfig} BatchDocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGlossariesResponse.decode = function decode(reader, length) { + BatchDocumentInputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.ListGlossariesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchDocumentInputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.glossaries && message.glossaries.length)) - message.glossaries = []; - message.glossaries.push($root.google.cloud.translation.v3.Glossary.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6913,135 +9943,117 @@ }; /** - * Decodes a ListGlossariesResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchDocumentInputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @memberof google.cloud.translation.v3.BatchDocumentInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.ListGlossariesResponse} ListGlossariesResponse + * @returns {google.cloud.translation.v3.BatchDocumentInputConfig} BatchDocumentInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGlossariesResponse.decodeDelimited = function decodeDelimited(reader) { + BatchDocumentInputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListGlossariesResponse message. + * Verifies a BatchDocumentInputConfig message. * @function verify - * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @memberof google.cloud.translation.v3.BatchDocumentInputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListGlossariesResponse.verify = function verify(message) { + BatchDocumentInputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.glossaries != null && message.hasOwnProperty("glossaries")) { - if (!Array.isArray(message.glossaries)) - return "glossaries: array expected"; - for (var i = 0; i < message.glossaries.length; ++i) { - var error = $root.google.cloud.translation.v3.Glossary.verify(message.glossaries[i]); + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.translation.v3.GcsSource.verify(message.gcsSource); if (error) - return "glossaries." + error; + return "gcsSource." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListGlossariesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDocumentInputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @memberof google.cloud.translation.v3.BatchDocumentInputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.ListGlossariesResponse} ListGlossariesResponse + * @returns {google.cloud.translation.v3.BatchDocumentInputConfig} BatchDocumentInputConfig */ - ListGlossariesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.ListGlossariesResponse) + BatchDocumentInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.BatchDocumentInputConfig) return object; - var message = new $root.google.cloud.translation.v3.ListGlossariesResponse(); - if (object.glossaries) { - if (!Array.isArray(object.glossaries)) - throw TypeError(".google.cloud.translation.v3.ListGlossariesResponse.glossaries: array expected"); - message.glossaries = []; - for (var i = 0; i < object.glossaries.length; ++i) { - if (typeof object.glossaries[i] !== "object") - throw TypeError(".google.cloud.translation.v3.ListGlossariesResponse.glossaries: object expected"); - message.glossaries[i] = $root.google.cloud.translation.v3.Glossary.fromObject(object.glossaries[i]); - } + var message = new $root.google.cloud.translation.v3.BatchDocumentInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.translation.v3.BatchDocumentInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.fromObject(object.gcsSource); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListGlossariesResponse message. Also converts values to other types if specified. + * Creates a plain object from a BatchDocumentInputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @memberof google.cloud.translation.v3.BatchDocumentInputConfig * @static - * @param {google.cloud.translation.v3.ListGlossariesResponse} message ListGlossariesResponse + * @param {google.cloud.translation.v3.BatchDocumentInputConfig} message BatchDocumentInputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListGlossariesResponse.toObject = function toObject(message, options) { + BatchDocumentInputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.glossaries = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.glossaries && message.glossaries.length) { - object.glossaries = []; - for (var j = 0; j < message.glossaries.length; ++j) - object.glossaries[j] = $root.google.cloud.translation.v3.Glossary.toObject(message.glossaries[j], options); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.translation.v3.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ListGlossariesResponse to JSON. + * Converts this BatchDocumentInputConfig to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @memberof google.cloud.translation.v3.BatchDocumentInputConfig * @instance * @returns {Object.} JSON object */ - ListGlossariesResponse.prototype.toJSON = function toJSON() { + BatchDocumentInputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListGlossariesResponse; + return BatchDocumentInputConfig; })(); - v3.CreateGlossaryMetadata = (function() { + v3.BatchDocumentOutputConfig = (function() { /** - * Properties of a CreateGlossaryMetadata. + * Properties of a BatchDocumentOutputConfig. * @memberof google.cloud.translation.v3 - * @interface ICreateGlossaryMetadata - * @property {string|null} [name] CreateGlossaryMetadata name - * @property {google.cloud.translation.v3.CreateGlossaryMetadata.State|null} [state] CreateGlossaryMetadata state - * @property {google.protobuf.ITimestamp|null} [submitTime] CreateGlossaryMetadata submitTime + * @interface IBatchDocumentOutputConfig + * @property {google.cloud.translation.v3.IGcsDestination|null} [gcsDestination] BatchDocumentOutputConfig gcsDestination */ /** - * Constructs a new CreateGlossaryMetadata. + * Constructs a new BatchDocumentOutputConfig. * @memberof google.cloud.translation.v3 - * @classdesc Represents a CreateGlossaryMetadata. - * @implements ICreateGlossaryMetadata + * @classdesc Represents a BatchDocumentOutputConfig. + * @implements IBatchDocumentOutputConfig * @constructor - * @param {google.cloud.translation.v3.ICreateGlossaryMetadata=} [properties] Properties to set + * @param {google.cloud.translation.v3.IBatchDocumentOutputConfig=} [properties] Properties to set */ - function CreateGlossaryMetadata(properties) { + function BatchDocumentOutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7049,101 +10061,89 @@ } /** - * CreateGlossaryMetadata name. - * @member {string} name - * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * BatchDocumentOutputConfig gcsDestination. + * @member {google.cloud.translation.v3.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.translation.v3.BatchDocumentOutputConfig * @instance */ - CreateGlossaryMetadata.prototype.name = ""; + BatchDocumentOutputConfig.prototype.gcsDestination = null; - /** - * CreateGlossaryMetadata state. - * @member {google.cloud.translation.v3.CreateGlossaryMetadata.State} state - * @memberof google.cloud.translation.v3.CreateGlossaryMetadata - * @instance - */ - CreateGlossaryMetadata.prototype.state = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * CreateGlossaryMetadata submitTime. - * @member {google.protobuf.ITimestamp|null|undefined} submitTime - * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * BatchDocumentOutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.translation.v3.BatchDocumentOutputConfig * @instance */ - CreateGlossaryMetadata.prototype.submitTime = null; + Object.defineProperty(BatchDocumentOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new CreateGlossaryMetadata instance using the specified properties. + * Creates a new BatchDocumentOutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchDocumentOutputConfig * @static - * @param {google.cloud.translation.v3.ICreateGlossaryMetadata=} [properties] Properties to set - * @returns {google.cloud.translation.v3.CreateGlossaryMetadata} CreateGlossaryMetadata instance + * @param {google.cloud.translation.v3.IBatchDocumentOutputConfig=} [properties] Properties to set + * @returns {google.cloud.translation.v3.BatchDocumentOutputConfig} BatchDocumentOutputConfig instance */ - CreateGlossaryMetadata.create = function create(properties) { - return new CreateGlossaryMetadata(properties); + BatchDocumentOutputConfig.create = function create(properties) { + return new BatchDocumentOutputConfig(properties); }; /** - * Encodes the specified CreateGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryMetadata.verify|verify} messages. + * Encodes the specified BatchDocumentOutputConfig message. Does not implicitly {@link google.cloud.translation.v3.BatchDocumentOutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchDocumentOutputConfig * @static - * @param {google.cloud.translation.v3.ICreateGlossaryMetadata} message CreateGlossaryMetadata message or plain object to encode + * @param {google.cloud.translation.v3.IBatchDocumentOutputConfig} message BatchDocumentOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateGlossaryMetadata.encode = function encode(message, writer) { + BatchDocumentOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) - $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.translation.v3.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.CreateGlossaryMetadata.verify|verify} messages. + * Encodes the specified BatchDocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchDocumentOutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchDocumentOutputConfig * @static - * @param {google.cloud.translation.v3.ICreateGlossaryMetadata} message CreateGlossaryMetadata message or plain object to encode + * @param {google.cloud.translation.v3.IBatchDocumentOutputConfig} message BatchDocumentOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateGlossaryMetadata.encodeDelimited = function encodeDelimited(message, writer) { + BatchDocumentOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateGlossaryMetadata message from the specified reader or buffer. + * Decodes a BatchDocumentOutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchDocumentOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.CreateGlossaryMetadata} CreateGlossaryMetadata + * @returns {google.cloud.translation.v3.BatchDocumentOutputConfig} BatchDocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateGlossaryMetadata.decode = function decode(reader, length) { + BatchDocumentOutputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.CreateGlossaryMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchDocumentOutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - message.state = reader.int32(); - break; - case 3: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7154,186 +10154,126 @@ }; /** - * Decodes a CreateGlossaryMetadata message from the specified reader or buffer, length delimited. + * Decodes a BatchDocumentOutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchDocumentOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.CreateGlossaryMetadata} CreateGlossaryMetadata + * @returns {google.cloud.translation.v3.BatchDocumentOutputConfig} BatchDocumentOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateGlossaryMetadata.decodeDelimited = function decodeDelimited(reader) { + BatchDocumentOutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateGlossaryMetadata message. + * Verifies a BatchDocumentOutputConfig message. * @function verify - * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchDocumentOutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateGlossaryMetadata.verify = function verify(message) { + BatchDocumentOutputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.translation.v3.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; } - if (message.submitTime != null && message.hasOwnProperty("submitTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.submitTime); - if (error) - return "submitTime." + error; } return null; }; /** - * Creates a CreateGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDocumentOutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchDocumentOutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.CreateGlossaryMetadata} CreateGlossaryMetadata + * @returns {google.cloud.translation.v3.BatchDocumentOutputConfig} BatchDocumentOutputConfig */ - CreateGlossaryMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.CreateGlossaryMetadata) + BatchDocumentOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.BatchDocumentOutputConfig) return object; - var message = new $root.google.cloud.translation.v3.CreateGlossaryMetadata(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "RUNNING": - case 1: - message.state = 1; - break; - case "SUCCEEDED": - case 2: - message.state = 2; - break; - case "FAILED": - case 3: - message.state = 3; - break; - case "CANCELLING": - case 4: - message.state = 4; - break; - case "CANCELLED": - case 5: - message.state = 5; - break; - } - if (object.submitTime != null) { - if (typeof object.submitTime !== "object") - throw TypeError(".google.cloud.translation.v3.CreateGlossaryMetadata.submitTime: object expected"); - message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + var message = new $root.google.cloud.translation.v3.BatchDocumentOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.translation.v3.BatchDocumentOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.fromObject(object.gcsDestination); } return message; }; /** - * Creates a plain object from a CreateGlossaryMetadata message. Also converts values to other types if specified. + * Creates a plain object from a BatchDocumentOutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchDocumentOutputConfig * @static - * @param {google.cloud.translation.v3.CreateGlossaryMetadata} message CreateGlossaryMetadata + * @param {google.cloud.translation.v3.BatchDocumentOutputConfig} message BatchDocumentOutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateGlossaryMetadata.toObject = function toObject(message, options) { + BatchDocumentOutputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.submitTime = null; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3.CreateGlossaryMetadata.State[message.state] : message.state; - if (message.submitTime != null && message.hasOwnProperty("submitTime")) - object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); return object; }; /** - * Converts this CreateGlossaryMetadata to JSON. + * Converts this BatchDocumentOutputConfig to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchDocumentOutputConfig * @instance * @returns {Object.} JSON object */ - CreateGlossaryMetadata.prototype.toJSON = function toJSON() { + BatchDocumentOutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.translation.v3.CreateGlossaryMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} SUCCEEDED=2 SUCCEEDED value - * @property {number} FAILED=3 FAILED value - * @property {number} CANCELLING=4 CANCELLING value - * @property {number} CANCELLED=5 CANCELLED value - */ - CreateGlossaryMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "SUCCEEDED"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "CANCELLING"] = 4; - values[valuesById[5] = "CANCELLED"] = 5; - return values; - })(); - - return CreateGlossaryMetadata; + return BatchDocumentOutputConfig; })(); - v3.DeleteGlossaryMetadata = (function() { + v3.BatchTranslateDocumentResponse = (function() { /** - * Properties of a DeleteGlossaryMetadata. + * Properties of a BatchTranslateDocumentResponse. * @memberof google.cloud.translation.v3 - * @interface IDeleteGlossaryMetadata - * @property {string|null} [name] DeleteGlossaryMetadata name - * @property {google.cloud.translation.v3.DeleteGlossaryMetadata.State|null} [state] DeleteGlossaryMetadata state - * @property {google.protobuf.ITimestamp|null} [submitTime] DeleteGlossaryMetadata submitTime + * @interface IBatchTranslateDocumentResponse + * @property {number|Long|null} [totalPages] BatchTranslateDocumentResponse totalPages + * @property {number|Long|null} [translatedPages] BatchTranslateDocumentResponse translatedPages + * @property {number|Long|null} [failedPages] BatchTranslateDocumentResponse failedPages + * @property {number|Long|null} [totalBillablePages] BatchTranslateDocumentResponse totalBillablePages + * @property {number|Long|null} [totalCharacters] BatchTranslateDocumentResponse totalCharacters + * @property {number|Long|null} [translatedCharacters] BatchTranslateDocumentResponse translatedCharacters + * @property {number|Long|null} [failedCharacters] BatchTranslateDocumentResponse failedCharacters + * @property {number|Long|null} [totalBillableCharacters] BatchTranslateDocumentResponse totalBillableCharacters + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateDocumentResponse submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] BatchTranslateDocumentResponse endTime */ /** - * Constructs a new DeleteGlossaryMetadata. + * Constructs a new BatchTranslateDocumentResponse. * @memberof google.cloud.translation.v3 - * @classdesc Represents a DeleteGlossaryMetadata. - * @implements IDeleteGlossaryMetadata + * @classdesc Represents a BatchTranslateDocumentResponse. + * @implements IBatchTranslateDocumentResponse * @constructor - * @param {google.cloud.translation.v3.IDeleteGlossaryMetadata=} [properties] Properties to set + * @param {google.cloud.translation.v3.IBatchTranslateDocumentResponse=} [properties] Properties to set */ - function DeleteGlossaryMetadata(properties) { + function BatchTranslateDocumentResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7341,102 +10281,193 @@ } /** - * DeleteGlossaryMetadata name. - * @member {string} name - * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * BatchTranslateDocumentResponse totalPages. + * @member {number|Long} totalPages + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse * @instance */ - DeleteGlossaryMetadata.prototype.name = ""; + BatchTranslateDocumentResponse.prototype.totalPages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * DeleteGlossaryMetadata state. - * @member {google.cloud.translation.v3.DeleteGlossaryMetadata.State} state - * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * BatchTranslateDocumentResponse translatedPages. + * @member {number|Long} translatedPages + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse * @instance */ - DeleteGlossaryMetadata.prototype.state = 0; + BatchTranslateDocumentResponse.prototype.translatedPages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * DeleteGlossaryMetadata submitTime. + * BatchTranslateDocumentResponse failedPages. + * @member {number|Long} failedPages + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.failedPages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentResponse totalBillablePages. + * @member {number|Long} totalBillablePages + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.totalBillablePages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentResponse totalCharacters. + * @member {number|Long} totalCharacters + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentResponse translatedCharacters. + * @member {number|Long} translatedCharacters + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentResponse failedCharacters. + * @member {number|Long} failedCharacters + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentResponse totalBillableCharacters. + * @member {number|Long} totalBillableCharacters + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.totalBillableCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentResponse submitTime. * @member {google.protobuf.ITimestamp|null|undefined} submitTime - * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse * @instance */ - DeleteGlossaryMetadata.prototype.submitTime = null; + BatchTranslateDocumentResponse.prototype.submitTime = null; /** - * Creates a new DeleteGlossaryMetadata instance using the specified properties. + * BatchTranslateDocumentResponse endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse + * @instance + */ + BatchTranslateDocumentResponse.prototype.endTime = null; + + /** + * Creates a new BatchTranslateDocumentResponse instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse * @static - * @param {google.cloud.translation.v3.IDeleteGlossaryMetadata=} [properties] Properties to set - * @returns {google.cloud.translation.v3.DeleteGlossaryMetadata} DeleteGlossaryMetadata instance + * @param {google.cloud.translation.v3.IBatchTranslateDocumentResponse=} [properties] Properties to set + * @returns {google.cloud.translation.v3.BatchTranslateDocumentResponse} BatchTranslateDocumentResponse instance */ - DeleteGlossaryMetadata.create = function create(properties) { - return new DeleteGlossaryMetadata(properties); + BatchTranslateDocumentResponse.create = function create(properties) { + return new BatchTranslateDocumentResponse(properties); }; /** - * Encodes the specified DeleteGlossaryMetadata message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryMetadata.verify|verify} messages. + * Encodes the specified BatchTranslateDocumentResponse message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateDocumentResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse * @static - * @param {google.cloud.translation.v3.IDeleteGlossaryMetadata} message DeleteGlossaryMetadata message or plain object to encode + * @param {google.cloud.translation.v3.IBatchTranslateDocumentResponse} message BatchTranslateDocumentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGlossaryMetadata.encode = function encode(message, writer) { + BatchTranslateDocumentResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.totalPages != null && Object.hasOwnProperty.call(message, "totalPages")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalPages); + if (message.translatedPages != null && Object.hasOwnProperty.call(message, "translatedPages")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.translatedPages); + if (message.failedPages != null && Object.hasOwnProperty.call(message, "failedPages")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedPages); + if (message.totalBillablePages != null && Object.hasOwnProperty.call(message, "totalBillablePages")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalBillablePages); + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalCharacters); + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.translatedCharacters); + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.failedCharacters); + if (message.totalBillableCharacters != null && Object.hasOwnProperty.call(message, "totalBillableCharacters")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.totalBillableCharacters); if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) - $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteGlossaryMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryMetadata.verify|verify} messages. + * Encodes the specified BatchTranslateDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateDocumentResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse * @static - * @param {google.cloud.translation.v3.IDeleteGlossaryMetadata} message DeleteGlossaryMetadata message or plain object to encode + * @param {google.cloud.translation.v3.IBatchTranslateDocumentResponse} message BatchTranslateDocumentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGlossaryMetadata.encodeDelimited = function encodeDelimited(message, writer) { + BatchTranslateDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer. + * Decodes a BatchTranslateDocumentResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.DeleteGlossaryMetadata} DeleteGlossaryMetadata + * @returns {google.cloud.translation.v3.BatchTranslateDocumentResponse} BatchTranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGlossaryMetadata.decode = function decode(reader, length) { + BatchTranslateDocumentResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DeleteGlossaryMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateDocumentResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.totalPages = reader.int64(); break; case 2: - message.state = reader.int32(); + message.translatedPages = reader.int64(); break; case 3: + message.failedPages = reader.int64(); + break; + case 4: + message.totalBillablePages = reader.int64(); + break; + case 5: + message.totalCharacters = reader.int64(); + break; + case 6: + message.translatedCharacters = reader.int64(); + break; + case 7: + message.failedCharacters = reader.int64(); + break; + case 8: + message.totalBillableCharacters = reader.int64(); + break; + case 9: message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; + case 10: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -7446,186 +10477,311 @@ }; /** - * Decodes a DeleteGlossaryMetadata message from the specified reader or buffer, length delimited. + * Decodes a BatchTranslateDocumentResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.DeleteGlossaryMetadata} DeleteGlossaryMetadata + * @returns {google.cloud.translation.v3.BatchTranslateDocumentResponse} BatchTranslateDocumentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGlossaryMetadata.decodeDelimited = function decodeDelimited(reader) { + BatchTranslateDocumentResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteGlossaryMetadata message. + * Verifies a BatchTranslateDocumentResponse message. * @function verify - * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteGlossaryMetadata.verify = function verify(message) { + BatchTranslateDocumentResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + if (!$util.isInteger(message.totalPages) && !(message.totalPages && $util.isInteger(message.totalPages.low) && $util.isInteger(message.totalPages.high))) + return "totalPages: integer|Long expected"; + if (message.translatedPages != null && message.hasOwnProperty("translatedPages")) + if (!$util.isInteger(message.translatedPages) && !(message.translatedPages && $util.isInteger(message.translatedPages.low) && $util.isInteger(message.translatedPages.high))) + return "translatedPages: integer|Long expected"; + if (message.failedPages != null && message.hasOwnProperty("failedPages")) + if (!$util.isInteger(message.failedPages) && !(message.failedPages && $util.isInteger(message.failedPages.low) && $util.isInteger(message.failedPages.high))) + return "failedPages: integer|Long expected"; + if (message.totalBillablePages != null && message.hasOwnProperty("totalBillablePages")) + if (!$util.isInteger(message.totalBillablePages) && !(message.totalBillablePages && $util.isInteger(message.totalBillablePages.low) && $util.isInteger(message.totalBillablePages.high))) + return "totalBillablePages: integer|Long expected"; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) + return "totalCharacters: integer|Long expected"; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) + return "translatedCharacters: integer|Long expected"; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) + return "failedCharacters: integer|Long expected"; + if (message.totalBillableCharacters != null && message.hasOwnProperty("totalBillableCharacters")) + if (!$util.isInteger(message.totalBillableCharacters) && !(message.totalBillableCharacters && $util.isInteger(message.totalBillableCharacters.low) && $util.isInteger(message.totalBillableCharacters.high))) + return "totalBillableCharacters: integer|Long expected"; if (message.submitTime != null && message.hasOwnProperty("submitTime")) { var error = $root.google.protobuf.Timestamp.verify(message.submitTime); if (error) return "submitTime." + error; } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } return null; }; /** - * Creates a DeleteGlossaryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a BatchTranslateDocumentResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.DeleteGlossaryMetadata} DeleteGlossaryMetadata + * @returns {google.cloud.translation.v3.BatchTranslateDocumentResponse} BatchTranslateDocumentResponse */ - DeleteGlossaryMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.DeleteGlossaryMetadata) + BatchTranslateDocumentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.BatchTranslateDocumentResponse) return object; - var message = new $root.google.cloud.translation.v3.DeleteGlossaryMetadata(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "RUNNING": - case 1: - message.state = 1; - break; - case "SUCCEEDED": - case 2: - message.state = 2; - break; - case "FAILED": - case 3: - message.state = 3; - break; - case "CANCELLING": - case 4: - message.state = 4; - break; - case "CANCELLED": - case 5: - message.state = 5; - break; - } + var message = new $root.google.cloud.translation.v3.BatchTranslateDocumentResponse(); + if (object.totalPages != null) + if ($util.Long) + (message.totalPages = $util.Long.fromValue(object.totalPages)).unsigned = false; + else if (typeof object.totalPages === "string") + message.totalPages = parseInt(object.totalPages, 10); + else if (typeof object.totalPages === "number") + message.totalPages = object.totalPages; + else if (typeof object.totalPages === "object") + message.totalPages = new $util.LongBits(object.totalPages.low >>> 0, object.totalPages.high >>> 0).toNumber(); + if (object.translatedPages != null) + if ($util.Long) + (message.translatedPages = $util.Long.fromValue(object.translatedPages)).unsigned = false; + else if (typeof object.translatedPages === "string") + message.translatedPages = parseInt(object.translatedPages, 10); + else if (typeof object.translatedPages === "number") + message.translatedPages = object.translatedPages; + else if (typeof object.translatedPages === "object") + message.translatedPages = new $util.LongBits(object.translatedPages.low >>> 0, object.translatedPages.high >>> 0).toNumber(); + if (object.failedPages != null) + if ($util.Long) + (message.failedPages = $util.Long.fromValue(object.failedPages)).unsigned = false; + else if (typeof object.failedPages === "string") + message.failedPages = parseInt(object.failedPages, 10); + else if (typeof object.failedPages === "number") + message.failedPages = object.failedPages; + else if (typeof object.failedPages === "object") + message.failedPages = new $util.LongBits(object.failedPages.low >>> 0, object.failedPages.high >>> 0).toNumber(); + if (object.totalBillablePages != null) + if ($util.Long) + (message.totalBillablePages = $util.Long.fromValue(object.totalBillablePages)).unsigned = false; + else if (typeof object.totalBillablePages === "string") + message.totalBillablePages = parseInt(object.totalBillablePages, 10); + else if (typeof object.totalBillablePages === "number") + message.totalBillablePages = object.totalBillablePages; + else if (typeof object.totalBillablePages === "object") + message.totalBillablePages = new $util.LongBits(object.totalBillablePages.low >>> 0, object.totalBillablePages.high >>> 0).toNumber(); + if (object.totalCharacters != null) + if ($util.Long) + (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; + else if (typeof object.totalCharacters === "string") + message.totalCharacters = parseInt(object.totalCharacters, 10); + else if (typeof object.totalCharacters === "number") + message.totalCharacters = object.totalCharacters; + else if (typeof object.totalCharacters === "object") + message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); + if (object.translatedCharacters != null) + if ($util.Long) + (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; + else if (typeof object.translatedCharacters === "string") + message.translatedCharacters = parseInt(object.translatedCharacters, 10); + else if (typeof object.translatedCharacters === "number") + message.translatedCharacters = object.translatedCharacters; + else if (typeof object.translatedCharacters === "object") + message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); + if (object.failedCharacters != null) + if ($util.Long) + (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; + else if (typeof object.failedCharacters === "string") + message.failedCharacters = parseInt(object.failedCharacters, 10); + else if (typeof object.failedCharacters === "number") + message.failedCharacters = object.failedCharacters; + else if (typeof object.failedCharacters === "object") + message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); + if (object.totalBillableCharacters != null) + if ($util.Long) + (message.totalBillableCharacters = $util.Long.fromValue(object.totalBillableCharacters)).unsigned = false; + else if (typeof object.totalBillableCharacters === "string") + message.totalBillableCharacters = parseInt(object.totalBillableCharacters, 10); + else if (typeof object.totalBillableCharacters === "number") + message.totalBillableCharacters = object.totalBillableCharacters; + else if (typeof object.totalBillableCharacters === "object") + message.totalBillableCharacters = new $util.LongBits(object.totalBillableCharacters.low >>> 0, object.totalBillableCharacters.high >>> 0).toNumber(); if (object.submitTime != null) { if (typeof object.submitTime !== "object") - throw TypeError(".google.cloud.translation.v3.DeleteGlossaryMetadata.submitTime: object expected"); + throw TypeError(".google.cloud.translation.v3.BatchTranslateDocumentResponse.submitTime: object expected"); message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.translation.v3.BatchTranslateDocumentResponse.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } return message; }; /** - * Creates a plain object from a DeleteGlossaryMetadata message. Also converts values to other types if specified. + * Creates a plain object from a BatchTranslateDocumentResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse * @static - * @param {google.cloud.translation.v3.DeleteGlossaryMetadata} message DeleteGlossaryMetadata + * @param {google.cloud.translation.v3.BatchTranslateDocumentResponse} message BatchTranslateDocumentResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteGlossaryMetadata.toObject = function toObject(message, options) { + BatchTranslateDocumentResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalPages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalPages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedPages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedPages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedPages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedPages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalBillablePages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalBillablePages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalBillableCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalBillableCharacters = options.longs === String ? "0" : 0; object.submitTime = null; + object.endTime = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3.DeleteGlossaryMetadata.State[message.state] : message.state; + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + if (typeof message.totalPages === "number") + object.totalPages = options.longs === String ? String(message.totalPages) : message.totalPages; + else + object.totalPages = options.longs === String ? $util.Long.prototype.toString.call(message.totalPages) : options.longs === Number ? new $util.LongBits(message.totalPages.low >>> 0, message.totalPages.high >>> 0).toNumber() : message.totalPages; + if (message.translatedPages != null && message.hasOwnProperty("translatedPages")) + if (typeof message.translatedPages === "number") + object.translatedPages = options.longs === String ? String(message.translatedPages) : message.translatedPages; + else + object.translatedPages = options.longs === String ? $util.Long.prototype.toString.call(message.translatedPages) : options.longs === Number ? new $util.LongBits(message.translatedPages.low >>> 0, message.translatedPages.high >>> 0).toNumber() : message.translatedPages; + if (message.failedPages != null && message.hasOwnProperty("failedPages")) + if (typeof message.failedPages === "number") + object.failedPages = options.longs === String ? String(message.failedPages) : message.failedPages; + else + object.failedPages = options.longs === String ? $util.Long.prototype.toString.call(message.failedPages) : options.longs === Number ? new $util.LongBits(message.failedPages.low >>> 0, message.failedPages.high >>> 0).toNumber() : message.failedPages; + if (message.totalBillablePages != null && message.hasOwnProperty("totalBillablePages")) + if (typeof message.totalBillablePages === "number") + object.totalBillablePages = options.longs === String ? String(message.totalBillablePages) : message.totalBillablePages; + else + object.totalBillablePages = options.longs === String ? $util.Long.prototype.toString.call(message.totalBillablePages) : options.longs === Number ? new $util.LongBits(message.totalBillablePages.low >>> 0, message.totalBillablePages.high >>> 0).toNumber() : message.totalBillablePages; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (typeof message.totalCharacters === "number") + object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; + else + object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (typeof message.translatedCharacters === "number") + object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; + else + object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (typeof message.failedCharacters === "number") + object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; + else + object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; + if (message.totalBillableCharacters != null && message.hasOwnProperty("totalBillableCharacters")) + if (typeof message.totalBillableCharacters === "number") + object.totalBillableCharacters = options.longs === String ? String(message.totalBillableCharacters) : message.totalBillableCharacters; + else + object.totalBillableCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalBillableCharacters) : options.longs === Number ? new $util.LongBits(message.totalBillableCharacters.low >>> 0, message.totalBillableCharacters.high >>> 0).toNumber() : message.totalBillableCharacters; if (message.submitTime != null && message.hasOwnProperty("submitTime")) object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); return object; }; /** - * Converts this DeleteGlossaryMetadata to JSON. + * Converts this BatchTranslateDocumentResponse to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse * @instance * @returns {Object.} JSON object */ - DeleteGlossaryMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * State enum. - * @name google.cloud.translation.v3.DeleteGlossaryMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} SUCCEEDED=2 SUCCEEDED value - * @property {number} FAILED=3 FAILED value - * @property {number} CANCELLING=4 CANCELLING value - * @property {number} CANCELLED=5 CANCELLED value - */ - DeleteGlossaryMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "SUCCEEDED"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "CANCELLING"] = 4; - values[valuesById[5] = "CANCELLED"] = 5; - return values; - })(); + BatchTranslateDocumentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return DeleteGlossaryMetadata; + return BatchTranslateDocumentResponse; })(); - v3.DeleteGlossaryResponse = (function() { + v3.BatchTranslateDocumentMetadata = (function() { /** - * Properties of a DeleteGlossaryResponse. + * Properties of a BatchTranslateDocumentMetadata. * @memberof google.cloud.translation.v3 - * @interface IDeleteGlossaryResponse - * @property {string|null} [name] DeleteGlossaryResponse name - * @property {google.protobuf.ITimestamp|null} [submitTime] DeleteGlossaryResponse submitTime - * @property {google.protobuf.ITimestamp|null} [endTime] DeleteGlossaryResponse endTime + * @interface IBatchTranslateDocumentMetadata + * @property {google.cloud.translation.v3.BatchTranslateDocumentMetadata.State|null} [state] BatchTranslateDocumentMetadata state + * @property {number|Long|null} [totalPages] BatchTranslateDocumentMetadata totalPages + * @property {number|Long|null} [translatedPages] BatchTranslateDocumentMetadata translatedPages + * @property {number|Long|null} [failedPages] BatchTranslateDocumentMetadata failedPages + * @property {number|Long|null} [totalBillablePages] BatchTranslateDocumentMetadata totalBillablePages + * @property {number|Long|null} [totalCharacters] BatchTranslateDocumentMetadata totalCharacters + * @property {number|Long|null} [translatedCharacters] BatchTranslateDocumentMetadata translatedCharacters + * @property {number|Long|null} [failedCharacters] BatchTranslateDocumentMetadata failedCharacters + * @property {number|Long|null} [totalBillableCharacters] BatchTranslateDocumentMetadata totalBillableCharacters + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchTranslateDocumentMetadata submitTime */ /** - * Constructs a new DeleteGlossaryResponse. + * Constructs a new BatchTranslateDocumentMetadata. * @memberof google.cloud.translation.v3 - * @classdesc Represents a DeleteGlossaryResponse. - * @implements IDeleteGlossaryResponse + * @classdesc Represents a BatchTranslateDocumentMetadata. + * @implements IBatchTranslateDocumentMetadata * @constructor - * @param {google.cloud.translation.v3.IDeleteGlossaryResponse=} [properties] Properties to set + * @param {google.cloud.translation.v3.IBatchTranslateDocumentMetadata=} [properties] Properties to set */ - function DeleteGlossaryResponse(properties) { + function BatchTranslateDocumentMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7633,101 +10789,192 @@ } /** - * DeleteGlossaryResponse name. - * @member {string} name - * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * BatchTranslateDocumentMetadata state. + * @member {google.cloud.translation.v3.BatchTranslateDocumentMetadata.State} state + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata * @instance */ - DeleteGlossaryResponse.prototype.name = ""; + BatchTranslateDocumentMetadata.prototype.state = 0; /** - * DeleteGlossaryResponse submitTime. - * @member {google.protobuf.ITimestamp|null|undefined} submitTime - * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * BatchTranslateDocumentMetadata totalPages. + * @member {number|Long} totalPages + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata * @instance */ - DeleteGlossaryResponse.prototype.submitTime = null; + BatchTranslateDocumentMetadata.prototype.totalPages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * DeleteGlossaryResponse endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * BatchTranslateDocumentMetadata translatedPages. + * @member {number|Long} translatedPages + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata * @instance */ - DeleteGlossaryResponse.prototype.endTime = null; + BatchTranslateDocumentMetadata.prototype.translatedPages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new DeleteGlossaryResponse instance using the specified properties. + * BatchTranslateDocumentMetadata failedPages. + * @member {number|Long} failedPages + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.failedPages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentMetadata totalBillablePages. + * @member {number|Long} totalBillablePages + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.totalBillablePages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentMetadata totalCharacters. + * @member {number|Long} totalCharacters + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.totalCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentMetadata translatedCharacters. + * @member {number|Long} translatedCharacters + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.translatedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentMetadata failedCharacters. + * @member {number|Long} failedCharacters + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.failedCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentMetadata totalBillableCharacters. + * @member {number|Long} totalBillableCharacters + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.totalBillableCharacters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BatchTranslateDocumentMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata + * @instance + */ + BatchTranslateDocumentMetadata.prototype.submitTime = null; + + /** + * Creates a new BatchTranslateDocumentMetadata instance using the specified properties. * @function create - * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata * @static - * @param {google.cloud.translation.v3.IDeleteGlossaryResponse=} [properties] Properties to set - * @returns {google.cloud.translation.v3.DeleteGlossaryResponse} DeleteGlossaryResponse instance + * @param {google.cloud.translation.v3.IBatchTranslateDocumentMetadata=} [properties] Properties to set + * @returns {google.cloud.translation.v3.BatchTranslateDocumentMetadata} BatchTranslateDocumentMetadata instance */ - DeleteGlossaryResponse.create = function create(properties) { - return new DeleteGlossaryResponse(properties); + BatchTranslateDocumentMetadata.create = function create(properties) { + return new BatchTranslateDocumentMetadata(properties); }; /** - * Encodes the specified DeleteGlossaryResponse message. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryResponse.verify|verify} messages. + * Encodes the specified BatchTranslateDocumentMetadata message. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateDocumentMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata * @static - * @param {google.cloud.translation.v3.IDeleteGlossaryResponse} message DeleteGlossaryResponse message or plain object to encode + * @param {google.cloud.translation.v3.IBatchTranslateDocumentMetadata} message BatchTranslateDocumentMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGlossaryResponse.encode = function encode(message, writer) { + BatchTranslateDocumentMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.totalPages != null && Object.hasOwnProperty.call(message, "totalPages")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.totalPages); + if (message.translatedPages != null && Object.hasOwnProperty.call(message, "translatedPages")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.translatedPages); + if (message.failedPages != null && Object.hasOwnProperty.call(message, "failedPages")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failedPages); + if (message.totalBillablePages != null && Object.hasOwnProperty.call(message, "totalBillablePages")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalBillablePages); + if (message.totalCharacters != null && Object.hasOwnProperty.call(message, "totalCharacters")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.totalCharacters); + if (message.translatedCharacters != null && Object.hasOwnProperty.call(message, "translatedCharacters")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.translatedCharacters); + if (message.failedCharacters != null && Object.hasOwnProperty.call(message, "failedCharacters")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.failedCharacters); + if (message.totalBillableCharacters != null && Object.hasOwnProperty.call(message, "totalBillableCharacters")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.totalBillableCharacters); if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime")) - $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteGlossaryResponse message, length delimited. Does not implicitly {@link google.cloud.translation.v3.DeleteGlossaryResponse.verify|verify} messages. + * Encodes the specified BatchTranslateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.translation.v3.BatchTranslateDocumentMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata * @static - * @param {google.cloud.translation.v3.IDeleteGlossaryResponse} message DeleteGlossaryResponse message or plain object to encode + * @param {google.cloud.translation.v3.IBatchTranslateDocumentMetadata} message BatchTranslateDocumentMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGlossaryResponse.encodeDelimited = function encodeDelimited(message, writer) { + BatchTranslateDocumentMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteGlossaryResponse message from the specified reader or buffer. + * Decodes a BatchTranslateDocumentMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.translation.v3.DeleteGlossaryResponse} DeleteGlossaryResponse + * @returns {google.cloud.translation.v3.BatchTranslateDocumentMetadata} BatchTranslateDocumentMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGlossaryResponse.decode = function decode(reader, length) { + BatchTranslateDocumentMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.DeleteGlossaryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.translation.v3.BatchTranslateDocumentMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.state = reader.int32(); break; case 2: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.totalPages = reader.int64(); break; case 3: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.translatedPages = reader.int64(); + break; + case 4: + message.failedPages = reader.int64(); + break; + case 5: + message.totalBillablePages = reader.int64(); + break; + case 6: + message.totalCharacters = reader.int64(); + break; + case 7: + message.translatedCharacters = reader.int64(); + break; + case 8: + message.failedCharacters = reader.int64(); + break; + case 9: + message.totalBillableCharacters = reader.int64(); + break; + case 10: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7738,114 +10985,332 @@ }; /** - * Decodes a DeleteGlossaryResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchTranslateDocumentMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.translation.v3.DeleteGlossaryResponse} DeleteGlossaryResponse + * @returns {google.cloud.translation.v3.BatchTranslateDocumentMetadata} BatchTranslateDocumentMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGlossaryResponse.decodeDelimited = function decodeDelimited(reader) { + BatchTranslateDocumentMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteGlossaryResponse message. + * Verifies a BatchTranslateDocumentMetadata message. * @function verify - * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteGlossaryResponse.verify = function verify(message) { + BatchTranslateDocumentMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + if (!$util.isInteger(message.totalPages) && !(message.totalPages && $util.isInteger(message.totalPages.low) && $util.isInteger(message.totalPages.high))) + return "totalPages: integer|Long expected"; + if (message.translatedPages != null && message.hasOwnProperty("translatedPages")) + if (!$util.isInteger(message.translatedPages) && !(message.translatedPages && $util.isInteger(message.translatedPages.low) && $util.isInteger(message.translatedPages.high))) + return "translatedPages: integer|Long expected"; + if (message.failedPages != null && message.hasOwnProperty("failedPages")) + if (!$util.isInteger(message.failedPages) && !(message.failedPages && $util.isInteger(message.failedPages.low) && $util.isInteger(message.failedPages.high))) + return "failedPages: integer|Long expected"; + if (message.totalBillablePages != null && message.hasOwnProperty("totalBillablePages")) + if (!$util.isInteger(message.totalBillablePages) && !(message.totalBillablePages && $util.isInteger(message.totalBillablePages.low) && $util.isInteger(message.totalBillablePages.high))) + return "totalBillablePages: integer|Long expected"; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (!$util.isInteger(message.totalCharacters) && !(message.totalCharacters && $util.isInteger(message.totalCharacters.low) && $util.isInteger(message.totalCharacters.high))) + return "totalCharacters: integer|Long expected"; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (!$util.isInteger(message.translatedCharacters) && !(message.translatedCharacters && $util.isInteger(message.translatedCharacters.low) && $util.isInteger(message.translatedCharacters.high))) + return "translatedCharacters: integer|Long expected"; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (!$util.isInteger(message.failedCharacters) && !(message.failedCharacters && $util.isInteger(message.failedCharacters.low) && $util.isInteger(message.failedCharacters.high))) + return "failedCharacters: integer|Long expected"; + if (message.totalBillableCharacters != null && message.hasOwnProperty("totalBillableCharacters")) + if (!$util.isInteger(message.totalBillableCharacters) && !(message.totalBillableCharacters && $util.isInteger(message.totalBillableCharacters.low) && $util.isInteger(message.totalBillableCharacters.high))) + return "totalBillableCharacters: integer|Long expected"; if (message.submitTime != null && message.hasOwnProperty("submitTime")) { var error = $root.google.protobuf.Timestamp.verify(message.submitTime); if (error) return "submitTime." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; + return null; + }; + + /** + * Creates a BatchTranslateDocumentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.translation.v3.BatchTranslateDocumentMetadata} BatchTranslateDocumentMetadata + */ + BatchTranslateDocumentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.translation.v3.BatchTranslateDocumentMetadata) + return object; + var message = new $root.google.cloud.translation.v3.BatchTranslateDocumentMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; } - return null; - }; - - /** - * Creates a DeleteGlossaryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.translation.v3.DeleteGlossaryResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.translation.v3.DeleteGlossaryResponse} DeleteGlossaryResponse - */ - DeleteGlossaryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.translation.v3.DeleteGlossaryResponse) - return object; - var message = new $root.google.cloud.translation.v3.DeleteGlossaryResponse(); - if (object.name != null) - message.name = String(object.name); + if (object.totalPages != null) + if ($util.Long) + (message.totalPages = $util.Long.fromValue(object.totalPages)).unsigned = false; + else if (typeof object.totalPages === "string") + message.totalPages = parseInt(object.totalPages, 10); + else if (typeof object.totalPages === "number") + message.totalPages = object.totalPages; + else if (typeof object.totalPages === "object") + message.totalPages = new $util.LongBits(object.totalPages.low >>> 0, object.totalPages.high >>> 0).toNumber(); + if (object.translatedPages != null) + if ($util.Long) + (message.translatedPages = $util.Long.fromValue(object.translatedPages)).unsigned = false; + else if (typeof object.translatedPages === "string") + message.translatedPages = parseInt(object.translatedPages, 10); + else if (typeof object.translatedPages === "number") + message.translatedPages = object.translatedPages; + else if (typeof object.translatedPages === "object") + message.translatedPages = new $util.LongBits(object.translatedPages.low >>> 0, object.translatedPages.high >>> 0).toNumber(); + if (object.failedPages != null) + if ($util.Long) + (message.failedPages = $util.Long.fromValue(object.failedPages)).unsigned = false; + else if (typeof object.failedPages === "string") + message.failedPages = parseInt(object.failedPages, 10); + else if (typeof object.failedPages === "number") + message.failedPages = object.failedPages; + else if (typeof object.failedPages === "object") + message.failedPages = new $util.LongBits(object.failedPages.low >>> 0, object.failedPages.high >>> 0).toNumber(); + if (object.totalBillablePages != null) + if ($util.Long) + (message.totalBillablePages = $util.Long.fromValue(object.totalBillablePages)).unsigned = false; + else if (typeof object.totalBillablePages === "string") + message.totalBillablePages = parseInt(object.totalBillablePages, 10); + else if (typeof object.totalBillablePages === "number") + message.totalBillablePages = object.totalBillablePages; + else if (typeof object.totalBillablePages === "object") + message.totalBillablePages = new $util.LongBits(object.totalBillablePages.low >>> 0, object.totalBillablePages.high >>> 0).toNumber(); + if (object.totalCharacters != null) + if ($util.Long) + (message.totalCharacters = $util.Long.fromValue(object.totalCharacters)).unsigned = false; + else if (typeof object.totalCharacters === "string") + message.totalCharacters = parseInt(object.totalCharacters, 10); + else if (typeof object.totalCharacters === "number") + message.totalCharacters = object.totalCharacters; + else if (typeof object.totalCharacters === "object") + message.totalCharacters = new $util.LongBits(object.totalCharacters.low >>> 0, object.totalCharacters.high >>> 0).toNumber(); + if (object.translatedCharacters != null) + if ($util.Long) + (message.translatedCharacters = $util.Long.fromValue(object.translatedCharacters)).unsigned = false; + else if (typeof object.translatedCharacters === "string") + message.translatedCharacters = parseInt(object.translatedCharacters, 10); + else if (typeof object.translatedCharacters === "number") + message.translatedCharacters = object.translatedCharacters; + else if (typeof object.translatedCharacters === "object") + message.translatedCharacters = new $util.LongBits(object.translatedCharacters.low >>> 0, object.translatedCharacters.high >>> 0).toNumber(); + if (object.failedCharacters != null) + if ($util.Long) + (message.failedCharacters = $util.Long.fromValue(object.failedCharacters)).unsigned = false; + else if (typeof object.failedCharacters === "string") + message.failedCharacters = parseInt(object.failedCharacters, 10); + else if (typeof object.failedCharacters === "number") + message.failedCharacters = object.failedCharacters; + else if (typeof object.failedCharacters === "object") + message.failedCharacters = new $util.LongBits(object.failedCharacters.low >>> 0, object.failedCharacters.high >>> 0).toNumber(); + if (object.totalBillableCharacters != null) + if ($util.Long) + (message.totalBillableCharacters = $util.Long.fromValue(object.totalBillableCharacters)).unsigned = false; + else if (typeof object.totalBillableCharacters === "string") + message.totalBillableCharacters = parseInt(object.totalBillableCharacters, 10); + else if (typeof object.totalBillableCharacters === "number") + message.totalBillableCharacters = object.totalBillableCharacters; + else if (typeof object.totalBillableCharacters === "object") + message.totalBillableCharacters = new $util.LongBits(object.totalBillableCharacters.low >>> 0, object.totalBillableCharacters.high >>> 0).toNumber(); if (object.submitTime != null) { if (typeof object.submitTime !== "object") - throw TypeError(".google.cloud.translation.v3.DeleteGlossaryResponse.submitTime: object expected"); + throw TypeError(".google.cloud.translation.v3.BatchTranslateDocumentMetadata.submitTime: object expected"); message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.translation.v3.DeleteGlossaryResponse.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } return message; }; /** - * Creates a plain object from a DeleteGlossaryResponse message. Also converts values to other types if specified. + * Creates a plain object from a BatchTranslateDocumentMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata * @static - * @param {google.cloud.translation.v3.DeleteGlossaryResponse} message DeleteGlossaryResponse + * @param {google.cloud.translation.v3.BatchTranslateDocumentMetadata} message BatchTranslateDocumentMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteGlossaryResponse.toObject = function toObject(message, options) { + BatchTranslateDocumentMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalPages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalPages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedPages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedPages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedPages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedPages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalBillablePages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalBillablePages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.translatedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.translatedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCharacters = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalBillableCharacters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalBillableCharacters = options.longs === String ? "0" : 0; object.submitTime = null; - object.endTime = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.translation.v3.BatchTranslateDocumentMetadata.State[message.state] : message.state; + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + if (typeof message.totalPages === "number") + object.totalPages = options.longs === String ? String(message.totalPages) : message.totalPages; + else + object.totalPages = options.longs === String ? $util.Long.prototype.toString.call(message.totalPages) : options.longs === Number ? new $util.LongBits(message.totalPages.low >>> 0, message.totalPages.high >>> 0).toNumber() : message.totalPages; + if (message.translatedPages != null && message.hasOwnProperty("translatedPages")) + if (typeof message.translatedPages === "number") + object.translatedPages = options.longs === String ? String(message.translatedPages) : message.translatedPages; + else + object.translatedPages = options.longs === String ? $util.Long.prototype.toString.call(message.translatedPages) : options.longs === Number ? new $util.LongBits(message.translatedPages.low >>> 0, message.translatedPages.high >>> 0).toNumber() : message.translatedPages; + if (message.failedPages != null && message.hasOwnProperty("failedPages")) + if (typeof message.failedPages === "number") + object.failedPages = options.longs === String ? String(message.failedPages) : message.failedPages; + else + object.failedPages = options.longs === String ? $util.Long.prototype.toString.call(message.failedPages) : options.longs === Number ? new $util.LongBits(message.failedPages.low >>> 0, message.failedPages.high >>> 0).toNumber() : message.failedPages; + if (message.totalBillablePages != null && message.hasOwnProperty("totalBillablePages")) + if (typeof message.totalBillablePages === "number") + object.totalBillablePages = options.longs === String ? String(message.totalBillablePages) : message.totalBillablePages; + else + object.totalBillablePages = options.longs === String ? $util.Long.prototype.toString.call(message.totalBillablePages) : options.longs === Number ? new $util.LongBits(message.totalBillablePages.low >>> 0, message.totalBillablePages.high >>> 0).toNumber() : message.totalBillablePages; + if (message.totalCharacters != null && message.hasOwnProperty("totalCharacters")) + if (typeof message.totalCharacters === "number") + object.totalCharacters = options.longs === String ? String(message.totalCharacters) : message.totalCharacters; + else + object.totalCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalCharacters) : options.longs === Number ? new $util.LongBits(message.totalCharacters.low >>> 0, message.totalCharacters.high >>> 0).toNumber() : message.totalCharacters; + if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) + if (typeof message.translatedCharacters === "number") + object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; + else + object.translatedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.translatedCharacters) : options.longs === Number ? new $util.LongBits(message.translatedCharacters.low >>> 0, message.translatedCharacters.high >>> 0).toNumber() : message.translatedCharacters; + if (message.failedCharacters != null && message.hasOwnProperty("failedCharacters")) + if (typeof message.failedCharacters === "number") + object.failedCharacters = options.longs === String ? String(message.failedCharacters) : message.failedCharacters; + else + object.failedCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.failedCharacters) : options.longs === Number ? new $util.LongBits(message.failedCharacters.low >>> 0, message.failedCharacters.high >>> 0).toNumber() : message.failedCharacters; + if (message.totalBillableCharacters != null && message.hasOwnProperty("totalBillableCharacters")) + if (typeof message.totalBillableCharacters === "number") + object.totalBillableCharacters = options.longs === String ? String(message.totalBillableCharacters) : message.totalBillableCharacters; + else + object.totalBillableCharacters = options.longs === String ? $util.Long.prototype.toString.call(message.totalBillableCharacters) : options.longs === Number ? new $util.LongBits(message.totalBillableCharacters.low >>> 0, message.totalBillableCharacters.high >>> 0).toNumber() : message.totalBillableCharacters; if (message.submitTime != null && message.hasOwnProperty("submitTime")) object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); return object; }; /** - * Converts this DeleteGlossaryResponse to JSON. + * Converts this BatchTranslateDocumentMetadata to JSON. * @function toJSON - * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata * @instance * @returns {Object.} JSON object */ - DeleteGlossaryResponse.prototype.toJSON = function toJSON() { + BatchTranslateDocumentMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteGlossaryResponse; + /** + * State enum. + * @name google.cloud.translation.v3.BatchTranslateDocumentMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + */ + BatchTranslateDocumentMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return BatchTranslateDocumentMetadata; })(); return v3; @@ -17134,6 +20599,7 @@ * @property {google.cloud.translation.v3beta1.IBatchDocumentOutputConfig|null} [outputConfig] BatchTranslateDocumentRequest outputConfig * @property {Object.|null} [models] BatchTranslateDocumentRequest models * @property {Object.|null} [glossaries] BatchTranslateDocumentRequest glossaries + * @property {Object.|null} [formatConversions] BatchTranslateDocumentRequest formatConversions */ /** @@ -17149,6 +20615,7 @@ this.inputConfigs = []; this.models = {}; this.glossaries = {}; + this.formatConversions = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17211,6 +20678,14 @@ */ BatchTranslateDocumentRequest.prototype.glossaries = $util.emptyObject; + /** + * BatchTranslateDocumentRequest formatConversions. + * @member {Object.} formatConversions + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest + * @instance + */ + BatchTranslateDocumentRequest.prototype.formatConversions = $util.emptyObject; + /** * Creates a new BatchTranslateDocumentRequest instance using the specified properties. * @function create @@ -17255,6 +20730,9 @@ writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.encode(message.glossaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } + if (message.formatConversions != null && Object.hasOwnProperty.call(message, "formatConversions")) + for (var keys = Object.keys(message.formatConversions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.formatConversions[keys[i]]).ldelim(); return writer; }; @@ -17352,6 +20830,28 @@ } message.glossaries[key] = value; break; + case 8: + if (message.formatConversions === $util.emptyObject) + message.formatConversions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.formatConversions[key] = value; + break; default: reader.skipType(tag & 7); break; @@ -17432,6 +20932,14 @@ return "glossaries." + error; } } + if (message.formatConversions != null && message.hasOwnProperty("formatConversions")) { + if (!$util.isObject(message.formatConversions)) + return "formatConversions: object expected"; + var key = Object.keys(message.formatConversions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.formatConversions[key[i]])) + return "formatConversions: string{k:string} expected"; + } return null; }; @@ -17490,6 +20998,13 @@ message.glossaries[keys[i]] = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.fromObject(object.glossaries[keys[i]]); } } + if (object.formatConversions) { + if (typeof object.formatConversions !== "object") + throw TypeError(".google.cloud.translation.v3beta1.BatchTranslateDocumentRequest.formatConversions: object expected"); + message.formatConversions = {}; + for (var keys = Object.keys(object.formatConversions), i = 0; i < keys.length; ++i) + message.formatConversions[keys[i]] = String(object.formatConversions[keys[i]]); + } return message; }; @@ -17513,6 +21028,7 @@ if (options.objects || options.defaults) { object.models = {}; object.glossaries = {}; + object.formatConversions = {}; } if (options.defaults) { object.parent = ""; @@ -17546,6 +21062,11 @@ for (var j = 0; j < keys2.length; ++j) object.glossaries[keys2[j]] = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.toObject(message.glossaries[keys2[j]], options); } + if (message.formatConversions && (keys2 = Object.keys(message.formatConversions)).length) { + object.formatConversions = {}; + for (var j = 0; j < keys2.length; ++j) + object.formatConversions[keys2[j]] = message.formatConversions[keys2[j]]; + } return object; }; diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index 965ef085212..d6b2f59e022 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -101,6 +101,22 @@ } ] }, + "TranslateDocument": { + "requestType": "TranslateDocumentRequest", + "responseType": "TranslateDocumentResponse", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*}:translateDocument", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*}:translateDocument", + "body": "*" + } + } + ] + }, "BatchTranslateText": { "requestType": "BatchTranslateTextRequest", "responseType": "google.longrunning.Operation", @@ -125,6 +141,30 @@ } ] }, + "BatchTranslateDocument": { + "requestType": "BatchTranslateDocumentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*/locations/*}:batchTranslateDocument", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "BatchTranslateDocumentResponse", + "(google.longrunning.operation_info).metadata_type": "BatchTranslateDocumentMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{parent=projects/*/locations/*}:batchTranslateDocument", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchTranslateDocumentResponse", + "metadata_type": "BatchTranslateDocumentMetadata" + } + } + ] + }, "CreateGlossary": { "requestType": "CreateGlossaryRequest", "responseType": "google.longrunning.Operation", @@ -457,7 +497,10 @@ "fields": { "inputUri": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -487,7 +530,10 @@ "fields": { "outputUriPrefix": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -506,6 +552,153 @@ } } }, + "DocumentInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "content", + "gcsSource" + ] + } + }, + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "gcsSource": { + "type": "GcsSource", + "id": 2 + }, + "mimeType": { + "type": "string", + "id": 4 + } + } + }, + "DocumentOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mimeType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TranslateDocumentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceLanguageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "targetLanguageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "documentInputConfig": { + "type": "DocumentInputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "documentOutputConfig": { + "type": "DocumentOutputConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "model": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "glossaryConfig": { + "type": "TranslateTextGlossaryConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DocumentTranslation": { + "fields": { + "byteStreamOutputs": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + }, + "detectedLanguageCode": { + "type": "string", + "id": 3 + } + } + }, + "TranslateDocumentResponse": { + "fields": { + "documentTranslation": { + "type": "DocumentTranslation", + "id": 1 + }, + "glossaryDocumentTranslation": { + "type": "DocumentTranslation", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + }, + "glossaryConfig": { + "type": "TranslateTextGlossaryConfig", + "id": 4 + } + } + }, "BatchTranslateTextRequest": { "fields": { "parent": { @@ -663,7 +856,10 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "languagePair": { "type": "LanguageCodePair", @@ -883,6 +1079,202 @@ "id": 3 } } + }, + "BatchTranslateDocumentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "sourceLanguageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputConfigs": { + "rule": "repeated", + "type": "BatchDocumentInputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "BatchDocumentOutputConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "models": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "glossaries": { + "keyType": "string", + "type": "TranslateTextGlossaryConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "formatConversions": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchDocumentInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + } + } + }, + "BatchDocumentOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + } + } + }, + "BatchTranslateDocumentResponse": { + "fields": { + "totalPages": { + "type": "int64", + "id": 1 + }, + "translatedPages": { + "type": "int64", + "id": 2 + }, + "failedPages": { + "type": "int64", + "id": 3 + }, + "totalBillablePages": { + "type": "int64", + "id": 4 + }, + "totalCharacters": { + "type": "int64", + "id": 5 + }, + "translatedCharacters": { + "type": "int64", + "id": 6 + }, + "failedCharacters": { + "type": "int64", + "id": 7 + }, + "totalBillableCharacters": { + "type": "int64", + "id": 8 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + } + }, + "BatchTranslateDocumentMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "totalPages": { + "type": "int64", + "id": 2 + }, + "translatedPages": { + "type": "int64", + "id": 3 + }, + "failedPages": { + "type": "int64", + "id": 4 + }, + "totalBillablePages": { + "type": "int64", + "id": 5 + }, + "totalCharacters": { + "type": "int64", + "id": 6 + }, + "translatedCharacters": { + "type": "int64", + "id": 7 + }, + "failedCharacters": { + "type": "int64", + "id": 8 + }, + "totalBillableCharacters": { + "type": "int64", + "id": 9 + }, + "submitTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "SUCCEEDED": 2, + "FAILED": 3, + "CANCELLING": 4, + "CANCELLED": 5 + } + } + } } } }, @@ -2008,6 +2400,14 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "formatConversions": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, diff --git a/packages/google-cloud-translate/src/v3/gapic_metadata.json b/packages/google-cloud-translate/src/v3/gapic_metadata.json index 54b01faa492..6af9328fa91 100644 --- a/packages/google-cloud-translate/src/v3/gapic_metadata.json +++ b/packages/google-cloud-translate/src/v3/gapic_metadata.json @@ -25,6 +25,11 @@ "getSupportedLanguages" ] }, + "TranslateDocument": { + "methods": [ + "translateDocument" + ] + }, "GetGlossary": { "methods": [ "getGlossary" @@ -35,6 +40,11 @@ "batchTranslateText" ] }, + "BatchTranslateDocument": { + "methods": [ + "batchTranslateDocument" + ] + }, "CreateGlossary": { "methods": [ "createGlossary" @@ -72,6 +82,11 @@ "getSupportedLanguages" ] }, + "TranslateDocument": { + "methods": [ + "translateDocument" + ] + }, "GetGlossary": { "methods": [ "getGlossary" @@ -82,6 +97,11 @@ "batchTranslateText" ] }, + "BatchTranslateDocument": { + "methods": [ + "batchTranslateDocument" + ] + }, "CreateGlossary": { "methods": [ "createGlossary" diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index a630052c890..477be829bbf 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -203,6 +203,12 @@ export class TranslationServiceClient { const batchTranslateTextMetadata = protoFilesRoot.lookup( '.google.cloud.translation.v3.BatchTranslateMetadata' ) as gax.protobuf.Type; + const batchTranslateDocumentResponse = protoFilesRoot.lookup( + '.google.cloud.translation.v3.BatchTranslateDocumentResponse' + ) as gax.protobuf.Type; + const batchTranslateDocumentMetadata = protoFilesRoot.lookup( + '.google.cloud.translation.v3.BatchTranslateDocumentMetadata' + ) as gax.protobuf.Type; const createGlossaryResponse = protoFilesRoot.lookup( '.google.cloud.translation.v3.Glossary' ) as gax.protobuf.Type; @@ -222,6 +228,15 @@ export class TranslationServiceClient { batchTranslateTextResponse.decode.bind(batchTranslateTextResponse), batchTranslateTextMetadata.decode.bind(batchTranslateTextMetadata) ), + batchTranslateDocument: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchTranslateDocumentResponse.decode.bind( + batchTranslateDocumentResponse + ), + batchTranslateDocumentMetadata.decode.bind( + batchTranslateDocumentMetadata + ) + ), createGlossary: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGlossaryResponse.decode.bind(createGlossaryResponse), @@ -287,7 +302,9 @@ export class TranslationServiceClient { 'translateText', 'detectLanguage', 'getSupportedLanguages', + 'translateDocument', 'batchTranslateText', + 'batchTranslateDocument', 'createGlossary', 'listGlossaries', 'getGlossary', @@ -418,7 +435,8 @@ export class TranslationServiceClient { * The request object that will be sent. * @param {string[]} request.contents * Required. The content of the input in string format. - * We recommend the total content be less than 30k codepoints. + * We recommend the total content be less than 30k codepoints. The max length + * of this field is 1024. * Use BatchTranslateText for larger text. * @param {string} [request.mimeType] * Optional. The format of the source text, for example, "text/html", @@ -457,14 +475,13 @@ export class TranslationServiceClient { * * - General (built-in) models: * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * * * For global (non-regionalized) requests, use `location-id` `global`. * For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. * - * If missing, the system decides which google base model to use. + * If not provided, the default Google model (NMT) will be used. * @param {google.cloud.translation.v3.TranslateTextGlossaryConfig} [request.glossaryConfig] * Optional. Glossary to be applied. The glossary must be * within the same region (have the same location-id) as the model, otherwise @@ -477,7 +494,8 @@ export class TranslationServiceClient { * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. * - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -602,7 +620,8 @@ export class TranslationServiceClient { * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. * - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -723,11 +742,10 @@ export class TranslationServiceClient { * * - General (built-in) models: * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * * * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. + * If missing, we get supported languages of Google general NMT model. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -784,6 +802,154 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.getSupportedLanguages(request, options, callback); } + translateDocument( + request?: protos.google.cloud.translation.v3.ITranslateDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3.ITranslateDocumentResponse, + protos.google.cloud.translation.v3.ITranslateDocumentRequest | undefined, + {} | undefined + ] + >; + translateDocument( + request: protos.google.cloud.translation.v3.ITranslateDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.ITranslateDocumentResponse, + | protos.google.cloud.translation.v3.ITranslateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + translateDocument( + request: protos.google.cloud.translation.v3.ITranslateDocumentRequest, + callback: Callback< + protos.google.cloud.translation.v3.ITranslateDocumentResponse, + | protos.google.cloud.translation.v3.ITranslateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Translates documents in synchronous mode. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Location to make a regional call. + * + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * + * Non-global location is required for requests using AutoML models or custom + * glossaries. + * + * Models and glossaries must be within the same region (have the same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + * @param {string} [request.sourceLanguageCode] + * Optional. The BCP-47 language code of the input document if known, for + * example, "en-US" or "sr-Latn". Supported language codes are listed in + * Language Support. If the source language isn't specified, the API attempts + * to identify the source language automatically and returns the source + * language within the response. Source language must be specified if the + * request contains a glossary or a custom model. + * @param {string} request.targetLanguageCode + * Required. The BCP-47 language code to use for translation of the input + * document, set to one of the language codes listed in Language Support. + * @param {google.cloud.translation.v3.DocumentInputConfig} request.documentInputConfig + * Required. Input configurations. + * @param {google.cloud.translation.v3.DocumentOutputConfig} [request.documentOutputConfig] + * Optional. Output configurations. + * Defines if the output file should be stored within Cloud Storage as well + * as the desired output format. If not provided the translated file will + * only be returned through a byte-stream and its output mime type will be + * the same as the input file's mime type. + * @param {string} [request.model] + * Optional. The `model` type requested for this translation. + * + * The format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * + * + * If not provided, the default Google model (NMT) will be used for + * translation. + * @param {google.cloud.translation.v3.TranslateTextGlossaryConfig} [request.glossaryConfig] + * Optional. Glossary to be applied. The glossary must be within the same + * region (have the same location-id) as the model, otherwise an + * INVALID_ARGUMENT (400) error is returned. + * @param {number[]} [request.labels] + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters (Unicode + * codepoints), can only contain lowercase letters, numeric characters, + * underscores and dashes. International characters are allowed. Label values + * are optional. Label keys must start with a letter. + * + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TranslateDocumentResponse]{@link google.cloud.translation.v3.TranslateDocumentResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.translateDocument(request); + */ + translateDocument( + request?: protos.google.cloud.translation.v3.ITranslateDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.translation.v3.ITranslateDocumentResponse, + | protos.google.cloud.translation.v3.ITranslateDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.translation.v3.ITranslateDocumentResponse, + | protos.google.cloud.translation.v3.ITranslateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.translation.v3.ITranslateDocumentResponse, + protos.google.cloud.translation.v3.ITranslateDocumentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.translateDocument(request, options, callback); + } getGlossary( request?: protos.google.cloud.translation.v3.IGetGlossaryRequest, options?: CallOptions @@ -944,14 +1110,13 @@ export class TranslationServiceClient { * * - General (built-in) models: * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * * * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @param {number[]} request.inputConfigs * Required. Input configurations. - * The total number of files matched should be <= 1000. + * The total number of files matched should be <= 100. * The total content size should be <= 100M Unicode codepoints. * The files must use UTF-8 encoding. * @param {google.cloud.translation.v3.OutputConfig} request.outputConfig @@ -969,7 +1134,8 @@ export class TranslationServiceClient { * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. * - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1068,6 +1234,210 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3.BatchTranslateMetadata >; } + batchTranslateDocument( + request?: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchTranslateDocument( + request: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchTranslateDocument( + request: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Translates a large volume of document in asynchronous batch mode. + * This function provides real-time output as the inputs are being processed. + * If caller cancels a request, the partial results (for an input file, it's + * all or nothing) may still be available on the specified output location. + * + * This call returns immediately and you can use + * google.longrunning.Operation.name to poll the status of the call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Location to make a regional call. + * + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * + * The `global` location is not supported for batch translation. + * + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. + * @param {string} request.sourceLanguageCode + * Required. The BCP-47 language code of the input document if known, for + * example, "en-US" or "sr-Latn". Supported language codes are listed in + * Language Support (https://cloud.google.com/translate/docs/languages). + * @param {string[]} request.targetLanguageCodes + * Required. The BCP-47 language code to use for translation of the input + * document. Specify up to 10 language codes here. + * @param {number[]} request.inputConfigs + * Required. Input configurations. + * The total number of files matched should be <= 100. + * The total content size to translate should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + * @param {google.cloud.translation.v3.BatchDocumentOutputConfig} request.outputConfig + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + * @param {number[]} [request.models] + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is the model name. Value can be a built-in general model, + * or an AutoML Translation model. + * + * The value format depends on model type: + * + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * + * + * If the map is empty or a specific model is + * not requested for a language pair, then default google model (nmt) is used. + * @param {number[]} [request.glossaries] + * Optional. Glossaries to be applied. It's keyed by target language code. + * @param {number[]} [request.formatConversions] + * Optional. File format conversion map to be applied to all input files. + * Map's key is the original mime_type. Map's value is the target mime_type of + * translated documents. + * + * Supported file format conversion includes: + * - `application/pdf` to + * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + * + * If nothing specified, output files will be in the same format as the + * original file. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.batchTranslateDocument(request); + * const [response] = await operation.promise(); + */ + batchTranslateDocument( + request?: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchTranslateDocument( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `batchTranslateDocument()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkBatchTranslateDocumentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkBatchTranslateDocumentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.translation.v3.BatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.BatchTranslateDocumentMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.batchTranslateDocument, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.translation.v3.BatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.BatchTranslateDocumentMetadata + >; + } createGlossary( request?: protos.google.cloud.translation.v3.ICreateGlossaryRequest, options?: CallOptions @@ -1404,7 +1774,20 @@ export class TranslationServiceClient { * The first page is returned if `page_token`is empty or missing. * @param {string} [request.filter] * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. + * Specify the constraint by the format of "key=value", where key must be + * "src" or "tgt", and the value must be a valid language code. + * For multiple restrictions, concatenate them by "AND" (uppercase only), + * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + * here, which means using 'en-US' and 'en' can lead to different results, + * which depends on the language code you used when you create the glossary. + * For the unidirectional glossaries, the "src" and "tgt" add restrictions + * on the source and target language code separately. + * For the equivalent term set glossaries, the "src" and/or "tgt" add + * restrictions on the term set. + * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + * glossaries which exactly match the source language code as "en-US" and the + * target language code "zh-CN", but all equivalent term set glossaries which + * contain "en-US" and "zh-CN" in their language set will be picked. * If missing, no filtering is performed. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1479,7 +1862,20 @@ export class TranslationServiceClient { * The first page is returned if `page_token`is empty or missing. * @param {string} [request.filter] * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. + * Specify the constraint by the format of "key=value", where key must be + * "src" or "tgt", and the value must be a valid language code. + * For multiple restrictions, concatenate them by "AND" (uppercase only), + * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + * here, which means using 'en-US' and 'en' can lead to different results, + * which depends on the language code you used when you create the glossary. + * For the unidirectional glossaries, the "src" and "tgt" add restrictions + * on the source and target language code separately. + * For the equivalent term set glossaries, the "src" and/or "tgt" add + * restrictions on the term set. + * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + * glossaries which exactly match the source language code as "en-US" and the + * target language code "zh-CN", but all equivalent term set glossaries which + * contain "en-US" and "zh-CN" in their language set will be picked. * If missing, no filtering is performed. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1532,7 +1928,20 @@ export class TranslationServiceClient { * The first page is returned if `page_token`is empty or missing. * @param {string} [request.filter] * Optional. Filter specifying constraints of a list operation. - * Filtering is not supported yet, and the parameter currently has no effect. + * Specify the constraint by the format of "key=value", where key must be + * "src" or "tgt", and the value must be a valid language code. + * For multiple restrictions, concatenate them by "AND" (uppercase only), + * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + * here, which means using 'en-US' and 'en' can lead to different results, + * which depends on the language code you used when you create the glossary. + * For the unidirectional glossaries, the "src" and "tgt" add restrictions + * on the source and target language code separately. + * For the equivalent term set glossaries, the "src" and/or "tgt" add + * restrictions on the term set. + * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + * glossaries which exactly match the source language code as "en-US" and the + * target language code "zh-CN", but all equivalent term set glossaries which + * contain "en-US" and "zh-CN" in their language set will be picked. * If missing, no filtering is performed. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. diff --git a/packages/google-cloud-translate/src/v3/translation_service_client_config.json b/packages/google-cloud-translate/src/v3/translation_service_client_config.json index 1bddde9c201..d17bfe2c1c7 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client_config.json +++ b/packages/google-cloud-translate/src/v3/translation_service_client_config.json @@ -35,11 +35,21 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "TranslateDocument": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "BatchTranslateText": { "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "BatchTranslateDocument": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "CreateGlossary": { "timeout_millis": 600000, "retry_codes_name": "non_idempotent", diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 7fa706de3dc..538e3711396 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -1340,6 +1340,17 @@ export class TranslationServiceClient { * pair, then default google model (nmt) is used. * @param {number[]} [request.glossaries] * Optional. Glossaries to be applied. It's keyed by target language code. + * @param {number[]} [request.formatConversions] + * Optional. File format conversion map to be applied to all input files. + * Map's key is the original mime_type. Map's value is the target mime_type of + * translated documents. + * + * Supported file format conversion includes: + * - `application/pdf` to + * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + * + * If nothing specified, output files will be in the same format as the + * original file. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts index 028f63108ba..5ab25331dbc 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -564,6 +564,117 @@ describe('v3.TranslationServiceClient', () => { }); }); + describe('translateDocument', () => { + it('invokes translateDocument without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateDocumentResponse() + ); + client.innerApiCalls.translateDocument = stubSimpleCall(expectedResponse); + const [response] = await client.translateDocument(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.translateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes translateDocument without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateDocumentResponse() + ); + client.innerApiCalls.translateDocument = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.translateDocument( + request, + ( + err?: Error | null, + result?: protos.google.cloud.translation.v3.ITranslateDocumentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.translateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes translateDocument with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.translateDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.translateDocument(request), expectedError); + assert( + (client.innerApiCalls.translateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getGlossary', () => { it('invokes getGlossary without error', async () => { const client = new translationserviceModule.v3.TranslationServiceClient({ @@ -869,6 +980,203 @@ describe('v3.TranslationServiceClient', () => { }); }); + describe('batchTranslateDocument', () => { + it('invokes batchTranslateDocument without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.BatchTranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchTranslateDocument = + stubLongRunningCall(expectedResponse); + const [operation] = await client.batchTranslateDocument(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchTranslateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchTranslateDocument without error using callback', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.BatchTranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchTranslateDocument = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchTranslateDocument( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchTranslateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes batchTranslateDocument with call error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.BatchTranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateDocument = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.batchTranslateDocument(request), + expectedError + ); + assert( + (client.innerApiCalls.batchTranslateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchTranslateDocument with LRO error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.BatchTranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchTranslateDocument = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchTranslateDocument(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.batchTranslateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkBatchTranslateDocumentProgress without error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchTranslateDocumentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchTranslateDocumentProgress with error', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkBatchTranslateDocumentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('createGlossary', () => { it('invokes createGlossary without error', async () => { const client = new translationserviceModule.v3.TranslationServiceClient({ From 99b426ba3bcd4bea97a1c43b61b13a55689e653f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 16 Sep 2021 14:45:53 -0700 Subject: [PATCH 457/513] chore: release 6.3.0 (#714) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-translate/CHANGELOG.md | 15 +++++++++++++++ packages/google-cloud-translate/package.json | 2 +- .../google-cloud-translate/samples/package.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index a6e34d00ca8..0e6901bbb9c 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,21 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [6.3.0](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.7...v6.3.0) (2021-09-13) + + +### Features + +* added v3 proto for online/batch document translation and updated v3beta1 proto for format conversion ([#719](https://www.github.com/googleapis/nodejs-translate/issues/719)) ([76c9a13](https://www.github.com/googleapis/nodejs-translate/commit/76c9a13a0bb8b9dadc9f671e649af82f58c943f6)) +* turns on self-signed JWT feature flag ([#713](https://www.github.com/googleapis/nodejs-translate/issues/713)) ([41062a6](https://www.github.com/googleapis/nodejs-translate/commit/41062a675ae8bb19d921b5612ae325383d219725)) + + +### Bug Fixes + +* add missing annotation for batch document translation ([#715](https://www.github.com/googleapis/nodejs-translate/issues/715)) ([b893e3d](https://www.github.com/googleapis/nodejs-translate/commit/b893e3dcc532813d29d96950fc90962215ad6e51)) +* **build:** set default branch to main ([#722](https://www.github.com/googleapis/nodejs-translate/issues/722)) ([26b9ba7](https://www.github.com/googleapis/nodejs-translate/commit/26b9ba7850d25234e1bfb8035dd5ef7a1108b31c)) +* remove unnecessary assertion ([#721](https://www.github.com/googleapis/nodejs-translate/issues/721)) ([a5a1f82](https://www.github.com/googleapis/nodejs-translate/commit/a5a1f82b9b78f465ef6bbbfba55dda8937d90dfa)) + ### [6.2.7](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.6...v6.2.7) (2021-08-17) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 50ed6dbe0e1..bda808b83f5 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.2.7", + "version": "6.3.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 7dca6870a34..a055da5f24b 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.2.7", + "@google-cloud/translate": "^6.3.0", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From 19f26c753baae42db3f5b6ed82930334340e959e Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 21 Sep 2021 15:02:11 -0700 Subject: [PATCH 458/513] chore: relocate owl bot post processor (#725) chore: relocate owl bot post processor --- packages/google-cloud-translate/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/.github/.OwlBot.yaml b/packages/google-cloud-translate/.github/.OwlBot.yaml index 1700df3c382..0bc4ec152bf 100644 --- a/packages/google-cloud-translate/.github/.OwlBot.yaml +++ b/packages/google-cloud-translate/.github/.OwlBot.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. docker: - image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest deep-remove-regex: From bae1440e5f87e1a11c1190b4077b93b2bd6268d4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 00:44:54 +0000 Subject: [PATCH 459/513] build(node): update deps used during postprocessing (#1243) (#734) --- .../google-cloud-translate/protos/protos.d.ts | 3 ++- packages/google-cloud-translate/protos/protos.js | 7 +++++++ .../google-cloud-translate/protos/protos.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index da1115d1019..130c922f3d2 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -9187,7 +9187,8 @@ export namespace google { OUTPUT_ONLY = 3, INPUT_ONLY = 4, IMMUTABLE = 5, - UNORDERED_LIST = 6 + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 } /** Properties of a ResourceDescriptor. */ diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index 19bd110eadc..eb78c393d80 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -23505,6 +23505,7 @@ * @property {number} INPUT_ONLY=4 INPUT_ONLY value * @property {number} IMMUTABLE=5 IMMUTABLE value * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value */ api.FieldBehavior = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -23515,6 +23516,7 @@ values[valuesById[4] = "INPUT_ONLY"] = 4; values[valuesById[5] = "IMMUTABLE"] = 5; values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; return values; })(); @@ -29683,6 +29685,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -29787,6 +29790,10 @@ case 6: message[".google.api.fieldBehavior"][i] = 6; break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; } } if (object[".google.api.resourceReference"] != null) { diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index d6b2f59e022..7251001d65d 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -2674,7 +2674,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "resourceReference": { @@ -3317,6 +3318,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From 4cf0a0721b0f4f7f409f80dd829a05f4745ea290 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 18:16:10 +0000 Subject: [PATCH 460/513] docs(samples): add auto-generated samples for Node with api short name in region tag (#730) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 399287285 Source-Link: https://github.com/googleapis/googleapis/commit/15759865d1c54e3d46429010f7e472fe6c3d3715 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b27fff623a5d8d586b703b5e4919856abe7c2eb3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI3ZmZmNjIzYTVkOGQ1ODZiNzAzYjVlNDkxOTg1NmFiZTdjMmViMyJ9 --- ...lation_service.batch_translate_document.js | 120 ++++++++++++++++++ ...ranslation_service.batch_translate_text.js | 117 +++++++++++++++++ .../v3/translation_service.create_glossary.js | 58 +++++++++ .../v3/translation_service.delete_glossary.js | 53 ++++++++ .../v3/translation_service.detect_language.js | 87 +++++++++++++ .../v3/translation_service.get_glossary.js | 52 ++++++++ ...slation_service.get_supported_languages.js | 77 +++++++++++ .../v3/translation_service.list_glossaries.js | 85 +++++++++++++ .../translation_service.translate_document.js | 114 +++++++++++++++++ .../v3/translation_service.translate_text.js | 117 +++++++++++++++++ ...lation_service.batch_translate_document.js | 120 ++++++++++++++++++ ...ranslation_service.batch_translate_text.js | 116 +++++++++++++++++ .../translation_service.create_glossary.js | 58 +++++++++ .../translation_service.delete_glossary.js | 53 ++++++++ .../translation_service.detect_language.js | 86 +++++++++++++ .../translation_service.get_glossary.js | 52 ++++++++ ...slation_service.get_supported_languages.js | 77 +++++++++++ .../translation_service.list_glossaries.js | 85 +++++++++++++ .../translation_service.translate_document.js | 113 +++++++++++++++++ .../translation_service.translate_text.js | 116 +++++++++++++++++ .../samples/package.json | 2 +- .../src/v3/translation_service_client.ts | 6 +- .../src/v3beta1/translation_service_client.ts | 6 +- 23 files changed, 1765 insertions(+), 5 deletions(-) create mode 100644 packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js create mode 100644 packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js create mode 100644 packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js create mode 100644 packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js create mode 100644 packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js create mode 100644 packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js create mode 100644 packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js create mode 100644 packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js create mode 100644 packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js create mode 100644 packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js create mode 100644 packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js create mode 100644 packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js create mode 100644 packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js create mode 100644 packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js create mode 100644 packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js create mode 100644 packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js create mode 100644 packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js create mode 100644 packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js create mode 100644 packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js create mode 100644 packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js new file mode 100644 index 00000000000..0e2dbeb211d --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js @@ -0,0 +1,120 @@ +// Copyright 2021 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. + +'use strict'; + +function main( + parent, + sourceLanguageCode, + targetLanguageCodes, + inputConfigs, + outputConfig +) { + // [START translate_v3_generated_TranslationService_BatchTranslateDocument_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Location to make a regional call. + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * The `global` location is not supported for batch translation. + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. + */ + // const parent = 'abc123' + /** + * Required. The BCP-47 language code of the input document if known, for + * example, "en-US" or "sr-Latn". Supported language codes are listed in + * Language Support (https://cloud.google.com/translate/docs/languages). + */ + // const sourceLanguageCode = 'abc123' + /** + * Required. The BCP-47 language code to use for translation of the input + * document. Specify up to 10 language codes here. + */ + // const targetLanguageCodes = 'abc123' + /** + * Required. Input configurations. + * The total number of files matched should be <= 100. + * The total content size to translate should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + */ + // const inputConfigs = 1234 + /** + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + */ + // const outputConfig = '' + /** + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is the model name. Value can be a built-in general model, + * or an AutoML Translation model. + * The value format depends on model type: + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * If the map is empty or a specific model is + * not requested for a language pair, then default google model (nmt) is used. + */ + // const models = 1234 + /** + * Optional. Glossaries to be applied. It's keyed by target language code. + */ + // const glossaries = 1234 + /** + * Optional. File format conversion map to be applied to all input files. + * Map's key is the original mime_type. Map's value is the target mime_type of + * translated documents. + * Supported file format conversion includes: + * - `application/pdf` to + * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + * If nothing specified, output files will be in the same format as the + * original file. + */ + // const formatConversions = 1234 + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function batchTranslateDocument() { + // Construct request + const request = { + parent, + sourceLanguageCode, + targetLanguageCodes, + inputConfigs, + outputConfig, + }; + + // Run request + const [operation] = await translationClient.batchTranslateDocument(request); + const [response] = await operation.promise(); + console.log(response); + } + + batchTranslateDocument(); + // [END translate_v3_generated_TranslationService_BatchTranslateDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js new file mode 100644 index 00000000000..b7661f7fcf4 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js @@ -0,0 +1,117 @@ +// Copyright 2021 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. + +'use strict'; + +function main( + parent, + sourceLanguageCode, + targetLanguageCodes, + inputConfigs, + outputConfig +) { + // [START translate_v3_generated_TranslationService_BatchTranslateText_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Location to make a call. Must refer to a caller's project. + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * The `global` location is not supported for batch translation. + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. + */ + // const parent = 'abc123' + /** + * Required. Source language code. + */ + // const sourceLanguageCode = 'abc123' + /** + * Required. Specify up to 10 language codes here. + */ + // const targetLanguageCodes = 'abc123' + /** + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is model name. Value can be a built-in general model, + * or an AutoML Translation model. + * The value format depends on model type: + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * If the map is empty or a specific model is + * not requested for a language pair, then default google model (nmt) is used. + */ + // const models = 1234 + /** + * Required. Input configurations. + * The total number of files matched should be <= 100. + * The total content size should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + */ + // const inputConfigs = 1234 + /** + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + */ + // const outputConfig = '' + /** + * Optional. Glossaries to be applied for translation. + * It's keyed by target language code. + */ + // const glossaries = 1234 + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. + */ + // const labels = 1234 + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function batchTranslateText() { + // Construct request + const request = { + parent, + sourceLanguageCode, + targetLanguageCodes, + inputConfigs, + outputConfig, + }; + + // Run request + const [operation] = await translationClient.batchTranslateText(request); + const [response] = await operation.promise(); + console.log(response); + } + + batchTranslateText(); + // [END translate_v3_generated_TranslationService_BatchTranslateText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js new file mode 100644 index 00000000000..eca43f35c28 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js @@ -0,0 +1,58 @@ +// Copyright 2021 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. + +'use strict'; + +function main(parent, glossary) { + // [START translate_v3_generated_TranslationService_CreateGlossary_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project name. + */ + // const parent = 'abc123' + /** + * Required. The glossary to create. + */ + // const glossary = '' + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function createGlossary() { + // Construct request + const request = { + parent, + glossary, + }; + + // Run request + const [operation] = await translationClient.createGlossary(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGlossary(); + // [END translate_v3_generated_TranslationService_CreateGlossary_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js new file mode 100644 index 00000000000..95126dd0cb3 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js @@ -0,0 +1,53 @@ +// Copyright 2021 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. + +'use strict'; + +function main(name) { + // [START translate_v3_generated_TranslationService_DeleteGlossary_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the glossary to delete. + */ + // const name = 'abc123' + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function deleteGlossary() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await translationClient.deleteGlossary(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGlossary(); + // [END translate_v3_generated_TranslationService_DeleteGlossary_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js new file mode 100644 index 00000000000..cfeec36e8d5 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js @@ -0,0 +1,87 @@ +// Copyright 2021 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. + +'use strict'; + +function main(parent) { + // [START translate_v3_generated_TranslationService_DetectLanguage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project or location to make a call. Must refer to a caller's + * project. + * Format: `projects/{project-number-or-id}/locations/{location-id}` or + * `projects/{project-number-or-id}`. + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * Only models within the same region (has same location-id) can be used. + * Otherwise an INVALID_ARGUMENT (400) error is returned. + */ + // const parent = 'abc123' + /** + * Optional. The language detection model to be used. + * Format: + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` + * Only one language detection model is currently supported: + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. + * If not specified, the default model is used. + */ + // const model = 'abc123' + /** + * The content of the input stored as a string. + */ + // const content = 'abc123' + /** + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + */ + // const mimeType = 'abc123' + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. + */ + // const labels = 1234 + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function detectLanguage() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await translationClient.detectLanguage(request); + console.log(response); + } + + detectLanguage(); + // [END translate_v3_generated_TranslationService_DetectLanguage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js new file mode 100644 index 00000000000..d8d98d992d1 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js @@ -0,0 +1,52 @@ +// Copyright 2021 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. + +'use strict'; + +function main(name) { + // [START translate_v3_generated_TranslationService_GetGlossary_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the glossary to retrieve. + */ + // const name = 'abc123' + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function getGlossary() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await translationClient.getGlossary(request); + console.log(response); + } + + getGlossary(); + // [END translate_v3_generated_TranslationService_GetGlossary_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js new file mode 100644 index 00000000000..455408a26e0 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js @@ -0,0 +1,77 @@ +// Copyright 2021 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. + +'use strict'; + +function main(parent) { + // [START translate_v3_generated_TranslationService_GetSupportedLanguages_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project or location to make a call. Must refer to a caller's + * project. + * Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * Non-global location is required for AutoML models. + * Only models within the same region (have same location-id) can be used, + * otherwise an INVALID_ARGUMENT (400) error is returned. + */ + // const parent = 'abc123' + /** + * Optional. The language to use to return localized, human readable names + * of supported languages. If missing, then display names are not returned + * in a response. + */ + // const displayLanguageCode = 'abc123' + /** + * Optional. Get supported languages of this model. + * The format depends on model type: + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * Returns languages supported by the specified model. + * If missing, we get supported languages of Google general NMT model. + */ + // const model = 'abc123' + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function getSupportedLanguages() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await translationClient.getSupportedLanguages(request); + console.log(response); + } + + getSupportedLanguages(); + // [END translate_v3_generated_TranslationService_GetSupportedLanguages_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js new file mode 100644 index 00000000000..e2e78ea38f2 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js @@ -0,0 +1,85 @@ +// Copyright 2021 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. + +'use strict'; + +function main(parent) { + // [START translate_v3_generated_TranslationService_ListGlossaries_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project from which to list all of the glossaries. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter specifying constraints of a list operation. + * Specify the constraint by the format of "key=value", where key must be + * "src" or "tgt", and the value must be a valid language code. + * For multiple restrictions, concatenate them by "AND" (uppercase only), + * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + * here, which means using 'en-US' and 'en' can lead to different results, + * which depends on the language code you used when you create the glossary. + * For the unidirectional glossaries, the "src" and "tgt" add restrictions + * on the source and target language code separately. + * For the equivalent term set glossaries, the "src" and/or "tgt" add + * restrictions on the term set. + * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + * glossaries which exactly match the source language code as "en-US" and the + * target language code "zh-CN", but all equivalent term set glossaries which + * contain "en-US" and "zh-CN" in their language set will be picked. + * If missing, no filtering is performed. + */ + // const filter = 'abc123' + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function listGlossaries() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await translationClient.listGlossariesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGlossaries(); + // [END translate_v3_generated_TranslationService_ListGlossaries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js new file mode 100644 index 00000000000..a46f9083b95 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js @@ -0,0 +1,114 @@ +// Copyright 2021 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. + +'use strict'; + +function main(parent, targetLanguageCode, documentInputConfig) { + // [START translate_v3_generated_TranslationService_TranslateDocument_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Location to make a regional call. + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * Non-global location is required for requests using AutoML models or custom + * glossaries. + * Models and glossaries must be within the same region (have the same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + */ + // const parent = 'abc123' + /** + * Optional. The BCP-47 language code of the input document if known, for + * example, "en-US" or "sr-Latn". Supported language codes are listed in + * Language Support. If the source language isn't specified, the API attempts + * to identify the source language automatically and returns the source + * language within the response. Source language must be specified if the + * request contains a glossary or a custom model. + */ + // const sourceLanguageCode = 'abc123' + /** + * Required. The BCP-47 language code to use for translation of the input + * document, set to one of the language codes listed in Language Support. + */ + // const targetLanguageCode = 'abc123' + /** + * Required. Input configurations. + */ + // const documentInputConfig = '' + /** + * Optional. Output configurations. + * Defines if the output file should be stored within Cloud Storage as well + * as the desired output format. If not provided the translated file will + * only be returned through a byte-stream and its output mime type will be + * the same as the input file's mime type. + */ + // const documentOutputConfig = '' + /** + * Optional. The `model` type requested for this translation. + * The format depends on model type: + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * If not provided, the default Google model (NMT) will be used for + * translation. + */ + // const model = 'abc123' + /** + * Optional. Glossary to be applied. The glossary must be within the same + * region (have the same location-id) as the model, otherwise an + * INVALID_ARGUMENT (400) error is returned. + */ + // const glossaryConfig = '' + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters (Unicode + * codepoints), can only contain lowercase letters, numeric characters, + * underscores and dashes. International characters are allowed. Label values + * are optional. Label keys must start with a letter. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. + */ + // const labels = 1234 + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function translateDocument() { + // Construct request + const request = { + parent, + targetLanguageCode, + documentInputConfig, + }; + + // Run request + const response = await translationClient.translateDocument(request); + console.log(response); + } + + translateDocument(); + // [END translate_v3_generated_TranslationService_TranslateDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js new file mode 100644 index 00000000000..fcb83914304 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js @@ -0,0 +1,117 @@ +// Copyright 2021 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. + +'use strict'; + +function main(contents, targetLanguageCode, parent) { + // [START translate_v3_generated_TranslationService_TranslateText_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The content of the input in string format. + * We recommend the total content be less than 30k codepoints. The max length + * of this field is 1024. + * Use BatchTranslateText for larger text. + */ + // const contents = 'abc123' + /** + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + */ + // const mimeType = 'abc123' + /** + * Optional. The BCP-47 language code of the input text if + * known, for example, "en-US" or "sr-Latn". Supported language codes are + * listed in Language Support. If the source language isn't specified, the API + * attempts to identify the source language automatically and returns the + * source language within the response. + */ + // const sourceLanguageCode = 'abc123' + /** + * Required. The BCP-47 language code to use for translation of the input + * text, set to one of the language codes listed in Language Support. + */ + // const targetLanguageCode = 'abc123' + /** + * Required. Project or location to make a call. Must refer to a caller's + * project. + * Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * Non-global location is required for requests using AutoML models or + * custom glossaries. + * Models and glossaries must be within the same region (have same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + */ + // const parent = 'abc123' + /** + * Optional. The `model` type requested for this translation. + * The format depends on model type: + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * For global (non-regionalized) requests, use `location-id` `global`. + * For example, + * `projects/{project-number-or-id}/locations/global/models/general/nmt`. + * If not provided, the default Google model (NMT) will be used. + */ + // const model = 'abc123' + /** + * Optional. Glossary to be applied. The glossary must be + * within the same region (have the same location-id) as the model, otherwise + * an INVALID_ARGUMENT (400) error is returned. + */ + // const glossaryConfig = '' + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. + */ + // const labels = 1234 + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function translateText() { + // Construct request + const request = { + contents, + targetLanguageCode, + parent, + }; + + // Run request + const response = await translationClient.translateText(request); + console.log(response); + } + + translateText(); + // [END translate_v3_generated_TranslationService_TranslateText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js new file mode 100644 index 00000000000..8b0c787821e --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js @@ -0,0 +1,120 @@ +// Copyright 2021 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. + +'use strict'; + +function main( + parent, + sourceLanguageCode, + targetLanguageCodes, + inputConfigs, + outputConfig +) { + // [START translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Location to make a regional call. + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * The `global` location is not supported for batch translation. + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. + */ + // const parent = 'abc123' + /** + * Required. The BCP-47 language code of the input document if known, for + * example, "en-US" or "sr-Latn". Supported language codes are listed in + * Language Support (https://cloud.google.com/translate/docs/languages). + */ + // const sourceLanguageCode = 'abc123' + /** + * Required. The BCP-47 language code to use for translation of the input + * document. Specify up to 10 language codes here. + */ + // const targetLanguageCodes = 'abc123' + /** + * Required. Input configurations. + * The total number of files matched should be <= 100. + * The total content size to translate should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + */ + // const inputConfigs = 1234 + /** + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + */ + // const outputConfig = '' + /** + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is the model name. Value can be a built-in general model, + * or an AutoML Translation model. + * The value format depends on model type: + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * If the map is empty or a specific model is not requested for a language + * pair, then default google model (nmt) is used. + */ + // const models = 1234 + /** + * Optional. Glossaries to be applied. It's keyed by target language code. + */ + // const glossaries = 1234 + /** + * Optional. File format conversion map to be applied to all input files. + * Map's key is the original mime_type. Map's value is the target mime_type of + * translated documents. + * Supported file format conversion includes: + * - `application/pdf` to + * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + * If nothing specified, output files will be in the same format as the + * original file. + */ + // const formatConversions = 1234 + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function batchTranslateDocument() { + // Construct request + const request = { + parent, + sourceLanguageCode, + targetLanguageCodes, + inputConfigs, + outputConfig, + }; + + // Run request + const [operation] = await translationClient.batchTranslateDocument(request); + const [response] = await operation.promise(); + console.log(response); + } + + batchTranslateDocument(); + // [END translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js new file mode 100644 index 00000000000..7f6ec6b3ecd --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js @@ -0,0 +1,116 @@ +// Copyright 2021 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. + +'use strict'; + +function main( + parent, + sourceLanguageCode, + targetLanguageCodes, + inputConfigs, + outputConfig +) { + // [START translate_v3beta1_generated_TranslationService_BatchTranslateText_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Location to make a call. Must refer to a caller's project. + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * The `global` location is not supported for batch translation. + * Only AutoML Translation models or glossaries within the same region (have + * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * error is returned. + */ + // const parent = 'abc123' + /** + * Required. Source language code. + */ + // const sourceLanguageCode = 'abc123' + /** + * Required. Specify up to 10 language codes here. + */ + // const targetLanguageCodes = 'abc123' + /** + * Optional. The models to use for translation. Map's key is target language + * code. Map's value is model name. Value can be a built-in general model, + * or an AutoML Translation model. + * The value format depends on model type: + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * If the map is empty or a specific model is + * not requested for a language pair, then default google model (nmt) is used. + */ + // const models = 1234 + /** + * Required. Input configurations. + * The total number of files matched should be <= 100. + * The total content size should be <= 100M Unicode codepoints. + * The files must use UTF-8 encoding. + */ + // const inputConfigs = 1234 + /** + * Required. Output configuration. + * If 2 input configs match to the same file (that is, same input path), + * we don't generate output for duplicate inputs. + */ + // const outputConfig = '' + /** + * Optional. Glossaries to be applied for translation. + * It's keyed by target language code. + */ + // const glossaries = 1234 + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://cloud.google.com/translate/docs/labels for more information. + */ + // const labels = 1234 + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function batchTranslateText() { + // Construct request + const request = { + parent, + sourceLanguageCode, + targetLanguageCodes, + inputConfigs, + outputConfig, + }; + + // Run request + const [operation] = await translationClient.batchTranslateText(request); + const [response] = await operation.promise(); + console.log(response); + } + + batchTranslateText(); + // [END translate_v3beta1_generated_TranslationService_BatchTranslateText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js new file mode 100644 index 00000000000..3412d351ca2 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js @@ -0,0 +1,58 @@ +// Copyright 2021 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. + +'use strict'; + +function main(parent, glossary) { + // [START translate_v3beta1_generated_TranslationService_CreateGlossary_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project name. + */ + // const parent = 'abc123' + /** + * Required. The glossary to create. + */ + // const glossary = '' + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function createGlossary() { + // Construct request + const request = { + parent, + glossary, + }; + + // Run request + const [operation] = await translationClient.createGlossary(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGlossary(); + // [END translate_v3beta1_generated_TranslationService_CreateGlossary_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js new file mode 100644 index 00000000000..05fbb762eab --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js @@ -0,0 +1,53 @@ +// Copyright 2021 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. + +'use strict'; + +function main(name) { + // [START translate_v3beta1_generated_TranslationService_DeleteGlossary_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the glossary to delete. + */ + // const name = 'abc123' + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function deleteGlossary() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await translationClient.deleteGlossary(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGlossary(); + // [END translate_v3beta1_generated_TranslationService_DeleteGlossary_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js new file mode 100644 index 00000000000..1ac0dab5248 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js @@ -0,0 +1,86 @@ +// Copyright 2021 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. + +'use strict'; + +function main(parent) { + // [START translate_v3beta1_generated_TranslationService_DetectLanguage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project or location to make a call. Must refer to a caller's + * project. + * Format: `projects/{project-number-or-id}/locations/{location-id}` or + * `projects/{project-number-or-id}`. + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * Only models within the same region (has same location-id) can be used. + * Otherwise an INVALID_ARGUMENT (400) error is returned. + */ + // const parent = 'abc123' + /** + * Optional. The language detection model to be used. + * Format: + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` + * Only one language detection model is currently supported: + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. + * If not specified, the default model is used. + */ + // const model = 'abc123' + /** + * The content of the input stored as a string. + */ + // const content = 'abc123' + /** + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + */ + // const mimeType = 'abc123' + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://cloud.google.com/translate/docs/labels for more information. + */ + // const labels = 1234 + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function detectLanguage() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await translationClient.detectLanguage(request); + console.log(response); + } + + detectLanguage(); + // [END translate_v3beta1_generated_TranslationService_DetectLanguage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js new file mode 100644 index 00000000000..a21b0b156e0 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js @@ -0,0 +1,52 @@ +// Copyright 2021 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. + +'use strict'; + +function main(name) { + // [START translate_v3beta1_generated_TranslationService_GetGlossary_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the glossary to retrieve. + */ + // const name = 'abc123' + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function getGlossary() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await translationClient.getGlossary(request); + console.log(response); + } + + getGlossary(); + // [END translate_v3beta1_generated_TranslationService_GetGlossary_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js new file mode 100644 index 00000000000..af0e86e281c --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js @@ -0,0 +1,77 @@ +// Copyright 2021 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. + +'use strict'; + +function main(parent) { + // [START translate_v3beta1_generated_TranslationService_GetSupportedLanguages_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project or location to make a call. Must refer to a caller's + * project. + * Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * Non-global location is required for AutoML models. + * Only models within the same region (have same location-id) can be used, + * otherwise an INVALID_ARGUMENT (400) error is returned. + */ + // const parent = 'abc123' + /** + * Optional. The language to use to return localized, human readable names + * of supported languages. If missing, then display names are not returned + * in a response. + */ + // const displayLanguageCode = 'abc123' + /** + * Optional. Get supported languages of this model. + * The format depends on model type: + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * Returns languages supported by the specified model. + * If missing, we get supported languages of Google general NMT model. + */ + // const model = 'abc123' + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function getSupportedLanguages() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await translationClient.getSupportedLanguages(request); + console.log(response); + } + + getSupportedLanguages(); + // [END translate_v3beta1_generated_TranslationService_GetSupportedLanguages_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js new file mode 100644 index 00000000000..debef4df299 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js @@ -0,0 +1,85 @@ +// Copyright 2021 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. + +'use strict'; + +function main(parent) { + // [START translate_v3beta1_generated_TranslationService_ListGlossaries_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project from which to list all of the glossaries. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. The server may return fewer glossaries than + * requested. If unspecified, the server picks an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * returned from the previous call to `ListGlossaries` method. + * The first page is returned if `page_token`is empty or missing. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter specifying constraints of a list operation. + * Specify the constraint by the format of "key=value", where key must be + * "src" or "tgt", and the value must be a valid language code. + * For multiple restrictions, concatenate them by "AND" (uppercase only), + * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + * here, which means using 'en-US' and 'en' can lead to different results, + * which depends on the language code you used when you create the glossary. + * For the unidirectional glossaries, the "src" and "tgt" add restrictions + * on the source and target language code separately. + * For the equivalent term set glossaries, the "src" and/or "tgt" add + * restrictions on the term set. + * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + * glossaries which exactly match the source language code as "en-US" and the + * target language code "zh-CN", but all equivalent term set glossaries which + * contain "en-US" and "zh-CN" in their language set will be picked. + * If missing, no filtering is performed. + */ + // const filter = 'abc123' + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function listGlossaries() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await translationClient.listGlossariesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGlossaries(); + // [END translate_v3beta1_generated_TranslationService_ListGlossaries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js new file mode 100644 index 00000000000..a34b457168d --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js @@ -0,0 +1,113 @@ +// Copyright 2021 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. + +'use strict'; + +function main(parent, targetLanguageCode, documentInputConfig) { + // [START translate_v3beta1_generated_TranslationService_TranslateDocument_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Location to make a regional call. + * Format: `projects/{project-number-or-id}/locations/{location-id}`. + * For global calls, use `projects/{project-number-or-id}/locations/global`. + * Non-global location is required for requests using AutoML models or custom + * glossaries. + * Models and glossaries must be within the same region (have the same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + */ + // const parent = 'abc123' + /** + * Optional. The BCP-47 language code of the input document if known, for + * example, "en-US" or "sr-Latn". Supported language codes are listed in + * Language Support. If the source language isn't specified, the API attempts + * to identify the source language automatically and returns the source + * language within the response. Source language must be specified if the + * request contains a glossary or a custom model. + */ + // const sourceLanguageCode = 'abc123' + /** + * Required. The BCP-47 language code to use for translation of the input + * document, set to one of the language codes listed in Language Support. + */ + // const targetLanguageCode = 'abc123' + /** + * Required. Input configurations. + */ + // const documentInputConfig = '' + /** + * Optional. Output configurations. + * Defines if the output file should be stored within Cloud Storage as well + * as the desired output format. If not provided the translated file will + * only be returned through a byte-stream and its output mime type will be + * the same as the input file's mime type. + */ + // const documentOutputConfig = '' + /** + * Optional. The `model` type requested for this translation. + * The format depends on model type: + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * If not provided, the default Google model (NMT) will be used for + * translation. + */ + // const model = 'abc123' + /** + * Optional. Glossary to be applied. The glossary must be within the same + * region (have the same location-id) as the model, otherwise an + * INVALID_ARGUMENT (400) error is returned. + */ + // const glossaryConfig = '' + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters (Unicode + * codepoints), can only contain lowercase letters, numeric characters, + * underscores and dashes. International characters are allowed. Label values + * are optional. Label keys must start with a letter. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. + */ + // const labels = 1234 + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function translateDocument() { + // Construct request + const request = { + parent, + targetLanguageCode, + documentInputConfig, + }; + + // Run request + const response = await translationClient.translateDocument(request); + console.log(response); + } + + translateDocument(); + // [END translate_v3beta1_generated_TranslationService_TranslateDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js new file mode 100644 index 00000000000..a080bd01558 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js @@ -0,0 +1,116 @@ +// Copyright 2021 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. + +'use strict'; + +function main(contents, targetLanguageCode, parent) { + // [START translate_v3beta1_generated_TranslationService_TranslateText_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The content of the input in string format. + * We recommend the total content be less than 30k codepoints. The max length + * of this field is 1024. + * Use BatchTranslateText for larger text. + */ + // const contents = 'abc123' + /** + * Optional. The format of the source text, for example, "text/html", + * "text/plain". If left blank, the MIME type defaults to "text/html". + */ + // const mimeType = 'abc123' + /** + * Optional. The BCP-47 language code of the input text if + * known, for example, "en-US" or "sr-Latn". Supported language codes are + * listed in Language Support. If the source language isn't specified, the API + * attempts to identify the source language automatically and returns the + * source language within the response. + */ + // const sourceLanguageCode = 'abc123' + /** + * Required. The BCP-47 language code to use for translation of the input + * text, set to one of the language codes listed in Language Support. + */ + // const targetLanguageCode = 'abc123' + /** + * Required. Project or location to make a call. Must refer to a caller's + * project. + * Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. + * For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + * Non-global location is required for requests using AutoML models or + * custom glossaries. + * Models and glossaries must be within the same region (have same + * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + */ + // const parent = 'abc123' + /** + * Optional. The `model` type requested for this translation. + * The format depends on model type: + * - AutoML Translation models: + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * - General (built-in) models: + * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * For global (non-regionalized) requests, use `location-id` `global`. + * For example, + * `projects/{project-number-or-id}/locations/global/models/general/nmt`. + * If not provided, the default Google model (NMT) will be used + */ + // const model = 'abc123' + /** + * Optional. Glossary to be applied. The glossary must be + * within the same region (have the same location-id) as the model, otherwise + * an INVALID_ARGUMENT (400) error is returned. + */ + // const glossaryConfig = '' + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints), can only contain lowercase letters, numeric + * characters, underscores and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * See https://cloud.google.com/translate/docs/labels for more information. + */ + // const labels = 1234 + + // Imports the Translation library + const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; + + // Instantiates a client + const translationClient = new TranslationServiceClient(); + + async function translateText() { + // Construct request + const request = { + contents, + targetLanguageCode, + parent, + }; + + // Run request + const response = await translationClient.translateText(request); + console.log(response); + } + + translateText(); + // [END translate_v3beta1_generated_TranslationService_TranslateText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index a055da5f24b..4fb0c8fecc6 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -8,7 +8,7 @@ "!test/" ], "engines": { - "node": ">=8" + "node": ">=10" }, "scripts": { "test": "mocha --recursive --timeout 240000" diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 477be829bbf..fa947886813 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -1901,7 +1901,8 @@ export class TranslationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGlossaries']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGlossaries.createStream( this.innerApiCalls.listGlossaries as gax.GaxCall, @@ -1972,7 +1973,8 @@ export class TranslationServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGlossaries']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGlossaries.asyncIterate( this.innerApiCalls['listGlossaries'] as GaxCall, diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 538e3711396..06cd4b9f463 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -1916,7 +1916,8 @@ export class TranslationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGlossaries']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGlossaries.createStream( this.innerApiCalls.listGlossaries as gax.GaxCall, @@ -1987,7 +1988,8 @@ export class TranslationServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGlossaries']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGlossaries.asyncIterate( this.innerApiCalls['listGlossaries'] as GaxCall, From c988d504c99d7b342805d0d05cf0bc5d6834e90d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 18 Oct 2021 10:29:23 -0700 Subject: [PATCH 461/513] fix: add model signature for batch document translation (#735) PiperOrigin-RevId: 403140062 Source-Link: https://github.com/googleapis/googleapis/commit/67e6e0a1dddaa16691d62c99addd3d762e26a7ce Source-Link: https://github.com/googleapis/googleapis-gen/commit/779ead92cdc2433d84ae5ae53418b1600843224e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzc5ZWFkOTJjZGMyNDMzZDg0YWU1YWU1MzQxOGIxNjAwODQzMjI0ZSJ9 --- .../google/cloud/translate/v3/translation_service.proto | 2 ++ .../cloud/translate/v3beta1/translation_service.proto | 2 ++ packages/google-cloud-translate/protos/protos.json | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto index 070786cef8e..9f7702488db 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto @@ -123,6 +123,8 @@ service TranslationService { post: "/v3/{parent=projects/*/locations/*}:batchTranslateDocument" body: "*" }; + option (google.api.method_signature) = + "parent,source_language_code,target_language_codes,input_configs,output_config"; option (google.longrunning.operation_info) = { response_type: "BatchTranslateDocumentResponse" metadata_type: "BatchTranslateDocumentMetadata" diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto index 03386518d8b..362d3ef334f 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto @@ -120,6 +120,8 @@ service TranslationService { post: "/v3beta1/{parent=projects/*/locations/*}:batchTranslateDocument" body: "*" }; + option (google.api.method_signature) = + "parent,source_language_code,target_language_codes,input_configs,output_config"; option (google.longrunning.operation_info) = { response_type: "BatchTranslateDocumentResponse" metadata_type: "BatchTranslateDocumentMetadata" diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index 7251001d65d..c43468de6bc 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -147,6 +147,7 @@ "options": { "(google.api.http).post": "/v3/{parent=projects/*/locations/*}:batchTranslateDocument", "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,source_language_code,target_language_codes,input_configs,output_config", "(google.longrunning.operation_info).response_type": "BatchTranslateDocumentResponse", "(google.longrunning.operation_info).metadata_type": "BatchTranslateDocumentMetadata" }, @@ -157,6 +158,9 @@ "body": "*" } }, + { + "(google.api.method_signature)": "parent,source_language_code,target_language_codes,input_configs,output_config" + }, { "(google.longrunning.operation_info)": { "response_type": "BatchTranslateDocumentResponse", @@ -1412,6 +1416,7 @@ "options": { "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}:batchTranslateDocument", "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,source_language_code,target_language_codes,input_configs,output_config", "(google.longrunning.operation_info).response_type": "BatchTranslateDocumentResponse", "(google.longrunning.operation_info).metadata_type": "BatchTranslateDocumentMetadata" }, @@ -1422,6 +1427,9 @@ "body": "*" } }, + { + "(google.api.method_signature)": "parent,source_language_code,target_language_codes,input_configs,output_config" + }, { "(google.longrunning.operation_info)": { "response_type": "BatchTranslateDocumentResponse", From dc42783b2aa18664468e1c2115fd3c6eaa4c4a26 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 18 Oct 2021 17:54:10 +0000 Subject: [PATCH 462/513] chore: release 6.3.1 (#736) :robot: I have created a release \*beep\* \*boop\* --- ### [6.3.1](https://www.github.com/googleapis/nodejs-translate/compare/v6.3.0...v6.3.1) (2021-10-18) ### Bug Fixes * add model signature for batch document translation ([#735](https://www.github.com/googleapis/nodejs-translate/issues/735)) ([406c768](https://www.github.com/googleapis/nodejs-translate/commit/406c7684babb00dcda8dfbb07c6210f810972262)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-translate/CHANGELOG.md | 7 +++++++ packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 0e6901bbb9c..b91ec3d08b8 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +### [6.3.1](https://www.github.com/googleapis/nodejs-translate/compare/v6.3.0...v6.3.1) (2021-10-18) + + +### Bug Fixes + +* add model signature for batch document translation ([#735](https://www.github.com/googleapis/nodejs-translate/issues/735)) ([406c768](https://www.github.com/googleapis/nodejs-translate/commit/406c7684babb00dcda8dfbb07c6210f810972262)) + ## [6.3.0](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.7...v6.3.0) (2021-09-13) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index bda808b83f5..e46421a9743 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.3.0", + "version": "6.3.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 4fb0c8fecc6..af48c3f9fde 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.3.0", + "@google-cloud/translate": "^6.3.1", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From a599ea0e4955e9781499226c2f79b3fd4dce8f9e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Oct 2021 23:18:20 +0200 Subject: [PATCH 463/513] chore(deps): update dependency @types/node to v16 (#738) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^14.0.0` -> `^16.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/14.17.32/16.11.6) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/compatibility-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/confidence-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index e46421a9743..359d0a6f4bd 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -58,7 +58,7 @@ "devDependencies": { "@types/extend": "^3.0.0", "@types/mocha": "^8.0.0", - "@types/node": "^14.0.0", + "@types/node": "^16.0.0", "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", "@types/sinon": "^10.0.0", From cf448d19c83b5d083e676680fe16308758605a69 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 3 Nov 2021 12:10:34 -0400 Subject: [PATCH 464/513] chore(cloud-rad): delete api-extractor config (#741) --- .../google-cloud-translate/api-extractor.json | 369 ------------------ 1 file changed, 369 deletions(-) delete mode 100644 packages/google-cloud-translate/api-extractor.json diff --git a/packages/google-cloud-translate/api-extractor.json b/packages/google-cloud-translate/api-extractor.json deleted file mode 100644 index de228294b23..00000000000 --- a/packages/google-cloud-translate/api-extractor.json +++ /dev/null @@ -1,369 +0,0 @@ -/** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - /** - * Optionally specifies another JSON config file that this file extends from. This provides a way for - * standard settings to be shared across multiple projects. - * - * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains - * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be - * resolved using NodeJS require(). - * - * SUPPORTED TOKENS: none - * DEFAULT VALUE: "" - */ - // "extends": "./shared/api-extractor-base.json" - // "extends": "my-package/include/api-extractor-base.json" - - /** - * Determines the "" token that can be used with other config file settings. The project folder - * typically contains the tsconfig.json and package.json config files, but the path is user-defined. - * - * The path is resolved relative to the folder of the config file that contains the setting. - * - * The default value for "projectFolder" is the token "", which means the folder is determined by traversing - * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder - * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error - * will be reported. - * - * SUPPORTED TOKENS: - * DEFAULT VALUE: "" - */ - // "projectFolder": "..", - - /** - * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor - * analyzes the symbols exported by this module. - * - * The file extension must be ".d.ts" and not ".ts". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - */ - "mainEntryPointFilePath": "/protos/protos.d.ts", - - /** - * A list of NPM package names whose exports should be treated as part of this package. - * - * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", - * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part - * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly - * imports library2. To avoid this, we can specify: - * - * "bundledPackages": [ "library2" ], - * - * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been - * local files for library1. - */ - "bundledPackages": [ ], - - /** - * Determines how the TypeScript compiler engine will be invoked by API Extractor. - */ - "compiler": { - /** - * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * Note: This setting will be ignored if "overrideTsconfig" is used. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/tsconfig.json" - */ - // "tsconfigFilePath": "/tsconfig.json", - - /** - * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. - * The object must conform to the TypeScript tsconfig schema: - * - * http://json.schemastore.org/tsconfig - * - * If omitted, then the tsconfig.json file will be read from the "projectFolder". - * - * DEFAULT VALUE: no overrideTsconfig section - */ - // "overrideTsconfig": { - // . . . - // } - - /** - * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended - * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when - * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses - * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. - * - * DEFAULT VALUE: false - */ - // "skipLibCheck": true, - }, - - /** - * Configures how the API report file (*.api.md) will be generated. - */ - "apiReport": { - /** - * (REQUIRED) Whether to generate an API report. - */ - "enabled": true, - - /** - * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce - * a full file path. - * - * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". - * - * SUPPORTED TOKENS: , - * DEFAULT VALUE: ".api.md" - */ - // "reportFileName": ".api.md", - - /** - * Specifies the folder where the API report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, - * e.g. for an API review. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/etc/" - */ - // "reportFolder": "/etc/", - - /** - * Specifies the folder where the temporary report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * After the temporary file is written to disk, it is compared with the file in the "reportFolder". - * If they are different, a production build will fail. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/" - */ - // "reportTempFolder": "/temp/" - }, - - /** - * Configures how the doc model file (*.api.json) will be generated. - */ - "docModel": { - /** - * (REQUIRED) Whether to generate a doc model file. - */ - "enabled": true, - - /** - * The output path for the doc model file. The file extension should be ".api.json". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/.api.json" - */ - // "apiJsonFilePath": "/temp/.api.json" - }, - - /** - * Configures how the .d.ts rollup file will be generated. - */ - "dtsRollup": { - /** - * (REQUIRED) Whether to generate the .d.ts rollup file. - */ - "enabled": true, - - /** - * Specifies the output path for a .d.ts rollup file to be generated without any trimming. - * This file will include all declarations that are exported by the main entry point. - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/dist/.d.ts" - */ - // "untrimmedFilePath": "/dist/.d.ts", - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. - * This file will include only declarations that are marked as "@public" or "@beta". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "betaTrimmedFilePath": "/dist/-beta.d.ts", - - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. - * This file will include only declarations that are marked as "@public". - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "publicTrimmedFilePath": "/dist/-public.d.ts", - - /** - * When a declaration is trimmed, by default it will be replaced by a code comment such as - * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the - * declaration completely. - * - * DEFAULT VALUE: false - */ - // "omitTrimmingComments": true - }, - - /** - * Configures how the tsdoc-metadata.json file will be generated. - */ - "tsdocMetadata": { - /** - * Whether to generate the tsdoc-metadata.json file. - * - * DEFAULT VALUE: true - */ - // "enabled": true, - - /** - * Specifies where the TSDoc metadata file should be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", - * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup - * falls back to "tsdoc-metadata.json" in the package folder. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" - }, - - /** - * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files - * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. - * To use the OS's default newline kind, specify "os". - * - * DEFAULT VALUE: "crlf" - */ - // "newlineKind": "crlf", - - /** - * Configures how API Extractor reports error and warning messages produced during analysis. - * - * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. - */ - "messages": { - /** - * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing - * the input .d.ts files. - * - * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "compilerMessageReporting": { - /** - * Configures the default routing for messages that don't match an explicit rule in this table. - */ - "default": { - /** - * Specifies whether the message should be written to the the tool's output log. Note that - * the "addToApiReportFile" property may supersede this option. - * - * Possible values: "error", "warning", "none" - * - * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail - * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes - * the "--local" option), the warning is displayed but the build will not fail. - * - * DEFAULT VALUE: "warning" - */ - "logLevel": "warning", - - /** - * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), - * then the message will be written inside that file; otherwise, the message is instead logged according to - * the "logLevel" option. - * - * DEFAULT VALUE: false - */ - // "addToApiReportFile": false - }, - - // "TS2551": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by API Extractor during its analysis. - * - * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" - * - * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings - */ - "extractorMessageReporting": { - "default": { - "logLevel": "warning", - // "addToApiReportFile": false - }, - - // "ae-extra-release-tag": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by the TSDoc parser when analyzing code comments. - * - * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "tsdocMessageReporting": { - "default": { - "logLevel": "warning", - // "addToApiReportFile": false - } - - // "tsdoc-link-tag-unescaped-text": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - } - } - -} From ccbba8678d6b72def3bee87d966c9de4931bf3b7 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 3 Nov 2021 15:36:45 -0400 Subject: [PATCH 465/513] chore(cloud-rad): fix links for TSDocs (#742) sed -i -e 's/\[\(.*\)\](\(.*\))/{@link \2| \1}/' src/**/*.ts --- .../google-cloud-translate/src/v2/index.ts | 8 ++--- .../src/v3/translation_service_client.ts | 36 +++++++++---------- .../src/v3beta1/translation_service_client.ts | 36 +++++++++---------- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/packages/google-cloud-translate/src/v2/index.ts b/packages/google-cloud-translate/src/v2/index.ts index 3b4e0aaf718..ed715604524 100644 --- a/packages/google-cloud-translate/src/v2/index.ts +++ b/packages/google-cloud-translate/src/v2/index.ts @@ -103,7 +103,7 @@ export interface TranslateConfig extends GoogleAuthOptions { * native Promises. */ /** - * With [Google Translate](https://cloud.google.com/translate), you can + * With {@link https://cloud.google.com/translate| Google Translate}, you can * dynamically translate text between thousands of language pairs. * * The Google Cloud Translation API lets websites and programs integrate with @@ -293,7 +293,7 @@ export class Translate extends Service { /** * @typedef {object} LanguageResult * @memberof v2 - * @property {string} code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * @property {string} code The {@link https://en.wikipedia.org/wiki/ISO_639-1| ISO 639-1} * language code. * @property {string} name The language name. This can be translated into your * preferred language with the `target` option. @@ -303,7 +303,7 @@ export class Translate extends Service { * @memberof v2 * @param {?Error} err Request error, if any. * @param {object[]} results The languages supported by the API. - * @param {string} results.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) + * @param {string} results.code The {@link https://en.wikipedia.org/wiki/ISO_639-1| ISO 639-1} * language code. * @param {string} results.name The language name. This can be translated into your * preferred language with the `target` option. @@ -425,7 +425,7 @@ export class Translate extends Service { /** * Translate a string or multiple strings into another language. * - * @see [Translate Text](https://cloud.google.com/translate/v2/using_rest#Translate) + * @see {@link https://cloud.google.com/translate/v2/using_rest#Translate| Translate Text} * * @throws {Error} If `options` is provided as an object without a `to` * property. diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index fa947886813..b59441b8c64 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -72,7 +72,7 @@ export class TranslationServiceClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance| this document}. * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -501,7 +501,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3.TranslateTextResponse}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example * const [response] = await client.translateText(request); @@ -627,7 +627,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3.DetectLanguageResponse}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example * const [response] = await client.detectLanguage(request); @@ -751,7 +751,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3.SupportedLanguages}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example * const [response] = await client.getSupportedLanguages(request); @@ -902,7 +902,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TranslateDocumentResponse]{@link google.cloud.translation.v3.TranslateDocumentResponse}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example * const [response] = await client.translateDocument(request); @@ -990,7 +990,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3.Glossary}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example * const [response] = await client.getGlossary(request); @@ -1143,7 +1143,7 @@ export class TranslationServiceClient { * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const [operation] = await client.batchTranslateText(request); @@ -1204,7 +1204,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const decodedOperation = await checkBatchTranslateTextProgress(name); @@ -1343,7 +1343,7 @@ export class TranslationServiceClient { * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const [operation] = await client.batchTranslateDocument(request); @@ -1408,7 +1408,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const decodedOperation = await checkBatchTranslateDocumentProgress(name); @@ -1491,7 +1491,7 @@ export class TranslationServiceClient { * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const [operation] = await client.createGlossary(request); @@ -1552,7 +1552,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const decodedOperation = await checkCreateGlossaryProgress(name); @@ -1634,7 +1634,7 @@ export class TranslationServiceClient { * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const [operation] = await client.deleteGlossary(request); @@ -1695,7 +1695,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const decodedOperation = await checkDeleteGlossaryProgress(name); @@ -1799,7 +1799,7 @@ export class TranslationServiceClient { * We recommend using `listGlossariesAsync()` * method described below for async iteration which you can stop as needed. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} * for more details and examples. */ listGlossaries( @@ -1886,7 +1886,7 @@ export class TranslationServiceClient { * We recommend using `listGlossariesAsync()` * method described below for async iteration which you can stop as needed. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} * for more details and examples. */ listGlossariesStream( @@ -1947,12 +1947,12 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols| async iteration}. * When you iterate the returned iterable, each element will be an object representing * [Glossary]{@link google.cloud.translation.v3.Glossary}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} * for more details and examples. * @example * const iterable = client.listGlossariesAsync(request); diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 06cd4b9f463..892c10974c1 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -72,7 +72,7 @@ export class TranslationServiceClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance| this document}. * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -501,7 +501,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3beta1.TranslateTextResponse}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example * const [response] = await client.translateText(request); @@ -629,7 +629,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3beta1.DetectLanguageResponse}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example * const [response] = await client.detectLanguage(request); @@ -756,7 +756,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3beta1.SupportedLanguages}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example * const [response] = await client.getSupportedLanguages(request); @@ -909,7 +909,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TranslateDocumentResponse]{@link google.cloud.translation.v3beta1.TranslateDocumentResponse}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example * const [response] = await client.translateDocument(request); @@ -1004,7 +1004,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example * const [response] = await client.getGlossary(request); @@ -1158,7 +1158,7 @@ export class TranslationServiceClient { * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const [operation] = await client.batchTranslateText(request); @@ -1219,7 +1219,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const decodedOperation = await checkBatchTranslateTextProgress(name); @@ -1358,7 +1358,7 @@ export class TranslationServiceClient { * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const [operation] = await client.batchTranslateDocument(request); @@ -1423,7 +1423,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const decodedOperation = await checkBatchTranslateDocumentProgress(name); @@ -1506,7 +1506,7 @@ export class TranslationServiceClient { * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const [operation] = await client.createGlossary(request); @@ -1567,7 +1567,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const decodedOperation = await checkCreateGlossaryProgress(name); @@ -1649,7 +1649,7 @@ export class TranslationServiceClient { * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const [operation] = await client.deleteGlossary(request); @@ -1710,7 +1710,7 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example * const decodedOperation = await checkDeleteGlossaryProgress(name); @@ -1814,7 +1814,7 @@ export class TranslationServiceClient { * We recommend using `listGlossariesAsync()` * method described below for async iteration which you can stop as needed. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} * for more details and examples. */ listGlossaries( @@ -1901,7 +1901,7 @@ export class TranslationServiceClient { * We recommend using `listGlossariesAsync()` * method described below for async iteration which you can stop as needed. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} * for more details and examples. */ listGlossariesStream( @@ -1962,12 +1962,12 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols| async iteration}. * When you iterate the returned iterable, each element will be an object representing * [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} * for more details and examples. * @example * const iterable = client.listGlossariesAsync(request); From 32021fdd21cda7c2dc5e2606257286e6b3db6ba6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:46:28 +0100 Subject: [PATCH 466/513] chore(deps): update dependency sinon to v12 (#744) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^11.0.0` -> `^12.0.0`](https://renovatebot.com/diffs/npm/sinon/11.1.2/12.0.1) | [![age](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/compatibility-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/confidence-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v12.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGES.md#​1201) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.0...v12.0.1) - [`3f598221`](https://togithub.com/sinonjs/sinon/commit/3f598221045904681f2b3b3ba1df617ed5e230e3) Fix issue with npm unlink for npm version > 6 (Carl-Erik Kopseng) > 'npm unlink' would implicitly unlink the current dir > until version 7, which requires an argument - [`51417a38`](https://togithub.com/sinonjs/sinon/commit/51417a38111eeeb7cd14338bfb762cc2df487e1b) Fix bundling of cjs module ([#​2412](https://togithub.com/sinonjs/sinon/issues/2412)) (Julian Grinblat) > - Fix bundling of cjs module > > - Run prettier *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2021-11-04.* #### 12.0.0 ### [`v12.0.0`](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0)
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 359d0a6f4bd..7edd9a025c5 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -74,7 +74,7 @@ "mocha": "^8.0.0", "pack-n-play": "^1.0.0-2", "proxyquire": "^2.0.1", - "sinon": "^11.0.0", + "sinon": "^12.0.0", "typescript": "^3.8.3" } } From 8307ad0d548d31d58cc1078a188fba25f6f4ddba Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Fri, 5 Nov 2021 11:16:13 -0400 Subject: [PATCH 467/513] chore(cloud-rad): Add code fencing (#743) Code examples need code fencing around them to distingish from rich text for TSDoc. Internally b/179483748 Script used: https://github.com/fhinkel/cloud-rad-script/blob/main/fixExampleComments.js --- packages/google-cloud-translate/src/index.ts | 23 +++++++++------ .../google-cloud-translate/src/v2/index.ts | 6 ++++ .../src/v3/translation_service_client.ts | 28 +++++++++++++++++++ .../src/v3beta1/translation_service_client.ts | 28 +++++++++++++++++++ 4 files changed, 77 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 58aff8bcf7e..1c62551b4a1 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -29,28 +29,35 @@ import * as v2 from './v2'; * @module {constructor} @google-cloud/translate * @alias nodejs-translate * - * @example Install the v3 client library with npm: + * @example Install the v3 client library with npm: + * ``` * npm install --save @google-cloud/translate * - * @example Import the v3 client library: + * ``` + * @example Import the v3 client library: + * ``` * const {TranslationServiceClient} = require('@google-cloud/translate'); * - * @example Create a v3 client that uses Application Default Credentials - * (ADC): + * ``` + * @example Create a v3 client that uses Application Default Credentials (ADC): + * ``` * const client = new TranslationServiceClient(); * + * ``` * @example include:samples/quickstart.js * region_tag:translate_quickstart * Full quickstart example: * - * @example Install the v3beta1 client library: + * @example Install the v3beta1 client library: + * ``` * npm install --save @google-cloud/translate * - * @example Import the v3beta1 client library: + * ``` + * @example Import the v3beta1 client library: + * ``` * const {TranslationServiceClient} = * require('@google-cloud/translate').v3beta1; + * ``` */ import * as v3beta1 from './v3beta1'; import * as v3 from './v3'; diff --git a/packages/google-cloud-translate/src/v2/index.ts b/packages/google-cloud-translate/src/v2/index.ts index ed715604524..e96893a5ec0 100644 --- a/packages/google-cloud-translate/src/v2/index.ts +++ b/packages/google-cloud-translate/src/v2/index.ts @@ -118,6 +118,7 @@ export interface TranslateConfig extends GoogleAuthOptions { * @param {ClientConfig} [options] Configuration options. * * @example + * ``` * //- * //

Custom Translation API

* // @@ -125,6 +126,7 @@ export interface TranslateConfig extends GoogleAuthOptions { * // a custom backend which our library will send requests to. * //- * + * ``` * @example include:samples/quickstart.js * region_tag:translate_quickstart * Full quickstart example: @@ -188,6 +190,7 @@ export class Translate extends Service { * @returns {Promise} * * @example + * ``` * const {Translate} = require('@google-cloud/translate'); * * const translate = new Translate(); @@ -237,6 +240,7 @@ export class Translate extends Service { * const apiResponse = data[2]; * }); * + * ``` * @example include:samples/translate.js * region_tag:translate_detect_language * Here's a full example: @@ -439,6 +443,7 @@ export class Translate extends Service { * @returns {Promise} * * @example + * ``` * //- * // Pass a string and a language code to get the translation. * //- @@ -489,6 +494,7 @@ export class Translate extends Service { * const apiResponse = data[1]; * }); * + * ``` * @example include:samples/translate.js * region_tag:translate_translate_text * Full translation example: diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index b59441b8c64..31986eb45be 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -504,7 +504,9 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example + * ``` * const [response] = await client.translateText(request); + * ``` */ translateText( request?: protos.google.cloud.translation.v3.ITranslateTextRequest, @@ -630,7 +632,9 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example + * ``` * const [response] = await client.detectLanguage(request); + * ``` */ detectLanguage( request?: protos.google.cloud.translation.v3.IDetectLanguageRequest, @@ -754,7 +758,9 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example + * ``` * const [response] = await client.getSupportedLanguages(request); + * ``` */ getSupportedLanguages( request?: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, @@ -905,7 +911,9 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example + * ``` * const [response] = await client.translateDocument(request); + * ``` */ translateDocument( request?: protos.google.cloud.translation.v3.ITranslateDocumentRequest, @@ -993,7 +1001,9 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example + * ``` * const [response] = await client.getGlossary(request); + * ``` */ getGlossary( request?: protos.google.cloud.translation.v3.IGetGlossaryRequest, @@ -1146,8 +1156,10 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const [operation] = await client.batchTranslateText(request); * const [response] = await operation.promise(); + * ``` */ batchTranslateText( request?: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, @@ -1207,10 +1219,12 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const decodedOperation = await checkBatchTranslateTextProgress(name); * console.log(decodedOperation.result); * console.log(decodedOperation.done); * console.log(decodedOperation.metadata); + * ``` */ async checkBatchTranslateTextProgress( name: string @@ -1346,8 +1360,10 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const [operation] = await client.batchTranslateDocument(request); * const [response] = await operation.promise(); + * ``` */ batchTranslateDocument( request?: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, @@ -1411,10 +1427,12 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const decodedOperation = await checkBatchTranslateDocumentProgress(name); * console.log(decodedOperation.result); * console.log(decodedOperation.done); * console.log(decodedOperation.metadata); + * ``` */ async checkBatchTranslateDocumentProgress( name: string @@ -1494,8 +1512,10 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const [operation] = await client.createGlossary(request); * const [response] = await operation.promise(); + * ``` */ createGlossary( request?: protos.google.cloud.translation.v3.ICreateGlossaryRequest, @@ -1555,10 +1575,12 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const decodedOperation = await checkCreateGlossaryProgress(name); * console.log(decodedOperation.result); * console.log(decodedOperation.done); * console.log(decodedOperation.metadata); + * ``` */ async checkCreateGlossaryProgress( name: string @@ -1637,8 +1659,10 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const [operation] = await client.deleteGlossary(request); * const [response] = await operation.promise(); + * ``` */ deleteGlossary( request?: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, @@ -1698,10 +1722,12 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const decodedOperation = await checkDeleteGlossaryProgress(name); * console.log(decodedOperation.result); * console.log(decodedOperation.done); * console.log(decodedOperation.metadata); + * ``` */ async checkDeleteGlossaryProgress( name: string @@ -1955,10 +1981,12 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} * for more details and examples. * @example + * ``` * const iterable = client.listGlossariesAsync(request); * for await (const response of iterable) { * // process response * } + * ``` */ listGlossariesAsync( request?: protos.google.cloud.translation.v3.IListGlossariesRequest, diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 892c10974c1..a1efee33ec0 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -504,7 +504,9 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example + * ``` * const [response] = await client.translateText(request); + * ``` */ translateText( request?: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, @@ -632,7 +634,9 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example + * ``` * const [response] = await client.detectLanguage(request); + * ``` */ detectLanguage( request?: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, @@ -759,7 +763,9 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example + * ``` * const [response] = await client.getSupportedLanguages(request); + * ``` */ getSupportedLanguages( request?: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, @@ -912,7 +918,9 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example + * ``` * const [response] = await client.translateDocument(request); + * ``` */ translateDocument( request?: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, @@ -1007,7 +1015,9 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} * for more details and examples. * @example + * ``` * const [response] = await client.getGlossary(request); + * ``` */ getGlossary( request?: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, @@ -1161,8 +1171,10 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const [operation] = await client.batchTranslateText(request); * const [response] = await operation.promise(); + * ``` */ batchTranslateText( request?: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, @@ -1222,10 +1234,12 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const decodedOperation = await checkBatchTranslateTextProgress(name); * console.log(decodedOperation.result); * console.log(decodedOperation.done); * console.log(decodedOperation.metadata); + * ``` */ async checkBatchTranslateTextProgress( name: string @@ -1361,8 +1375,10 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const [operation] = await client.batchTranslateDocument(request); * const [response] = await operation.promise(); + * ``` */ batchTranslateDocument( request?: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, @@ -1426,10 +1442,12 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const decodedOperation = await checkBatchTranslateDocumentProgress(name); * console.log(decodedOperation.result); * console.log(decodedOperation.done); * console.log(decodedOperation.metadata); + * ``` */ async checkBatchTranslateDocumentProgress( name: string @@ -1509,8 +1527,10 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const [operation] = await client.createGlossary(request); * const [response] = await operation.promise(); + * ``` */ createGlossary( request?: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, @@ -1570,10 +1590,12 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const decodedOperation = await checkCreateGlossaryProgress(name); * console.log(decodedOperation.result); * console.log(decodedOperation.done); * console.log(decodedOperation.metadata); + * ``` */ async checkCreateGlossaryProgress( name: string @@ -1652,8 +1674,10 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const [operation] = await client.deleteGlossary(request); * const [response] = await operation.promise(); + * ``` */ deleteGlossary( request?: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, @@ -1713,10 +1737,12 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} * for more details and examples. * @example + * ``` * const decodedOperation = await checkDeleteGlossaryProgress(name); * console.log(decodedOperation.result); * console.log(decodedOperation.done); * console.log(decodedOperation.metadata); + * ``` */ async checkDeleteGlossaryProgress( name: string @@ -1970,10 +1996,12 @@ export class TranslationServiceClient { * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} * for more details and examples. * @example + * ``` * const iterable = client.listGlossariesAsync(request); * for await (const response of iterable) { * // process response * } + * ``` */ listGlossariesAsync( request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, From ba4abb12781d1579b4594615f1b0d5ee31dd550e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 22 Nov 2021 17:14:25 +0000 Subject: [PATCH 468/513] docs(samples): add example tags to generated samples (#745) PiperOrigin-RevId: 408439482 Source-Link: https://github.com/googleapis/googleapis/commit/b9f61843dc80c7c285fc34fd3a40aae55082c2b9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../linkinator.config.json | 2 +- ...lation_service.batch_translate_document.js | 6 +- ...ranslation_service.batch_translate_text.js | 6 +- .../v3/translation_service.create_glossary.js | 6 +- .../v3/translation_service.delete_glossary.js | 4 +- .../v3/translation_service.detect_language.js | 4 +- .../v3/translation_service.get_glossary.js | 4 +- ...slation_service.get_supported_languages.js | 4 +- .../v3/translation_service.list_glossaries.js | 6 +- .../translation_service.translate_document.js | 10 +- .../v3/translation_service.translate_text.js | 6 +- ...lation_service.batch_translate_document.js | 6 +- ...ranslation_service.batch_translate_text.js | 6 +- .../translation_service.create_glossary.js | 6 +- .../translation_service.delete_glossary.js | 4 +- .../translation_service.detect_language.js | 4 +- .../translation_service.get_glossary.js | 4 +- ...slation_service.get_supported_languages.js | 4 +- .../translation_service.list_glossaries.js | 6 +- .../translation_service.translate_document.js | 10 +- .../translation_service.translate_text.js | 6 +- .../src/v3/translation_service_client.ts | 726 ++++++++--------- .../src/v3beta1/translation_service_client.ts | 738 ++++++++---------- 23 files changed, 741 insertions(+), 837 deletions(-) diff --git a/packages/google-cloud-translate/linkinator.config.json b/packages/google-cloud-translate/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-translate/linkinator.config.json +++ b/packages/google-cloud-translate/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js index 0e2dbeb211d..c04bb397eba 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js @@ -57,7 +57,7 @@ function main( * If 2 input configs match to the same file (that is, same input path), * we don't generate output for duplicate inputs. */ - // const outputConfig = '' + // const outputConfig = {} /** * Optional. The models to use for translation. Map's key is target language * code. Map's value is the model name. Value can be a built-in general model, @@ -93,7 +93,7 @@ function main( // Instantiates a client const translationClient = new TranslationServiceClient(); - async function batchTranslateDocument() { + async function callBatchTranslateDocument() { // Construct request const request = { parent, @@ -109,7 +109,7 @@ function main( console.log(response); } - batchTranslateDocument(); + callBatchTranslateDocument(); // [END translate_v3_generated_TranslationService_BatchTranslateDocument_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js index b7661f7fcf4..a86dfb966ac 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js @@ -67,7 +67,7 @@ function main( * If 2 input configs match to the same file (that is, same input path), * we don't generate output for duplicate inputs. */ - // const outputConfig = '' + // const outputConfig = {} /** * Optional. Glossaries to be applied for translation. * It's keyed by target language code. @@ -90,7 +90,7 @@ function main( // Instantiates a client const translationClient = new TranslationServiceClient(); - async function batchTranslateText() { + async function callBatchTranslateText() { // Construct request const request = { parent, @@ -106,7 +106,7 @@ function main( console.log(response); } - batchTranslateText(); + callBatchTranslateText(); // [END translate_v3_generated_TranslationService_BatchTranslateText_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js index eca43f35c28..f5454f12544 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js @@ -26,7 +26,7 @@ function main(parent, glossary) { /** * Required. The glossary to create. */ - // const glossary = '' + // const glossary = {} // Imports the Translation library const {TranslationServiceClient} = require('@google-cloud/translate').v3; @@ -34,7 +34,7 @@ function main(parent, glossary) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function createGlossary() { + async function callCreateGlossary() { // Construct request const request = { parent, @@ -47,7 +47,7 @@ function main(parent, glossary) { console.log(response); } - createGlossary(); + callCreateGlossary(); // [END translate_v3_generated_TranslationService_CreateGlossary_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js index 95126dd0cb3..4828e7e5b2c 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js @@ -30,7 +30,7 @@ function main(name) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function deleteGlossary() { + async function callDeleteGlossary() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - deleteGlossary(); + callDeleteGlossary(); // [END translate_v3_generated_TranslationService_DeleteGlossary_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js index cfeec36e8d5..508a8291f19 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js @@ -65,7 +65,7 @@ function main(parent) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function detectLanguage() { + async function callDetectLanguage() { // Construct request const request = { parent, @@ -76,7 +76,7 @@ function main(parent) { console.log(response); } - detectLanguage(); + callDetectLanguage(); // [END translate_v3_generated_TranslationService_DetectLanguage_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js index d8d98d992d1..462e2506c8d 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js @@ -30,7 +30,7 @@ function main(name) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function getGlossary() { + async function callGetGlossary() { // Construct request const request = { name, @@ -41,7 +41,7 @@ function main(name) { console.log(response); } - getGlossary(); + callGetGlossary(); // [END translate_v3_generated_TranslationService_GetGlossary_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js index 455408a26e0..5544ce47328 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js @@ -55,7 +55,7 @@ function main(parent) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function getSupportedLanguages() { + async function callGetSupportedLanguages() { // Construct request const request = { parent, @@ -66,7 +66,7 @@ function main(parent) { console.log(response); } - getSupportedLanguages(); + callGetSupportedLanguages(); // [END translate_v3_generated_TranslationService_GetSupportedLanguages_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js index e2e78ea38f2..b741bd1ffd6 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js @@ -30,7 +30,7 @@ function main(parent) { // const pageSize = 1234 /** * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * Typically, this is the value of ListGlossariesResponse.next_page_token * returned from the previous call to `ListGlossaries` method. * The first page is returned if `page_token`is empty or missing. */ @@ -61,7 +61,7 @@ function main(parent) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function listGlossaries() { + async function callListGlossaries() { // Construct request const request = { parent, @@ -74,7 +74,7 @@ function main(parent) { } } - listGlossaries(); + callListGlossaries(); // [END translate_v3_generated_TranslationService_ListGlossaries_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js index a46f9083b95..475010be7c0 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js @@ -47,7 +47,7 @@ function main(parent, targetLanguageCode, documentInputConfig) { /** * Required. Input configurations. */ - // const documentInputConfig = '' + // const documentInputConfig = {} /** * Optional. Output configurations. * Defines if the output file should be stored within Cloud Storage as well @@ -55,7 +55,7 @@ function main(parent, targetLanguageCode, documentInputConfig) { * only be returned through a byte-stream and its output mime type will be * the same as the input file's mime type. */ - // const documentOutputConfig = '' + // const documentOutputConfig = {} /** * Optional. The `model` type requested for this translation. * The format depends on model type: @@ -72,7 +72,7 @@ function main(parent, targetLanguageCode, documentInputConfig) { * region (have the same location-id) as the model, otherwise an * INVALID_ARGUMENT (400) error is returned. */ - // const glossaryConfig = '' + // const glossaryConfig = {} /** * Optional. The labels with user-defined metadata for the request. * Label keys and values can be no longer than 63 characters (Unicode @@ -90,7 +90,7 @@ function main(parent, targetLanguageCode, documentInputConfig) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function translateDocument() { + async function callTranslateDocument() { // Construct request const request = { parent, @@ -103,7 +103,7 @@ function main(parent, targetLanguageCode, documentInputConfig) { console.log(response); } - translateDocument(); + callTranslateDocument(); // [END translate_v3_generated_TranslationService_TranslateDocument_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js index fcb83914304..eb7f32d051c 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js @@ -75,7 +75,7 @@ function main(contents, targetLanguageCode, parent) { * within the same region (have the same location-id) as the model, otherwise * an INVALID_ARGUMENT (400) error is returned. */ - // const glossaryConfig = '' + // const glossaryConfig = {} /** * Optional. The labels with user-defined metadata for the request. * Label keys and values can be no longer than 63 characters @@ -93,7 +93,7 @@ function main(contents, targetLanguageCode, parent) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function translateText() { + async function callTranslateText() { // Construct request const request = { contents, @@ -106,7 +106,7 @@ function main(contents, targetLanguageCode, parent) { console.log(response); } - translateText(); + callTranslateText(); // [END translate_v3_generated_TranslationService_TranslateText_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js index 8b0c787821e..d712cf9a8f2 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js @@ -57,7 +57,7 @@ function main( * If 2 input configs match to the same file (that is, same input path), * we don't generate output for duplicate inputs. */ - // const outputConfig = '' + // const outputConfig = {} /** * Optional. The models to use for translation. Map's key is target language * code. Map's value is the model name. Value can be a built-in general model, @@ -93,7 +93,7 @@ function main( // Instantiates a client const translationClient = new TranslationServiceClient(); - async function batchTranslateDocument() { + async function callBatchTranslateDocument() { // Construct request const request = { parent, @@ -109,7 +109,7 @@ function main( console.log(response); } - batchTranslateDocument(); + callBatchTranslateDocument(); // [END translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js index 7f6ec6b3ecd..0d10a2da009 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js @@ -67,7 +67,7 @@ function main( * If 2 input configs match to the same file (that is, same input path), * we don't generate output for duplicate inputs. */ - // const outputConfig = '' + // const outputConfig = {} /** * Optional. Glossaries to be applied for translation. * It's keyed by target language code. @@ -89,7 +89,7 @@ function main( // Instantiates a client const translationClient = new TranslationServiceClient(); - async function batchTranslateText() { + async function callBatchTranslateText() { // Construct request const request = { parent, @@ -105,7 +105,7 @@ function main( console.log(response); } - batchTranslateText(); + callBatchTranslateText(); // [END translate_v3beta1_generated_TranslationService_BatchTranslateText_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js index 3412d351ca2..42652ee9178 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js @@ -26,7 +26,7 @@ function main(parent, glossary) { /** * Required. The glossary to create. */ - // const glossary = '' + // const glossary = {} // Imports the Translation library const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; @@ -34,7 +34,7 @@ function main(parent, glossary) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function createGlossary() { + async function callCreateGlossary() { // Construct request const request = { parent, @@ -47,7 +47,7 @@ function main(parent, glossary) { console.log(response); } - createGlossary(); + callCreateGlossary(); // [END translate_v3beta1_generated_TranslationService_CreateGlossary_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js index 05fbb762eab..1868d6ca909 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js @@ -30,7 +30,7 @@ function main(name) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function deleteGlossary() { + async function callDeleteGlossary() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - deleteGlossary(); + callDeleteGlossary(); // [END translate_v3beta1_generated_TranslationService_DeleteGlossary_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js index 1ac0dab5248..93e83b80032 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js @@ -64,7 +64,7 @@ function main(parent) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function detectLanguage() { + async function callDetectLanguage() { // Construct request const request = { parent, @@ -75,7 +75,7 @@ function main(parent) { console.log(response); } - detectLanguage(); + callDetectLanguage(); // [END translate_v3beta1_generated_TranslationService_DetectLanguage_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js index a21b0b156e0..bf53b48fd21 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js @@ -30,7 +30,7 @@ function main(name) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function getGlossary() { + async function callGetGlossary() { // Construct request const request = { name, @@ -41,7 +41,7 @@ function main(name) { console.log(response); } - getGlossary(); + callGetGlossary(); // [END translate_v3beta1_generated_TranslationService_GetGlossary_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js index af0e86e281c..e4bb43dbbfc 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js @@ -55,7 +55,7 @@ function main(parent) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function getSupportedLanguages() { + async function callGetSupportedLanguages() { // Construct request const request = { parent, @@ -66,7 +66,7 @@ function main(parent) { console.log(response); } - getSupportedLanguages(); + callGetSupportedLanguages(); // [END translate_v3beta1_generated_TranslationService_GetSupportedLanguages_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js index debef4df299..de9e6908873 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js @@ -30,7 +30,7 @@ function main(parent) { // const pageSize = 1234 /** * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of [ListGlossariesResponse.next_page_token] + * Typically, this is the value of ListGlossariesResponse.next_page_token * returned from the previous call to `ListGlossaries` method. * The first page is returned if `page_token`is empty or missing. */ @@ -61,7 +61,7 @@ function main(parent) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function listGlossaries() { + async function callListGlossaries() { // Construct request const request = { parent, @@ -74,7 +74,7 @@ function main(parent) { } } - listGlossaries(); + callListGlossaries(); // [END translate_v3beta1_generated_TranslationService_ListGlossaries_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js index a34b457168d..f6e7ff9cb22 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js @@ -46,7 +46,7 @@ function main(parent, targetLanguageCode, documentInputConfig) { /** * Required. Input configurations. */ - // const documentInputConfig = '' + // const documentInputConfig = {} /** * Optional. Output configurations. * Defines if the output file should be stored within Cloud Storage as well @@ -54,7 +54,7 @@ function main(parent, targetLanguageCode, documentInputConfig) { * only be returned through a byte-stream and its output mime type will be * the same as the input file's mime type. */ - // const documentOutputConfig = '' + // const documentOutputConfig = {} /** * Optional. The `model` type requested for this translation. * The format depends on model type: @@ -71,7 +71,7 @@ function main(parent, targetLanguageCode, documentInputConfig) { * region (have the same location-id) as the model, otherwise an * INVALID_ARGUMENT (400) error is returned. */ - // const glossaryConfig = '' + // const glossaryConfig = {} /** * Optional. The labels with user-defined metadata for the request. * Label keys and values can be no longer than 63 characters (Unicode @@ -89,7 +89,7 @@ function main(parent, targetLanguageCode, documentInputConfig) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function translateDocument() { + async function callTranslateDocument() { // Construct request const request = { parent, @@ -102,7 +102,7 @@ function main(parent, targetLanguageCode, documentInputConfig) { console.log(response); } - translateDocument(); + callTranslateDocument(); // [END translate_v3beta1_generated_TranslationService_TranslateDocument_async] } diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js index a080bd01558..ae15a4dda12 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js @@ -75,7 +75,7 @@ function main(contents, targetLanguageCode, parent) { * within the same region (have the same location-id) as the model, otherwise * an INVALID_ARGUMENT (400) error is returned. */ - // const glossaryConfig = '' + // const glossaryConfig = {} /** * Optional. The labels with user-defined metadata for the request. * Label keys and values can be no longer than 63 characters @@ -92,7 +92,7 @@ function main(contents, targetLanguageCode, parent) { // Instantiates a client const translationClient = new TranslationServiceClient(); - async function translateText() { + async function callTranslateText() { // Construct request const request = { contents, @@ -105,7 +105,7 @@ function main(contents, targetLanguageCode, parent) { console.log(response); } - translateText(); + callTranslateText(); // [END translate_v3beta1_generated_TranslationService_TranslateText_async] } diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 31986eb45be..31356432773 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -72,7 +72,7 @@ export class TranslationServiceClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance| this document}. + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -397,37 +397,6 @@ export class TranslationServiceClient { // ------------------- // -- Service calls -- // ------------------- - translateText( - request?: protos.google.cloud.translation.v3.ITranslateTextRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3.ITranslateTextResponse, - protos.google.cloud.translation.v3.ITranslateTextRequest | undefined, - {} | undefined - ] - >; - translateText( - request: protos.google.cloud.translation.v3.ITranslateTextRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.translation.v3.ITranslateTextResponse, - | protos.google.cloud.translation.v3.ITranslateTextRequest - | null - | undefined, - {} | null | undefined - > - ): void; - translateText( - request: protos.google.cloud.translation.v3.ITranslateTextRequest, - callback: Callback< - protos.google.cloud.translation.v3.ITranslateTextResponse, - | protos.google.cloud.translation.v3.ITranslateTextRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Translates input text and returns translated text. * @@ -501,13 +470,42 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3.TranslateTextResponse}. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * ``` - * const [response] = await client.translateText(request); - * ``` + * @example include:samples/generated/v3/translation_service.translate_text.js + * region_tag:translate_v3_generated_TranslationService_TranslateText_async */ + translateText( + request?: protos.google.cloud.translation.v3.ITranslateTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3.ITranslateTextResponse, + protos.google.cloud.translation.v3.ITranslateTextRequest | undefined, + {} | undefined + ] + >; + translateText( + request: protos.google.cloud.translation.v3.ITranslateTextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.ITranslateTextResponse, + | protos.google.cloud.translation.v3.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + translateText( + request: protos.google.cloud.translation.v3.ITranslateTextRequest, + callback: Callback< + protos.google.cloud.translation.v3.ITranslateTextResponse, + | protos.google.cloud.translation.v3.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; translateText( request?: protos.google.cloud.translation.v3.ITranslateTextRequest, optionsOrCallback?: @@ -551,37 +549,6 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.translateText(request, options, callback); } - detectLanguage( - request?: protos.google.cloud.translation.v3.IDetectLanguageRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3.IDetectLanguageResponse, - protos.google.cloud.translation.v3.IDetectLanguageRequest | undefined, - {} | undefined - ] - >; - detectLanguage( - request: protos.google.cloud.translation.v3.IDetectLanguageRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.translation.v3.IDetectLanguageResponse, - | protos.google.cloud.translation.v3.IDetectLanguageRequest - | null - | undefined, - {} | null | undefined - > - ): void; - detectLanguage( - request: protos.google.cloud.translation.v3.IDetectLanguageRequest, - callback: Callback< - protos.google.cloud.translation.v3.IDetectLanguageResponse, - | protos.google.cloud.translation.v3.IDetectLanguageRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Detects the language of text within a request. * @@ -629,13 +596,42 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3.DetectLanguageResponse}. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * ``` - * const [response] = await client.detectLanguage(request); - * ``` + * @example include:samples/generated/v3/translation_service.detect_language.js + * region_tag:translate_v3_generated_TranslationService_DetectLanguage_async */ + detectLanguage( + request?: protos.google.cloud.translation.v3.IDetectLanguageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3.IDetectLanguageResponse, + protos.google.cloud.translation.v3.IDetectLanguageRequest | undefined, + {} | undefined + ] + >; + detectLanguage( + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.IDetectLanguageResponse, + | protos.google.cloud.translation.v3.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + detectLanguage( + request: protos.google.cloud.translation.v3.IDetectLanguageRequest, + callback: Callback< + protos.google.cloud.translation.v3.IDetectLanguageResponse, + | protos.google.cloud.translation.v3.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined + > + ): void; detectLanguage( request?: protos.google.cloud.translation.v3.IDetectLanguageRequest, optionsOrCallback?: @@ -679,40 +675,6 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.detectLanguage(request, options, callback); } - getSupportedLanguages( - request?: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3.ISupportedLanguages, - ( - | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest - | undefined - ), - {} | undefined - ] - >; - getSupportedLanguages( - request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.translation.v3.ISupportedLanguages, - | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest - | null - | undefined, - {} | null | undefined - > - ): void; - getSupportedLanguages( - request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, - callback: Callback< - protos.google.cloud.translation.v3.ISupportedLanguages, - | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Returns a list of supported languages for translation. * @@ -755,13 +717,45 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3.SupportedLanguages}. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * ``` - * const [response] = await client.getSupportedLanguages(request); - * ``` + * @example include:samples/generated/v3/translation_service.get_supported_languages.js + * region_tag:translate_v3_generated_TranslationService_GetSupportedLanguages_async */ + getSupportedLanguages( + request?: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3.ISupportedLanguages, + ( + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | undefined + ), + {} | undefined + ] + >; + getSupportedLanguages( + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.ISupportedLanguages, + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSupportedLanguages( + request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, + callback: Callback< + protos.google.cloud.translation.v3.ISupportedLanguages, + | protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined + > + ): void; getSupportedLanguages( request?: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, optionsOrCallback?: @@ -808,37 +802,6 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.getSupportedLanguages(request, options, callback); } - translateDocument( - request?: protos.google.cloud.translation.v3.ITranslateDocumentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3.ITranslateDocumentResponse, - protos.google.cloud.translation.v3.ITranslateDocumentRequest | undefined, - {} | undefined - ] - >; - translateDocument( - request: protos.google.cloud.translation.v3.ITranslateDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.translation.v3.ITranslateDocumentResponse, - | protos.google.cloud.translation.v3.ITranslateDocumentRequest - | null - | undefined, - {} | null | undefined - > - ): void; - translateDocument( - request: protos.google.cloud.translation.v3.ITranslateDocumentRequest, - callback: Callback< - protos.google.cloud.translation.v3.ITranslateDocumentResponse, - | protos.google.cloud.translation.v3.ITranslateDocumentRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Translates documents in synchronous mode. * @@ -908,13 +871,42 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TranslateDocumentResponse]{@link google.cloud.translation.v3.TranslateDocumentResponse}. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * ``` - * const [response] = await client.translateDocument(request); - * ``` + * @example include:samples/generated/v3/translation_service.translate_document.js + * region_tag:translate_v3_generated_TranslationService_TranslateDocument_async */ + translateDocument( + request?: protos.google.cloud.translation.v3.ITranslateDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3.ITranslateDocumentResponse, + protos.google.cloud.translation.v3.ITranslateDocumentRequest | undefined, + {} | undefined + ] + >; + translateDocument( + request: protos.google.cloud.translation.v3.ITranslateDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.translation.v3.ITranslateDocumentResponse, + | protos.google.cloud.translation.v3.ITranslateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + translateDocument( + request: protos.google.cloud.translation.v3.ITranslateDocumentRequest, + callback: Callback< + protos.google.cloud.translation.v3.ITranslateDocumentResponse, + | protos.google.cloud.translation.v3.ITranslateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; translateDocument( request?: protos.google.cloud.translation.v3.ITranslateDocumentRequest, optionsOrCallback?: @@ -958,6 +950,24 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.translateDocument(request, options, callback); } + /** + * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3.Glossary}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/translation_service.get_glossary.js + * region_tag:translate_v3_generated_TranslationService_GetGlossary_async + */ getGlossary( request?: protos.google.cloud.translation.v3.IGetGlossaryRequest, options?: CallOptions @@ -985,26 +995,6 @@ export class TranslationServiceClient { {} | null | undefined > ): void; - /** - * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3.Glossary}. - * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} - * for more details and examples. - * @example - * ``` - * const [response] = await client.getGlossary(request); - * ``` - */ getGlossary( request?: protos.google.cloud.translation.v3.IGetGlossaryRequest, optionsOrCallback?: @@ -1036,53 +1026,17 @@ export class TranslationServiceClient { } else { options = optionsOrCallback as CallOptions; } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - name: request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getGlossary(request, options, callback); - } - - batchTranslateText( - request?: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3.IBatchTranslateResponse, - protos.google.cloud.translation.v3.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchTranslateText( - request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3.IBatchTranslateResponse, - protos.google.cloud.translation.v3.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchTranslateText( - request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3.IBatchTranslateResponse, - protos.google.cloud.translation.v3.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getGlossary(request, options, callback); + } + /** * Translates a large volume of text in asynchronous batch mode. * This function provides real-time output as the inputs are being processed. @@ -1153,14 +1107,47 @@ export class TranslationServiceClient { * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * ``` - * const [operation] = await client.batchTranslateText(request); - * const [response] = await operation.promise(); - * ``` + * @example include:samples/generated/v3/translation_service.batch_translate_text.js + * region_tag:translate_v3_generated_TranslationService_BatchTranslateText_async */ + batchTranslateText( + request?: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchTranslateText( + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchTranslateText( + request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateResponse, + protos.google.cloud.translation.v3.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchTranslateText( request?: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, optionsOrCallback?: @@ -1216,15 +1203,10 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * ``` - * const decodedOperation = await checkBatchTranslateTextProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * ``` + * @example include:samples/generated/v3/translation_service.batch_translate_text.js + * region_tag:translate_v3_generated_TranslationService_BatchTranslateText_async */ async checkBatchTranslateTextProgress( name: string @@ -1248,42 +1230,6 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3.BatchTranslateMetadata >; } - batchTranslateDocument( - request?: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, - protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchTranslateDocument( - request: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, - protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchTranslateDocument( - request: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, - protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Translates a large volume of document in asynchronous batch mode. * This function provides real-time output as the inputs are being processed. @@ -1357,14 +1303,47 @@ export class TranslationServiceClient { * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * ``` - * const [operation] = await client.batchTranslateDocument(request); - * const [response] = await operation.promise(); - * ``` + * @example include:samples/generated/v3/translation_service.batch_translate_document.js + * region_tag:translate_v3_generated_TranslationService_BatchTranslateDocument_async */ + batchTranslateDocument( + request?: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchTranslateDocument( + request: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchTranslateDocument( + request: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchTranslateDocument( request?: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, optionsOrCallback?: @@ -1424,15 +1403,10 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * ``` - * const decodedOperation = await checkBatchTranslateDocumentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * ``` + * @example include:samples/generated/v3/translation_service.batch_translate_document.js + * region_tag:translate_v3_generated_TranslationService_BatchTranslateDocument_async */ async checkBatchTranslateDocumentProgress( name: string @@ -1456,6 +1430,28 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3.BatchTranslateDocumentMetadata >; } + /** + * Creates a glossary and returns the long-running operation. Returns + * NOT_FOUND, if the project doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project name. + * @param {google.cloud.translation.v3.Glossary} request.glossary + * Required. The glossary to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/translation_service.create_glossary.js + * region_tag:translate_v3_generated_TranslationService_CreateGlossary_async + */ createGlossary( request?: protos.google.cloud.translation.v3.ICreateGlossaryRequest, options?: CallOptions @@ -1492,31 +1488,6 @@ export class TranslationServiceClient { {} | null | undefined > ): void; - /** - * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project name. - * @param {google.cloud.translation.v3.Glossary} request.glossary - * Required. The glossary to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} - * for more details and examples. - * @example - * ``` - * const [operation] = await client.createGlossary(request); - * const [response] = await operation.promise(); - * ``` - */ createGlossary( request?: protos.google.cloud.translation.v3.ICreateGlossaryRequest, optionsOrCallback?: @@ -1572,15 +1543,10 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * ``` - * const decodedOperation = await checkCreateGlossaryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * ``` + * @example include:samples/generated/v3/translation_service.create_glossary.js + * region_tag:translate_v3_generated_TranslationService_CreateGlossary_async */ async checkCreateGlossaryProgress( name: string @@ -1604,6 +1570,27 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3.CreateGlossaryMetadata >; } + /** + * Deletes a glossary, or cancels glossary construction + * if the glossary isn't created yet. + * Returns NOT_FOUND, if the glossary doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/translation_service.delete_glossary.js + * region_tag:translate_v3_generated_TranslationService_DeleteGlossary_async + */ deleteGlossary( request?: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, options?: CallOptions @@ -1640,30 +1627,6 @@ export class TranslationServiceClient { {} | null | undefined > ): void; - /** - * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} - * for more details and examples. - * @example - * ``` - * const [operation] = await client.deleteGlossary(request); - * const [response] = await operation.promise(); - * ``` - */ deleteGlossary( request?: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, optionsOrCallback?: @@ -1719,15 +1682,10 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * ``` - * const decodedOperation = await checkDeleteGlossaryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * ``` + * @example include:samples/generated/v3/translation_service.delete_glossary.js + * region_tag:translate_v3_generated_TranslationService_DeleteGlossary_async */ async checkDeleteGlossaryProgress( name: string @@ -1751,37 +1709,6 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3.DeleteGlossaryMetadata >; } - listGlossaries( - request?: protos.google.cloud.translation.v3.IListGlossariesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3.IGlossary[], - protos.google.cloud.translation.v3.IListGlossariesRequest | null, - protos.google.cloud.translation.v3.IListGlossariesResponse - ] - >; - listGlossaries( - request: protos.google.cloud.translation.v3.IListGlossariesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.translation.v3.IListGlossariesRequest, - | protos.google.cloud.translation.v3.IListGlossariesResponse - | null - | undefined, - protos.google.cloud.translation.v3.IGlossary - > - ): void; - listGlossaries( - request: protos.google.cloud.translation.v3.IListGlossariesRequest, - callback: PaginationCallback< - protos.google.cloud.translation.v3.IListGlossariesRequest, - | protos.google.cloud.translation.v3.IListGlossariesResponse - | null - | undefined, - protos.google.cloud.translation.v3.IGlossary - > - ): void; /** * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't * exist. @@ -1825,9 +1752,40 @@ export class TranslationServiceClient { * We recommend using `listGlossariesAsync()` * method described below for async iteration which you can stop as needed. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listGlossaries( + request?: protos.google.cloud.translation.v3.IListGlossariesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3.IGlossary[], + protos.google.cloud.translation.v3.IListGlossariesRequest | null, + protos.google.cloud.translation.v3.IListGlossariesResponse + ] + >; + listGlossaries( + request: protos.google.cloud.translation.v3.IListGlossariesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.translation.v3.IListGlossariesRequest, + | protos.google.cloud.translation.v3.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3.IGlossary + > + ): void; + listGlossaries( + request: protos.google.cloud.translation.v3.IListGlossariesRequest, + callback: PaginationCallback< + protos.google.cloud.translation.v3.IListGlossariesRequest, + | protos.google.cloud.translation.v3.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3.IGlossary + > + ): void; listGlossaries( request?: protos.google.cloud.translation.v3.IListGlossariesRequest, optionsOrCallback?: @@ -1912,7 +1870,7 @@ export class TranslationServiceClient { * We recommend using `listGlossariesAsync()` * method described below for async iteration which you can stop as needed. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ listGlossariesStream( @@ -1973,20 +1931,15 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols| async iteration}. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing * [Glossary]{@link google.cloud.translation.v3.Glossary}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * ``` - * const iterable = client.listGlossariesAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` + * @example include:samples/generated/v3/translation_service.list_glossaries.js + * region_tag:translate_v3_generated_TranslationService_ListGlossaries_async */ listGlossariesAsync( request?: protos.google.cloud.translation.v3.IListGlossariesRequest, @@ -2000,7 +1953,6 @@ export class TranslationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listGlossaries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index a1efee33ec0..ac09fae0c8e 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -72,7 +72,7 @@ export class TranslationServiceClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance| this document}. + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -398,37 +398,6 @@ export class TranslationServiceClient { // ------------------- // -- Service calls -- // ------------------- - translateText( - request?: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - protos.google.cloud.translation.v3beta1.ITranslateTextRequest | undefined, - {} | undefined - ] - >; - translateText( - request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - | protos.google.cloud.translation.v3beta1.ITranslateTextRequest - | null - | undefined, - {} | null | undefined - > - ): void; - translateText( - request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, - callback: Callback< - protos.google.cloud.translation.v3beta1.ITranslateTextResponse, - | protos.google.cloud.translation.v3beta1.ITranslateTextRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Translates input text and returns translated text. * @@ -501,13 +470,42 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3beta1.TranslateTextResponse}. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * ``` - * const [response] = await client.translateText(request); - * ``` + * @example include:samples/generated/v3beta1/translation_service.translate_text.js + * region_tag:translate_v3beta1_generated_TranslationService_TranslateText_async */ + translateText( + request?: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + protos.google.cloud.translation.v3beta1.ITranslateTextRequest | undefined, + {} | undefined + ] + >; + translateText( + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + | protos.google.cloud.translation.v3beta1.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + translateText( + request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.ITranslateTextResponse, + | protos.google.cloud.translation.v3beta1.ITranslateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; translateText( request?: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, optionsOrCallback?: @@ -551,40 +549,6 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.translateText(request, options, callback); } - detectLanguage( - request?: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - ( - | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest - | undefined - ), - {} | undefined - ] - >; - detectLanguage( - request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest - | null - | undefined, - {} | null | undefined - > - ): void; - detectLanguage( - request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, - callback: Callback< - protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, - | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Detects the language of text within a request. * @@ -631,13 +595,45 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3beta1.DetectLanguageResponse}. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * ``` - * const [response] = await client.detectLanguage(request); - * ``` + * @example include:samples/generated/v3beta1/translation_service.detect_language.js + * region_tag:translate_v3beta1_generated_TranslationService_DetectLanguage_async */ + detectLanguage( + request?: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + ( + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | undefined + ), + {} | undefined + ] + >; + detectLanguage( + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + detectLanguage( + request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, + | protos.google.cloud.translation.v3beta1.IDetectLanguageRequest + | null + | undefined, + {} | null | undefined + > + ): void; detectLanguage( request?: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, optionsOrCallback?: @@ -684,40 +680,6 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.detectLanguage(request, options, callback); } - getSupportedLanguages( - request?: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - ( - | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest - | undefined - ), - {} | undefined - ] - >; - getSupportedLanguages( - request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest - | null - | undefined, - {} | null | undefined - > - ): void; - getSupportedLanguages( - request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, - callback: Callback< - protos.google.cloud.translation.v3beta1.ISupportedLanguages, - | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Returns a list of supported languages for translation. * @@ -760,13 +722,45 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3beta1.SupportedLanguages}. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * ``` - * const [response] = await client.getSupportedLanguages(request); - * ``` + * @example include:samples/generated/v3beta1/translation_service.get_supported_languages.js + * region_tag:translate_v3beta1_generated_TranslationService_GetSupportedLanguages_async */ + getSupportedLanguages( + request?: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + ( + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | undefined + ), + {} | undefined + ] + >; + getSupportedLanguages( + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSupportedLanguages( + request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.ISupportedLanguages, + | protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest + | null + | undefined, + {} | null | undefined + > + ): void; getSupportedLanguages( request?: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, optionsOrCallback?: @@ -813,40 +807,6 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.getSupportedLanguages(request, options, callback); } - translateDocument( - request?: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, - ( - | protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest - | undefined - ), - {} | undefined - ] - >; - translateDocument( - request: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, - | protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest - | null - | undefined, - {} | null | undefined - > - ): void; - translateDocument( - request: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, - callback: Callback< - protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, - | protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Translates documents in synchronous mode. * @@ -915,13 +875,45 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TranslateDocumentResponse]{@link google.cloud.translation.v3beta1.TranslateDocumentResponse}. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * ``` - * const [response] = await client.translateDocument(request); - * ``` + * @example include:samples/generated/v3beta1/translation_service.translate_document.js + * region_tag:translate_v3beta1_generated_TranslationService_TranslateDocument_async */ + translateDocument( + request?: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, + ( + | protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest + | undefined + ), + {} | undefined + ] + >; + translateDocument( + request: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, + | protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + translateDocument( + request: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, + callback: Callback< + protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, + | protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; translateDocument( request?: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, optionsOrCallback?: @@ -968,6 +960,24 @@ export class TranslationServiceClient { this.initialize(); return this.innerApiCalls.translateDocument(request, options, callback); } + /** + * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3beta1/translation_service.get_glossary.js + * region_tag:translate_v3beta1_generated_TranslationService_GetGlossary_async + */ getGlossary( request?: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, options?: CallOptions @@ -999,26 +1009,6 @@ export class TranslationServiceClient { {} | null | undefined > ): void; - /** - * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. - * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods| documentation} - * for more details and examples. - * @example - * ``` - * const [response] = await client.getGlossary(request); - * ``` - */ getGlossary( request?: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, optionsOrCallback?: @@ -1052,53 +1042,17 @@ export class TranslationServiceClient { } else { options = optionsOrCallback as CallOptions; } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - name: request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getGlossary(request, options, callback); - } - - batchTranslateText( - request?: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchTranslateText( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchTranslateText( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getGlossary(request, options, callback); + } + /** * Translates a large volume of text in asynchronous batch mode. * This function provides real-time output as the inputs are being processed. @@ -1168,14 +1122,47 @@ export class TranslationServiceClient { * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * ``` - * const [operation] = await client.batchTranslateText(request); - * const [response] = await operation.promise(); - * ``` + * @example include:samples/generated/v3beta1/translation_service.batch_translate_text.js + * region_tag:translate_v3beta1_generated_TranslationService_BatchTranslateText_async */ + batchTranslateText( + request?: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchTranslateText( + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchTranslateText( + request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchTranslateText( request?: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, optionsOrCallback?: @@ -1231,15 +1218,10 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * ``` - * const decodedOperation = await checkBatchTranslateTextProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * ``` + * @example include:samples/generated/v3beta1/translation_service.batch_translate_text.js + * region_tag:translate_v3beta1_generated_TranslationService_BatchTranslateText_async */ async checkBatchTranslateTextProgress( name: string @@ -1263,42 +1245,6 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3beta1.BatchTranslateMetadata >; } - batchTranslateDocument( - request?: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchTranslateDocument( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchTranslateDocument( - request: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, - callback: Callback< - LROperation< - protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, - protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Translates a large volume of documents in asynchronous batch mode. * This function provides real-time output as the inputs are being processed. @@ -1372,14 +1318,47 @@ export class TranslationServiceClient { * a long running operation. Its `promise()` method returns a promise * you can `await` for. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * ``` - * const [operation] = await client.batchTranslateDocument(request); - * const [response] = await operation.promise(); - * ``` + * @example include:samples/generated/v3beta1/translation_service.batch_translate_document.js + * region_tag:translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async */ + batchTranslateDocument( + request?: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchTranslateDocument( + request: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchTranslateDocument( + request: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, + callback: Callback< + LROperation< + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, + protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchTranslateDocument( request?: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, optionsOrCallback?: @@ -1439,15 +1418,10 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * ``` - * const decodedOperation = await checkBatchTranslateDocumentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * ``` + * @example include:samples/generated/v3beta1/translation_service.batch_translate_document.js + * region_tag:translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async */ async checkBatchTranslateDocumentProgress( name: string @@ -1471,6 +1445,28 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata >; } + /** + * Creates a glossary and returns the long-running operation. Returns + * NOT_FOUND, if the project doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project name. + * @param {google.cloud.translation.v3beta1.Glossary} request.glossary + * Required. The glossary to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3beta1/translation_service.create_glossary.js + * region_tag:translate_v3beta1_generated_TranslationService_CreateGlossary_async + */ createGlossary( request?: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, options?: CallOptions @@ -1507,31 +1503,6 @@ export class TranslationServiceClient { {} | null | undefined > ): void; - /** - * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project name. - * @param {google.cloud.translation.v3beta1.Glossary} request.glossary - * Required. The glossary to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} - * for more details and examples. - * @example - * ``` - * const [operation] = await client.createGlossary(request); - * const [response] = await operation.promise(); - * ``` - */ createGlossary( request?: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, optionsOrCallback?: @@ -1587,15 +1558,10 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * ``` - * const decodedOperation = await checkCreateGlossaryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * ``` + * @example include:samples/generated/v3beta1/translation_service.create_glossary.js + * region_tag:translate_v3beta1_generated_TranslationService_CreateGlossary_async */ async checkCreateGlossaryProgress( name: string @@ -1619,6 +1585,27 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3beta1.CreateGlossaryMetadata >; } + /** + * Deletes a glossary, or cancels glossary construction + * if the glossary isn't created yet. + * Returns NOT_FOUND, if the glossary doesn't exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the glossary to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3beta1/translation_service.delete_glossary.js + * region_tag:translate_v3beta1_generated_TranslationService_DeleteGlossary_async + */ deleteGlossary( request?: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, options?: CallOptions @@ -1655,30 +1642,6 @@ export class TranslationServiceClient { {} | null | undefined > ): void; - /** - * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the glossary to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} - * for more details and examples. - * @example - * ``` - * const [operation] = await client.deleteGlossary(request); - * const [response] = await operation.promise(); - * ``` - */ deleteGlossary( request?: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, optionsOrCallback?: @@ -1734,15 +1697,10 @@ export class TranslationServiceClient { * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * ``` - * const decodedOperation = await checkDeleteGlossaryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * ``` + * @example include:samples/generated/v3beta1/translation_service.delete_glossary.js + * region_tag:translate_v3beta1_generated_TranslationService_DeleteGlossary_async */ async checkDeleteGlossaryProgress( name: string @@ -1766,37 +1724,6 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3beta1.DeleteGlossaryMetadata >; } - listGlossaries( - request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.translation.v3beta1.IGlossary[], - protos.google.cloud.translation.v3beta1.IListGlossariesRequest | null, - protos.google.cloud.translation.v3beta1.IListGlossariesResponse - ] - >; - listGlossaries( - request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - | protos.google.cloud.translation.v3beta1.IListGlossariesResponse - | null - | undefined, - protos.google.cloud.translation.v3beta1.IGlossary - > - ): void; - listGlossaries( - request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - callback: PaginationCallback< - protos.google.cloud.translation.v3beta1.IListGlossariesRequest, - | protos.google.cloud.translation.v3beta1.IListGlossariesResponse - | null - | undefined, - protos.google.cloud.translation.v3beta1.IGlossary - > - ): void; /** * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't * exist. @@ -1840,9 +1767,40 @@ export class TranslationServiceClient { * We recommend using `listGlossariesAsync()` * method described below for async iteration which you can stop as needed. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listGlossaries( + request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.translation.v3beta1.IGlossary[], + protos.google.cloud.translation.v3beta1.IListGlossariesRequest | null, + protos.google.cloud.translation.v3beta1.IListGlossariesResponse + ] + >; + listGlossaries( + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + | protos.google.cloud.translation.v3beta1.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3beta1.IGlossary + > + ): void; + listGlossaries( + request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + callback: PaginationCallback< + protos.google.cloud.translation.v3beta1.IListGlossariesRequest, + | protos.google.cloud.translation.v3beta1.IListGlossariesResponse + | null + | undefined, + protos.google.cloud.translation.v3beta1.IGlossary + > + ): void; listGlossaries( request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, optionsOrCallback?: @@ -1927,7 +1885,7 @@ export class TranslationServiceClient { * We recommend using `listGlossariesAsync()` * method described below for async iteration which you can stop as needed. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ listGlossariesStream( @@ -1988,20 +1946,15 @@ export class TranslationServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols| async iteration}. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing * [Glossary]{@link google.cloud.translation.v3beta1.Glossary}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the - * {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination| documentation} + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * ``` - * const iterable = client.listGlossariesAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` + * @example include:samples/generated/v3beta1/translation_service.list_glossaries.js + * region_tag:translate_v3beta1_generated_TranslationService_ListGlossaries_async */ listGlossariesAsync( request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, @@ -2015,7 +1968,6 @@ export class TranslationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listGlossaries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); From 8decd6b3fc8176a6f17a11fd7a7c04f742ec86dc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 9 Dec 2021 22:44:33 +0000 Subject: [PATCH 469/513] build: add generated samples to .eslintignore (#748) --- packages/google-cloud-translate/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-translate/.eslintignore b/packages/google-cloud-translate/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-translate/.eslintignore +++ b/packages/google-cloud-translate/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From 9d43974601fe6b88dce69f8c98caca70a8aa35b6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Dec 2021 20:06:24 +0000 Subject: [PATCH 470/513] docs(node): support "stable"/"preview" release level (#1312) (#751) --- packages/google-cloud-translate/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 1b90c889c4f..2d113d6b371 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -143,6 +143,8 @@ are addressed with the highest priority. + + More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From d017b9f986b0f7c332eeee3b9b39f0425a375773 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Dec 2021 23:30:10 +0000 Subject: [PATCH 471/513] docs(badges): tweak badge to use new preview/stable language (#1314) (#752) --- packages/google-cloud-translate/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 2d113d6b371..07ee72119e2 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -6,7 +6,6 @@ [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/translate.svg)](https://www.npmjs.org/package/@google-cloud/translate) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-translate/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-translate) From c32c32c3caefbb08e847d1b47c1164e9f2daea56 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 11:52:09 -0500 Subject: [PATCH 472/513] test(nodejs): remove 15 add 16 (#1322) (#754) Source-Link: https://github.com/googleapis/synthtool/commit/6981da4f29c0ae3dd783d58f1be5ab222d6a5642 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:3563b6b264989c4f5aa31a3682e4df36c95756cfef275d3201508947cbfc511e Co-authored-by: Owl Bot --- packages/google-cloud-translate/protos/protos.d.ts | 2 +- packages/google-cloud-translate/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index 130c922f3d2..23bf0162498 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index eb78c393d80..214151b63a9 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 15d09925d6ab49188e9f55e807e6967492d0c01a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 11 Jan 2022 18:19:31 +0100 Subject: [PATCH 473/513] chore(deps): update dependency gts to v3 (#756) See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Benjamin E. Coe --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 7edd9a025c5..6d3b2ee9e74 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -65,7 +65,7 @@ "c8": "^7.0.0", "codecov": "^3.0.2", "google-auth-library": "^6.0.0", - "gts": "^2.0.0", + "gts": "^3.0.0", "http2spy": "^2.0.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", From 57cef1d479f4fef7567f754b8bc13dbd44d2311c Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 12 Jan 2022 13:15:44 -0500 Subject: [PATCH 474/513] chore: add api_shortname and library_type to repo metadata (#750) --- packages/google-cloud-translate/.repo-metadata.json | 6 ++++-- packages/google-cloud-translate/README.md | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-translate/.repo-metadata.json b/packages/google-cloud-translate/.repo-metadata.json index 1a6d26e6752..df42d3c00dc 100644 --- a/packages/google-cloud-translate/.repo-metadata.json +++ b/packages/google-cloud-translate/.repo-metadata.json @@ -1,6 +1,6 @@ { "distribution_name": "@google-cloud/translate", - "release_level": "ga", + "release_level": "stable", "product_documentation": "https://cloud.google.com/translate/docs/", "repo": "googleapis/nodejs-translate", "default_version": "v3", @@ -11,5 +11,7 @@ "name": "translate", "name_pretty": "Cloud Translation", "api_id": "translate.googleapis.com", - "codeowner_team": "@googleapis/ml-apis" + "codeowner_team": "@googleapis/ml-apis", + "api_shortname": "translate", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 07ee72119e2..3c753f88d37 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -4,7 +4,7 @@ # [Cloud Translation: Node.js Client](https://github.com/googleapis/nodejs-translate) -[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/translate.svg)](https://www.npmjs.org/package/@google-cloud/translate) @@ -132,10 +132,10 @@ _Legacy Node.js versions are supported as a best effort:_ This library follows [Semantic Versioning](http://semver.org/). -This library is considered to be **General Availability (GA)**. This means it -is stable; the code surface will not change in backwards-incompatible ways + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **GA** libraries +an extensive deprecation period. Issues and requests against **stable** libraries are addressed with the highest priority. @@ -143,7 +143,6 @@ are addressed with the highest priority. - More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From f59c1c3ea340ffa15d4ddc312e5f382743269b24 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 26 Jan 2022 19:56:18 +0000 Subject: [PATCH 475/513] chore: update v2.12.0 gapic-generator-typescript (#760) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 424244721 Source-Link: https://github.com/googleapis/googleapis/commit/4b6b01f507ebc3df95fdf8e1d76b0ae0ae33e52c Source-Link: https://github.com/googleapis/googleapis-gen/commit/8ac83fba606d008c7e8a42e7d55b6596ec4be35f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGFjODNmYmE2MDZkMDA4YzdlOGE0MmU3ZDU1YjY1OTZlYzRiZTM1ZiJ9 --- packages/google-cloud-translate/.jsdoc.js | 4 ++-- packages/google-cloud-translate/linkinator.config.json | 10 ++++++++-- .../v3/translation_service.batch_translate_document.js | 9 ++------- .../v3/translation_service.batch_translate_text.js | 9 ++------- .../v3/translation_service.create_glossary.js | 1 + .../v3/translation_service.delete_glossary.js | 1 + .../v3/translation_service.detect_language.js | 1 + .../generated/v3/translation_service.get_glossary.js | 1 + .../v3/translation_service.get_supported_languages.js | 1 + .../v3/translation_service.list_glossaries.js | 5 +++-- .../v3/translation_service.translate_document.js | 1 + .../generated/v3/translation_service.translate_text.js | 1 + .../translation_service.batch_translate_document.js | 9 ++------- .../translation_service.batch_translate_text.js | 9 ++------- .../v3beta1/translation_service.create_glossary.js | 1 + .../v3beta1/translation_service.delete_glossary.js | 1 + .../v3beta1/translation_service.detect_language.js | 1 + .../v3beta1/translation_service.get_glossary.js | 1 + .../translation_service.get_supported_languages.js | 1 + .../v3beta1/translation_service.list_glossaries.js | 5 +++-- .../v3beta1/translation_service.translate_document.js | 1 + .../v3beta1/translation_service.translate_text.js | 1 + packages/google-cloud-translate/src/v3/index.ts | 2 +- .../src/v3/translation_service_client.ts | 2 +- packages/google-cloud-translate/src/v3beta1/index.ts | 2 +- .../src/v3beta1/translation_service_client.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-translate/system-test/install.ts | 2 +- .../test/gapic_translation_service_v3.ts | 2 +- .../test/gapic_translation_service_v3beta1.ts | 2 +- 31 files changed, 47 insertions(+), 45 deletions(-) diff --git a/packages/google-cloud-translate/.jsdoc.js b/packages/google-cloud-translate/.jsdoc.js index 0a8a25c2efa..2f0f785e54e 100644 --- a/packages/google-cloud-translate/.jsdoc.js +++ b/packages/google-cloud-translate/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2021 Google LLC', + copyright: 'Copyright 2022 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/translate', diff --git a/packages/google-cloud-translate/linkinator.config.json b/packages/google-cloud-translate/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-translate/linkinator.config.json +++ b/packages/google-cloud-translate/linkinator.config.json @@ -3,8 +3,14 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" ], "silent": true, - "concurrency": 5 + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 } diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js index c04bb397eba..dd92515812c 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js @@ -12,15 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main( - parent, - sourceLanguageCode, - targetLanguageCodes, - inputConfigs, - outputConfig -) { +function main(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig) { // [START translate_v3_generated_TranslationService_BatchTranslateDocument_async] /** * TODO(developer): Uncomment these variables before running the sample. diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js index a86dfb966ac..b239fcbb6cf 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js @@ -12,15 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main( - parent, - sourceLanguageCode, - targetLanguageCodes, - inputConfigs, - outputConfig -) { +function main(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig) { // [START translate_v3_generated_TranslationService_BatchTranslateText_async] /** * TODO(developer): Uncomment these variables before running the sample. diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js index f5454f12544..d7304465d25 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, glossary) { diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js index 4828e7e5b2c..23e855551b2 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js index 508a8291f19..3f27c790482 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js index 462e2506c8d..c3c87f222d5 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js index 5544ce47328..890114f5192 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js index b741bd1ffd6..849895840a1 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -30,7 +31,7 @@ function main(parent) { // const pageSize = 1234 /** * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of ListGlossariesResponse.next_page_token + * Typically, this is the value of ListGlossariesResponse.next_page_token * returned from the previous call to `ListGlossaries` method. * The first page is returned if `page_token`is empty or missing. */ @@ -70,7 +71,7 @@ function main(parent) { // Run request const iterable = await translationClient.listGlossariesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js index 475010be7c0..509574955f2 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, targetLanguageCode, documentInputConfig) { diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js index eb7f32d051c..b2c5107864c 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(contents, targetLanguageCode, parent) { diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js index d712cf9a8f2..0ef646a2837 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js @@ -12,15 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main( - parent, - sourceLanguageCode, - targetLanguageCodes, - inputConfigs, - outputConfig -) { +function main(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig) { // [START translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async] /** * TODO(developer): Uncomment these variables before running the sample. diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js index 0d10a2da009..4fad7d6b087 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js @@ -12,15 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main( - parent, - sourceLanguageCode, - targetLanguageCodes, - inputConfigs, - outputConfig -) { +function main(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig) { // [START translate_v3beta1_generated_TranslationService_BatchTranslateText_async] /** * TODO(developer): Uncomment these variables before running the sample. diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js index 42652ee9178..185289e47eb 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, glossary) { diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js index 1868d6ca909..bfb77a6a09c 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js index 93e83b80032..21bfe1de2a2 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js index bf53b48fd21..c1025ff9225 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js index e4bb43dbbfc..8fe8dab2cf7 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js index de9e6908873..9d2ccc7a879 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -30,7 +31,7 @@ function main(parent) { // const pageSize = 1234 /** * Optional. A token identifying a page of results the server should return. - * Typically, this is the value of ListGlossariesResponse.next_page_token + * Typically, this is the value of ListGlossariesResponse.next_page_token * returned from the previous call to `ListGlossaries` method. * The first page is returned if `page_token`is empty or missing. */ @@ -70,7 +71,7 @@ function main(parent) { // Run request const iterable = await translationClient.listGlossariesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js index f6e7ff9cb22..ff1974a8b8f 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, targetLanguageCode, documentInputConfig) { diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js index ae15a4dda12..fb9b9d257c4 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(contents, targetLanguageCode, parent) { diff --git a/packages/google-cloud-translate/src/v3/index.ts b/packages/google-cloud-translate/src/v3/index.ts index 46c4e3c5aa0..46c99bab76a 100644 --- a/packages/google-cloud-translate/src/v3/index.ts +++ b/packages/google-cloud-translate/src/v3/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 31356432773..549b08d8b92 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/src/v3beta1/index.ts b/packages/google-cloud-translate/src/v3beta1/index.ts index 46c4e3c5aa0..46c99bab76a 100644 --- a/packages/google-cloud-translate/src/v3beta1/index.ts +++ b/packages/google-cloud-translate/src/v3beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index ac09fae0c8e..ec097bef619 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js index 46a6206922b..ece56feb1d4 100644 --- a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts index 6c04cfbdbb1..38feffe8bea 100644 --- a/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-translate/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/system-test/install.ts b/packages/google-cloud-translate/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-translate/system-test/install.ts +++ b/packages/google-cloud-translate/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts index 5ab25331dbc..852f8a2ab52 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts index d5d7e7d5efd..231b79cd3f8 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From bf571429f00867d1cc5a0f7ade55d1ed8af082db Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 31 Jan 2022 23:34:24 +0100 Subject: [PATCH 476/513] chore(deps): update dependency sinon to v13 (#762) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^12.0.0` -> `^13.0.0`](https://renovatebot.com/diffs/npm/sinon/12.0.1/13.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/compatibility-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/confidence-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v13.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1300) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.1...v13.0.0) - [`cf3d6c0c`](https://togithub.com/sinonjs/sinon/commit/cf3d6c0cd9689c0ee673b3daa8bf9abd70304392) Upgrade packages ([#​2431](https://togithub.com/sinonjs/sinon/issues/2431)) (Carl-Erik Kopseng) > - Update all @​sinonjs/ packages > > - Upgrade to fake-timers 9 > > - chore: ensure always using latest LTS release - [`41710467`](https://togithub.com/sinonjs/sinon/commit/417104670d575e96a1b645ea40ce763afa76fb1b) Adjust deploy scripts to archive old releases in a separate branch, move existing releases out of master ([#​2426](https://togithub.com/sinonjs/sinon/issues/2426)) (Joel Bradshaw) > Co-authored-by: Carl-Erik Kopseng - [`c80a7266`](https://togithub.com/sinonjs/sinon/commit/c80a72660e89d88b08275eff1028ecb9e26fd8e9) Bump node-fetch from 2.6.1 to 2.6.7 ([#​2430](https://togithub.com/sinonjs/sinon/issues/2430)) (dependabot\[bot]) > Co-authored-by: dependabot\[bot] <49699333+dependabot\[bot][@​users](https://togithub.com/users).noreply.github.com> - [`a00f14a9`](https://togithub.com/sinonjs/sinon/commit/a00f14a97dbe8c65afa89674e16ad73fc7d2fdc0) Add explicit export for `./*` ([#​2413](https://togithub.com/sinonjs/sinon/issues/2413)) (なつき) - [`b82ca7ad`](https://togithub.com/sinonjs/sinon/commit/b82ca7ad9b1add59007771f65a18ee34415de8ca) Bump cached-path-relative from 1.0.2 to 1.1.0 ([#​2428](https://togithub.com/sinonjs/sinon/issues/2428)) (dependabot\[bot]) - [`a9ea1427`](https://togithub.com/sinonjs/sinon/commit/a9ea142716c094ef3c432ecc4089f8207b8dd8b6) Add documentation for assert.calledOnceWithMatch ([#​2424](https://togithub.com/sinonjs/sinon/issues/2424)) (Mathias Schreck) - [`1d5ab86b`](https://togithub.com/sinonjs/sinon/commit/1d5ab86ba60e50dd69593ffed2bffd4b8faa0d38) Be more general in stripping off stack frames to fix Firefox tests ([#​2425](https://togithub.com/sinonjs/sinon/issues/2425)) (Joel Bradshaw) - [`56b06129`](https://togithub.com/sinonjs/sinon/commit/56b06129e223eae690265c37b1113067e2b31bdc) Check call count type ([#​2410](https://togithub.com/sinonjs/sinon/issues/2410)) (Joel Bradshaw) - [`7863e2df`](https://togithub.com/sinonjs/sinon/commit/7863e2dfdbda79e0a32e42af09e6539fc2f2b80f) Fix [#​2414](https://togithub.com/sinonjs/sinon/issues/2414): make Sinon available on homepage (Carl-Erik Kopseng) - [`fabaabdd`](https://togithub.com/sinonjs/sinon/commit/fabaabdda82f39a7f5b75b55bd56cf77b1cd4a8f) Bump nokogiri from 1.11.4 to 1.13.1 ([#​2423](https://togithub.com/sinonjs/sinon/issues/2423)) (dependabot\[bot]) - [`dbc0fbd2`](https://togithub.com/sinonjs/sinon/commit/dbc0fbd263c8419fa47f9c3b20cf47890a242d21) Bump shelljs from 0.8.4 to 0.8.5 ([#​2422](https://togithub.com/sinonjs/sinon/issues/2422)) (dependabot\[bot]) - [`fb8b3d72`](https://togithub.com/sinonjs/sinon/commit/fb8b3d72a85dc8fb0547f859baf3f03a22a039f7) Run Prettier (Carl-Erik Kopseng) - [`12a45939`](https://togithub.com/sinonjs/sinon/commit/12a45939e9b047b6d3663fe55f2eb383ec63c4e1) Fix 2377: Throw error when trying to stub non-configurable or non-writable properties ([#​2417](https://togithub.com/sinonjs/sinon/issues/2417)) (Stuart Dotson) > Fixes issue [#​2377](https://togithub.com/sinonjs/sinon/issues/2377) by throwing an error when trying to stub non-configurable or non-writable properties *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2022-01-28.*
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 6d3b2ee9e74..8c5e9dbbdac 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -74,7 +74,7 @@ "mocha": "^8.0.0", "pack-n-play": "^1.0.0-2", "proxyquire": "^2.0.1", - "sinon": "^12.0.0", + "sinon": "^13.0.0", "typescript": "^3.8.3" } } From 77bb5712a758c11ca00a520df14dc80dd20dead5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 4 Feb 2022 16:08:58 +0000 Subject: [PATCH 477/513] docs(nodejs): version support policy edits (#1346) (#764) --- packages/google-cloud-translate/README.md | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 3c753f88d37..9b1aeeb6d99 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -111,21 +111,21 @@ also contains samples. Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). Libraries are compatible with all current _active_ and _maintenance_ versions of Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. - -_Legacy Node.js versions are supported as a best effort:_ +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: -* Legacy versions will not be tested in continuous integration. -* Some security patches may not be able to be backported. -* Dependencies will not be kept up-to-date, and features will not be backported. +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. -#### Legacy tags available - -* `legacy-8`: install client libraries from this dist-tag for versions - compatible with Node.js 8. +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/translate@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From 0e9364ec014d15224cf98303cecae00a56b2081f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 00:56:42 +0000 Subject: [PATCH 478/513] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#765) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 429395631 Source-Link: https://github.com/googleapis/googleapis/commit/84594b35af0c38efcd6967e8179d801702ad96ff Source-Link: https://github.com/googleapis/googleapis-gen/commit/ed74f970fd82914874e6b27b04763cfa66bafe9b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9 --- ..._metadata.google.cloud.translation.v3.json | 567 ++++++++++++++++++ ...lation_service.batch_translate_document.js | 9 +- ...ranslation_service.batch_translate_text.js | 9 +- .../v3/translation_service.create_glossary.js | 9 +- .../v3/translation_service.delete_glossary.js | 9 +- .../v3/translation_service.detect_language.js | 9 +- .../v3/translation_service.get_glossary.js | 9 +- ...slation_service.get_supported_languages.js | 9 +- .../v3/translation_service.list_glossaries.js | 9 +- .../translation_service.translate_document.js | 9 +- .../v3/translation_service.translate_text.js | 9 +- ...data.google.cloud.translation.v3beta1.json | 567 ++++++++++++++++++ ...lation_service.batch_translate_document.js | 9 +- ...ranslation_service.batch_translate_text.js | 9 +- .../translation_service.create_glossary.js | 9 +- .../translation_service.delete_glossary.js | 9 +- .../translation_service.detect_language.js | 9 +- .../translation_service.get_glossary.js | 9 +- ...slation_service.get_supported_languages.js | 9 +- .../translation_service.list_glossaries.js | 9 +- .../translation_service.translate_document.js | 9 +- .../translation_service.translate_text.js | 9 +- .../src/v3/translation_service_client.ts | 5 +- .../src/v3beta1/translation_service_client.ts | 5 +- .../test/gapic_translation_service_v3.ts | 102 +++- .../test/gapic_translation_service_v3beta1.ts | 108 +++- 26 files changed, 1484 insertions(+), 50 deletions(-) create mode 100644 packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json create mode 100644 packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json diff --git a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json new file mode 100644 index 00000000000..8a4e6dc87d6 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json @@ -0,0 +1,567 @@ +{ + "clientLibrary": { + "name": "nodejs-translation", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.translation.v3", + "version": "v3" + } + ] + }, + "snippets": [ + { + "regionTag": "translate_v3_generated_TranslationService_TranslateText_async", + "title": "TranslationService translateText Sample", + "origin": "API_DEFINITION", + "description": " Translates input text and returns translated text.", + "canonical": true, + "file": "translation_service.translate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 115, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TranslateText", + "fullName": "google.cloud.translation.v3.TranslationService.TranslateText", + "async": true, + "parameters": [ + { + "name": "contents", + "type": "TYPE_STRING[]" + }, + { + "name": "mime_type", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_code", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "glossary_config", + "type": ".google.cloud.translation.v3.TranslateTextGlossaryConfig" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.translation.v3.TranslateTextResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "TranslateText", + "fullName": "google.cloud.translation.v3.TranslationService.TranslateText", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3_generated_TranslationService_DetectLanguage_async", + "title": "TranslationService detectLanguage Sample", + "origin": "API_DEFINITION", + "description": " Detects the language of text within a request.", + "canonical": true, + "file": "translation_service.detect_language.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DetectLanguage", + "fullName": "google.cloud.translation.v3.TranslationService.DetectLanguage", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "content", + "type": "TYPE_STRING" + }, + { + "name": "mime_type", + "type": "TYPE_STRING" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.translation.v3.DetectLanguageResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "DetectLanguage", + "fullName": "google.cloud.translation.v3.TranslationService.DetectLanguage", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3_generated_TranslationService_GetSupportedLanguages_async", + "title": "TranslationService getSupportedLanguages Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of supported languages for translation.", + "canonical": true, + "file": "translation_service.get_supported_languages.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSupportedLanguages", + "fullName": "google.cloud.translation.v3.TranslationService.GetSupportedLanguages", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "display_language_code", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.translation.v3.SupportedLanguages", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "GetSupportedLanguages", + "fullName": "google.cloud.translation.v3.TranslationService.GetSupportedLanguages", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3_generated_TranslationService_TranslateDocument_async", + "title": "TranslationService translateDocument Sample", + "origin": "API_DEFINITION", + "description": " Translates documents in synchronous mode.", + "canonical": true, + "file": "translation_service.translate_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 112, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TranslateDocument", + "fullName": "google.cloud.translation.v3.TranslationService.TranslateDocument", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_code", + "type": "TYPE_STRING" + }, + { + "name": "document_input_config", + "type": ".google.cloud.translation.v3.DocumentInputConfig" + }, + { + "name": "document_output_config", + "type": ".google.cloud.translation.v3.DocumentOutputConfig" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "glossary_config", + "type": ".google.cloud.translation.v3.TranslateTextGlossaryConfig" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.translation.v3.TranslateDocumentResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "TranslateDocument", + "fullName": "google.cloud.translation.v3.TranslationService.TranslateDocument", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3_generated_TranslationService_BatchTranslateText_async", + "title": "TranslationService batchTranslateText Sample", + "origin": "API_DEFINITION", + "description": " Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", + "canonical": true, + "file": "translation_service.batch_translate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 109, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchTranslateText", + "fullName": "google.cloud.translation.v3.TranslationService.BatchTranslateText", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_codes", + "type": "TYPE_STRING[]" + }, + { + "name": "models", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "input_configs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "output_config", + "type": ".google.cloud.translation.v3.OutputConfig" + }, + { + "name": "glossaries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "BatchTranslateText", + "fullName": "google.cloud.translation.v3.TranslationService.BatchTranslateText", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3_generated_TranslationService_BatchTranslateDocument_async", + "title": "TranslationService batchTranslateDocument Sample", + "origin": "API_DEFINITION", + "description": " Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", + "canonical": true, + "file": "translation_service.batch_translate_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 112, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchTranslateDocument", + "fullName": "google.cloud.translation.v3.TranslationService.BatchTranslateDocument", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_codes", + "type": "TYPE_STRING[]" + }, + { + "name": "input_configs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "output_config", + "type": ".google.cloud.translation.v3.BatchDocumentOutputConfig" + }, + { + "name": "models", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "glossaries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "format_conversions", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "BatchTranslateDocument", + "fullName": "google.cloud.translation.v3.TranslationService.BatchTranslateDocument", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3_generated_TranslationService_CreateGlossary_async", + "title": "TranslationService createGlossary Sample", + "origin": "API_DEFINITION", + "description": " Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.", + "canonical": true, + "file": "translation_service.create_glossary.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGlossary", + "fullName": "google.cloud.translation.v3.TranslationService.CreateGlossary", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "glossary", + "type": ".google.cloud.translation.v3.Glossary" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "CreateGlossary", + "fullName": "google.cloud.translation.v3.TranslationService.CreateGlossary", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3_generated_TranslationService_ListGlossaries_async", + "title": "TranslationService listGlossaries Sample", + "origin": "API_DEFINITION", + "description": " Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.", + "canonical": true, + "file": "translation_service.list_glossaries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGlossaries", + "fullName": "google.cloud.translation.v3.TranslationService.ListGlossaries", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.translation.v3.ListGlossariesResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "ListGlossaries", + "fullName": "google.cloud.translation.v3.TranslationService.ListGlossaries", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3_generated_TranslationService_GetGlossary_async", + "title": "TranslationService getGlossary Sample", + "origin": "API_DEFINITION", + "description": " Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.", + "canonical": true, + "file": "translation_service.get_glossary.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGlossary", + "fullName": "google.cloud.translation.v3.TranslationService.GetGlossary", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.translation.v3.Glossary", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "GetGlossary", + "fullName": "google.cloud.translation.v3.TranslationService.GetGlossary", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3_generated_TranslationService_DeleteGlossary_async", + "title": "TranslationService deleteGlossary Sample", + "origin": "API_DEFINITION", + "description": " Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.", + "canonical": true, + "file": "translation_service.delete_glossary.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGlossary", + "fullName": "google.cloud.translation.v3.TranslationService.DeleteGlossary", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "DeleteGlossary", + "fullName": "google.cloud.translation.v3.TranslationService.DeleteGlossary", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js index dd92515812c..337493ac91e 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js index b239fcbb6cf..71e72d34095 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js index d7304465d25..12f19003463 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js index 23e855551b2..10f634d3792 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js index 3f27c790482..37287108dfd 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js index c3c87f222d5..ed5d7b43043 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js index 890114f5192..0a498bea7c8 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js index 849895840a1..0d085bc5417 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js index 509574955f2..993c4129a22 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js index b2c5107864c..6ec73656415 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json new file mode 100644 index 00000000000..a9b9e06b565 --- /dev/null +++ b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json @@ -0,0 +1,567 @@ +{ + "clientLibrary": { + "name": "nodejs-translation", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.translation.v3beta1", + "version": "v3beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "translate_v3beta1_generated_TranslationService_TranslateText_async", + "title": "TranslationService translateText Sample", + "origin": "API_DEFINITION", + "description": " Translates input text and returns translated text.", + "canonical": true, + "file": "translation_service.translate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 114, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TranslateText", + "fullName": "google.cloud.translation.v3beta1.TranslationService.TranslateText", + "async": true, + "parameters": [ + { + "name": "contents", + "type": "TYPE_STRING[]" + }, + { + "name": "mime_type", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_code", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "glossary_config", + "type": ".google.cloud.translation.v3beta1.TranslateTextGlossaryConfig" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.translation.v3beta1.TranslateTextResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "TranslateText", + "fullName": "google.cloud.translation.v3beta1.TranslationService.TranslateText", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3beta1_generated_TranslationService_DetectLanguage_async", + "title": "TranslationService detectLanguage Sample", + "origin": "API_DEFINITION", + "description": " Detects the language of text within a request.", + "canonical": true, + "file": "translation_service.detect_language.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DetectLanguage", + "fullName": "google.cloud.translation.v3beta1.TranslationService.DetectLanguage", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "content", + "type": "TYPE_STRING" + }, + { + "name": "mime_type", + "type": "TYPE_STRING" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.translation.v3beta1.DetectLanguageResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "DetectLanguage", + "fullName": "google.cloud.translation.v3beta1.TranslationService.DetectLanguage", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3beta1_generated_TranslationService_GetSupportedLanguages_async", + "title": "TranslationService getSupportedLanguages Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of supported languages for translation.", + "canonical": true, + "file": "translation_service.get_supported_languages.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSupportedLanguages", + "fullName": "google.cloud.translation.v3beta1.TranslationService.GetSupportedLanguages", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "display_language_code", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.translation.v3beta1.SupportedLanguages", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "GetSupportedLanguages", + "fullName": "google.cloud.translation.v3beta1.TranslationService.GetSupportedLanguages", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3beta1_generated_TranslationService_TranslateDocument_async", + "title": "TranslationService translateDocument Sample", + "origin": "API_DEFINITION", + "description": " Translates documents in synchronous mode.", + "canonical": true, + "file": "translation_service.translate_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 111, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TranslateDocument", + "fullName": "google.cloud.translation.v3beta1.TranslationService.TranslateDocument", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_code", + "type": "TYPE_STRING" + }, + { + "name": "document_input_config", + "type": ".google.cloud.translation.v3beta1.DocumentInputConfig" + }, + { + "name": "document_output_config", + "type": ".google.cloud.translation.v3beta1.DocumentOutputConfig" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "glossary_config", + "type": ".google.cloud.translation.v3beta1.TranslateTextGlossaryConfig" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.translation.v3beta1.TranslateDocumentResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "TranslateDocument", + "fullName": "google.cloud.translation.v3beta1.TranslationService.TranslateDocument", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3beta1_generated_TranslationService_BatchTranslateText_async", + "title": "TranslationService batchTranslateText Sample", + "origin": "API_DEFINITION", + "description": " Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", + "canonical": true, + "file": "translation_service.batch_translate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 108, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchTranslateText", + "fullName": "google.cloud.translation.v3beta1.TranslationService.BatchTranslateText", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_codes", + "type": "TYPE_STRING[]" + }, + { + "name": "models", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "input_configs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "output_config", + "type": ".google.cloud.translation.v3beta1.OutputConfig" + }, + { + "name": "glossaries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "BatchTranslateText", + "fullName": "google.cloud.translation.v3beta1.TranslationService.BatchTranslateText", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async", + "title": "TranslationService batchTranslateDocument Sample", + "origin": "API_DEFINITION", + "description": " Translates a large volume of documents in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", + "canonical": true, + "file": "translation_service.batch_translate_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 112, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchTranslateDocument", + "fullName": "google.cloud.translation.v3beta1.TranslationService.BatchTranslateDocument", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_codes", + "type": "TYPE_STRING[]" + }, + { + "name": "input_configs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "output_config", + "type": ".google.cloud.translation.v3beta1.BatchDocumentOutputConfig" + }, + { + "name": "models", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "glossaries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "format_conversions", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "BatchTranslateDocument", + "fullName": "google.cloud.translation.v3beta1.TranslationService.BatchTranslateDocument", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3beta1_generated_TranslationService_CreateGlossary_async", + "title": "TranslationService createGlossary Sample", + "origin": "API_DEFINITION", + "description": " Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.", + "canonical": true, + "file": "translation_service.create_glossary.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGlossary", + "fullName": "google.cloud.translation.v3beta1.TranslationService.CreateGlossary", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "glossary", + "type": ".google.cloud.translation.v3beta1.Glossary" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "CreateGlossary", + "fullName": "google.cloud.translation.v3beta1.TranslationService.CreateGlossary", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3beta1_generated_TranslationService_ListGlossaries_async", + "title": "TranslationService listGlossaries Sample", + "origin": "API_DEFINITION", + "description": " Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.", + "canonical": true, + "file": "translation_service.list_glossaries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGlossaries", + "fullName": "google.cloud.translation.v3beta1.TranslationService.ListGlossaries", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.translation.v3beta1.ListGlossariesResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "ListGlossaries", + "fullName": "google.cloud.translation.v3beta1.TranslationService.ListGlossaries", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3beta1_generated_TranslationService_GetGlossary_async", + "title": "TranslationService getGlossary Sample", + "origin": "API_DEFINITION", + "description": " Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.", + "canonical": true, + "file": "translation_service.get_glossary.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGlossary", + "fullName": "google.cloud.translation.v3beta1.TranslationService.GetGlossary", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.translation.v3beta1.Glossary", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "GetGlossary", + "fullName": "google.cloud.translation.v3beta1.TranslationService.GetGlossary", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } + }, + { + "regionTag": "translate_v3beta1_generated_TranslationService_DeleteGlossary_async", + "title": "TranslationService deleteGlossary Sample", + "origin": "API_DEFINITION", + "description": " Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.", + "canonical": true, + "file": "translation_service.delete_glossary.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGlossary", + "fullName": "google.cloud.translation.v3beta1.TranslationService.DeleteGlossary", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "DeleteGlossary", + "fullName": "google.cloud.translation.v3beta1.TranslationService.DeleteGlossary", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js index 0ef646a2837..9799f7636e9 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js index 4fad7d6b087..cd544b9f55e 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js index 185289e47eb..98d9ec5ba9a 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js index bfb77a6a09c..349ddd3c64a 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js index 21bfe1de2a2..671d81e856b 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js index c1025ff9225..bfc46986c22 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js index 8fe8dab2cf7..f587de0dda5 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js index 9d2ccc7a879..d634c74e2f7 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js index ff1974a8b8f..5374904ff24 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js index fb9b9d257c4..8dc72738298 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 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 +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 549b08d8b92..5181d2860e5 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -2058,9 +2058,8 @@ export class TranslationServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.translationServiceStub!.then(stub => { + if (this.translationServiceStub && !this._terminated) { + return this.translationServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index ec097bef619..ab1fa9ceeb4 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -2073,9 +2073,8 @@ export class TranslationServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.translationServiceStub!.then(stub => { + if (this.translationServiceStub && !this._terminated) { + return this.translationServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts index 852f8a2ab52..94b9f7324aa 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -185,12 +185,27 @@ describe('v3.TranslationServiceClient', () => { assert(client.translationServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new translationserviceModule.v3.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.translationServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.translationServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -336,6 +351,22 @@ describe('v3.TranslationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes translateText with closed client', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.translateText(request), expectedError); + }); }); describe('detectLanguage', () => { @@ -447,6 +478,22 @@ describe('v3.TranslationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes detectLanguage with closed client', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.detectLanguage(request), expectedError); + }); }); describe('getSupportedLanguages', () => { @@ -562,6 +609,25 @@ describe('v3.TranslationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getSupportedLanguages with closed client', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getSupportedLanguages(request), + expectedError + ); + }); }); describe('translateDocument', () => { @@ -673,6 +739,22 @@ describe('v3.TranslationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes translateDocument with closed client', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.TranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.translateDocument(request), expectedError); + }); }); describe('getGlossary', () => { @@ -784,6 +866,22 @@ describe('v3.TranslationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getGlossary with closed client', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGlossary(request), expectedError); + }); }); describe('batchTranslateText', () => { diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts index 231b79cd3f8..fd56884a5c8 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -188,13 +188,29 @@ describe('v3beta1.TranslationServiceClient', () => { assert(client.translationServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new translationserviceModule.v3beta1.TranslationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.translationServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.translationServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -345,6 +361,23 @@ describe('v3beta1.TranslationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes translateText with closed client', async () => { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateTextRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.translateText(request), expectedError); + }); }); describe('detectLanguage', () => { @@ -459,6 +492,23 @@ describe('v3beta1.TranslationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes detectLanguage with closed client', async () => { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.detectLanguage(request), expectedError); + }); }); describe('getSupportedLanguages', () => { @@ -577,6 +627,26 @@ describe('v3beta1.TranslationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getSupportedLanguages with closed client', async () => { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getSupportedLanguages(request), + expectedError + ); + }); }); describe('translateDocument', () => { @@ -691,6 +761,23 @@ describe('v3beta1.TranslationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes translateDocument with closed client', async () => { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.TranslateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.translateDocument(request), expectedError); + }); }); describe('getGlossary', () => { @@ -805,6 +892,23 @@ describe('v3beta1.TranslationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getGlossary with closed client', async () => { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGlossary(request), expectedError); + }); }); describe('batchTranslateText', () => { From e42c46b3bc2dd50eaef10efd68a72f2079ff3a99 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 16 Mar 2022 21:32:34 +0000 Subject: [PATCH 479/513] chore: update v2.14.2 gapic-generator-typescript (#769) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 434859890 Source-Link: https://github.com/googleapis/googleapis/commit/bc2432d50cba657e95212122e3fa112591b5bec2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/930b673103e92523f8cfed38decd7d3afae8ebe7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMwYjY3MzEwM2U5MjUyM2Y4Y2ZlZDM4ZGVjZDdkM2FmYWU4ZWJlNyJ9 --- .../test/gapic_translation_service_v3.ts | 5 ----- .../test/gapic_translation_service_v3beta1.ts | 5 ----- 2 files changed, 10 deletions(-) diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts index 94b9f7324aa..07fe1fafb14 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -362,7 +362,6 @@ describe('v3.TranslationServiceClient', () => { new protos.google.cloud.translation.v3.TranslateTextRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.translateText(request), expectedError); @@ -489,7 +488,6 @@ describe('v3.TranslationServiceClient', () => { new protos.google.cloud.translation.v3.DetectLanguageRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.detectLanguage(request), expectedError); @@ -620,7 +618,6 @@ describe('v3.TranslationServiceClient', () => { new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -750,7 +747,6 @@ describe('v3.TranslationServiceClient', () => { new protos.google.cloud.translation.v3.TranslateDocumentRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.translateDocument(request), expectedError); @@ -877,7 +873,6 @@ describe('v3.TranslationServiceClient', () => { new protos.google.cloud.translation.v3.GetGlossaryRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getGlossary(request), expectedError); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts index fd56884a5c8..e5f741879aa 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -373,7 +373,6 @@ describe('v3beta1.TranslationServiceClient', () => { new protos.google.cloud.translation.v3beta1.TranslateTextRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.translateText(request), expectedError); @@ -504,7 +503,6 @@ describe('v3beta1.TranslationServiceClient', () => { new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.detectLanguage(request), expectedError); @@ -639,7 +637,6 @@ describe('v3beta1.TranslationServiceClient', () => { new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -773,7 +770,6 @@ describe('v3beta1.TranslationServiceClient', () => { new protos.google.cloud.translation.v3beta1.TranslateDocumentRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.translateDocument(request), expectedError); @@ -904,7 +900,6 @@ describe('v3beta1.TranslationServiceClient', () => { new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getGlossary(request), expectedError); From cc97caf0545ead4b049bf5ee2881a4f01bebdcbf Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 21 Apr 2022 11:06:25 -0700 Subject: [PATCH 480/513] fix(test): fix language detection test (#779) * fix(test): fix language detection test The existing test started returning `haw` (Hawaiian?), so let's use the longer text :) * fix(test): typo --- packages/google-cloud-translate/system-test/translate.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 550b8a1e8a2..7c4ce3b43a2 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -29,12 +29,12 @@ describe('translate', () => { expectedLanguage: 'en', }, { - content: '¡Hola!', + content: 'Esto es una prueba.', expectedLanguage: 'es', }, ]; - it('should detect a langauge', async () => { + it('should detect a language', async () => { const projectId = await translate.getProjectId(); for (const input of INPUT) { const [result] = await translate.detectLanguage({ From 4cc088f8e28f9df9ba2b95d7d15fb12269f7c7d9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 18:42:17 +0000 Subject: [PATCH 481/513] build(node): update client library version in samples metadata (#1356) (#778) * build(node): add feat in node post-processor to add client library version number in snippet metadata Co-authored-by: Benjamin E. Coe Source-Link: https://github.com/googleapis/synthtool/commit/d337b88dd1494365183718a2de0b7b4056b6fdfe Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:d106724ad2a96daa1b8d88de101ba50bdb30b8df62ffa0aa2b451d93b4556641 --- ..._metadata.google.cloud.translation.v3.json | 1092 ++++++++--------- ...data.google.cloud.translation.v3beta1.json | 1092 ++++++++--------- 2 files changed, 1092 insertions(+), 1092 deletions(-) diff --git a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json index 8a4e6dc87d6..a2609b7ed28 100644 --- a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json +++ b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json @@ -1,567 +1,567 @@ { - "clientLibrary": { - "name": "nodejs-translation", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.translation.v3", - "version": "v3" - } - ] - }, - "snippets": [ - { - "regionTag": "translate_v3_generated_TranslationService_TranslateText_async", - "title": "TranslationService translateText Sample", - "origin": "API_DEFINITION", - "description": " Translates input text and returns translated text.", - "canonical": true, - "file": "translation_service.translate_text.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 115, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TranslateText", - "fullName": "google.cloud.translation.v3.TranslationService.TranslateText", - "async": true, - "parameters": [ - { - "name": "contents", - "type": "TYPE_STRING[]" - }, - { - "name": "mime_type", - "type": "TYPE_STRING" - }, - { - "name": "source_language_code", - "type": "TYPE_STRING" - }, - { - "name": "target_language_code", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "model", - "type": "TYPE_STRING" - }, - { - "name": "glossary_config", - "type": ".google.cloud.translation.v3.TranslateTextGlossaryConfig" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.cloud.translation.v3.TranslateTextResponse", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3.TranslationServiceClient" - }, - "method": { - "shortName": "TranslateText", - "fullName": "google.cloud.translation.v3.TranslationService.TranslateText", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3.TranslationService" - } - } - } + "clientLibrary": { + "name": "nodejs-translation", + "version": "6.3.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.translation.v3", + "version": "v3" + } + ] }, - { - "regionTag": "translate_v3_generated_TranslationService_DetectLanguage_async", - "title": "TranslationService detectLanguage Sample", - "origin": "API_DEFINITION", - "description": " Detects the language of text within a request.", - "canonical": true, - "file": "translation_service.detect_language.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DetectLanguage", - "fullName": "google.cloud.translation.v3.TranslationService.DetectLanguage", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "model", - "type": "TYPE_STRING" - }, - { - "name": "content", - "type": "TYPE_STRING" - }, - { - "name": "mime_type", - "type": "TYPE_STRING" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.cloud.translation.v3.DetectLanguageResponse", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3.TranslationServiceClient" + "regionTag": "translate_v3_generated_TranslationService_TranslateText_async", + "title": "TranslationService translateText Sample", + "origin": "API_DEFINITION", + "description": " Translates input text and returns translated text.", + "canonical": true, + "file": "translation_service.translate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 115, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TranslateText", + "fullName": "google.cloud.translation.v3.TranslationService.TranslateText", + "async": true, + "parameters": [ + { + "name": "contents", + "type": "TYPE_STRING[]" + }, + { + "name": "mime_type", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_code", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "glossary_config", + "type": ".google.cloud.translation.v3.TranslateTextGlossaryConfig" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.translation.v3.TranslateTextResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "TranslateText", + "fullName": "google.cloud.translation.v3.TranslationService.TranslateText", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } }, - "method": { - "shortName": "DetectLanguage", - "fullName": "google.cloud.translation.v3.TranslationService.DetectLanguage", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3_generated_TranslationService_GetSupportedLanguages_async", - "title": "TranslationService getSupportedLanguages Sample", - "origin": "API_DEFINITION", - "description": " Returns a list of supported languages for translation.", - "canonical": true, - "file": "translation_service.get_supported_languages.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSupportedLanguages", - "fullName": "google.cloud.translation.v3.TranslationService.GetSupportedLanguages", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "display_language_code", - "type": "TYPE_STRING" - }, - { - "name": "model", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.translation.v3.SupportedLanguages", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3.TranslationServiceClient" + "regionTag": "translate_v3_generated_TranslationService_DetectLanguage_async", + "title": "TranslationService detectLanguage Sample", + "origin": "API_DEFINITION", + "description": " Detects the language of text within a request.", + "canonical": true, + "file": "translation_service.detect_language.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DetectLanguage", + "fullName": "google.cloud.translation.v3.TranslationService.DetectLanguage", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "content", + "type": "TYPE_STRING" + }, + { + "name": "mime_type", + "type": "TYPE_STRING" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.translation.v3.DetectLanguageResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "DetectLanguage", + "fullName": "google.cloud.translation.v3.TranslationService.DetectLanguage", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } }, - "method": { - "shortName": "GetSupportedLanguages", - "fullName": "google.cloud.translation.v3.TranslationService.GetSupportedLanguages", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3_generated_TranslationService_TranslateDocument_async", - "title": "TranslationService translateDocument Sample", - "origin": "API_DEFINITION", - "description": " Translates documents in synchronous mode.", - "canonical": true, - "file": "translation_service.translate_document.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 112, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TranslateDocument", - "fullName": "google.cloud.translation.v3.TranslationService.TranslateDocument", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "source_language_code", - "type": "TYPE_STRING" - }, - { - "name": "target_language_code", - "type": "TYPE_STRING" - }, - { - "name": "document_input_config", - "type": ".google.cloud.translation.v3.DocumentInputConfig" - }, - { - "name": "document_output_config", - "type": ".google.cloud.translation.v3.DocumentOutputConfig" - }, - { - "name": "model", - "type": "TYPE_STRING" - }, - { - "name": "glossary_config", - "type": ".google.cloud.translation.v3.TranslateTextGlossaryConfig" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.cloud.translation.v3.TranslateDocumentResponse", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3.TranslationServiceClient" + "regionTag": "translate_v3_generated_TranslationService_GetSupportedLanguages_async", + "title": "TranslationService getSupportedLanguages Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of supported languages for translation.", + "canonical": true, + "file": "translation_service.get_supported_languages.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSupportedLanguages", + "fullName": "google.cloud.translation.v3.TranslationService.GetSupportedLanguages", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "display_language_code", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.translation.v3.SupportedLanguages", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "GetSupportedLanguages", + "fullName": "google.cloud.translation.v3.TranslationService.GetSupportedLanguages", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } }, - "method": { - "shortName": "TranslateDocument", - "fullName": "google.cloud.translation.v3.TranslationService.TranslateDocument", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3_generated_TranslationService_BatchTranslateText_async", - "title": "TranslationService batchTranslateText Sample", - "origin": "API_DEFINITION", - "description": " Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", - "canonical": true, - "file": "translation_service.batch_translate_text.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 109, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchTranslateText", - "fullName": "google.cloud.translation.v3.TranslationService.BatchTranslateText", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "source_language_code", - "type": "TYPE_STRING" - }, - { - "name": "target_language_codes", - "type": "TYPE_STRING[]" - }, - { - "name": "models", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "input_configs", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "output_config", - "type": ".google.cloud.translation.v3.OutputConfig" - }, - { - "name": "glossaries", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3.TranslationServiceClient" + "regionTag": "translate_v3_generated_TranslationService_TranslateDocument_async", + "title": "TranslationService translateDocument Sample", + "origin": "API_DEFINITION", + "description": " Translates documents in synchronous mode.", + "canonical": true, + "file": "translation_service.translate_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 112, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TranslateDocument", + "fullName": "google.cloud.translation.v3.TranslationService.TranslateDocument", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_code", + "type": "TYPE_STRING" + }, + { + "name": "document_input_config", + "type": ".google.cloud.translation.v3.DocumentInputConfig" + }, + { + "name": "document_output_config", + "type": ".google.cloud.translation.v3.DocumentOutputConfig" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "glossary_config", + "type": ".google.cloud.translation.v3.TranslateTextGlossaryConfig" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.translation.v3.TranslateDocumentResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "TranslateDocument", + "fullName": "google.cloud.translation.v3.TranslationService.TranslateDocument", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } }, - "method": { - "shortName": "BatchTranslateText", - "fullName": "google.cloud.translation.v3.TranslationService.BatchTranslateText", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3_generated_TranslationService_BatchTranslateDocument_async", - "title": "TranslationService batchTranslateDocument Sample", - "origin": "API_DEFINITION", - "description": " Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", - "canonical": true, - "file": "translation_service.batch_translate_document.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 112, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchTranslateDocument", - "fullName": "google.cloud.translation.v3.TranslationService.BatchTranslateDocument", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "source_language_code", - "type": "TYPE_STRING" - }, - { - "name": "target_language_codes", - "type": "TYPE_STRING[]" - }, - { - "name": "input_configs", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "output_config", - "type": ".google.cloud.translation.v3.BatchDocumentOutputConfig" - }, - { - "name": "models", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "glossaries", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "format_conversions", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3.TranslationServiceClient" + "regionTag": "translate_v3_generated_TranslationService_BatchTranslateText_async", + "title": "TranslationService batchTranslateText Sample", + "origin": "API_DEFINITION", + "description": " Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", + "canonical": true, + "file": "translation_service.batch_translate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 109, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchTranslateText", + "fullName": "google.cloud.translation.v3.TranslationService.BatchTranslateText", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_codes", + "type": "TYPE_STRING[]" + }, + { + "name": "models", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "input_configs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "output_config", + "type": ".google.cloud.translation.v3.OutputConfig" + }, + { + "name": "glossaries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "BatchTranslateText", + "fullName": "google.cloud.translation.v3.TranslationService.BatchTranslateText", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } }, - "method": { - "shortName": "BatchTranslateDocument", - "fullName": "google.cloud.translation.v3.TranslationService.BatchTranslateDocument", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3_generated_TranslationService_CreateGlossary_async", - "title": "TranslationService createGlossary Sample", - "origin": "API_DEFINITION", - "description": " Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.", - "canonical": true, - "file": "translation_service.create_glossary.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateGlossary", - "fullName": "google.cloud.translation.v3.TranslationService.CreateGlossary", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "glossary", - "type": ".google.cloud.translation.v3.Glossary" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3.TranslationServiceClient" + "regionTag": "translate_v3_generated_TranslationService_BatchTranslateDocument_async", + "title": "TranslationService batchTranslateDocument Sample", + "origin": "API_DEFINITION", + "description": " Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", + "canonical": true, + "file": "translation_service.batch_translate_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 112, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchTranslateDocument", + "fullName": "google.cloud.translation.v3.TranslationService.BatchTranslateDocument", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_codes", + "type": "TYPE_STRING[]" + }, + { + "name": "input_configs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "output_config", + "type": ".google.cloud.translation.v3.BatchDocumentOutputConfig" + }, + { + "name": "models", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "glossaries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "format_conversions", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "BatchTranslateDocument", + "fullName": "google.cloud.translation.v3.TranslationService.BatchTranslateDocument", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } }, - "method": { - "shortName": "CreateGlossary", - "fullName": "google.cloud.translation.v3.TranslationService.CreateGlossary", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3_generated_TranslationService_ListGlossaries_async", - "title": "TranslationService listGlossaries Sample", - "origin": "API_DEFINITION", - "description": " Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.", - "canonical": true, - "file": "translation_service.list_glossaries.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListGlossaries", - "fullName": "google.cloud.translation.v3.TranslationService.ListGlossaries", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.translation.v3.ListGlossariesResponse", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3.TranslationServiceClient" + "regionTag": "translate_v3_generated_TranslationService_CreateGlossary_async", + "title": "TranslationService createGlossary Sample", + "origin": "API_DEFINITION", + "description": " Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.", + "canonical": true, + "file": "translation_service.create_glossary.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGlossary", + "fullName": "google.cloud.translation.v3.TranslationService.CreateGlossary", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "glossary", + "type": ".google.cloud.translation.v3.Glossary" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "CreateGlossary", + "fullName": "google.cloud.translation.v3.TranslationService.CreateGlossary", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } }, - "method": { - "shortName": "ListGlossaries", - "fullName": "google.cloud.translation.v3.TranslationService.ListGlossaries", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3_generated_TranslationService_GetGlossary_async", - "title": "TranslationService getGlossary Sample", - "origin": "API_DEFINITION", - "description": " Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.", - "canonical": true, - "file": "translation_service.get_glossary.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetGlossary", - "fullName": "google.cloud.translation.v3.TranslationService.GetGlossary", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.translation.v3.Glossary", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3.TranslationServiceClient" + "regionTag": "translate_v3_generated_TranslationService_ListGlossaries_async", + "title": "TranslationService listGlossaries Sample", + "origin": "API_DEFINITION", + "description": " Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.", + "canonical": true, + "file": "translation_service.list_glossaries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGlossaries", + "fullName": "google.cloud.translation.v3.TranslationService.ListGlossaries", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.translation.v3.ListGlossariesResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "ListGlossaries", + "fullName": "google.cloud.translation.v3.TranslationService.ListGlossaries", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } }, - "method": { - "shortName": "GetGlossary", - "fullName": "google.cloud.translation.v3.TranslationService.GetGlossary", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3_generated_TranslationService_DeleteGlossary_async", - "title": "TranslationService deleteGlossary Sample", - "origin": "API_DEFINITION", - "description": " Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.", - "canonical": true, - "file": "translation_service.delete_glossary.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteGlossary", - "fullName": "google.cloud.translation.v3.TranslationService.DeleteGlossary", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3.TranslationServiceClient" + "regionTag": "translate_v3_generated_TranslationService_GetGlossary_async", + "title": "TranslationService getGlossary Sample", + "origin": "API_DEFINITION", + "description": " Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.", + "canonical": true, + "file": "translation_service.get_glossary.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGlossary", + "fullName": "google.cloud.translation.v3.TranslationService.GetGlossary", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.translation.v3.Glossary", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "GetGlossary", + "fullName": "google.cloud.translation.v3.TranslationService.GetGlossary", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } }, - "method": { - "shortName": "DeleteGlossary", - "fullName": "google.cloud.translation.v3.TranslationService.DeleteGlossary", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3.TranslationService" - } + { + "regionTag": "translate_v3_generated_TranslationService_DeleteGlossary_async", + "title": "TranslationService deleteGlossary Sample", + "origin": "API_DEFINITION", + "description": " Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.", + "canonical": true, + "file": "translation_service.delete_glossary.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGlossary", + "fullName": "google.cloud.translation.v3.TranslationService.DeleteGlossary", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3.TranslationServiceClient" + }, + "method": { + "shortName": "DeleteGlossary", + "fullName": "google.cloud.translation.v3.TranslationService.DeleteGlossary", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3.TranslationService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json index a9b9e06b565..61a01fa9e39 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json +++ b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json @@ -1,567 +1,567 @@ { - "clientLibrary": { - "name": "nodejs-translation", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.translation.v3beta1", - "version": "v3beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "translate_v3beta1_generated_TranslationService_TranslateText_async", - "title": "TranslationService translateText Sample", - "origin": "API_DEFINITION", - "description": " Translates input text and returns translated text.", - "canonical": true, - "file": "translation_service.translate_text.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 114, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TranslateText", - "fullName": "google.cloud.translation.v3beta1.TranslationService.TranslateText", - "async": true, - "parameters": [ - { - "name": "contents", - "type": "TYPE_STRING[]" - }, - { - "name": "mime_type", - "type": "TYPE_STRING" - }, - { - "name": "source_language_code", - "type": "TYPE_STRING" - }, - { - "name": "target_language_code", - "type": "TYPE_STRING" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "model", - "type": "TYPE_STRING" - }, - { - "name": "glossary_config", - "type": ".google.cloud.translation.v3beta1.TranslateTextGlossaryConfig" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.cloud.translation.v3beta1.TranslateTextResponse", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" - }, - "method": { - "shortName": "TranslateText", - "fullName": "google.cloud.translation.v3beta1.TranslationService.TranslateText", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3beta1.TranslationService" - } - } - } + "clientLibrary": { + "name": "nodejs-translation", + "version": "6.3.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.translation.v3beta1", + "version": "v3beta1" + } + ] }, - { - "regionTag": "translate_v3beta1_generated_TranslationService_DetectLanguage_async", - "title": "TranslationService detectLanguage Sample", - "origin": "API_DEFINITION", - "description": " Detects the language of text within a request.", - "canonical": true, - "file": "translation_service.detect_language.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DetectLanguage", - "fullName": "google.cloud.translation.v3beta1.TranslationService.DetectLanguage", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "model", - "type": "TYPE_STRING" - }, - { - "name": "content", - "type": "TYPE_STRING" - }, - { - "name": "mime_type", - "type": "TYPE_STRING" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.cloud.translation.v3beta1.DetectLanguageResponse", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + "regionTag": "translate_v3beta1_generated_TranslationService_TranslateText_async", + "title": "TranslationService translateText Sample", + "origin": "API_DEFINITION", + "description": " Translates input text and returns translated text.", + "canonical": true, + "file": "translation_service.translate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 114, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TranslateText", + "fullName": "google.cloud.translation.v3beta1.TranslationService.TranslateText", + "async": true, + "parameters": [ + { + "name": "contents", + "type": "TYPE_STRING[]" + }, + { + "name": "mime_type", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_code", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "glossary_config", + "type": ".google.cloud.translation.v3beta1.TranslateTextGlossaryConfig" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.translation.v3beta1.TranslateTextResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "TranslateText", + "fullName": "google.cloud.translation.v3beta1.TranslationService.TranslateText", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } }, - "method": { - "shortName": "DetectLanguage", - "fullName": "google.cloud.translation.v3beta1.TranslationService.DetectLanguage", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3beta1.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3beta1_generated_TranslationService_GetSupportedLanguages_async", - "title": "TranslationService getSupportedLanguages Sample", - "origin": "API_DEFINITION", - "description": " Returns a list of supported languages for translation.", - "canonical": true, - "file": "translation_service.get_supported_languages.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSupportedLanguages", - "fullName": "google.cloud.translation.v3beta1.TranslationService.GetSupportedLanguages", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "display_language_code", - "type": "TYPE_STRING" - }, - { - "name": "model", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.translation.v3beta1.SupportedLanguages", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + "regionTag": "translate_v3beta1_generated_TranslationService_DetectLanguage_async", + "title": "TranslationService detectLanguage Sample", + "origin": "API_DEFINITION", + "description": " Detects the language of text within a request.", + "canonical": true, + "file": "translation_service.detect_language.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DetectLanguage", + "fullName": "google.cloud.translation.v3beta1.TranslationService.DetectLanguage", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "content", + "type": "TYPE_STRING" + }, + { + "name": "mime_type", + "type": "TYPE_STRING" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.translation.v3beta1.DetectLanguageResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "DetectLanguage", + "fullName": "google.cloud.translation.v3beta1.TranslationService.DetectLanguage", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } }, - "method": { - "shortName": "GetSupportedLanguages", - "fullName": "google.cloud.translation.v3beta1.TranslationService.GetSupportedLanguages", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3beta1.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3beta1_generated_TranslationService_TranslateDocument_async", - "title": "TranslationService translateDocument Sample", - "origin": "API_DEFINITION", - "description": " Translates documents in synchronous mode.", - "canonical": true, - "file": "translation_service.translate_document.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 111, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TranslateDocument", - "fullName": "google.cloud.translation.v3beta1.TranslationService.TranslateDocument", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "source_language_code", - "type": "TYPE_STRING" - }, - { - "name": "target_language_code", - "type": "TYPE_STRING" - }, - { - "name": "document_input_config", - "type": ".google.cloud.translation.v3beta1.DocumentInputConfig" - }, - { - "name": "document_output_config", - "type": ".google.cloud.translation.v3beta1.DocumentOutputConfig" - }, - { - "name": "model", - "type": "TYPE_STRING" - }, - { - "name": "glossary_config", - "type": ".google.cloud.translation.v3beta1.TranslateTextGlossaryConfig" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.cloud.translation.v3beta1.TranslateDocumentResponse", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + "regionTag": "translate_v3beta1_generated_TranslationService_GetSupportedLanguages_async", + "title": "TranslationService getSupportedLanguages Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of supported languages for translation.", + "canonical": true, + "file": "translation_service.get_supported_languages.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSupportedLanguages", + "fullName": "google.cloud.translation.v3beta1.TranslationService.GetSupportedLanguages", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "display_language_code", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.translation.v3beta1.SupportedLanguages", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "GetSupportedLanguages", + "fullName": "google.cloud.translation.v3beta1.TranslationService.GetSupportedLanguages", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } }, - "method": { - "shortName": "TranslateDocument", - "fullName": "google.cloud.translation.v3beta1.TranslationService.TranslateDocument", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3beta1.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3beta1_generated_TranslationService_BatchTranslateText_async", - "title": "TranslationService batchTranslateText Sample", - "origin": "API_DEFINITION", - "description": " Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", - "canonical": true, - "file": "translation_service.batch_translate_text.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 108, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchTranslateText", - "fullName": "google.cloud.translation.v3beta1.TranslationService.BatchTranslateText", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "source_language_code", - "type": "TYPE_STRING" - }, - { - "name": "target_language_codes", - "type": "TYPE_STRING[]" - }, - { - "name": "models", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "input_configs", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "output_config", - "type": ".google.cloud.translation.v3beta1.OutputConfig" - }, - { - "name": "glossaries", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + "regionTag": "translate_v3beta1_generated_TranslationService_TranslateDocument_async", + "title": "TranslationService translateDocument Sample", + "origin": "API_DEFINITION", + "description": " Translates documents in synchronous mode.", + "canonical": true, + "file": "translation_service.translate_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 111, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TranslateDocument", + "fullName": "google.cloud.translation.v3beta1.TranslationService.TranslateDocument", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_code", + "type": "TYPE_STRING" + }, + { + "name": "document_input_config", + "type": ".google.cloud.translation.v3beta1.DocumentInputConfig" + }, + { + "name": "document_output_config", + "type": ".google.cloud.translation.v3beta1.DocumentOutputConfig" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "glossary_config", + "type": ".google.cloud.translation.v3beta1.TranslateTextGlossaryConfig" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.translation.v3beta1.TranslateDocumentResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "TranslateDocument", + "fullName": "google.cloud.translation.v3beta1.TranslationService.TranslateDocument", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } }, - "method": { - "shortName": "BatchTranslateText", - "fullName": "google.cloud.translation.v3beta1.TranslationService.BatchTranslateText", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3beta1.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async", - "title": "TranslationService batchTranslateDocument Sample", - "origin": "API_DEFINITION", - "description": " Translates a large volume of documents in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", - "canonical": true, - "file": "translation_service.batch_translate_document.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 112, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchTranslateDocument", - "fullName": "google.cloud.translation.v3beta1.TranslationService.BatchTranslateDocument", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "source_language_code", - "type": "TYPE_STRING" - }, - { - "name": "target_language_codes", - "type": "TYPE_STRING[]" - }, - { - "name": "input_configs", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "output_config", - "type": ".google.cloud.translation.v3beta1.BatchDocumentOutputConfig" - }, - { - "name": "models", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "glossaries", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "format_conversions", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + "regionTag": "translate_v3beta1_generated_TranslationService_BatchTranslateText_async", + "title": "TranslationService batchTranslateText Sample", + "origin": "API_DEFINITION", + "description": " Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", + "canonical": true, + "file": "translation_service.batch_translate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 108, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchTranslateText", + "fullName": "google.cloud.translation.v3beta1.TranslationService.BatchTranslateText", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_codes", + "type": "TYPE_STRING[]" + }, + { + "name": "models", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "input_configs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "output_config", + "type": ".google.cloud.translation.v3beta1.OutputConfig" + }, + { + "name": "glossaries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "BatchTranslateText", + "fullName": "google.cloud.translation.v3beta1.TranslationService.BatchTranslateText", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } }, - "method": { - "shortName": "BatchTranslateDocument", - "fullName": "google.cloud.translation.v3beta1.TranslationService.BatchTranslateDocument", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3beta1.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3beta1_generated_TranslationService_CreateGlossary_async", - "title": "TranslationService createGlossary Sample", - "origin": "API_DEFINITION", - "description": " Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.", - "canonical": true, - "file": "translation_service.create_glossary.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateGlossary", - "fullName": "google.cloud.translation.v3beta1.TranslationService.CreateGlossary", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "glossary", - "type": ".google.cloud.translation.v3beta1.Glossary" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + "regionTag": "translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async", + "title": "TranslationService batchTranslateDocument Sample", + "origin": "API_DEFINITION", + "description": " Translates a large volume of documents in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", + "canonical": true, + "file": "translation_service.batch_translate_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 112, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchTranslateDocument", + "fullName": "google.cloud.translation.v3beta1.TranslationService.BatchTranslateDocument", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_language_code", + "type": "TYPE_STRING" + }, + { + "name": "target_language_codes", + "type": "TYPE_STRING[]" + }, + { + "name": "input_configs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "output_config", + "type": ".google.cloud.translation.v3beta1.BatchDocumentOutputConfig" + }, + { + "name": "models", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "glossaries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "format_conversions", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "BatchTranslateDocument", + "fullName": "google.cloud.translation.v3beta1.TranslationService.BatchTranslateDocument", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } }, - "method": { - "shortName": "CreateGlossary", - "fullName": "google.cloud.translation.v3beta1.TranslationService.CreateGlossary", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3beta1.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3beta1_generated_TranslationService_ListGlossaries_async", - "title": "TranslationService listGlossaries Sample", - "origin": "API_DEFINITION", - "description": " Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.", - "canonical": true, - "file": "translation_service.list_glossaries.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListGlossaries", - "fullName": "google.cloud.translation.v3beta1.TranslationService.ListGlossaries", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.translation.v3beta1.ListGlossariesResponse", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + "regionTag": "translate_v3beta1_generated_TranslationService_CreateGlossary_async", + "title": "TranslationService createGlossary Sample", + "origin": "API_DEFINITION", + "description": " Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.", + "canonical": true, + "file": "translation_service.create_glossary.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGlossary", + "fullName": "google.cloud.translation.v3beta1.TranslationService.CreateGlossary", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "glossary", + "type": ".google.cloud.translation.v3beta1.Glossary" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "CreateGlossary", + "fullName": "google.cloud.translation.v3beta1.TranslationService.CreateGlossary", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } }, - "method": { - "shortName": "ListGlossaries", - "fullName": "google.cloud.translation.v3beta1.TranslationService.ListGlossaries", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3beta1.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3beta1_generated_TranslationService_GetGlossary_async", - "title": "TranslationService getGlossary Sample", - "origin": "API_DEFINITION", - "description": " Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.", - "canonical": true, - "file": "translation_service.get_glossary.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetGlossary", - "fullName": "google.cloud.translation.v3beta1.TranslationService.GetGlossary", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.translation.v3beta1.Glossary", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + "regionTag": "translate_v3beta1_generated_TranslationService_ListGlossaries_async", + "title": "TranslationService listGlossaries Sample", + "origin": "API_DEFINITION", + "description": " Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.", + "canonical": true, + "file": "translation_service.list_glossaries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGlossaries", + "fullName": "google.cloud.translation.v3beta1.TranslationService.ListGlossaries", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.translation.v3beta1.ListGlossariesResponse", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "ListGlossaries", + "fullName": "google.cloud.translation.v3beta1.TranslationService.ListGlossaries", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } }, - "method": { - "shortName": "GetGlossary", - "fullName": "google.cloud.translation.v3beta1.TranslationService.GetGlossary", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3beta1.TranslationService" - } - } - } - }, - { - "regionTag": "translate_v3beta1_generated_TranslationService_DeleteGlossary_async", - "title": "TranslationService deleteGlossary Sample", - "origin": "API_DEFINITION", - "description": " Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.", - "canonical": true, - "file": "translation_service.delete_glossary.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteGlossary", - "fullName": "google.cloud.translation.v3beta1.TranslationService.DeleteGlossary", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "TranslationServiceClient", - "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + "regionTag": "translate_v3beta1_generated_TranslationService_GetGlossary_async", + "title": "TranslationService getGlossary Sample", + "origin": "API_DEFINITION", + "description": " Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.", + "canonical": true, + "file": "translation_service.get_glossary.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGlossary", + "fullName": "google.cloud.translation.v3beta1.TranslationService.GetGlossary", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.translation.v3beta1.Glossary", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "GetGlossary", + "fullName": "google.cloud.translation.v3beta1.TranslationService.GetGlossary", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } }, - "method": { - "shortName": "DeleteGlossary", - "fullName": "google.cloud.translation.v3beta1.TranslationService.DeleteGlossary", - "service": { - "shortName": "TranslationService", - "fullName": "google.cloud.translation.v3beta1.TranslationService" - } + { + "regionTag": "translate_v3beta1_generated_TranslationService_DeleteGlossary_async", + "title": "TranslationService deleteGlossary Sample", + "origin": "API_DEFINITION", + "description": " Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.", + "canonical": true, + "file": "translation_service.delete_glossary.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGlossary", + "fullName": "google.cloud.translation.v3beta1.TranslationService.DeleteGlossary", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TranslationServiceClient", + "fullName": "google.cloud.translation.v3beta1.TranslationServiceClient" + }, + "method": { + "shortName": "DeleteGlossary", + "fullName": "google.cloud.translation.v3beta1.TranslationService.DeleteGlossary", + "service": { + "shortName": "TranslationService", + "fullName": "google.cloud.translation.v3beta1.TranslationService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From 2ab8190e31ecb9d20f726c03a923b4009c9b37e0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:40:31 +0200 Subject: [PATCH 482/513] chore(deps): update dependency sinon to v14 (#786) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^13.0.0` -> `^14.0.0`](https://renovatebot.com/diffs/npm/sinon/13.0.2/14.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/compatibility-slim/13.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/confidence-slim/13.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v14.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1400) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v13.0.2...v14.0.0) - [`c2bbd826`](https://togithub.com/sinonjs/sinon/commit/c2bbd82641444eb5b32822489ae40f185afbbf00) Drop node 12 (Morgan Roderick) > And embrace Node 18 > > See https://nodejs.org/en/about/releases/ *Released by Morgan Roderick on 2022-05-07.*
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 8c5e9dbbdac..61cfdf28f47 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -74,7 +74,7 @@ "mocha": "^8.0.0", "pack-n-play": "^1.0.0-2", "proxyquire": "^2.0.1", - "sinon": "^13.0.0", + "sinon": "^14.0.0", "typescript": "^3.8.3" } } From e4ea3aaca013bf2887691dc55019dfa6a186a034 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 13 May 2022 23:53:08 +0200 Subject: [PATCH 483/513] chore(deps): update dependency @types/mocha to v9 (#782) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 61cfdf28f47..dcb86186937 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -57,7 +57,7 @@ }, "devDependencies": { "@types/extend": "^3.0.0", - "@types/mocha": "^8.0.0", + "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", From 92b5ee32a5ea0578cbc0151624eb73823b504ed2 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 19 May 2022 15:21:38 -0700 Subject: [PATCH 484/513] build!: update library to use Node 12 (#789) * build!: Update library to use Node 12 Co-authored-by: Owl Bot --- packages/google-cloud-translate/package.json | 10 +++++----- packages/google-cloud-translate/samples/package.json | 2 +- .../google-cloud-translate/system-test/translate.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index dcb86186937..d5f7d665a08 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "author": "Google Inc.", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "repository": "googleapis/nodejs-translate", "main": "build/src/index.js", @@ -51,7 +51,7 @@ "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^2.24.1", + "google-gax": "^3.0.1", "is-html": "^2.0.0", "protobufjs": "^6.8.8" }, @@ -65,16 +65,16 @@ "c8": "^7.0.0", "codecov": "^3.0.2", "google-auth-library": "^6.0.0", - "gts": "^3.0.0", + "gts": "^3.1.0", "http2spy": "^2.0.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.0", - "mocha": "^8.0.0", + "mocha": "^9.2.2", "pack-n-play": "^1.0.0-2", "proxyquire": "^2.0.1", "sinon": "^14.0.0", - "typescript": "^3.8.3" + "typescript": "^4.6.4" } } diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index af48c3f9fde..e8409e3710d 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -8,7 +8,7 @@ "!test/" ], "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "scripts": { "test": "mocha --recursive --timeout 240000" diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 7c4ce3b43a2..9b456dd7fd3 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -200,7 +200,7 @@ describe('translate', () => { parent: `projects/${projectId}`, }); } catch (_err) { - err = _err; + err = _err as Error; } assert(err); assert( From 655b9f7517d7f521eff5e136866a43685ce7e5ce Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 9 Jun 2022 22:10:23 +0200 Subject: [PATCH 485/513] chore(deps): update dependency jsdoc-region-tag to v2 (#795) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc-region-tag](https://togithub.com/googleapis/jsdoc-region-tag) | [`^1.0.2` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-region-tag/1.3.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/compatibility-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/confidence-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-region-tag ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-region-tag/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-region-tagcomparev131v200-2022-05-20) [Compare Source](https://togithub.com/googleapis/jsdoc-region-tag/compare/v1.3.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ##### Build System - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ([5b51796](https://togithub.com/googleapis/jsdoc-region-tag/commit/5b51796771984cf8b978990025f14faa03c19923)) ##### [1.3.1](https://www.github.com/googleapis/jsdoc-region-tag/compare/v1.3.0...v1.3.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​79](https://www.togithub.com/googleapis/jsdoc-region-tag/issues/79)) ([5050615](https://www.github.com/googleapis/jsdoc-region-tag/commit/50506150b7758592df5e389c6a5c3d82b3b20881))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index d5f7d665a08..deb2c43a6eb 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -69,7 +69,7 @@ "http2spy": "^2.0.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", - "jsdoc-region-tag": "^1.0.2", + "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.0", "mocha": "^9.2.2", "pack-n-play": "^1.0.0-2", From b7ac89af943dccfe35dcc4ff72e88880091483b1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 9 Jun 2022 22:44:27 +0200 Subject: [PATCH 486/513] chore(deps): update dependency jsdoc-fresh to v2 (#794) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc-fresh](https://togithub.com/googleapis/jsdoc-fresh) | [`^1.0.1` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-fresh/1.1.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/compatibility-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/confidence-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-fresh ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-fresh/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-freshcomparev111v200-2022-05-18) [Compare Source](https://togithub.com/googleapis/jsdoc-fresh/compare/v1.1.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ##### Build System - update library to use Node 12 ([#​108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ([e61c223](https://togithub.com/googleapis/jsdoc-fresh/commit/e61c2238db8900e339e5fe7fb8aea09642290182)) ##### [1.1.1](https://www.github.com/googleapis/jsdoc-fresh/compare/v1.1.0...v1.1.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​83](https://www.togithub.com/googleapis/jsdoc-fresh/issues/83)) ([9474adb](https://www.github.com/googleapis/jsdoc-fresh/commit/9474adbf0d559d319ff207397ba2be6b557999ac))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index deb2c43a6eb..25d23e7e1ce 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -68,7 +68,7 @@ "gts": "^3.1.0", "http2spy": "^2.0.0", "jsdoc": "^3.6.2", - "jsdoc-fresh": "^1.0.1", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.0", "mocha": "^9.2.2", From 794aaf2ad9eeb1a1482cf0295471182daaf251bb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 20 Jun 2022 21:51:33 +0200 Subject: [PATCH 487/513] fix(deps): update dependency @google-cloud/common to v4 (#793) --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 25d23e7e1ce..36cd4b68383 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -47,7 +47,7 @@ "precompile": "gts clean" }, "dependencies": { - "@google-cloud/common": "^3.0.0", + "@google-cloud/common": "^4.0.0", "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", From c8c55885e99d09a646b59375dd20a303aacbf229 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 20 Jun 2022 22:16:11 +0200 Subject: [PATCH 488/513] chore(deps): update dependency @google-cloud/storage to v6 (#790) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@google-cloud/storage](https://togithub.com/googleapis/nodejs-storage) | [`^5.0.0` -> `^6.0.0`](https://renovatebot.com/diffs/npm/@google-cloud%2fstorage/5.20.5/6.1.0) | [![age](https://badges.renovateapi.com/packages/npm/@google-cloud%2fstorage/6.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@google-cloud%2fstorage/6.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@google-cloud%2fstorage/6.1.0/compatibility-slim/5.20.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@google-cloud%2fstorage/6.1.0/confidence-slim/5.20.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index e8409e3710d..ad36604c8dd 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -21,7 +21,7 @@ "yargs": "^16.0.0" }, "devDependencies": { - "@google-cloud/storage": "^5.0.0", + "@google-cloud/storage": "^6.0.0", "chai": "^4.2.0", "mocha": "^8.0.0", "uuid": "^8.0.0" From d2e953cd272a95ce9f50b91dabab787e9c9526fd Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 17:22:26 -0700 Subject: [PATCH 489/513] feat: support regapic LRO (#798) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: support regapic LRO Use gapic-generator-typescript v2.15.1. PiperOrigin-RevId: 456946341 Source-Link: https://github.com/googleapis/googleapis/commit/88fd18d9d3b872b3d06a3d9392879f50b5bf3ce5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/accfa371f667439313335c64042b063c1c53102e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWNjZmEzNzFmNjY3NDM5MzEzMzM1YzY0MDQyYjA2M2MxYzUzMTAyZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../src/v3/translation_service_client.ts | 58 +++++++++++++++---- .../src/v3beta1/translation_service_client.ts | 58 +++++++++++++++---- 2 files changed, 92 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 5181d2860e5..f67e99c5a0c 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -72,7 +73,7 @@ export class TranslationServiceClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -95,11 +96,10 @@ export class TranslationServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -186,16 +186,50 @@ export class TranslationServiceClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v3/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/v3/{name=projects/*/locations/*/operations/*}:wait', + body: '*', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const batchTranslateTextResponse = protoFilesRoot.lookup( '.google.cloud.translation.v3.BatchTranslateResponse' diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index ab1fa9ceeb4..765f4dfdd78 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -72,7 +73,7 @@ export class TranslationServiceClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -95,11 +96,10 @@ export class TranslationServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -186,16 +186,50 @@ export class TranslationServiceClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v3beta1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v3beta1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v3beta1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v3beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v3beta1/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/v3beta1/{name=projects/*/locations/*/operations/*}:wait', + body: '*', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const batchTranslateTextResponse = protoFilesRoot.lookup( '.google.cloud.translation.v3beta1.BatchTranslateResponse' From 40b937e8fd0abf164961a9a8101ffb69fab78af1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 19:16:20 +0000 Subject: [PATCH 490/513] chore(main): release 7.0.0 (#788) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* --- ## [7.0.0](https://github.com/googleapis/nodejs-translate/compare/v6.3.1...v7.0.0) (2022-06-30) ### ⚠ BREAKING CHANGES * update library to use Node 12 (#789) ### Features * support regapic LRO ([#798](https://github.com/googleapis/nodejs-translate/issues/798)) ([9f1ddc1](https://github.com/googleapis/nodejs-translate/commit/9f1ddc167b20e1b5c3eeadf68867ba2294f2bb12)) ### Bug Fixes * **deps:** update dependency @google-cloud/common to v4 ([#793](https://github.com/googleapis/nodejs-translate/issues/793)) ([a2d079b](https://github.com/googleapis/nodejs-translate/commit/a2d079b6b36c67a21d2c3860c1c1fb497f56c499)) * **test:** fix language detection test ([#779](https://github.com/googleapis/nodejs-translate/issues/779)) ([b6df5e2](https://github.com/googleapis/nodejs-translate/commit/b6df5e27ce37bab53f654bcfdfabf40b8db3e8a0)) ### Build System * update library to use Node 12 ([#789](https://github.com/googleapis/nodejs-translate/issues/789)) ([3060301](https://github.com/googleapis/nodejs-translate/commit/30603014cecb2da9cc73c561bd1fb127a158d84d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-translate/CHANGELOG.md | 22 +++++++++++++++++++ packages/google-cloud-translate/package.json | 2 +- ..._metadata.google.cloud.translation.v3.json | 2 +- ...data.google.cloud.translation.v3beta1.json | 2 +- .../samples/package.json | 2 +- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index b91ec3d08b8..f5d373deb2f 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,28 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [7.0.0](https://github.com/googleapis/nodejs-translate/compare/v6.3.1...v7.0.0) (2022-06-30) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#789) + +### Features + +* support regapic LRO ([#798](https://github.com/googleapis/nodejs-translate/issues/798)) ([9f1ddc1](https://github.com/googleapis/nodejs-translate/commit/9f1ddc167b20e1b5c3eeadf68867ba2294f2bb12)) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/common to v4 ([#793](https://github.com/googleapis/nodejs-translate/issues/793)) ([a2d079b](https://github.com/googleapis/nodejs-translate/commit/a2d079b6b36c67a21d2c3860c1c1fb497f56c499)) +* **test:** fix language detection test ([#779](https://github.com/googleapis/nodejs-translate/issues/779)) ([b6df5e2](https://github.com/googleapis/nodejs-translate/commit/b6df5e27ce37bab53f654bcfdfabf40b8db3e8a0)) + + +### Build System + +* update library to use Node 12 ([#789](https://github.com/googleapis/nodejs-translate/issues/789)) ([3060301](https://github.com/googleapis/nodejs-translate/commit/30603014cecb2da9cc73c561bd1fb127a158d84d)) + ### [6.3.1](https://www.github.com/googleapis/nodejs-translate/compare/v6.3.0...v6.3.1) (2021-10-18) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 36cd4b68383..90e0fa0c9ae 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "6.3.1", + "version": "7.0.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json index a2609b7ed28..791a095ca5f 100644 --- a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json +++ b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-translation", - "version": "6.3.1", + "version": "7.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json index 61a01fa9e39..7069635d4e7 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json +++ b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-translation", - "version": "6.3.1", + "version": "7.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index ad36604c8dd..019117f355d 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^2.0.0", "@google-cloud/text-to-speech": "^3.0.0", - "@google-cloud/translate": "^6.3.1", + "@google-cloud/translate": "^7.0.0", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From f81d9a23031aec1fcb9e16c3b0b7bf788be7177e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Jul 2022 23:02:19 +0200 Subject: [PATCH 491/513] chore(deps): update dependency linkinator to v4 (#801) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [linkinator](https://togithub.com/JustinBeckwith/linkinator) | [`^2.0.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/linkinator/2.16.2/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/compatibility-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/confidence-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
JustinBeckwith/linkinator ### [`v4.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.1.0...v4.0.0) ##### Features - create new release with notes ([#​508](https://togithub.com/JustinBeckwith/linkinator/issues/508)) ([2cab633](https://togithub.com/JustinBeckwith/linkinator/commit/2cab633c9659eb10794a4bac06f8b0acdc3e2c0c)) ##### BREAKING CHANGES - The commits in [#​507](https://togithub.com/JustinBeckwith/linkinator/issues/507) and [#​506](https://togithub.com/JustinBeckwith/linkinator/issues/506) both had breaking changes. They included dropping support for Node.js 12.x and updating the CSV export to be streaming, and to use a new way of writing the CSV file. This is an empty to commit using the `BREAKING CHANGE` format in the commit message to ensure a release is triggered. ### [`v3.1.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.1.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.6...v3.1.0) ##### Features - allow --skip to be defined multiple times ([#​399](https://togithub.com/JustinBeckwith/linkinator/issues/399)) ([5ca5a46](https://togithub.com/JustinBeckwith/linkinator/commit/5ca5a461508e688de12e5ae6b4cfb6565f832ebf)) ### [`v3.0.6`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.6) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.5...v3.0.6) ##### Bug Fixes - **deps:** upgrade node-glob to v8 ([#​397](https://togithub.com/JustinBeckwith/linkinator/issues/397)) ([d334dc6](https://togithub.com/JustinBeckwith/linkinator/commit/d334dc6734cd7c2b73d7ed3dea0550a6c3072ad5)) ### [`v3.0.5`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.5) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.4...v3.0.5) ##### Bug Fixes - **deps:** upgrade to htmlparser2 v8.0.1 ([#​396](https://togithub.com/JustinBeckwith/linkinator/issues/396)) ([ba3b9a8](https://togithub.com/JustinBeckwith/linkinator/commit/ba3b9a8a9b19d39af6ed91790135e833b80c1eb6)) ### [`v3.0.4`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.4) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.3...v3.0.4) ##### Bug Fixes - **deps:** update dependency gaxios to v5 ([#​391](https://togithub.com/JustinBeckwith/linkinator/issues/391)) ([48af50e](https://togithub.com/JustinBeckwith/linkinator/commit/48af50e787731204aeb7eff41325c62291311e45)) ### [`v3.0.3`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.3) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.2...v3.0.3) ##### Bug Fixes - export getConfig from index ([#​371](https://togithub.com/JustinBeckwith/linkinator/issues/371)) ([0bc0355](https://togithub.com/JustinBeckwith/linkinator/commit/0bc0355c7e2ea457f247e6b52d1577b8c4ecb3a1)) ### [`v3.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.1...v3.0.2) ##### Bug Fixes - allow server root with trailing slash ([#​370](https://togithub.com/JustinBeckwith/linkinator/issues/370)) ([8adf6b0](https://togithub.com/JustinBeckwith/linkinator/commit/8adf6b025fda250e38461f1cdad40fe08c3b3b7c)) ### [`v3.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.0...v3.0.1) ##### Bug Fixes - decode path parts in local web server ([#​369](https://togithub.com/JustinBeckwith/linkinator/issues/369)) ([4696a0c](https://togithub.com/JustinBeckwith/linkinator/commit/4696a0c38c341b178ed815f47371fca955979feb)) ### [`v3.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v2.16.2...v3.0.0) ##### Bug Fixes - **deps:** update dependency chalk to v5 ([#​362](https://togithub.com/JustinBeckwith/linkinator/issues/362)) ([4b17a8d](https://togithub.com/JustinBeckwith/linkinator/commit/4b17a8d87b649eaf813428f8ee6955e1d21dae4f)) - feat!: convert to es modules, drop node 10 ([#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359)) ([efee299](https://togithub.com/JustinBeckwith/linkinator/commit/efee299ab8a805accef751eecf8538915a4e7783)), closes [#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359) ##### BREAKING CHANGES - this module now requires node.js 12 and above, and has moved to es modules by default.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 90e0fa0c9ae..c36ad2618d5 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -70,7 +70,7 @@ "jsdoc": "^3.6.2", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.0.0", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "pack-n-play": "^1.0.0-2", "proxyquire": "^2.0.1", From b13ea40815b73c8602efb7fc1ddc08a953983059 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 10 Jul 2022 12:01:15 +0200 Subject: [PATCH 492/513] fix(deps): do not depend on protobufjs (#802) * fix(deps): update dependency protobufjs to v7 * fix(deps): do not depend on protobufjs Co-authored-by: Alexander Fenster --- packages/google-cloud-translate/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index c36ad2618d5..2f738b1edd6 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -52,8 +52,7 @@ "arrify": "^2.0.0", "extend": "^3.0.2", "google-gax": "^3.0.1", - "is-html": "^2.0.0", - "protobufjs": "^6.8.8" + "is-html": "^2.0.0" }, "devDependencies": { "@types/extend": "^3.0.0", From c38f2835dcd3a61d5f10f22c807da9aab99e742d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 25 Jul 2022 18:12:11 +0200 Subject: [PATCH 493/513] fix(deps): update dependency @google-cloud/automl to v3 (#796) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@google-cloud/automl](https://togithub.com/googleapis/nodejs-automl) | [`^2.0.0` -> `^3.0.0`](https://renovatebot.com/diffs/npm/@google-cloud%2fautoml/2.5.2/3.0.0) | [![age](https://badges.renovateapi.com/packages/npm/@google-cloud%2fautoml/3.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@google-cloud%2fautoml/3.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@google-cloud%2fautoml/3.0.0/compatibility-slim/2.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@google-cloud%2fautoml/3.0.0/confidence-slim/2.5.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/nodejs-automl ### [`v3.0.0`](https://togithub.com/googleapis/nodejs-automl/blob/HEAD/CHANGELOG.md#​300-httpsgithubcomgoogleapisnodejs-automlcomparev252v300-2022-06-20) [Compare Source](https://togithub.com/googleapis/nodejs-automl/compare/v2.5.2...v3.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​613](https://togithub.com/googleapis/nodejs-automl/issues/613)) ##### Bug Fixes - Add back java_multiple_files option to the text_sentiment.proto to match with the previous published version of text_sentiment proto ([20995db](https://togithub.com/googleapis/nodejs-automl/commit/20995db72854243213a6ffabcb188a52c9cef8f6)) - proto field markdown comment for the display_name field in annotation_payload.proto to point the correct public v1/ version ([20995db](https://togithub.com/googleapis/nodejs-automl/commit/20995db72854243213a6ffabcb188a52c9cef8f6)) ##### Build System - update library to use Node 12 ([#​613](https://togithub.com/googleapis/nodejs-automl/issues/613)) ([9ddf084](https://togithub.com/googleapis/nodejs-automl/commit/9ddf0845c8f5f1a2434a1f48d3740447fa2d747d)) ##### [2.5.2](https://www.github.com/googleapis/nodejs-automl/compare/v2.5.1...v2.5.2) (2021-12-30) ##### Bug Fixes - **deps:** update dependency csv to v6 ([#​565](https://www.togithub.com/googleapis/nodejs-automl/issues/565)) ([7f1d947](https://www.github.com/googleapis/nodejs-automl/commit/7f1d9477cfa2d9697206dffabdfb92dfb80bc1d1)) ##### [2.5.1](https://www.github.com/googleapis/nodejs-automl/compare/v2.5.0...v2.5.1) (2021-11-08) ##### Bug Fixes - **deps:** update dependency mathjs to v10 ([#​559](https://www.togithub.com/googleapis/nodejs-automl/issues/559)) ([120a457](https://www.github.com/googleapis/nodejs-automl/commit/120a457211590c48c0e8d81e35e364f6c098dbce))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 019117f355d..3e71ad1537b 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -14,7 +14,7 @@ "test": "mocha --recursive --timeout 240000" }, "dependencies": { - "@google-cloud/automl": "^2.0.0", + "@google-cloud/automl": "^3.0.0", "@google-cloud/text-to-speech": "^3.0.0", "@google-cloud/translate": "^7.0.0", "@google-cloud/vision": "^2.0.0", From e862627ee809cfff46a61b34d08f9b4d23819ea1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 10 Aug 2022 21:08:11 +0200 Subject: [PATCH 494/513] fix(deps): update dependency @google-cloud/text-to-speech to v4 (#797) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@google-cloud/text-to-speech](https://togithub.com/googleapis/nodejs-text-to-speech) | [`^3.0.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/@google-cloud%2ftext-to-speech/3.4.0/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/@google-cloud%2ftext-to-speech/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@google-cloud%2ftext-to-speech/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@google-cloud%2ftext-to-speech/4.0.0/compatibility-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@google-cloud%2ftext-to-speech/4.0.0/confidence-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/nodejs-text-to-speech ### [`v4.0.0`](https://togithub.com/googleapis/nodejs-text-to-speech/blob/HEAD/CHANGELOG.md#​400-httpsgithubcomgoogleapisnodejs-text-to-speechcomparev340v400-2022-06-10) [Compare Source](https://togithub.com/googleapis/nodejs-text-to-speech/compare/v3.4.0...v4.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​604](https://togithub.com/googleapis/nodejs-text-to-speech/issues/604)) ##### Features - Consolidate task details into service API and add orchestration result details ([74f7cfb](https://togithub.com/googleapis/nodejs-text-to-speech/commit/74f7cfb6947c0b9b35dcddb9ede343877b4938a6)) - promote CustomVoiceParams to v1 ([#​591](https://togithub.com/googleapis/nodejs-text-to-speech/issues/591)) ([fe647dc](https://togithub.com/googleapis/nodejs-text-to-speech/commit/fe647dc8735792333e0203844279da6ada898e1a)) ##### Build System - update library to use Node 12 ([#​604](https://togithub.com/googleapis/nodejs-text-to-speech/issues/604)) ([4395d56](https://togithub.com/googleapis/nodejs-text-to-speech/commit/4395d5696205c257498d33693e53135da998ed38))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 3e71ad1537b..de4688c0749 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@google-cloud/automl": "^3.0.0", - "@google-cloud/text-to-speech": "^3.0.0", + "@google-cloud/text-to-speech": "^4.0.0", "@google-cloud/translate": "^7.0.0", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" From b99d43866f0698a780272ee25a2749428714a853 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 10 Aug 2022 19:36:11 +0000 Subject: [PATCH 495/513] chore(main): release 7.0.1 (#803) :robot: I have created a release *beep* *boop* --- ## [7.0.1](https://github.com/googleapis/nodejs-translate/compare/v7.0.0...v7.0.1) (2022-08-10) ### Bug Fixes * **deps:** do not depend on protobufjs ([#802](https://github.com/googleapis/nodejs-translate/issues/802)) ([e8f13e4](https://github.com/googleapis/nodejs-translate/commit/e8f13e412c2ee9c8cded6cd4efed31b3d78f8170)) * **deps:** update dependency @google-cloud/automl to v3 ([#796](https://github.com/googleapis/nodejs-translate/issues/796)) ([440b1cb](https://github.com/googleapis/nodejs-translate/commit/440b1cb267a8d737038881d5525c4096629d64aa)) * **deps:** update dependency @google-cloud/text-to-speech to v4 ([#797](https://github.com/googleapis/nodejs-translate/issues/797)) ([a210e6e](https://github.com/googleapis/nodejs-translate/commit/a210e6e7d154e137a8ed3eb344f322552cd785a8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-translate/CHANGELOG.md | 9 +++++++++ packages/google-cloud-translate/package.json | 2 +- .../v3/snippet_metadata.google.cloud.translation.v3.json | 2 +- ...nippet_metadata.google.cloud.translation.v3beta1.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index f5d373deb2f..d81c2847dca 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,15 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [7.0.1](https://github.com/googleapis/nodejs-translate/compare/v7.0.0...v7.0.1) (2022-08-10) + + +### Bug Fixes + +* **deps:** do not depend on protobufjs ([#802](https://github.com/googleapis/nodejs-translate/issues/802)) ([e8f13e4](https://github.com/googleapis/nodejs-translate/commit/e8f13e412c2ee9c8cded6cd4efed31b3d78f8170)) +* **deps:** update dependency @google-cloud/automl to v3 ([#796](https://github.com/googleapis/nodejs-translate/issues/796)) ([440b1cb](https://github.com/googleapis/nodejs-translate/commit/440b1cb267a8d737038881d5525c4096629d64aa)) +* **deps:** update dependency @google-cloud/text-to-speech to v4 ([#797](https://github.com/googleapis/nodejs-translate/issues/797)) ([a210e6e](https://github.com/googleapis/nodejs-translate/commit/a210e6e7d154e137a8ed3eb344f322552cd785a8)) + ## [7.0.0](https://github.com/googleapis/nodejs-translate/compare/v6.3.1...v7.0.0) (2022-06-30) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 2f738b1edd6..3c51b00a9be 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "7.0.0", + "version": "7.0.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json index 791a095ca5f..f157d735748 100644 --- a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json +++ b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-translation", - "version": "7.0.0", + "version": "7.0.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json index 7069635d4e7..62a724e1ce9 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json +++ b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-translation", - "version": "7.0.0", + "version": "7.0.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index de4688c0749..8750d71b57e 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^3.0.0", "@google-cloud/text-to-speech": "^4.0.0", - "@google-cloud/translate": "^7.0.0", + "@google-cloud/translate": "^7.0.1", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From b49fd92f15d39bc5f86d046a021f902b379e3bea Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 19 Aug 2022 20:20:39 +0000 Subject: [PATCH 496/513] chore: remove unused proto imports (#808) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468735472 Source-Link: https://github.com/googleapis/googleapis/commit/cfa1b3782da7ccae31673d45401a0b79d2d4a84b Source-Link: https://github.com/googleapis/googleapis-gen/commit/09b7666656510f5b00b893f003a0ba5766f9e250 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDliNzY2NjY1NjUxMGY1YjAwYjg5M2YwMDNhMGJhNTc2NmY5ZTI1MCJ9 --- .../protos/google/cloud/translate/v3/translation_service.proto | 2 -- .../google/cloud/translate/v3beta1/translation_service.proto | 1 - 2 files changed, 3 deletions(-) diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto index 9f7702488db..4ea17daddbe 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3/translation_service.proto @@ -21,9 +21,7 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Translate.V3"; diff --git a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto index 362d3ef334f..05ad079fda9 100644 --- a/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto +++ b/packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto @@ -22,7 +22,6 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Translate.V3Beta1"; From ec38559dc593d1220f51f257d34c9167b46485eb Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 00:10:19 +0000 Subject: [PATCH 497/513] fix: better support for fallback mode (#809) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468790263 Source-Link: https://github.com/googleapis/googleapis/commit/873ab456273d105245df0fb82a6c17a814553b80 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb6f37aeff2a3472e40a7bbace8c67d75e24bee5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9 --- ..._metadata.google.cloud.translation.v3.json | 20 +- ...lation_service.batch_translate_document.js | 3 + ...ranslation_service.batch_translate_text.js | 3 + .../v3/translation_service.create_glossary.js | 3 + .../v3/translation_service.delete_glossary.js | 3 + .../v3/translation_service.detect_language.js | 3 + .../v3/translation_service.get_glossary.js | 3 + ...slation_service.get_supported_languages.js | 3 + .../v3/translation_service.list_glossaries.js | 3 + .../translation_service.translate_document.js | 3 + .../v3/translation_service.translate_text.js | 3 + ...data.google.cloud.translation.v3beta1.json | 20 +- ...lation_service.batch_translate_document.js | 3 + ...ranslation_service.batch_translate_text.js | 3 + .../translation_service.create_glossary.js | 3 + .../translation_service.delete_glossary.js | 3 + .../translation_service.detect_language.js | 3 + .../translation_service.get_glossary.js | 3 + ...slation_service.get_supported_languages.js | 3 + .../translation_service.list_glossaries.js | 3 + .../translation_service.translate_document.js | 3 + .../translation_service.translate_text.js | 3 + .../src/v3/translation_service_client.ts | 16 +- .../src/v3beta1/translation_service_client.ts | 16 +- .../test/gapic_translation_service_v3.ts | 160 ++++++++-------- .../test/gapic_translation_service_v3beta1.ts | 177 +++++++++--------- 26 files changed, 267 insertions(+), 202 deletions(-) diff --git a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json index f157d735748..6269b9102d8 100644 --- a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json +++ b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 115, + "end": 118, "type": "FULL" } ], @@ -90,7 +90,7 @@ "segments": [ { "start": 25, - "end": 85, + "end": 88, "type": "FULL" } ], @@ -146,7 +146,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -194,7 +194,7 @@ "segments": [ { "start": 25, - "end": 112, + "end": 115, "type": "FULL" } ], @@ -262,7 +262,7 @@ "segments": [ { "start": 25, - "end": 109, + "end": 112, "type": "FULL" } ], @@ -330,7 +330,7 @@ "segments": [ { "start": 25, - "end": 112, + "end": 115, "type": "FULL" } ], @@ -398,7 +398,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -442,7 +442,7 @@ "segments": [ { "start": 25, - "end": 83, + "end": 86, "type": "FULL" } ], @@ -494,7 +494,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -534,7 +534,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js index 337493ac91e..eb48f979ebc 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js @@ -23,6 +23,9 @@ function main(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig) { // [START translate_v3_generated_TranslationService_BatchTranslateDocument_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js index 71e72d34095..6e6352ff38c 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js @@ -23,6 +23,9 @@ function main(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig) { // [START translate_v3_generated_TranslationService_BatchTranslateText_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js index 12f19003463..6851f996a9d 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js @@ -23,6 +23,9 @@ function main(parent, glossary) { // [START translate_v3_generated_TranslationService_CreateGlossary_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js index 10f634d3792..3f73f2c4240 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js @@ -23,6 +23,9 @@ function main(name) { // [START translate_v3_generated_TranslationService_DeleteGlossary_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js index 37287108dfd..265776c21dc 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js @@ -23,6 +23,9 @@ function main(parent) { // [START translate_v3_generated_TranslationService_DetectLanguage_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js index ed5d7b43043..3b715e01252 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js @@ -23,6 +23,9 @@ function main(name) { // [START translate_v3_generated_TranslationService_GetGlossary_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js index 0a498bea7c8..bcc8e78f3a2 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js @@ -23,6 +23,9 @@ function main(parent) { // [START translate_v3_generated_TranslationService_GetSupportedLanguages_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js index 0d085bc5417..2e5ed20b433 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js @@ -23,6 +23,9 @@ function main(parent) { // [START translate_v3_generated_TranslationService_ListGlossaries_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js index 993c4129a22..069b2b60183 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js @@ -23,6 +23,9 @@ function main(parent, targetLanguageCode, documentInputConfig) { // [START translate_v3_generated_TranslationService_TranslateDocument_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js index 6ec73656415..0eb65ba0243 100644 --- a/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js @@ -23,6 +23,9 @@ function main(contents, targetLanguageCode, parent) { // [START translate_v3_generated_TranslationService_TranslateText_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json index 62a724e1ce9..319d303e92e 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json +++ b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 114, + "end": 117, "type": "FULL" } ], @@ -90,7 +90,7 @@ "segments": [ { "start": 25, - "end": 84, + "end": 87, "type": "FULL" } ], @@ -146,7 +146,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -194,7 +194,7 @@ "segments": [ { "start": 25, - "end": 111, + "end": 114, "type": "FULL" } ], @@ -262,7 +262,7 @@ "segments": [ { "start": 25, - "end": 108, + "end": 111, "type": "FULL" } ], @@ -330,7 +330,7 @@ "segments": [ { "start": 25, - "end": 112, + "end": 115, "type": "FULL" } ], @@ -398,7 +398,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -442,7 +442,7 @@ "segments": [ { "start": 25, - "end": 83, + "end": 86, "type": "FULL" } ], @@ -494,7 +494,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -534,7 +534,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js index 9799f7636e9..5cea9cd7e20 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js @@ -23,6 +23,9 @@ function main(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig) { // [START translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js index cd544b9f55e..050b66c6dd5 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js @@ -23,6 +23,9 @@ function main(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig) { // [START translate_v3beta1_generated_TranslationService_BatchTranslateText_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js index 98d9ec5ba9a..c0282423f71 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js @@ -23,6 +23,9 @@ function main(parent, glossary) { // [START translate_v3beta1_generated_TranslationService_CreateGlossary_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js index 349ddd3c64a..a5f77fcf736 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js @@ -23,6 +23,9 @@ function main(name) { // [START translate_v3beta1_generated_TranslationService_DeleteGlossary_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js index 671d81e856b..cfd74d4634e 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js @@ -23,6 +23,9 @@ function main(parent) { // [START translate_v3beta1_generated_TranslationService_DetectLanguage_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js index bfc46986c22..8f031109a00 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js @@ -23,6 +23,9 @@ function main(name) { // [START translate_v3beta1_generated_TranslationService_GetGlossary_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js index f587de0dda5..6d86e73751c 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js @@ -23,6 +23,9 @@ function main(parent) { // [START translate_v3beta1_generated_TranslationService_GetSupportedLanguages_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js index d634c74e2f7..b6749dd23e4 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js @@ -23,6 +23,9 @@ function main(parent) { // [START translate_v3beta1_generated_TranslationService_ListGlossaries_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js index 5374904ff24..ba5432f9c30 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js @@ -23,6 +23,9 @@ function main(parent, targetLanguageCode, documentInputConfig) { // [START translate_v3beta1_generated_TranslationService_TranslateDocument_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js index 8dc72738298..bb98ef28de6 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js +++ b/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js @@ -23,6 +23,9 @@ function main(contents, targetLanguageCode, parent) { // [START translate_v3beta1_generated_TranslationService_TranslateText_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index f67e99c5a0c..4922d27d28c 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -366,7 +365,8 @@ export class TranslationServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1257,7 +1257,7 @@ export class TranslationServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.batchTranslateText, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.translation.v3.BatchTranslateResponse, @@ -1457,7 +1457,7 @@ export class TranslationServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.batchTranslateDocument, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.translation.v3.BatchTranslateDocumentResponse, @@ -1597,7 +1597,7 @@ export class TranslationServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createGlossary, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.translation.v3.Glossary, @@ -1736,7 +1736,7 @@ export class TranslationServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteGlossary, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.translation.v3.DeleteGlossaryResponse, @@ -1923,7 +1923,7 @@ export class TranslationServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGlossaries.createStream( - this.innerApiCalls.listGlossaries as gax.GaxCall, + this.innerApiCalls.listGlossaries as GaxCall, request, callSettings ); @@ -1992,7 +1992,7 @@ export class TranslationServiceClient { this.initialize(); return this.descriptors.page.listGlossaries.asyncIterate( this.innerApiCalls['listGlossaries'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 765f4dfdd78..d16bfed3918 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -367,7 +366,8 @@ export class TranslationServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1272,7 +1272,7 @@ export class TranslationServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.batchTranslateText, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.translation.v3beta1.BatchTranslateResponse, @@ -1472,7 +1472,7 @@ export class TranslationServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.batchTranslateDocument, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.translation.v3beta1.BatchTranslateDocumentResponse, @@ -1612,7 +1612,7 @@ export class TranslationServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createGlossary, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.translation.v3beta1.Glossary, @@ -1751,7 +1751,7 @@ export class TranslationServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteGlossary, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.translation.v3beta1.DeleteGlossaryResponse, @@ -1938,7 +1938,7 @@ export class TranslationServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGlossaries.createStream( - this.innerApiCalls.listGlossaries as gax.GaxCall, + this.innerApiCalls.listGlossaries as GaxCall, request, callSettings ); @@ -2007,7 +2007,7 @@ export class TranslationServiceClient { this.initialize(); return this.descriptors.page.listGlossaries.asyncIterate( this.innerApiCalls['listGlossaries'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts index 07fe1fafb14..bbb893d31d8 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -145,101 +145,103 @@ function stubAsyncIterationCall( } describe('v3.TranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = - translationserviceModule.v3.TranslationServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - translationserviceModule.v3.TranslationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = translationserviceModule.v3.TranslationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + translationserviceModule.v3.TranslationServiceClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new translationserviceModule.v3.TranslationServiceClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + translationserviceModule.v3.TranslationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - fallback: true, + it('has port', () => { + const port = translationserviceModule.v3.TranslationServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new translationserviceModule.v3.TranslationServiceClient(); + assert(client); }); - assert.strictEqual(client.translationServiceStub, undefined); - await client.initialize(); - assert(client.translationServiceStub); - }); - it('has close method for the initialized client', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.translationServiceStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.translationServiceStub, undefined); + await client.initialize(); + assert(client.translationServiceStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.translationServiceStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.translationServiceStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.translationServiceStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new translationserviceModule.v3.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new translationserviceModule.v3.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('translateText', () => { diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts index e5f741879aa..313d4c88526 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -145,108 +145,111 @@ function stubAsyncIterationCall( } describe('v3beta1.TranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = - translationserviceModule.v3beta1.TranslationServiceClient.servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + translationserviceModule.v3beta1.TranslationServiceClient.servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - translationserviceModule.v3beta1.TranslationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + translationserviceModule.v3beta1.TranslationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = translationserviceModule.v3beta1.TranslationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + translationserviceModule.v3beta1.TranslationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new translationserviceModule.v3beta1.TranslationServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new translationserviceModule.v3beta1.TranslationServiceClient({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ + fallback: true, + }); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.translationServiceStub, undefined); - await client.initialize(); - assert(client.translationServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.translationServiceStub, undefined); + await client.initialize(); + assert(client.translationServiceStub); + }); - it('has close method for the initialized client', done => { - const client = - new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.translationServiceStub); + client.close().then(() => { + done(); }); - client.initialize(); - assert(client.translationServiceStub); - client.close().then(() => { - done(); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.translationServiceStub, undefined); + client.close().then(() => { + done(); }); - assert.strictEqual(client.translationServiceStub, undefined); - client.close().then(() => { - done(); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new translationserviceModule.v3beta1.TranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new translationserviceModule.v3beta1.TranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('translateText', () => { From fb30e78110ec72721964d36e29837b53674af745 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 17:16:12 +0000 Subject: [PATCH 498/513] fix: change import long to require (#810) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .../google-cloud-translate/protos/protos.d.ts | 941 ++- .../google-cloud-translate/protos/protos.js | 6132 ++++++++++++----- .../google-cloud-translate/protos/protos.json | 24 + 3 files changed, 5206 insertions(+), 1891 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index 23bf0162498..0f457453e1a 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import * as Long from "long"; +import Long = require("long"); import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { @@ -190,70 +190,70 @@ export namespace google { namespace TranslationService { /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#translateText}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|translateText}. * @param error Error, if any * @param [response] TranslateTextResponse */ type TranslateTextCallback = (error: (Error|null), response?: google.cloud.translation.v3.TranslateTextResponse) => void; /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#detectLanguage}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|detectLanguage}. * @param error Error, if any * @param [response] DetectLanguageResponse */ type DetectLanguageCallback = (error: (Error|null), response?: google.cloud.translation.v3.DetectLanguageResponse) => void; /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#getSupportedLanguages}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|getSupportedLanguages}. * @param error Error, if any * @param [response] SupportedLanguages */ type GetSupportedLanguagesCallback = (error: (Error|null), response?: google.cloud.translation.v3.SupportedLanguages) => void; /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#translateDocument}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|translateDocument}. * @param error Error, if any * @param [response] TranslateDocumentResponse */ type TranslateDocumentCallback = (error: (Error|null), response?: google.cloud.translation.v3.TranslateDocumentResponse) => void; /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#batchTranslateText}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|batchTranslateText}. * @param error Error, if any * @param [response] Operation */ type BatchTranslateTextCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#batchTranslateDocument}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|batchTranslateDocument}. * @param error Error, if any * @param [response] Operation */ type BatchTranslateDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#createGlossary}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|createGlossary}. * @param error Error, if any * @param [response] Operation */ type CreateGlossaryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#listGlossaries}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|listGlossaries}. * @param error Error, if any * @param [response] ListGlossariesResponse */ type ListGlossariesCallback = (error: (Error|null), response?: google.cloud.translation.v3.ListGlossariesResponse) => void; /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#getGlossary}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|getGlossary}. * @param error Error, if any * @param [response] Glossary */ type GetGlossaryCallback = (error: (Error|null), response?: google.cloud.translation.v3.Glossary) => void; /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#deleteGlossary}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|deleteGlossary}. * @param error Error, if any * @param [response] Operation */ @@ -354,6 +354,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslateTextGlossaryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TranslateTextRequest. */ @@ -486,6 +493,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslateTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TranslateTextResponse. */ @@ -582,6 +596,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslateTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Translation. */ @@ -690,6 +711,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Translation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DetectLanguageRequest. */ @@ -807,6 +835,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectLanguageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DetectedLanguage. */ @@ -903,6 +938,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedLanguage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DetectLanguageResponse. */ @@ -993,6 +1035,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectLanguageResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetSupportedLanguagesRequest. */ @@ -1095,6 +1144,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSupportedLanguagesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SupportedLanguages. */ @@ -1185,6 +1241,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupportedLanguages + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SupportedLanguage. */ @@ -1293,6 +1356,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupportedLanguage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GcsSource. */ @@ -1383,6 +1453,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an InputConfig. */ @@ -1482,6 +1559,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GcsDestination. */ @@ -1572,6 +1656,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OutputConfig. */ @@ -1665,6 +1756,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DocumentInputConfig. */ @@ -1770,6 +1868,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DocumentOutputConfig. */ @@ -1869,6 +1974,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TranslateDocumentRequest. */ @@ -2001,6 +2113,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslateDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DocumentTranslation. */ @@ -2103,6 +2222,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentTranslation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TranslateDocumentResponse. */ @@ -2211,6 +2337,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslateDocumentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchTranslateTextRequest. */ @@ -2343,6 +2476,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchTranslateTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchTranslateMetadata. */ @@ -2457,6 +2597,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchTranslateMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace BatchTranslateMetadata { @@ -2584,6 +2731,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchTranslateResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GlossaryInputConfig. */ @@ -2677,6 +2831,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GlossaryInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Glossary. */ @@ -2806,6 +2967,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Glossary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Glossary { @@ -2904,6 +3072,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LanguageCodePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a LanguageCodesSet. */ @@ -2994,6 +3169,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LanguageCodesSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -3091,6 +3273,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGlossaryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetGlossaryRequest. */ @@ -3181,6 +3370,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGlossaryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteGlossaryRequest. */ @@ -3271,6 +3467,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGlossaryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListGlossariesRequest. */ @@ -3379,6 +3582,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGlossariesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListGlossariesResponse. */ @@ -3475,6 +3685,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGlossariesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateGlossaryMetadata. */ @@ -3577,6 +3794,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGlossaryMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace CreateGlossaryMetadata { @@ -3692,6 +3916,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGlossaryMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace DeleteGlossaryMetadata { @@ -3807,6 +4038,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGlossaryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchTranslateDocumentRequest. */ @@ -3939,6 +4177,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchTranslateDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchDocumentInputConfig. */ @@ -4032,6 +4277,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDocumentInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchDocumentOutputConfig. */ @@ -4125,6 +4377,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDocumentOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchTranslateDocumentResponse. */ @@ -4269,6 +4528,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchTranslateDocumentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchTranslateDocumentMetadata. */ @@ -4413,6 +4679,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchTranslateDocumentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace BatchTranslateDocumentMetadata { @@ -4596,70 +4869,70 @@ export namespace google { namespace TranslationService { /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#translateText}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|translateText}. * @param error Error, if any * @param [response] TranslateTextResponse */ type TranslateTextCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.TranslateTextResponse) => void; /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#detectLanguage}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|detectLanguage}. * @param error Error, if any * @param [response] DetectLanguageResponse */ type DetectLanguageCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.DetectLanguageResponse) => void; /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#getSupportedLanguages}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|getSupportedLanguages}. * @param error Error, if any * @param [response] SupportedLanguages */ type GetSupportedLanguagesCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.SupportedLanguages) => void; /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#translateDocument}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|translateDocument}. * @param error Error, if any * @param [response] TranslateDocumentResponse */ type TranslateDocumentCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.TranslateDocumentResponse) => void; /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#batchTranslateText}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|batchTranslateText}. * @param error Error, if any * @param [response] Operation */ type BatchTranslateTextCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#batchTranslateDocument}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|batchTranslateDocument}. * @param error Error, if any * @param [response] Operation */ type BatchTranslateDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#createGlossary}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|createGlossary}. * @param error Error, if any * @param [response] Operation */ type CreateGlossaryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#listGlossaries}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|listGlossaries}. * @param error Error, if any * @param [response] ListGlossariesResponse */ type ListGlossariesCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.ListGlossariesResponse) => void; /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#getGlossary}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|getGlossary}. * @param error Error, if any * @param [response] Glossary */ type GetGlossaryCallback = (error: (Error|null), response?: google.cloud.translation.v3beta1.Glossary) => void; /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#deleteGlossary}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|deleteGlossary}. * @param error Error, if any * @param [response] Operation */ @@ -4760,6 +5033,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslateTextGlossaryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TranslateTextRequest. */ @@ -4892,6 +5172,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslateTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TranslateTextResponse. */ @@ -4988,6 +5275,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslateTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Translation. */ @@ -5096,6 +5390,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Translation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DetectLanguageRequest. */ @@ -5213,6 +5514,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectLanguageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DetectedLanguage. */ @@ -5309,6 +5617,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedLanguage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DetectLanguageResponse. */ @@ -5399,6 +5714,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectLanguageResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetSupportedLanguagesRequest. */ @@ -5501,6 +5823,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSupportedLanguagesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SupportedLanguages. */ @@ -5591,6 +5920,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupportedLanguages + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SupportedLanguage. */ @@ -5699,6 +6035,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupportedLanguage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GcsSource. */ @@ -5789,6 +6132,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an InputConfig. */ @@ -5888,6 +6238,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GcsDestination. */ @@ -5978,6 +6335,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OutputConfig. */ @@ -6071,6 +6435,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DocumentInputConfig. */ @@ -6176,6 +6547,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DocumentOutputConfig. */ @@ -6275,6 +6653,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TranslateDocumentRequest. */ @@ -6407,6 +6792,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslateDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DocumentTranslation. */ @@ -6509,6 +6901,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentTranslation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TranslateDocumentResponse. */ @@ -6617,6 +7016,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslateDocumentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchTranslateTextRequest. */ @@ -6749,6 +7155,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchTranslateTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchTranslateMetadata. */ @@ -6863,6 +7276,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchTranslateMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace BatchTranslateMetadata { @@ -6990,6 +7410,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchTranslateResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GlossaryInputConfig. */ @@ -7083,6 +7510,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GlossaryInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Glossary. */ @@ -7212,6 +7646,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Glossary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Glossary { @@ -7310,6 +7751,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LanguageCodePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a LanguageCodesSet. */ @@ -7400,6 +7848,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LanguageCodesSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -7497,6 +7952,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGlossaryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetGlossaryRequest. */ @@ -7587,6 +8049,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGlossaryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteGlossaryRequest. */ @@ -7677,6 +8146,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGlossaryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListGlossariesRequest. */ @@ -7785,6 +8261,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGlossariesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListGlossariesResponse. */ @@ -7881,6 +8364,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGlossariesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateGlossaryMetadata. */ @@ -7983,6 +8473,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGlossaryMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace CreateGlossaryMetadata { @@ -8098,6 +8595,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGlossaryMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace DeleteGlossaryMetadata { @@ -8213,6 +8717,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGlossaryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchTranslateDocumentRequest. */ @@ -8345,6 +8856,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchTranslateDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchDocumentInputConfig. */ @@ -8438,6 +8956,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDocumentInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchDocumentOutputConfig. */ @@ -8531,6 +9056,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDocumentOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchTranslateDocumentResponse. */ @@ -8675,6 +9207,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchTranslateDocumentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchTranslateDocumentMetadata. */ @@ -8819,6 +9358,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchTranslateDocumentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace BatchTranslateDocumentMetadata { @@ -8934,6 +9480,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a HttpRule. */ @@ -9081,6 +9634,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CustomHttpPattern. */ @@ -9177,6 +9737,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** FieldBehavior enum. */ @@ -9315,6 +9882,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ResourceDescriptor { @@ -9427,6 +10001,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -9521,6 +10102,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FileDescriptorProto. */ @@ -9561,6 +10149,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -9608,6 +10199,9 @@ export namespace google { /** FileDescriptorProto syntax. */ public syntax: string; + /** FileDescriptorProto edition. */ + public edition: string; + /** * Creates a new FileDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -9677,6 +10271,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DescriptorProto. */ @@ -9821,6 +10422,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace DescriptorProto { @@ -9925,6 +10533,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ReservedRange. */ @@ -10021,6 +10636,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -10112,6 +10734,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FieldDescriptorProto. */ @@ -10262,6 +10891,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace FieldDescriptorProto { @@ -10390,6 +11026,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an EnumDescriptorProto. */ @@ -10504,6 +11147,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace EnumDescriptorProto { @@ -10602,6 +11252,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -10705,6 +11362,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ServiceDescriptorProto. */ @@ -10807,6 +11471,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MethodDescriptorProto. */ @@ -10927,6 +11598,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FileOptions. */ @@ -11140,6 +11818,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace FileOptions { @@ -11267,6 +11952,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FieldOptions. */ @@ -11284,6 +11976,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -11321,6 +12016,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -11399,6 +12097,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace FieldOptions { @@ -11506,6 +12211,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an EnumOptions. */ @@ -11608,6 +12320,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an EnumValueOptions. */ @@ -11704,6 +12423,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ServiceOptions. */ @@ -11806,6 +12532,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MethodOptions. */ @@ -11917,6 +12650,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace MethodOptions { @@ -12053,6 +12793,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace UninterpretedOption { @@ -12151,6 +12898,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -12242,6 +12996,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace SourceCodeInfo { @@ -12358,6 +13119,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -12449,6 +13217,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace GeneratedCodeInfo { @@ -12467,6 +13242,9 @@ export namespace google { /** Annotation end */ end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); } /** Represents an Annotation. */ @@ -12490,6 +13268,9 @@ export namespace google { /** Annotation end. */ public end: number; + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + /** * Creates a new Annotation instance using the specified properties. * @param [properties] Properties to set @@ -12559,6 +13340,23 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } } } @@ -12656,6 +13454,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Duration. */ @@ -12752,6 +13557,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Empty. */ @@ -12836,6 +13648,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Timestamp. */ @@ -12932,6 +13751,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -13032,35 +13858,35 @@ export namespace google { namespace Operations { /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. + * Callback as used by {@link google.longrunning.Operations|listOperations}. * @param error Error, if any * @param [response] ListOperationsResponse */ type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. + * Callback as used by {@link google.longrunning.Operations|getOperation}. * @param error Error, if any * @param [response] Operation */ type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. * @param error Error, if any * @param [response] Empty */ type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. * @param error Error, if any * @param [response] Empty */ type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * Callback as used by {@link google.longrunning.Operations|waitOperation}. * @param error Error, if any * @param [response] Operation */ @@ -13182,6 +14008,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetOperationRequest. */ @@ -13272,6 +14105,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListOperationsRequest. */ @@ -13380,6 +14220,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListOperationsResponse. */ @@ -13476,6 +14323,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CancelOperationRequest. */ @@ -13566,6 +14420,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteOperationRequest. */ @@ -13656,6 +14517,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a WaitOperationRequest. */ @@ -13752,6 +14620,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OperationInfo. */ @@ -13848,6 +14723,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -13954,6 +14836,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index 214151b63a9..d8c6b0f70a7 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -99,7 +99,7 @@ }; /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#translateText}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|translateText}. * @memberof google.cloud.translation.v3.TranslationService * @typedef TranslateTextCallback * @type {function} @@ -132,7 +132,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#detectLanguage}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|detectLanguage}. * @memberof google.cloud.translation.v3.TranslationService * @typedef DetectLanguageCallback * @type {function} @@ -165,7 +165,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#getSupportedLanguages}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|getSupportedLanguages}. * @memberof google.cloud.translation.v3.TranslationService * @typedef GetSupportedLanguagesCallback * @type {function} @@ -198,7 +198,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#translateDocument}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|translateDocument}. * @memberof google.cloud.translation.v3.TranslationService * @typedef TranslateDocumentCallback * @type {function} @@ -231,7 +231,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#batchTranslateText}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|batchTranslateText}. * @memberof google.cloud.translation.v3.TranslationService * @typedef BatchTranslateTextCallback * @type {function} @@ -264,7 +264,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#batchTranslateDocument}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|batchTranslateDocument}. * @memberof google.cloud.translation.v3.TranslationService * @typedef BatchTranslateDocumentCallback * @type {function} @@ -297,7 +297,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#createGlossary}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|createGlossary}. * @memberof google.cloud.translation.v3.TranslationService * @typedef CreateGlossaryCallback * @type {function} @@ -330,7 +330,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#listGlossaries}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|listGlossaries}. * @memberof google.cloud.translation.v3.TranslationService * @typedef ListGlossariesCallback * @type {function} @@ -363,7 +363,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#getGlossary}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|getGlossary}. * @memberof google.cloud.translation.v3.TranslationService * @typedef GetGlossaryCallback * @type {function} @@ -396,7 +396,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3.TranslationService#deleteGlossary}. + * Callback as used by {@link google.cloud.translation.v3.TranslationService|deleteGlossary}. * @memberof google.cloud.translation.v3.TranslationService * @typedef DeleteGlossaryCallback * @type {function} @@ -534,12 +534,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.glossary = reader.string(); - break; - case 2: - message.ignoreCase = reader.bool(); - break; + case 1: { + message.glossary = reader.string(); + break; + } + case 2: { + message.ignoreCase = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -638,6 +640,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TranslateTextGlossaryConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3.TranslateTextGlossaryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslateTextGlossaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.TranslateTextGlossaryConfig"; + }; + return TranslateTextGlossaryConfig; })(); @@ -814,51 +831,59 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.contents && message.contents.length)) - message.contents = []; - message.contents.push(reader.string()); - break; - case 3: - message.mimeType = reader.string(); - break; - case 4: - message.sourceLanguageCode = reader.string(); - break; - case 5: - message.targetLanguageCode = reader.string(); - break; - case 8: - message.parent = reader.string(); - break; - case 6: - message.model = reader.string(); - break; - case 7: - message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; - case 10: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push(reader.string()); + break; + } + case 3: { + message.mimeType = reader.string(); + break; + } + case 4: { + message.sourceLanguageCode = reader.string(); + break; + } + case 5: { + message.targetLanguageCode = reader.string(); + break; + } + case 8: { + message.parent = reader.string(); + break; + } + case 6: { + message.model = reader.string(); + break; + } + case 7: { + message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; } - message.labels[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -1038,6 +1063,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TranslateTextRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3.TranslateTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.TranslateTextRequest"; + }; + return TranslateTextRequest; })(); @@ -1148,16 +1188,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.translations && message.translations.length)) - message.translations = []; - message.translations.push($root.google.cloud.translation.v3.Translation.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.glossaryTranslations && message.glossaryTranslations.length)) - message.glossaryTranslations = []; - message.glossaryTranslations.push($root.google.cloud.translation.v3.Translation.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.translations && message.translations.length)) + message.translations = []; + message.translations.push($root.google.cloud.translation.v3.Translation.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.glossaryTranslations && message.glossaryTranslations.length)) + message.glossaryTranslations = []; + message.glossaryTranslations.push($root.google.cloud.translation.v3.Translation.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -1290,6 +1332,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TranslateTextResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3.TranslateTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.TranslateTextResponse"; + }; + return TranslateTextResponse; })(); @@ -1418,18 +1475,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.translatedText = reader.string(); - break; - case 2: - message.model = reader.string(); - break; - case 4: - message.detectedLanguageCode = reader.string(); - break; - case 3: - message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.translatedText = reader.string(); + break; + } + case 2: { + message.model = reader.string(); + break; + } + case 4: { + message.detectedLanguageCode = reader.string(); + break; + } + case 3: { + message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1549,6 +1610,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Translation + * @function getTypeUrl + * @memberof google.cloud.translation.v3.Translation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Translation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.Translation"; + }; + return Translation; })(); @@ -1704,40 +1780,45 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 5: - message.parent = reader.string(); - break; - case 4: - message.model = reader.string(); - break; - case 1: - message.content = reader.string(); - break; - case 3: - message.mimeType = reader.string(); - break; - case 6: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 5: { + message.parent = reader.string(); + break; + } + case 4: { + message.model = reader.string(); + break; + } + case 1: { + message.content = reader.string(); + break; + } + case 3: { + message.mimeType = reader.string(); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; } - message.labels[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -1880,6 +1961,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DetectLanguageRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3.DetectLanguageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectLanguageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.DetectLanguageRequest"; + }; + return DetectLanguageRequest; })(); @@ -1986,12 +2082,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.languageCode = reader.string(); - break; - case 2: - message.confidence = reader.float(); - break; + case 1: { + message.languageCode = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } default: reader.skipType(tag & 7); break; @@ -2090,6 +2188,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DetectedLanguage + * @function getTypeUrl + * @memberof google.cloud.translation.v3.DetectedLanguage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedLanguage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.DetectedLanguage"; + }; + return DetectedLanguage; })(); @@ -2187,11 +2300,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.languages && message.languages.length)) - message.languages = []; - message.languages.push($root.google.cloud.translation.v3.DetectedLanguage.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.languages && message.languages.length)) + message.languages = []; + message.languages.push($root.google.cloud.translation.v3.DetectedLanguage.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -2298,6 +2412,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DetectLanguageResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3.DetectLanguageResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectLanguageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.DetectLanguageResponse"; + }; + return DetectLanguageResponse; })(); @@ -2415,15 +2544,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.parent = reader.string(); - break; - case 1: - message.displayLanguageCode = reader.string(); - break; - case 2: - message.model = reader.string(); - break; + case 3: { + message.parent = reader.string(); + break; + } + case 1: { + message.displayLanguageCode = reader.string(); + break; + } + case 2: { + message.model = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2530,6 +2662,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetSupportedLanguagesRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3.GetSupportedLanguagesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSupportedLanguagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.GetSupportedLanguagesRequest"; + }; + return GetSupportedLanguagesRequest; })(); @@ -2627,11 +2774,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.languages && message.languages.length)) - message.languages = []; - message.languages.push($root.google.cloud.translation.v3.SupportedLanguage.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.languages && message.languages.length)) + message.languages = []; + message.languages.push($root.google.cloud.translation.v3.SupportedLanguage.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -2738,6 +2886,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SupportedLanguages + * @function getTypeUrl + * @memberof google.cloud.translation.v3.SupportedLanguages + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupportedLanguages.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.SupportedLanguages"; + }; + return SupportedLanguages; })(); @@ -2866,18 +3029,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.languageCode = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.supportSource = reader.bool(); - break; - case 4: - message.supportTarget = reader.bool(); - break; + case 1: { + message.languageCode = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.supportSource = reader.bool(); + break; + } + case 4: { + message.supportTarget = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -2992,6 +3159,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SupportedLanguage + * @function getTypeUrl + * @memberof google.cloud.translation.v3.SupportedLanguage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupportedLanguage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.SupportedLanguage"; + }; + return SupportedLanguage; })(); @@ -3087,9 +3269,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.inputUri = reader.string(); - break; + case 1: { + message.inputUri = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3179,6 +3362,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GcsSource + * @function getTypeUrl + * @memberof google.cloud.translation.v3.GcsSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.GcsSource"; + }; + return GcsSource; })(); @@ -3299,12 +3497,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.mimeType = reader.string(); - break; - case 2: - message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); - break; + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3413,6 +3613,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3.InputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.InputConfig"; + }; + return InputConfig; })(); @@ -3508,9 +3723,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.outputUriPrefix = reader.string(); - break; + case 1: { + message.outputUriPrefix = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3600,6 +3816,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.translation.v3.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.GcsDestination"; + }; + return GcsDestination; })(); @@ -3709,9 +3940,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3811,6 +4043,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OutputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3.OutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.OutputConfig"; + }; + return OutputConfig; })(); @@ -3942,15 +4189,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.content = reader.bytes(); - break; - case 2: - message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); - break; - case 4: - message.mimeType = reader.string(); - break; + case 1: { + message.content = reader.bytes(); + break; + } + case 2: { + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.mimeType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4023,7 +4273,7 @@ if (object.content != null) if (typeof object.content === "string") $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); - else if (object.content.length) + else if (object.content.length >= 0) message.content = object.content; if (object.gcsSource != null) { if (typeof object.gcsSource !== "object") @@ -4076,6 +4326,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DocumentInputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3.DocumentInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.DocumentInputConfig"; + }; + return DocumentInputConfig; })(); @@ -4196,12 +4461,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.decode(reader, reader.uint32()); - break; - case 3: - message.mimeType = reader.string(); - break; + case 1: { + message.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 3: { + message.mimeType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4310,6 +4577,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DocumentOutputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3.DocumentOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.DocumentOutputConfig"; + }; + return DocumentOutputConfig; })(); @@ -4484,49 +4766,57 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.sourceLanguageCode = reader.string(); - break; - case 3: - message.targetLanguageCode = reader.string(); - break; - case 4: - message.documentInputConfig = $root.google.cloud.translation.v3.DocumentInputConfig.decode(reader, reader.uint32()); - break; - case 5: - message.documentOutputConfig = $root.google.cloud.translation.v3.DocumentOutputConfig.decode(reader, reader.uint32()); - break; - case 6: - message.model = reader.string(); - break; - case 7: - message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; - case 8: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.sourceLanguageCode = reader.string(); + break; + } + case 3: { + message.targetLanguageCode = reader.string(); + break; + } + case 4: { + message.documentInputConfig = $root.google.cloud.translation.v3.DocumentInputConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.documentOutputConfig = $root.google.cloud.translation.v3.DocumentOutputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.model = reader.string(); + break; + } + case 7: { + message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; } - message.labels[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -4703,6 +4993,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TranslateDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3.TranslateDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.TranslateDocumentRequest"; + }; + return TranslateDocumentRequest; })(); @@ -4822,17 +5127,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.byteStreamOutputs && message.byteStreamOutputs.length)) - message.byteStreamOutputs = []; - message.byteStreamOutputs.push(reader.bytes()); - break; - case 2: - message.mimeType = reader.string(); - break; - case 3: - message.detectedLanguageCode = reader.string(); - break; + case 1: { + if (!(message.byteStreamOutputs && message.byteStreamOutputs.length)) + message.byteStreamOutputs = []; + message.byteStreamOutputs.push(reader.bytes()); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 3: { + message.detectedLanguageCode = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4903,7 +5211,7 @@ for (var i = 0; i < object.byteStreamOutputs.length; ++i) if (typeof object.byteStreamOutputs[i] === "string") $util.base64.decode(object.byteStreamOutputs[i], message.byteStreamOutputs[i] = $util.newBuffer($util.base64.length(object.byteStreamOutputs[i])), 0); - else if (object.byteStreamOutputs[i].length) + else if (object.byteStreamOutputs[i].length >= 0) message.byteStreamOutputs[i] = object.byteStreamOutputs[i]; } if (object.mimeType != null) @@ -4955,6 +5263,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DocumentTranslation + * @function getTypeUrl + * @memberof google.cloud.translation.v3.DocumentTranslation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentTranslation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.DocumentTranslation"; + }; + return DocumentTranslation; })(); @@ -5083,18 +5406,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.documentTranslation = $root.google.cloud.translation.v3.DocumentTranslation.decode(reader, reader.uint32()); - break; - case 2: - message.glossaryDocumentTranslation = $root.google.cloud.translation.v3.DocumentTranslation.decode(reader, reader.uint32()); - break; - case 3: - message.model = reader.string(); - break; - case 4: - message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.documentTranslation = $root.google.cloud.translation.v3.DocumentTranslation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.glossaryDocumentTranslation = $root.google.cloud.translation.v3.DocumentTranslation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.model = reader.string(); + break; + } + case 4: { + message.glossaryConfig = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -5224,6 +5551,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TranslateDocumentResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3.TranslateDocumentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslateDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.TranslateDocumentResponse"; + }; + return TranslateDocumentResponse; })(); @@ -5408,91 +5750,99 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.sourceLanguageCode = reader.string(); - break; - case 3: - if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) - message.targetLanguageCodes = []; - message.targetLanguageCodes.push(reader.string()); - break; - case 4: - if (message.models === $util.emptyObject) - message.models = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.sourceLanguageCode = reader.string(); + break; + } + case 3: { + if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) + message.targetLanguageCodes = []; + message.targetLanguageCodes.push(reader.string()); + break; + } + case 4: { + if (message.models === $util.emptyObject) + message.models = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.models[key] = value; + break; } - message.models[key] = value; - break; - case 5: - if (!(message.inputConfigs && message.inputConfigs.length)) - message.inputConfigs = []; - message.inputConfigs.push($root.google.cloud.translation.v3.InputConfig.decode(reader, reader.uint32())); - break; - case 6: - message.outputConfig = $root.google.cloud.translation.v3.OutputConfig.decode(reader, reader.uint32()); - break; - case 7: - if (message.glossaries === $util.emptyObject) - message.glossaries = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 5: { + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.translation.v3.InputConfig.decode(reader, reader.uint32())); + break; + } + case 6: { + message.outputConfig = $root.google.cloud.translation.v3.OutputConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.glossaries === $util.emptyObject) + message.glossaries = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.glossaries[key] = value; + break; } - message.glossaries[key] = value; - break; - case 9: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; } - message.labels[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -5722,6 +6072,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchTranslateTextRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3.BatchTranslateTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchTranslateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.BatchTranslateTextRequest"; + }; + return BatchTranslateTextRequest; })(); @@ -5861,21 +6226,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.translatedCharacters = reader.int64(); - break; - case 3: - message.failedCharacters = reader.int64(); - break; - case 4: - message.totalCharacters = reader.int64(); - break; - case 5: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.translatedCharacters = reader.int64(); + break; + } + case 3: { + message.failedCharacters = reader.int64(); + break; + } + case 4: { + message.totalCharacters = reader.int64(); + break; + } + case 5: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -6078,6 +6448,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchTranslateMetadata + * @function getTypeUrl + * @memberof google.cloud.translation.v3.BatchTranslateMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchTranslateMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.BatchTranslateMetadata"; + }; + /** * State enum. * @name google.cloud.translation.v3.BatchTranslateMetadata.State @@ -6239,21 +6624,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.totalCharacters = reader.int64(); - break; - case 2: - message.translatedCharacters = reader.int64(); - break; - case 3: - message.failedCharacters = reader.int64(); - break; - case 4: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.totalCharacters = reader.int64(); + break; + } + case 2: { + message.translatedCharacters = reader.int64(); + break; + } + case 3: { + message.failedCharacters = reader.int64(); + break; + } + case 4: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -6428,6 +6818,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchTranslateResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3.BatchTranslateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchTranslateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.BatchTranslateResponse"; + }; + return BatchTranslateResponse; })(); @@ -6537,9 +6942,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -6639,6 +7045,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GlossaryInputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3.GlossaryInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GlossaryInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.GlossaryInputConfig"; + }; + return GlossaryInputConfig; })(); @@ -6814,27 +7235,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.languagePair = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.decode(reader, reader.uint32()); - break; - case 4: - message.languageCodesSet = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.decode(reader, reader.uint32()); - break; - case 5: - message.inputConfig = $root.google.cloud.translation.v3.GlossaryInputConfig.decode(reader, reader.uint32()); - break; - case 6: - message.entryCount = reader.int32(); - break; - case 7: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 8: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.languagePair = $root.google.cloud.translation.v3.Glossary.LanguageCodePair.decode(reader, reader.uint32()); + break; + } + case 4: { + message.languageCodesSet = $root.google.cloud.translation.v3.Glossary.LanguageCodesSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.inputConfig = $root.google.cloud.translation.v3.GlossaryInputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.entryCount = reader.int32(); + break; + } + case 7: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7011,6 +7439,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Glossary + * @function getTypeUrl + * @memberof google.cloud.translation.v3.Glossary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Glossary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.Glossary"; + }; + Glossary.LanguageCodePair = (function() { /** @@ -7114,12 +7557,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.sourceLanguageCode = reader.string(); - break; - case 2: - message.targetLanguageCode = reader.string(); - break; + case 1: { + message.sourceLanguageCode = reader.string(); + break; + } + case 2: { + message.targetLanguageCode = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7218,6 +7663,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for LanguageCodePair + * @function getTypeUrl + * @memberof google.cloud.translation.v3.Glossary.LanguageCodePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LanguageCodePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.Glossary.LanguageCodePair"; + }; + return LanguageCodePair; })(); @@ -7315,11 +7775,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.languageCodes && message.languageCodes.length)) - message.languageCodes = []; - message.languageCodes.push(reader.string()); - break; + case 1: { + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -7421,6 +7882,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for LanguageCodesSet + * @function getTypeUrl + * @memberof google.cloud.translation.v3.Glossary.LanguageCodesSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LanguageCodesSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.Glossary.LanguageCodesSet"; + }; + return LanguageCodesSet; })(); @@ -7530,12 +8006,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.glossary = $root.google.cloud.translation.v3.Glossary.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.glossary = $root.google.cloud.translation.v3.Glossary.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7639,6 +8117,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateGlossaryRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3.CreateGlossaryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGlossaryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.CreateGlossaryRequest"; + }; + return CreateGlossaryRequest; })(); @@ -7734,9 +8227,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7826,6 +8320,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetGlossaryRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3.GetGlossaryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGlossaryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.GetGlossaryRequest"; + }; + return GetGlossaryRequest; })(); @@ -7921,9 +8430,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8013,6 +8523,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteGlossaryRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3.DeleteGlossaryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGlossaryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.DeleteGlossaryRequest"; + }; + return DeleteGlossaryRequest; })(); @@ -8141,18 +8666,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8267,6 +8796,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListGlossariesRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3.ListGlossariesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGlossariesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.ListGlossariesRequest"; + }; + return ListGlossariesRequest; })(); @@ -8375,14 +8919,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.glossaries && message.glossaries.length)) - message.glossaries = []; - message.glossaries.push($root.google.cloud.translation.v3.Glossary.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.glossaries && message.glossaries.length)) + message.glossaries = []; + message.glossaries.push($root.google.cloud.translation.v3.Glossary.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8498,6 +9044,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListGlossariesResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3.ListGlossariesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGlossariesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.ListGlossariesResponse"; + }; + return ListGlossariesResponse; })(); @@ -8615,15 +9176,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.state = reader.int32(); - break; - case 3: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8768,6 +9332,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateGlossaryMetadata + * @function getTypeUrl + * @memberof google.cloud.translation.v3.CreateGlossaryMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGlossaryMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.CreateGlossaryMetadata"; + }; + /** * State enum. * @name google.cloud.translation.v3.CreateGlossaryMetadata.State @@ -8907,15 +9486,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.state = reader.int32(); - break; - case 3: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9060,6 +9642,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteGlossaryMetadata + * @function getTypeUrl + * @memberof google.cloud.translation.v3.DeleteGlossaryMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGlossaryMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.DeleteGlossaryMetadata"; + }; + /** * State enum. * @name google.cloud.translation.v3.DeleteGlossaryMetadata.State @@ -9199,15 +9796,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9324,6 +9924,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteGlossaryResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3.DeleteGlossaryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGlossaryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.DeleteGlossaryResponse"; + }; + return DeleteGlossaryResponse; })(); @@ -9508,91 +10123,99 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.sourceLanguageCode = reader.string(); - break; - case 3: - if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) - message.targetLanguageCodes = []; - message.targetLanguageCodes.push(reader.string()); - break; - case 4: - if (!(message.inputConfigs && message.inputConfigs.length)) - message.inputConfigs = []; - message.inputConfigs.push($root.google.cloud.translation.v3.BatchDocumentInputConfig.decode(reader, reader.uint32())); - break; - case 5: - message.outputConfig = $root.google.cloud.translation.v3.BatchDocumentOutputConfig.decode(reader, reader.uint32()); - break; - case 6: - if (message.models === $util.emptyObject) - message.models = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.sourceLanguageCode = reader.string(); + break; + } + case 3: { + if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) + message.targetLanguageCodes = []; + message.targetLanguageCodes.push(reader.string()); + break; + } + case 4: { + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.translation.v3.BatchDocumentInputConfig.decode(reader, reader.uint32())); + break; + } + case 5: { + message.outputConfig = $root.google.cloud.translation.v3.BatchDocumentOutputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.models === $util.emptyObject) + message.models = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.models[key] = value; + break; } - message.models[key] = value; - break; - case 7: - if (message.glossaries === $util.emptyObject) - message.glossaries = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 7: { + if (message.glossaries === $util.emptyObject) + message.glossaries = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.translation.v3.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.glossaries[key] = value; + break; } - message.glossaries[key] = value; - break; - case 8: - if (message.formatConversions === $util.emptyObject) - message.formatConversions = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 8: { + if (message.formatConversions === $util.emptyObject) + message.formatConversions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.formatConversions[key] = value; + break; } - message.formatConversions[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -9822,6 +10445,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchTranslateDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3.BatchTranslateDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchTranslateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.BatchTranslateDocumentRequest"; + }; + return BatchTranslateDocumentRequest; })(); @@ -9931,9 +10569,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsSource = $root.google.cloud.translation.v3.GcsSource.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -10033,6 +10672,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchDocumentInputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3.BatchDocumentInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDocumentInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.BatchDocumentInputConfig"; + }; + return BatchDocumentInputConfig; })(); @@ -10142,9 +10796,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsDestination = $root.google.cloud.translation.v3.GcsDestination.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -10244,6 +10899,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchDocumentOutputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3.BatchDocumentOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDocumentOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.BatchDocumentOutputConfig"; + }; + return BatchDocumentOutputConfig; })(); @@ -10438,36 +11108,46 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.totalPages = reader.int64(); - break; - case 2: - message.translatedPages = reader.int64(); - break; - case 3: - message.failedPages = reader.int64(); - break; - case 4: - message.totalBillablePages = reader.int64(); - break; - case 5: - message.totalCharacters = reader.int64(); - break; - case 6: - message.translatedCharacters = reader.int64(); - break; - case 7: - message.failedCharacters = reader.int64(); - break; - case 8: - message.totalBillableCharacters = reader.int64(); - break; - case 9: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.totalPages = reader.int64(); + break; + } + case 2: { + message.translatedPages = reader.int64(); + break; + } + case 3: { + message.failedPages = reader.int64(); + break; + } + case 4: { + message.totalBillablePages = reader.int64(); + break; + } + case 5: { + message.totalCharacters = reader.int64(); + break; + } + case 6: { + message.translatedCharacters = reader.int64(); + break; + } + case 7: { + message.failedCharacters = reader.int64(); + break; + } + case 8: { + message.totalBillableCharacters = reader.int64(); + break; + } + case 9: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -10752,6 +11432,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchTranslateDocumentResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3.BatchTranslateDocumentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchTranslateDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.BatchTranslateDocumentResponse"; + }; + return BatchTranslateDocumentResponse; })(); @@ -10946,36 +11641,46 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.totalPages = reader.int64(); - break; - case 3: - message.translatedPages = reader.int64(); - break; - case 4: - message.failedPages = reader.int64(); - break; - case 5: - message.totalBillablePages = reader.int64(); - break; - case 6: - message.totalCharacters = reader.int64(); - break; - case 7: - message.translatedCharacters = reader.int64(); - break; - case 8: - message.failedCharacters = reader.int64(); - break; - case 9: - message.totalBillableCharacters = reader.int64(); - break; - case 10: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.totalPages = reader.int64(); + break; + } + case 3: { + message.translatedPages = reader.int64(); + break; + } + case 4: { + message.failedPages = reader.int64(); + break; + } + case 5: { + message.totalBillablePages = reader.int64(); + break; + } + case 6: { + message.totalCharacters = reader.int64(); + break; + } + case 7: { + message.translatedCharacters = reader.int64(); + break; + } + case 8: { + message.failedCharacters = reader.int64(); + break; + } + case 9: { + message.totalBillableCharacters = reader.int64(); + break; + } + case 10: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -11288,6 +11993,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchTranslateDocumentMetadata + * @function getTypeUrl + * @memberof google.cloud.translation.v3.BatchTranslateDocumentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchTranslateDocumentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3.BatchTranslateDocumentMetadata"; + }; + /** * State enum. * @name google.cloud.translation.v3.BatchTranslateDocumentMetadata.State @@ -11358,7 +12078,7 @@ }; /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#translateText}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|translateText}. * @memberof google.cloud.translation.v3beta1.TranslationService * @typedef TranslateTextCallback * @type {function} @@ -11391,7 +12111,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#detectLanguage}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|detectLanguage}. * @memberof google.cloud.translation.v3beta1.TranslationService * @typedef DetectLanguageCallback * @type {function} @@ -11424,7 +12144,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#getSupportedLanguages}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|getSupportedLanguages}. * @memberof google.cloud.translation.v3beta1.TranslationService * @typedef GetSupportedLanguagesCallback * @type {function} @@ -11457,7 +12177,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#translateDocument}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|translateDocument}. * @memberof google.cloud.translation.v3beta1.TranslationService * @typedef TranslateDocumentCallback * @type {function} @@ -11490,7 +12210,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#batchTranslateText}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|batchTranslateText}. * @memberof google.cloud.translation.v3beta1.TranslationService * @typedef BatchTranslateTextCallback * @type {function} @@ -11523,7 +12243,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#batchTranslateDocument}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|batchTranslateDocument}. * @memberof google.cloud.translation.v3beta1.TranslationService * @typedef BatchTranslateDocumentCallback * @type {function} @@ -11556,7 +12276,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#createGlossary}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|createGlossary}. * @memberof google.cloud.translation.v3beta1.TranslationService * @typedef CreateGlossaryCallback * @type {function} @@ -11589,7 +12309,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#listGlossaries}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|listGlossaries}. * @memberof google.cloud.translation.v3beta1.TranslationService * @typedef ListGlossariesCallback * @type {function} @@ -11622,7 +12342,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#getGlossary}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|getGlossary}. * @memberof google.cloud.translation.v3beta1.TranslationService * @typedef GetGlossaryCallback * @type {function} @@ -11655,7 +12375,7 @@ */ /** - * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService#deleteGlossary}. + * Callback as used by {@link google.cloud.translation.v3beta1.TranslationService|deleteGlossary}. * @memberof google.cloud.translation.v3beta1.TranslationService * @typedef DeleteGlossaryCallback * @type {function} @@ -11793,12 +12513,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.glossary = reader.string(); - break; - case 2: - message.ignoreCase = reader.bool(); - break; + case 1: { + message.glossary = reader.string(); + break; + } + case 2: { + message.ignoreCase = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -11897,6 +12619,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TranslateTextGlossaryConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.TranslateTextGlossaryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslateTextGlossaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.TranslateTextGlossaryConfig"; + }; + return TranslateTextGlossaryConfig; })(); @@ -12073,51 +12810,59 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.contents && message.contents.length)) - message.contents = []; - message.contents.push(reader.string()); - break; - case 3: - message.mimeType = reader.string(); - break; - case 4: - message.sourceLanguageCode = reader.string(); - break; - case 5: - message.targetLanguageCode = reader.string(); - break; - case 8: - message.parent = reader.string(); - break; - case 6: - message.model = reader.string(); - break; - case 7: - message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; - case 10: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push(reader.string()); + break; + } + case 3: { + message.mimeType = reader.string(); + break; + } + case 4: { + message.sourceLanguageCode = reader.string(); + break; + } + case 5: { + message.targetLanguageCode = reader.string(); + break; + } + case 8: { + message.parent = reader.string(); + break; + } + case 6: { + message.model = reader.string(); + break; + } + case 7: { + message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; } - message.labels[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -12297,6 +13042,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TranslateTextRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.TranslateTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.TranslateTextRequest"; + }; + return TranslateTextRequest; })(); @@ -12407,16 +13167,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.translations && message.translations.length)) - message.translations = []; - message.translations.push($root.google.cloud.translation.v3beta1.Translation.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.glossaryTranslations && message.glossaryTranslations.length)) - message.glossaryTranslations = []; - message.glossaryTranslations.push($root.google.cloud.translation.v3beta1.Translation.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.translations && message.translations.length)) + message.translations = []; + message.translations.push($root.google.cloud.translation.v3beta1.Translation.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.glossaryTranslations && message.glossaryTranslations.length)) + message.glossaryTranslations = []; + message.glossaryTranslations.push($root.google.cloud.translation.v3beta1.Translation.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -12549,6 +13311,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TranslateTextResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.TranslateTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.TranslateTextResponse"; + }; + return TranslateTextResponse; })(); @@ -12677,18 +13454,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.translatedText = reader.string(); - break; - case 2: - message.model = reader.string(); - break; - case 4: - message.detectedLanguageCode = reader.string(); - break; - case 3: - message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.translatedText = reader.string(); + break; + } + case 2: { + message.model = reader.string(); + break; + } + case 4: { + message.detectedLanguageCode = reader.string(); + break; + } + case 3: { + message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -12808,6 +13589,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Translation + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.Translation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Translation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.Translation"; + }; + return Translation; })(); @@ -12963,40 +13759,45 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 5: - message.parent = reader.string(); - break; - case 4: - message.model = reader.string(); - break; - case 1: - message.content = reader.string(); - break; - case 3: - message.mimeType = reader.string(); - break; - case 6: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 5: { + message.parent = reader.string(); + break; + } + case 4: { + message.model = reader.string(); + break; + } + case 1: { + message.content = reader.string(); + break; + } + case 3: { + message.mimeType = reader.string(); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; } - message.labels[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -13139,6 +13940,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DetectLanguageRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.DetectLanguageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectLanguageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.DetectLanguageRequest"; + }; + return DetectLanguageRequest; })(); @@ -13245,12 +14061,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.languageCode = reader.string(); - break; - case 2: - message.confidence = reader.float(); - break; + case 1: { + message.languageCode = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } default: reader.skipType(tag & 7); break; @@ -13349,6 +14167,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DetectedLanguage + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.DetectedLanguage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedLanguage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.DetectedLanguage"; + }; + return DetectedLanguage; })(); @@ -13446,11 +14279,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.languages && message.languages.length)) - message.languages = []; - message.languages.push($root.google.cloud.translation.v3beta1.DetectedLanguage.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.languages && message.languages.length)) + message.languages = []; + message.languages.push($root.google.cloud.translation.v3beta1.DetectedLanguage.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -13557,6 +14391,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DetectLanguageResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.DetectLanguageResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectLanguageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.DetectLanguageResponse"; + }; + return DetectLanguageResponse; })(); @@ -13674,15 +14523,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.parent = reader.string(); - break; - case 1: - message.displayLanguageCode = reader.string(); - break; - case 2: - message.model = reader.string(); - break; + case 3: { + message.parent = reader.string(); + break; + } + case 1: { + message.displayLanguageCode = reader.string(); + break; + } + case 2: { + message.model = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -13789,6 +14641,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetSupportedLanguagesRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.GetSupportedLanguagesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSupportedLanguagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.GetSupportedLanguagesRequest"; + }; + return GetSupportedLanguagesRequest; })(); @@ -13886,11 +14753,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.languages && message.languages.length)) - message.languages = []; - message.languages.push($root.google.cloud.translation.v3beta1.SupportedLanguage.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.languages && message.languages.length)) + message.languages = []; + message.languages.push($root.google.cloud.translation.v3beta1.SupportedLanguage.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -13997,6 +14865,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SupportedLanguages + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.SupportedLanguages + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupportedLanguages.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.SupportedLanguages"; + }; + return SupportedLanguages; })(); @@ -14125,18 +15008,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.languageCode = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.supportSource = reader.bool(); - break; - case 4: - message.supportTarget = reader.bool(); - break; + case 1: { + message.languageCode = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.supportSource = reader.bool(); + break; + } + case 4: { + message.supportTarget = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -14251,6 +15138,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SupportedLanguage + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.SupportedLanguage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupportedLanguage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.SupportedLanguage"; + }; + return SupportedLanguage; })(); @@ -14346,9 +15248,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.inputUri = reader.string(); - break; + case 1: { + message.inputUri = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -14438,6 +15341,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GcsSource + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.GcsSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.GcsSource"; + }; + return GcsSource; })(); @@ -14558,12 +15476,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.mimeType = reader.string(); - break; - case 2: - message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); - break; + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -14672,6 +15592,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.InputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.InputConfig"; + }; + return InputConfig; })(); @@ -14767,9 +15702,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.outputUriPrefix = reader.string(); - break; + case 1: { + message.outputUriPrefix = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -14859,6 +15795,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.GcsDestination"; + }; + return GcsDestination; })(); @@ -14968,9 +15919,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -15070,6 +16022,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OutputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.OutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.OutputConfig"; + }; + return OutputConfig; })(); @@ -15201,15 +16168,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.content = reader.bytes(); - break; - case 2: - message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); - break; - case 4: - message.mimeType = reader.string(); - break; + case 1: { + message.content = reader.bytes(); + break; + } + case 2: { + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.mimeType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -15282,7 +16252,7 @@ if (object.content != null) if (typeof object.content === "string") $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); - else if (object.content.length) + else if (object.content.length >= 0) message.content = object.content; if (object.gcsSource != null) { if (typeof object.gcsSource !== "object") @@ -15335,6 +16305,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DocumentInputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.DocumentInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.DocumentInputConfig"; + }; + return DocumentInputConfig; })(); @@ -15455,12 +16440,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.decode(reader, reader.uint32()); - break; - case 3: - message.mimeType = reader.string(); - break; + case 1: { + message.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 3: { + message.mimeType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -15569,6 +16556,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DocumentOutputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.DocumentOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.DocumentOutputConfig"; + }; + return DocumentOutputConfig; })(); @@ -15743,49 +16745,57 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.sourceLanguageCode = reader.string(); - break; - case 3: - message.targetLanguageCode = reader.string(); - break; - case 4: - message.documentInputConfig = $root.google.cloud.translation.v3beta1.DocumentInputConfig.decode(reader, reader.uint32()); - break; - case 5: - message.documentOutputConfig = $root.google.cloud.translation.v3beta1.DocumentOutputConfig.decode(reader, reader.uint32()); - break; - case 6: - message.model = reader.string(); - break; - case 7: - message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; - case 8: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.sourceLanguageCode = reader.string(); + break; + } + case 3: { + message.targetLanguageCode = reader.string(); + break; + } + case 4: { + message.documentInputConfig = $root.google.cloud.translation.v3beta1.DocumentInputConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.documentOutputConfig = $root.google.cloud.translation.v3beta1.DocumentOutputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.model = reader.string(); + break; + } + case 7: { + message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; } - message.labels[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -15962,6 +16972,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TranslateDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.TranslateDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.TranslateDocumentRequest"; + }; + return TranslateDocumentRequest; })(); @@ -16081,17 +17106,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.byteStreamOutputs && message.byteStreamOutputs.length)) - message.byteStreamOutputs = []; - message.byteStreamOutputs.push(reader.bytes()); - break; - case 2: - message.mimeType = reader.string(); - break; - case 3: - message.detectedLanguageCode = reader.string(); - break; + case 1: { + if (!(message.byteStreamOutputs && message.byteStreamOutputs.length)) + message.byteStreamOutputs = []; + message.byteStreamOutputs.push(reader.bytes()); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 3: { + message.detectedLanguageCode = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -16162,7 +17190,7 @@ for (var i = 0; i < object.byteStreamOutputs.length; ++i) if (typeof object.byteStreamOutputs[i] === "string") $util.base64.decode(object.byteStreamOutputs[i], message.byteStreamOutputs[i] = $util.newBuffer($util.base64.length(object.byteStreamOutputs[i])), 0); - else if (object.byteStreamOutputs[i].length) + else if (object.byteStreamOutputs[i].length >= 0) message.byteStreamOutputs[i] = object.byteStreamOutputs[i]; } if (object.mimeType != null) @@ -16214,6 +17242,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DocumentTranslation + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.DocumentTranslation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentTranslation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.DocumentTranslation"; + }; + return DocumentTranslation; })(); @@ -16342,18 +17385,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.documentTranslation = $root.google.cloud.translation.v3beta1.DocumentTranslation.decode(reader, reader.uint32()); - break; - case 2: - message.glossaryDocumentTranslation = $root.google.cloud.translation.v3beta1.DocumentTranslation.decode(reader, reader.uint32()); - break; - case 3: - message.model = reader.string(); - break; - case 4: - message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.documentTranslation = $root.google.cloud.translation.v3beta1.DocumentTranslation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.glossaryDocumentTranslation = $root.google.cloud.translation.v3beta1.DocumentTranslation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.model = reader.string(); + break; + } + case 4: { + message.glossaryConfig = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -16483,6 +17530,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TranslateDocumentResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.TranslateDocumentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslateDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.TranslateDocumentResponse"; + }; + return TranslateDocumentResponse; })(); @@ -16667,91 +17729,99 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.sourceLanguageCode = reader.string(); - break; - case 3: - if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) - message.targetLanguageCodes = []; - message.targetLanguageCodes.push(reader.string()); - break; - case 4: - if (message.models === $util.emptyObject) - message.models = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.sourceLanguageCode = reader.string(); + break; + } + case 3: { + if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) + message.targetLanguageCodes = []; + message.targetLanguageCodes.push(reader.string()); + break; + } + case 4: { + if (message.models === $util.emptyObject) + message.models = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.models[key] = value; + break; } - message.models[key] = value; - break; - case 5: - if (!(message.inputConfigs && message.inputConfigs.length)) - message.inputConfigs = []; - message.inputConfigs.push($root.google.cloud.translation.v3beta1.InputConfig.decode(reader, reader.uint32())); - break; - case 6: - message.outputConfig = $root.google.cloud.translation.v3beta1.OutputConfig.decode(reader, reader.uint32()); - break; - case 7: - if (message.glossaries === $util.emptyObject) - message.glossaries = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 5: { + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.translation.v3beta1.InputConfig.decode(reader, reader.uint32())); + break; + } + case 6: { + message.outputConfig = $root.google.cloud.translation.v3beta1.OutputConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.glossaries === $util.emptyObject) + message.glossaries = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.glossaries[key] = value; + break; } - message.glossaries[key] = value; - break; - case 9: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; } - message.labels[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -16981,6 +18051,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchTranslateTextRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.BatchTranslateTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchTranslateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.BatchTranslateTextRequest"; + }; + return BatchTranslateTextRequest; })(); @@ -17120,21 +18205,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.translatedCharacters = reader.int64(); - break; - case 3: - message.failedCharacters = reader.int64(); - break; - case 4: - message.totalCharacters = reader.int64(); - break; - case 5: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.translatedCharacters = reader.int64(); + break; + } + case 3: { + message.failedCharacters = reader.int64(); + break; + } + case 4: { + message.totalCharacters = reader.int64(); + break; + } + case 5: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -17337,6 +18427,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchTranslateMetadata + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.BatchTranslateMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchTranslateMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.BatchTranslateMetadata"; + }; + /** * State enum. * @name google.cloud.translation.v3beta1.BatchTranslateMetadata.State @@ -17498,21 +18603,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.totalCharacters = reader.int64(); - break; - case 2: - message.translatedCharacters = reader.int64(); - break; - case 3: - message.failedCharacters = reader.int64(); - break; - case 4: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.totalCharacters = reader.int64(); + break; + } + case 2: { + message.translatedCharacters = reader.int64(); + break; + } + case 3: { + message.failedCharacters = reader.int64(); + break; + } + case 4: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -17687,6 +18797,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchTranslateResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.BatchTranslateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchTranslateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.BatchTranslateResponse"; + }; + return BatchTranslateResponse; })(); @@ -17796,9 +18921,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -17898,6 +19024,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GlossaryInputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.GlossaryInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GlossaryInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.GlossaryInputConfig"; + }; + return GlossaryInputConfig; })(); @@ -18073,27 +19214,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.languagePair = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.decode(reader, reader.uint32()); - break; - case 4: - message.languageCodesSet = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.decode(reader, reader.uint32()); - break; - case 5: - message.inputConfig = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.decode(reader, reader.uint32()); - break; - case 6: - message.entryCount = reader.int32(); - break; - case 7: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 8: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.languagePair = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodePair.decode(reader, reader.uint32()); + break; + } + case 4: { + message.languageCodesSet = $root.google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.inputConfig = $root.google.cloud.translation.v3beta1.GlossaryInputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.entryCount = reader.int32(); + break; + } + case 7: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -18270,6 +19418,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Glossary + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.Glossary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Glossary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.Glossary"; + }; + Glossary.LanguageCodePair = (function() { /** @@ -18373,12 +19536,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.sourceLanguageCode = reader.string(); - break; - case 2: - message.targetLanguageCode = reader.string(); - break; + case 1: { + message.sourceLanguageCode = reader.string(); + break; + } + case 2: { + message.targetLanguageCode = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -18477,6 +19642,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for LanguageCodePair + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LanguageCodePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.Glossary.LanguageCodePair"; + }; + return LanguageCodePair; })(); @@ -18574,11 +19754,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.languageCodes && message.languageCodes.length)) - message.languageCodes = []; - message.languageCodes.push(reader.string()); - break; + case 1: { + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -18680,6 +19861,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for LanguageCodesSet + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.Glossary.LanguageCodesSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LanguageCodesSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.Glossary.LanguageCodesSet"; + }; + return LanguageCodesSet; })(); @@ -18789,12 +19985,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.glossary = $root.google.cloud.translation.v3beta1.Glossary.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.glossary = $root.google.cloud.translation.v3beta1.Glossary.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -18898,6 +20096,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateGlossaryRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.CreateGlossaryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGlossaryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.CreateGlossaryRequest"; + }; + return CreateGlossaryRequest; })(); @@ -18993,9 +20206,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -19085,6 +20299,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetGlossaryRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.GetGlossaryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGlossaryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.GetGlossaryRequest"; + }; + return GetGlossaryRequest; })(); @@ -19180,9 +20409,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -19272,6 +20502,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteGlossaryRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGlossaryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.DeleteGlossaryRequest"; + }; + return DeleteGlossaryRequest; })(); @@ -19400,18 +20645,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -19526,6 +20775,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListGlossariesRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.ListGlossariesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGlossariesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.ListGlossariesRequest"; + }; + return ListGlossariesRequest; })(); @@ -19634,14 +20898,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.glossaries && message.glossaries.length)) - message.glossaries = []; - message.glossaries.push($root.google.cloud.translation.v3beta1.Glossary.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.glossaries && message.glossaries.length)) + message.glossaries = []; + message.glossaries.push($root.google.cloud.translation.v3beta1.Glossary.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -19757,6 +21023,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListGlossariesResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.ListGlossariesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGlossariesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.ListGlossariesResponse"; + }; + return ListGlossariesResponse; })(); @@ -19874,15 +21155,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.state = reader.int32(); - break; - case 3: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -20027,6 +21311,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateGlossaryMetadata + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.CreateGlossaryMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGlossaryMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.CreateGlossaryMetadata"; + }; + /** * State enum. * @name google.cloud.translation.v3beta1.CreateGlossaryMetadata.State @@ -20166,15 +21465,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.state = reader.int32(); - break; - case 3: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -20319,6 +21621,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteGlossaryMetadata + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGlossaryMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.DeleteGlossaryMetadata"; + }; + /** * State enum. * @name google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State @@ -20458,15 +21775,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -20583,6 +21903,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteGlossaryResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.DeleteGlossaryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGlossaryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.DeleteGlossaryResponse"; + }; + return DeleteGlossaryResponse; })(); @@ -20767,91 +22102,99 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.sourceLanguageCode = reader.string(); - break; - case 3: - if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) - message.targetLanguageCodes = []; - message.targetLanguageCodes.push(reader.string()); - break; - case 4: - if (!(message.inputConfigs && message.inputConfigs.length)) - message.inputConfigs = []; - message.inputConfigs.push($root.google.cloud.translation.v3beta1.BatchDocumentInputConfig.decode(reader, reader.uint32())); - break; - case 5: - message.outputConfig = $root.google.cloud.translation.v3beta1.BatchDocumentOutputConfig.decode(reader, reader.uint32()); - break; - case 6: - if (message.models === $util.emptyObject) - message.models = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.sourceLanguageCode = reader.string(); + break; + } + case 3: { + if (!(message.targetLanguageCodes && message.targetLanguageCodes.length)) + message.targetLanguageCodes = []; + message.targetLanguageCodes.push(reader.string()); + break; + } + case 4: { + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.translation.v3beta1.BatchDocumentInputConfig.decode(reader, reader.uint32())); + break; + } + case 5: { + message.outputConfig = $root.google.cloud.translation.v3beta1.BatchDocumentOutputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.models === $util.emptyObject) + message.models = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.models[key] = value; + break; } - message.models[key] = value; - break; - case 7: - if (message.glossaries === $util.emptyObject) - message.glossaries = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 7: { + if (message.glossaries === $util.emptyObject) + message.glossaries = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.glossaries[key] = value; + break; } - message.glossaries[key] = value; - break; - case 8: - if (message.formatConversions === $util.emptyObject) - message.formatConversions = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 8: { + if (message.formatConversions === $util.emptyObject) + message.formatConversions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.formatConversions[key] = value; + break; } - message.formatConversions[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -21081,6 +22424,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchTranslateDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchTranslateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.BatchTranslateDocumentRequest"; + }; + return BatchTranslateDocumentRequest; })(); @@ -21190,9 +22548,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsSource = $root.google.cloud.translation.v3beta1.GcsSource.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -21292,6 +22651,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchDocumentInputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.BatchDocumentInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDocumentInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.BatchDocumentInputConfig"; + }; + return BatchDocumentInputConfig; })(); @@ -21401,9 +22775,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsDestination = $root.google.cloud.translation.v3beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -21503,6 +22878,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchDocumentOutputConfig + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.BatchDocumentOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDocumentOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.BatchDocumentOutputConfig"; + }; + return BatchDocumentOutputConfig; })(); @@ -21697,36 +23087,46 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.totalPages = reader.int64(); - break; - case 2: - message.translatedPages = reader.int64(); - break; - case 3: - message.failedPages = reader.int64(); - break; - case 4: - message.totalBillablePages = reader.int64(); - break; - case 5: - message.totalCharacters = reader.int64(); - break; - case 6: - message.translatedCharacters = reader.int64(); - break; - case 7: - message.failedCharacters = reader.int64(); - break; - case 8: - message.totalBillableCharacters = reader.int64(); - break; - case 9: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.totalPages = reader.int64(); + break; + } + case 2: { + message.translatedPages = reader.int64(); + break; + } + case 3: { + message.failedPages = reader.int64(); + break; + } + case 4: { + message.totalBillablePages = reader.int64(); + break; + } + case 5: { + message.totalCharacters = reader.int64(); + break; + } + case 6: { + message.translatedCharacters = reader.int64(); + break; + } + case 7: { + message.failedCharacters = reader.int64(); + break; + } + case 8: { + message.totalBillableCharacters = reader.int64(); + break; + } + case 9: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -22011,6 +23411,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchTranslateDocumentResponse + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchTranslateDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.BatchTranslateDocumentResponse"; + }; + return BatchTranslateDocumentResponse; })(); @@ -22205,36 +23620,46 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.totalPages = reader.int64(); - break; - case 3: - message.translatedPages = reader.int64(); - break; - case 4: - message.failedPages = reader.int64(); - break; - case 5: - message.totalBillablePages = reader.int64(); - break; - case 6: - message.totalCharacters = reader.int64(); - break; - case 7: - message.translatedCharacters = reader.int64(); - break; - case 8: - message.failedCharacters = reader.int64(); - break; - case 9: - message.totalBillableCharacters = reader.int64(); - break; - case 10: - message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.totalPages = reader.int64(); + break; + } + case 3: { + message.translatedPages = reader.int64(); + break; + } + case 4: { + message.failedPages = reader.int64(); + break; + } + case 5: { + message.totalBillablePages = reader.int64(); + break; + } + case 6: { + message.totalCharacters = reader.int64(); + break; + } + case 7: { + message.translatedCharacters = reader.int64(); + break; + } + case 8: { + message.failedCharacters = reader.int64(); + break; + } + case 9: { + message.totalBillableCharacters = reader.int64(); + break; + } + case 10: { + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -22547,6 +23972,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchTranslateDocumentMetadata + * @function getTypeUrl + * @memberof google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchTranslateDocumentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata"; + }; + /** * State enum. * @name google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State @@ -22695,14 +24135,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - case 2: - message.fullyDecodeReservedExpansion = reader.bool(); - break; + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -22818,6 +24260,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + return Http; })(); @@ -23028,38 +24485,48 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.selector = reader.string(); - break; - case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.responseBody = reader.string(); - break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -23281,6 +24748,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + return HttpRule; })(); @@ -23387,12 +24869,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.kind = reader.string(); - break; - case 2: - message.path = reader.string(); - break; + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -23491,6 +24975,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + return CustomHttpPattern; })(); @@ -23685,36 +25184,43 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - case 3: - message.nameField = reader.string(); - break; - case 4: - message.history = reader.int32(); - break; - case 5: - message.plural = reader.string(); - break; - case 6: - message.singular = reader.string(); - break; - case 10: - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -23912,6 +25418,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + /** * History enum. * @name google.api.ResourceDescriptor.History @@ -24048,12 +25569,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - message.childType = reader.string(); - break; + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -24152,6 +25675,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + return ResourceReference; })(); @@ -24261,11 +25799,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -24372,6 +25911,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + return FileDescriptorSet; })(); @@ -24393,6 +25947,7 @@ * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition */ /** @@ -24513,6 +26068,14 @@ */ FileDescriptorProto.prototype.syntax = ""; + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + /** * Creates a new FileDescriptorProto instance using the specified properties. * @function create @@ -24568,6 +26131,8 @@ writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); return writer; }; @@ -24602,66 +26167,82 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message["package"] = reader.string(); - break; - case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - case 10: - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - case 11: - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - case 4: - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -24773,6 +26354,9 @@ if (message.syntax != null && message.hasOwnProperty("syntax")) if (!$util.isString(message.syntax)) return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; return null; }; @@ -24865,6 +26449,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -24896,6 +26482,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -24942,6 +26529,8 @@ } if (message.syntax != null && message.hasOwnProperty("syntax")) object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; return object; }; @@ -24956,6 +26545,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + return FileDescriptorProto; })(); @@ -25166,52 +26770,62 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -25512,6 +27126,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + DescriptorProto.ExtensionRange = (function() { /** @@ -25626,15 +27255,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25746,6 +27378,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + return ExtensionRange; })(); @@ -25852,12 +27499,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -25956,6 +27605,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + return ReservedRange; })(); @@ -26056,11 +27720,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -26167,6 +27832,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + return ExtensionRangeOptions; })(); @@ -26372,39 +28052,50 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32(); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.typeName = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.defaultValue = reader.string(); - break; - case 9: - message.oneofIndex = reader.int32(); - break; - case 10: - message.jsonName = reader.string(); - break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3Optional = reader.bool(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -26691,6 +28382,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type @@ -26859,12 +28565,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -26968,6 +28676,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + return OneofDescriptorProto; })(); @@ -27113,27 +28836,32 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -27309,6 +29037,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + EnumDescriptorProto.EnumReservedRange = (function() { /** @@ -27412,12 +29155,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -27516,6 +29261,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + return EnumReservedRange; })(); @@ -27636,15 +29396,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -27756,6 +29519,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + return EnumValueDescriptorProto; })(); @@ -27875,17 +29653,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -28015,6 +29796,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + return ServiceDescriptorProto; })(); @@ -28165,24 +29961,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.inputType = reader.string(); - break; - case 3: - message.outputType = reader.string(); - break; - case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.clientStreaming = reader.bool(); - break; - case 6: - message.serverStreaming = reader.bool(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -28318,6 +30120,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + return MethodDescriptorProto; })(); @@ -28648,76 +30465,98 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.javaPackage = reader.string(); - break; - case 8: - message.javaOuterClassname = reader.string(); - break; - case 10: - message.javaMultipleFiles = reader.bool(); - break; - case 20: - message.javaGenerateEqualsAndHash = reader.bool(); - break; - case 27: - message.javaStringCheckUtf8 = reader.bool(); - break; - case 9: - message.optimizeFor = reader.int32(); - break; - case 11: - message.goPackage = reader.string(); - break; - case 16: - message.ccGenericServices = reader.bool(); - break; - case 17: - message.javaGenericServices = reader.bool(); - break; - case 18: - message.pyGenericServices = reader.bool(); - break; - case 42: - message.phpGenericServices = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.ccEnableArenas = reader.bool(); - break; - case 36: - message.objcClassPrefix = reader.string(); - break; - case 37: - message.csharpNamespace = reader.string(); - break; - case 39: - message.swiftPrefix = reader.string(); - break; - case 40: - message.phpClassPrefix = reader.string(); - break; - case 41: - message.phpNamespace = reader.string(); - break; - case 44: - message.phpMetadataNamespace = reader.string(); - break; - case 45: - message.rubyPackage = reader.string(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1053: - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -29030,6 +30869,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode @@ -29198,26 +31052,32 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.messageSetWireFormat = reader.bool(); - break; - case 2: - message.noStandardDescriptorAccessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.mapEntry = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1053: - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -29371,6 +31231,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + return MessageOptions; })(); @@ -29384,6 +31259,7 @@ * @property {boolean|null} [packed] FieldOptions packed * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption @@ -29440,6 +31316,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -29516,6 +31400,8 @@ writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -29561,42 +31447,55 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.ctype = reader.int32(); - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32(); - break; - case 5: - message.lazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1052: - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - case 1055: - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -29656,6 +31555,9 @@ if (message.lazy != null && message.hasOwnProperty("lazy")) if (typeof message.lazy !== "boolean") return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; @@ -29741,6 +31643,8 @@ } if (object.lazy != null) message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.weak != null) @@ -29828,6 +31732,7 @@ object.lazy = false; object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = false; + object.unverifiedLazy = false; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -29842,6 +31747,8 @@ object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; if (message.weak != null && message.hasOwnProperty("weak")) object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -29868,6 +31775,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + /** * CType enum. * @name google.protobuf.FieldOptions.CType @@ -29997,11 +31919,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -30108,6 +32031,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + return OneofOptions; })(); @@ -30227,17 +32165,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.allowAlias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -30362,6 +32303,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + return EnumOptions; })(); @@ -30470,14 +32426,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -30593,6 +32551,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + return EnumValueOptions; })(); @@ -30723,20 +32696,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1049: - message[".google.api.defaultHost"] = reader.string(); - break; - case 1050: - message[".google.api.oauthScopes"] = reader.string(); - break; + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -30869,6 +32846,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + return ServiceOptions; })(); @@ -31023,28 +33015,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotencyLevel = reader.int32(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - case 1051: - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - case 1049: - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -31234,6 +33232,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel @@ -31413,29 +33426,36 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifierValue = reader.string(); - break; - case 4: - message.positiveIntValue = reader.uint64(); - break; - case 5: - message.negativeIntValue = reader.int64(); - break; - case 6: - message.doubleValue = reader.double(); - break; - case 7: - message.stringValue = reader.bytes(); - break; - case 8: - message.aggregateValue = reader.string(); - break; + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -31548,7 +33568,7 @@ if (object.stringValue != null) if (typeof object.stringValue === "string") $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length) + else if (object.stringValue.length >= 0) message.stringValue = object.stringValue; if (object.aggregateValue != null) message.aggregateValue = String(object.aggregateValue); @@ -31629,6 +33649,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + UninterpretedOption.NamePart = (function() { /** @@ -31730,12 +33765,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.namePart = reader.string(); - break; - case 2: - message.isExtension = reader.bool(); - break; + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -31836,6 +33873,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + return NamePart; })(); @@ -31936,11 +33988,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -32047,6 +34100,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + SourceCodeInfo.Location = (function() { /** @@ -32195,37 +34263,42 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - case 3: - message.leadingComments = reader.string(); - break; - case 4: - message.trailingComments = reader.string(); - break; - case 6: - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -32386,6 +34459,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + return Location; })(); @@ -32486,11 +34574,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -32597,6 +34686,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + GeneratedCodeInfo.Annotation = (function() { /** @@ -32607,6 +34711,7 @@ * @property {string|null} [sourceFile] Annotation sourceFile * @property {number|null} [begin] Annotation begin * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic */ /** @@ -32657,6 +34762,14 @@ */ Annotation.prototype.end = 0; + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + /** * Creates a new Annotation instance using the specified properties. * @function create @@ -32693,6 +34806,8 @@ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); return writer; }; @@ -32727,25 +34842,33 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - message.sourceFile = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -32797,6 +34920,15 @@ if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -32825,6 +34957,20 @@ message.begin = object.begin | 0; if (object.end != null) message.end = object.end | 0; + switch (object.semantic) { + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } return message; }; @@ -32847,6 +34993,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -32859,6 +35006,8 @@ object.begin = message.begin; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; return object; }; @@ -32873,6 +35022,37 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + return Annotation; })(); @@ -32982,12 +35162,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -33049,7 +35231,7 @@ if (object.value != null) if (typeof object.value === "string") $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) + else if (object.value.length >= 0) message.value = object.value; return message; }; @@ -33095,6 +35277,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + return Any; })(); @@ -33201,12 +35398,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -33319,6 +35518,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + return Duration; })(); @@ -33479,6 +35693,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + return Empty; })(); @@ -33585,12 +35814,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -33703,6 +35934,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + return Timestamp; })(); @@ -33751,7 +35997,7 @@ }; /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. + * Callback as used by {@link google.longrunning.Operations|listOperations}. * @memberof google.longrunning.Operations * @typedef ListOperationsCallback * @type {function} @@ -33784,7 +36030,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. + * Callback as used by {@link google.longrunning.Operations|getOperation}. * @memberof google.longrunning.Operations * @typedef GetOperationCallback * @type {function} @@ -33817,7 +36063,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. * @memberof google.longrunning.Operations * @typedef DeleteOperationCallback * @type {function} @@ -33850,7 +36096,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. * @memberof google.longrunning.Operations * @typedef CancelOperationCallback * @type {function} @@ -33883,7 +36129,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * Callback as used by {@link google.longrunning.Operations|waitOperation}. * @memberof google.longrunning.Operations * @typedef WaitOperationCallback * @type {function} @@ -34068,21 +36314,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.done = reader.bool(); - break; - case 4: - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 5: - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -34233,6 +36484,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + return Operation; })(); @@ -34328,9 +36594,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -34420,6 +36687,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + return GetOperationRequest; })(); @@ -34548,18 +36830,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.name = reader.string(); - break; - case 1: - message.filter = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -34674,6 +36960,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + return ListOperationsRequest; })(); @@ -34782,14 +37083,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -34905,6 +37208,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + return ListOperationsResponse; })(); @@ -35000,9 +37318,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -35092,6 +37411,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + return CancelOperationRequest; })(); @@ -35187,9 +37521,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -35279,6 +37614,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + return DeleteOperationRequest; })(); @@ -35385,12 +37735,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -35494,6 +37846,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + return WaitOperationRequest; })(); @@ -35600,12 +37967,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.responseType = reader.string(); - break; - case 2: - message.metadataType = reader.string(); - break; + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -35704,6 +38073,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + return OperationInfo; })(); @@ -35835,17 +38219,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.code = reader.int32(); - break; - case 2: - message.message = reader.string(); - break; - case 3: - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -35970,6 +38357,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + return Status; })(); diff --git a/packages/google-cloud-translate/protos/protos.json b/packages/google-cloud-translate/protos/protos.json index c43468de6bc..d714fb7f191 100644 --- a/packages/google-cloud-translate/protos/protos.json +++ b/packages/google-cloud-translate/protos/protos.json @@ -2847,6 +2847,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -3375,6 +3379,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -3667,6 +3678,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } From a246e53a70949ce90a4214dc586d2d63da598ace Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 27 Aug 2022 05:18:12 +0000 Subject: [PATCH 499/513] fix: do not import the whole google-gax from proto JS (#1553) (#813) fix: use google-gax v3.3.0 Source-Link: https://github.com/googleapis/synthtool/commit/c73d112a11a1f1a93efa67c50495c19aa3a88910 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:b15a6f06cc06dcffa11e1bebdf1a74b6775a134aac24a0f86f51ddf728eb373e --- packages/google-cloud-translate/package.json | 2 +- packages/google-cloud-translate/protos/protos.d.ts | 2 +- packages/google-cloud-translate/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 3c51b00a9be..b4308fd05e1 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -51,7 +51,7 @@ "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^3.0.1", + "google-gax": "^3.3.0", "is-html": "^2.0.0" }, "devDependencies": { diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index 0f457453e1a..89faea696f9 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -13,7 +13,7 @@ // limitations under the License. import Long = require("long"); -import {protobuf as $protobuf} from "google-gax"; +import type {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index d8c6b0f70a7..f52c063283e 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -19,7 +19,7 @@ define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax").protobufMinimal); + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); })(this, function($protobuf) { "use strict"; From b0299e00b55f6b4a83c895256c89046f59993615 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:54:46 -0400 Subject: [PATCH 500/513] chore(main): release 7.0.2 (#811) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 7.0.2 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-translate/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-translate/package.json | 2 +- .../snippet_metadata.google.cloud.translation.v3.json | 2 +- ...pet_metadata.google.cloud.translation.v3beta1.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index d81c2847dca..81e99ff68a2 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,17 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [7.0.2](https://github.com/googleapis/nodejs-translate/compare/v7.0.1...v7.0.2) (2022-08-27) + + +### Bug Fixes + +* better support for fallback mode ([#809](https://github.com/googleapis/nodejs-translate/issues/809)) ([1a90646](https://github.com/googleapis/nodejs-translate/commit/1a9064602582090468e9371ddfe830bd32dad566)) +* change import long to require ([#810](https://github.com/googleapis/nodejs-translate/issues/810)) ([2fa0935](https://github.com/googleapis/nodejs-translate/commit/2fa09350e03c4abd34ab00956a0349627baa5196)) +* do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-translate/issues/1553)) ([#813](https://github.com/googleapis/nodejs-translate/issues/813)) ([15e8ec9](https://github.com/googleapis/nodejs-translate/commit/15e8ec92bfa95adcfd31f8f8945f7ad6b7f02a79)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-translate/issues/1546)) ([#812](https://github.com/googleapis/nodejs-translate/issues/812)) ([d82da1f](https://github.com/googleapis/nodejs-translate/commit/d82da1f4788f273931324e8a84a2d06abc9a7e7e)) +* use google-gax v3.3.0 ([15e8ec9](https://github.com/googleapis/nodejs-translate/commit/15e8ec92bfa95adcfd31f8f8945f7ad6b7f02a79)) + ## [7.0.1](https://github.com/googleapis/nodejs-translate/compare/v7.0.0...v7.0.1) (2022-08-10) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index b4308fd05e1..f95c8981011 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "7.0.1", + "version": "7.0.2", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json index 6269b9102d8..92e5edeb902 100644 --- a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json +++ b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-translation", - "version": "7.0.1", + "version": "7.0.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json index 319d303e92e..247fef2efc9 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json +++ b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-translation", - "version": "7.0.1", + "version": "7.0.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 8750d71b57e..83a3a5d434a 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^3.0.0", "@google-cloud/text-to-speech": "^4.0.0", - "@google-cloud/translate": "^7.0.1", + "@google-cloud/translate": "^7.0.2", "@google-cloud/vision": "^2.0.0", "yargs": "^16.0.0" }, From a8fcf6abc1dfcda436ffcac8571e87f9d1330a23 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 8 Sep 2022 15:59:42 -0700 Subject: [PATCH 501/513] fix: allow passing gax instance to client constructor (#814) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: accept google-gax instance as a parameter Please see the documentation of the client constructor for details. PiperOrigin-RevId: 470332808 Source-Link: https://github.com/googleapis/googleapis/commit/d4a23675457cd8f0b44080e0594ec72de1291b89 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e97a1ac204ead4fe7341f91e72db7c6ac6016341 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTk3YTFhYzIwNGVhZDRmZTczNDFmOTFlNzJkYjdjNmFjNjAxNjM0MSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: use _gaxModule when accessing gax for bundling PiperOrigin-RevId: 470911839 Source-Link: https://github.com/googleapis/googleapis/commit/352756699ebc5b2144c252867c265ea44448712e Source-Link: https://github.com/googleapis/googleapis-gen/commit/f16a1d224f00a630ea43d6a9a1a31f566f45cdea Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjE2YTFkMjI0ZjAwYTYzMGVhNDNkNmE5YTFhMzFmNTY2ZjQ1Y2RlYSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: point http2spy to gax since it's now loaded dynamically * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: make it work * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Alexander Fenster --- .../src/v3/translation_service_client.ts | 87 +++++++++++-------- .../src/v3beta1/translation_service_client.ts | 87 +++++++++++-------- .../system-test/translate.ts | 22 ++--- 3 files changed, 116 insertions(+), 80 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 4922d27d28c..50e653f7eef 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './translation_service_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class TranslationServiceClient { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new TranslationServiceClient({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof TranslationServiceClient; const servicePath = @@ -120,8 +128,13 @@ export class TranslationServiceClient { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -296,7 +309,7 @@ export class TranslationServiceClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -577,7 +590,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -703,7 +716,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -830,7 +843,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -978,7 +991,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1064,7 +1077,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1224,7 +1237,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1250,11 +1263,12 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3.BatchTranslateMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.batchTranslateText, this._gaxModule.createDefaultBackoffSettings() @@ -1420,7 +1434,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1450,11 +1464,12 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3.BatchTranslateDocumentMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.batchTranslateDocument, this._gaxModule.createDefaultBackoffSettings() @@ -1564,7 +1579,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1590,11 +1605,12 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3.CreateGlossaryMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createGlossary, this._gaxModule.createDefaultBackoffSettings() @@ -1703,7 +1719,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1729,11 +1745,12 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3.DeleteGlossaryMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteGlossary, this._gaxModule.createDefaultBackoffSettings() @@ -1857,7 +1874,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1916,7 +1933,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGlossaries']; @@ -1984,7 +2001,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGlossaries']; diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index d16bfed3918..32795c3f88c 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './translation_service_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class TranslationServiceClient { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new TranslationServiceClient({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof TranslationServiceClient; const servicePath = @@ -120,8 +128,13 @@ export class TranslationServiceClient { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -296,7 +309,7 @@ export class TranslationServiceClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -577,7 +590,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -708,7 +721,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -835,7 +848,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -988,7 +1001,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1080,7 +1093,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1239,7 +1252,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1265,11 +1278,12 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3beta1.BatchTranslateMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.batchTranslateText, this._gaxModule.createDefaultBackoffSettings() @@ -1435,7 +1449,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1465,11 +1479,12 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.batchTranslateDocument, this._gaxModule.createDefaultBackoffSettings() @@ -1579,7 +1594,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1605,11 +1620,12 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3beta1.CreateGlossaryMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createGlossary, this._gaxModule.createDefaultBackoffSettings() @@ -1718,7 +1734,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1744,11 +1760,12 @@ export class TranslationServiceClient { protos.google.cloud.translation.v3beta1.DeleteGlossaryMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteGlossary, this._gaxModule.createDefaultBackoffSettings() @@ -1872,7 +1889,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1931,7 +1948,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGlossaries']; @@ -1999,7 +2016,7 @@ export class TranslationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGlossaries']; diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index 9b456dd7fd3..5c20f46ba10 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -148,12 +148,13 @@ describe('translate', () => { } ), }); - const {TranslationServiceClient} = http2spy.require( - require.resolve('../src') + const gax = http2spy.require('google-gax'); + const translate = new TranslationServiceClient( + { + auth, + }, + gax ); - const translate = new TranslationServiceClient({ - auth, - }); // We run the same test as "list of supported languages", but with an // alternate "quota_project_id" set; Given that GCLOUD_PROJECT @@ -184,12 +185,13 @@ describe('translate', () => { } ), }); - const {TranslationServiceClient} = http2spy.require( - require.resolve('../src') + const gax = http2spy.require('google-gax'); + const translate = new TranslationServiceClient( + { + auth, + }, + gax ); - const translate = new TranslationServiceClient({ - auth, - }); // We set a quota project "my-fake-billing-project" that does not exist, // this should result in an error. From 5d45801b5cf031bd6cb333444d01b8d49e241a24 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Sep 2022 04:18:16 +0200 Subject: [PATCH 502/513] chore(deps): update dependency uuid to v9 (#815) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [uuid](https://togithub.com/uuidjs/uuid) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/uuid/8.3.2/9.0.0) | [![age](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/compatibility-slim/8.3.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/confidence-slim/8.3.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 83a3a5d434a..b906eaf362c 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -24,6 +24,6 @@ "@google-cloud/storage": "^6.0.0", "chai": "^4.2.0", "mocha": "^8.0.0", - "uuid": "^8.0.0" + "uuid": "^9.0.0" } } From 4950dfff358f4dea60fd2c17b1b2a012f95dcdd8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 21 Sep 2022 12:02:27 -0700 Subject: [PATCH 503/513] fix: preserve default values in x-goog-request-params header (#820) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-typescript v2.17.0 PiperOrigin-RevId: 474338479 Source-Link: https://github.com/googleapis/googleapis/commit/d5d35e0353b59719e8917103b1bc7df2782bf6ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/efcd3f93962a103f68f003e2a1eecde6fa216a27 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: use fully qualified request type name in tests PiperOrigin-RevId: 475685359 Source-Link: https://github.com/googleapis/googleapis/commit/7a129736313ceb1f277c3b7f7e16d2e04cc901dd Source-Link: https://github.com/googleapis/googleapis-gen/commit/370c729e2ba062a167449c27882ba5f379c5c34d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzcwYzcyOWUyYmEwNjJhMTY3NDQ5YzI3ODgyYmE1ZjM3OWM1YzM0ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: fix translation Co-authored-by: Owl Bot Co-authored-by: Alexander Fenster --- .../src/v3/translation_service_client.ts | 24 +- .../src/v3beta1/translation_service_client.ts | 24 +- .../test/gapic_translation_service_v3.ts | 1073 +++++++++-------- .../test/gapic_translation_service_v3beta1.ts | 1073 +++++++++-------- 4 files changed, 1152 insertions(+), 1042 deletions(-) diff --git a/packages/google-cloud-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index 50e653f7eef..a7bf7499a57 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -591,7 +591,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.translateText(request, options, callback); @@ -717,7 +717,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.detectLanguage(request, options, callback); @@ -844,7 +844,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.getSupportedLanguages(request, options, callback); @@ -992,7 +992,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.translateDocument(request, options, callback); @@ -1078,7 +1078,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getGlossary(request, options, callback); @@ -1238,7 +1238,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchTranslateText(request, options, callback); @@ -1435,7 +1435,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchTranslateDocument( @@ -1580,7 +1580,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createGlossary(request, options, callback); @@ -1720,7 +1720,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteGlossary(request, options, callback); @@ -1875,7 +1875,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listGlossaries(request, options, callback); @@ -1934,7 +1934,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGlossaries']; const callSettings = defaultCallSettings.merge(options); @@ -2002,7 +2002,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGlossaries']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 32795c3f88c..9fe11f56fb0 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -591,7 +591,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.translateText(request, options, callback); @@ -722,7 +722,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.detectLanguage(request, options, callback); @@ -849,7 +849,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.getSupportedLanguages(request, options, callback); @@ -1002,7 +1002,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.translateDocument(request, options, callback); @@ -1094,7 +1094,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getGlossary(request, options, callback); @@ -1253,7 +1253,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchTranslateText(request, options, callback); @@ -1450,7 +1450,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchTranslateDocument( @@ -1595,7 +1595,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createGlossary(request, options, callback); @@ -1735,7 +1735,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteGlossary(request, options, callback); @@ -1890,7 +1890,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listGlossaries(request, options, callback); @@ -1949,7 +1949,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGlossaries']; const callSettings = defaultCallSettings.merge(options); @@ -2017,7 +2017,7 @@ export class TranslationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGlossaries']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts index bbb893d31d8..640f81602c7 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -254,26 +269,26 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.TranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateTextResponse() ); client.innerApiCalls.translateText = stubSimpleCall(expectedResponse); const [response] = await client.translateText(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.translateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.translateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.translateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes translateText without error using callback', async () => { @@ -285,15 +300,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.TranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateTextResponse() ); @@ -316,11 +328,14 @@ describe('v3.TranslationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.translateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.translateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.translateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes translateText with error', async () => { @@ -332,26 +347,26 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.TranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.translateText = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.translateText(request), expectedError); - assert( - (client.innerApiCalls.translateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.translateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.translateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes translateText with closed client', async () => { @@ -363,7 +378,11 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateTextRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.TranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.translateText(request), expectedError); @@ -380,26 +399,26 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.DetectLanguageRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.DetectLanguageRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.DetectLanguageResponse() ); client.innerApiCalls.detectLanguage = stubSimpleCall(expectedResponse); const [response] = await client.detectLanguage(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.detectLanguage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detectLanguage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes detectLanguage without error using callback', async () => { @@ -411,15 +430,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.DetectLanguageRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.DetectLanguageRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.DetectLanguageResponse() ); @@ -442,11 +458,14 @@ describe('v3.TranslationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.detectLanguage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detectLanguage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes detectLanguage with error', async () => { @@ -458,26 +477,26 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.DetectLanguageRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.DetectLanguageRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.detectLanguage = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.detectLanguage(request), expectedError); - assert( - (client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.detectLanguage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detectLanguage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes detectLanguage with closed client', async () => { @@ -489,7 +508,11 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.DetectLanguageRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.DetectLanguageRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.detectLanguage(request), expectedError); @@ -506,15 +529,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.GetSupportedLanguagesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.SupportedLanguages() ); @@ -522,11 +542,14 @@ describe('v3.TranslationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getSupportedLanguages(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSupportedLanguages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSupportedLanguages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSupportedLanguages without error using callback', async () => { @@ -538,15 +561,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.GetSupportedLanguagesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.SupportedLanguages() ); @@ -569,11 +589,14 @@ describe('v3.TranslationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getSupportedLanguages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSupportedLanguages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSupportedLanguages with error', async () => { @@ -585,15 +608,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.GetSupportedLanguagesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getSupportedLanguages = stubSimpleCall( undefined, @@ -603,11 +623,14 @@ describe('v3.TranslationServiceClient', () => { client.getSupportedLanguages(request), expectedError ); - assert( - (client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSupportedLanguages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSupportedLanguages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSupportedLanguages with closed client', async () => { @@ -619,7 +642,11 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.GetSupportedLanguagesRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.GetSupportedLanguagesRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -639,26 +666,26 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.TranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateDocumentResponse() ); client.innerApiCalls.translateDocument = stubSimpleCall(expectedResponse); const [response] = await client.translateDocument(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.translateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.translateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.translateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes translateDocument without error using callback', async () => { @@ -670,15 +697,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.TranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateDocumentResponse() ); @@ -701,11 +725,14 @@ describe('v3.TranslationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.translateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.translateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.translateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes translateDocument with error', async () => { @@ -717,26 +744,26 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.TranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.translateDocument = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.translateDocument(request), expectedError); - assert( - (client.innerApiCalls.translateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.translateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.translateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes translateDocument with closed client', async () => { @@ -748,7 +775,11 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.TranslateDocumentRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.TranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.translateDocument(request), expectedError); @@ -765,26 +796,26 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.GetGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.GetGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.Glossary() ); client.innerApiCalls.getGlossary = stubSimpleCall(expectedResponse); const [response] = await client.getGlossary(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getGlossary without error using callback', async () => { @@ -796,15 +827,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.GetGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.GetGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3.Glossary() ); @@ -827,11 +855,14 @@ describe('v3.TranslationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getGlossary with error', async () => { @@ -843,26 +874,26 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.GetGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.GetGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getGlossary = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getGlossary(request), expectedError); - assert( - (client.innerApiCalls.getGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getGlossary with closed client', async () => { @@ -874,7 +905,11 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.GetGlossaryRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.GetGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getGlossary(request), expectedError); @@ -891,15 +926,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.BatchTranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.BatchTranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -908,11 +940,14 @@ describe('v3.TranslationServiceClient', () => { const [operation] = await client.batchTranslateText(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchTranslateText without error using callback', async () => { @@ -924,15 +959,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.BatchTranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.BatchTranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -962,11 +994,14 @@ describe('v3.TranslationServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchTranslateText with call error', async () => { @@ -978,26 +1013,26 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.BatchTranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.BatchTranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchTranslateText = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.batchTranslateText(request), expectedError); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchTranslateText with LRO error', async () => { @@ -1009,15 +1044,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.BatchTranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.BatchTranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchTranslateText = stubLongRunningCall( undefined, @@ -1026,11 +1058,14 @@ describe('v3.TranslationServiceClient', () => { ); const [operation] = await client.batchTranslateText(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkBatchTranslateTextProgress without error', async () => { @@ -1085,15 +1120,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.BatchTranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.BatchTranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1102,11 +1134,14 @@ describe('v3.TranslationServiceClient', () => { const [operation] = await client.batchTranslateDocument(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchTranslateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchTranslateDocument without error using callback', async () => { @@ -1118,15 +1153,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.BatchTranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.BatchTranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1156,11 +1188,14 @@ describe('v3.TranslationServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchTranslateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchTranslateDocument with call error', async () => { @@ -1172,15 +1207,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.BatchTranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.BatchTranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchTranslateDocument = stubLongRunningCall( undefined, @@ -1190,11 +1222,14 @@ describe('v3.TranslationServiceClient', () => { client.batchTranslateDocument(request), expectedError ); - assert( - (client.innerApiCalls.batchTranslateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchTranslateDocument with LRO error', async () => { @@ -1206,15 +1241,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.BatchTranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.BatchTranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchTranslateDocument = stubLongRunningCall( undefined, @@ -1223,11 +1255,14 @@ describe('v3.TranslationServiceClient', () => { ); const [operation] = await client.batchTranslateDocument(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.batchTranslateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkBatchTranslateDocumentProgress without error', async () => { @@ -1282,15 +1317,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.CreateGlossaryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.CreateGlossaryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1299,11 +1331,14 @@ describe('v3.TranslationServiceClient', () => { const [operation] = await client.createGlossary(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createGlossary without error using callback', async () => { @@ -1315,15 +1350,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.CreateGlossaryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.CreateGlossaryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1353,11 +1385,14 @@ describe('v3.TranslationServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createGlossary with call error', async () => { @@ -1369,26 +1404,26 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.CreateGlossaryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.CreateGlossaryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGlossary = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.createGlossary(request), expectedError); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createGlossary with LRO error', async () => { @@ -1400,15 +1435,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.CreateGlossaryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.CreateGlossaryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGlossary = stubLongRunningCall( undefined, @@ -1417,11 +1449,14 @@ describe('v3.TranslationServiceClient', () => { ); const [operation] = await client.createGlossary(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateGlossaryProgress without error', async () => { @@ -1476,15 +1511,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.DeleteGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.DeleteGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1493,11 +1525,14 @@ describe('v3.TranslationServiceClient', () => { const [operation] = await client.deleteGlossary(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteGlossary without error using callback', async () => { @@ -1509,15 +1544,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.DeleteGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.DeleteGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1547,11 +1579,14 @@ describe('v3.TranslationServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteGlossary with call error', async () => { @@ -1563,26 +1598,26 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.DeleteGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.DeleteGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGlossary = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.deleteGlossary(request), expectedError); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteGlossary with LRO error', async () => { @@ -1594,15 +1629,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.DeleteGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.DeleteGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGlossary = stubLongRunningCall( undefined, @@ -1611,11 +1643,14 @@ describe('v3.TranslationServiceClient', () => { ); const [operation] = await client.deleteGlossary(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteGlossaryProgress without error', async () => { @@ -1670,15 +1705,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.translation.v3.Glossary() @@ -1693,11 +1725,14 @@ describe('v3.TranslationServiceClient', () => { client.innerApiCalls.listGlossaries = stubSimpleCall(expectedResponse); const [response] = await client.listGlossaries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listGlossaries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGlossaries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listGlossaries without error using callback', async () => { @@ -1709,15 +1744,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.translation.v3.Glossary() @@ -1748,11 +1780,14 @@ describe('v3.TranslationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listGlossaries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGlossaries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listGlossaries with error', async () => { @@ -1764,26 +1799,26 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listGlossaries = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listGlossaries(request), expectedError); - assert( - (client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listGlossaries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGlossaries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listGlossariesStream without error', async () => { @@ -1795,8 +1830,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.translation.v3.Glossary() @@ -1833,11 +1872,12 @@ describe('v3.TranslationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGlossaries, request) ); - assert.strictEqual( - ( - client.descriptors.page.listGlossaries.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1850,8 +1890,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1877,11 +1921,12 @@ describe('v3.TranslationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGlossaries, request) ); - assert.strictEqual( - ( - client.descriptors.page.listGlossaries.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1894,8 +1939,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.translation.v3.Glossary() @@ -1921,11 +1970,12 @@ describe('v3.TranslationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listGlossaries.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1938,8 +1988,12 @@ describe('v3.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1956,11 +2010,12 @@ describe('v3.TranslationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listGlossaries.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts index 313d4c88526..ba1f72d388a 100644 --- a/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts +++ b/packages/google-cloud-translate/test/gapic_translation_service_v3beta1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -263,26 +278,26 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.TranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateTextResponse() ); client.innerApiCalls.translateText = stubSimpleCall(expectedResponse); const [response] = await client.translateText(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.translateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.translateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.translateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes translateText without error using callback', async () => { @@ -295,15 +310,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.TranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateTextResponse() ); @@ -326,11 +338,14 @@ describe('v3beta1.TranslationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.translateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.translateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.translateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes translateText with error', async () => { @@ -343,26 +358,26 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.TranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.translateText = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.translateText(request), expectedError); - assert( - (client.innerApiCalls.translateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.translateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.translateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes translateText with closed client', async () => { @@ -375,7 +390,11 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateTextRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.TranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.translateText(request), expectedError); @@ -393,26 +412,26 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.DetectLanguageRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DetectLanguageResponse() ); client.innerApiCalls.detectLanguage = stubSimpleCall(expectedResponse); const [response] = await client.detectLanguage(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.detectLanguage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detectLanguage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes detectLanguage without error using callback', async () => { @@ -425,15 +444,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.DetectLanguageRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DetectLanguageResponse() ); @@ -456,11 +472,14 @@ describe('v3beta1.TranslationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.detectLanguage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detectLanguage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes detectLanguage with error', async () => { @@ -473,26 +492,26 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.DetectLanguageRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.detectLanguage = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.detectLanguage(request), expectedError); - assert( - (client.innerApiCalls.detectLanguage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.detectLanguage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detectLanguage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes detectLanguage with closed client', async () => { @@ -505,7 +524,11 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DetectLanguageRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.DetectLanguageRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.detectLanguage(request), expectedError); @@ -523,15 +546,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.SupportedLanguages() ); @@ -539,11 +559,14 @@ describe('v3beta1.TranslationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getSupportedLanguages(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSupportedLanguages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSupportedLanguages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSupportedLanguages without error using callback', async () => { @@ -556,15 +579,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.SupportedLanguages() ); @@ -587,11 +607,14 @@ describe('v3beta1.TranslationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getSupportedLanguages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSupportedLanguages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSupportedLanguages with error', async () => { @@ -604,15 +627,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getSupportedLanguages = stubSimpleCall( undefined, @@ -622,11 +642,14 @@ describe('v3beta1.TranslationServiceClient', () => { client.getSupportedLanguages(request), expectedError ); - assert( - (client.innerApiCalls.getSupportedLanguages as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSupportedLanguages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSupportedLanguages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSupportedLanguages with closed client', async () => { @@ -639,7 +662,11 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -660,26 +687,26 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.TranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateDocumentResponse() ); client.innerApiCalls.translateDocument = stubSimpleCall(expectedResponse); const [response] = await client.translateDocument(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.translateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.translateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.translateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes translateDocument without error using callback', async () => { @@ -692,15 +719,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.TranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateDocumentResponse() ); @@ -723,11 +747,14 @@ describe('v3beta1.TranslationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.translateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.translateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.translateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes translateDocument with error', async () => { @@ -740,26 +767,26 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.TranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.translateDocument = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.translateDocument(request), expectedError); - assert( - (client.innerApiCalls.translateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.translateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.translateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes translateDocument with closed client', async () => { @@ -772,7 +799,11 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.TranslateDocumentRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.TranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.translateDocument(request), expectedError); @@ -790,26 +821,26 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.GetGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.Glossary() ); client.innerApiCalls.getGlossary = stubSimpleCall(expectedResponse); const [response] = await client.getGlossary(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getGlossary without error using callback', async () => { @@ -822,15 +853,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.GetGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.translation.v3beta1.Glossary() ); @@ -853,11 +881,14 @@ describe('v3beta1.TranslationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getGlossary with error', async () => { @@ -870,26 +901,26 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.GetGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getGlossary = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getGlossary(request), expectedError); - assert( - (client.innerApiCalls.getGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getGlossary with closed client', async () => { @@ -902,7 +933,11 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.GetGlossaryRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.GetGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getGlossary(request), expectedError); @@ -920,15 +955,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.BatchTranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -937,11 +969,14 @@ describe('v3beta1.TranslationServiceClient', () => { const [operation] = await client.batchTranslateText(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchTranslateText without error using callback', async () => { @@ -954,15 +989,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.BatchTranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -992,11 +1024,14 @@ describe('v3beta1.TranslationServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchTranslateText with call error', async () => { @@ -1009,26 +1044,26 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.BatchTranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchTranslateText = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.batchTranslateText(request), expectedError); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchTranslateText with LRO error', async () => { @@ -1041,15 +1076,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateTextRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.BatchTranslateTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchTranslateText = stubLongRunningCall( undefined, @@ -1058,11 +1090,14 @@ describe('v3beta1.TranslationServiceClient', () => { ); const [operation] = await client.batchTranslateText(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.batchTranslateText as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkBatchTranslateTextProgress without error', async () => { @@ -1120,15 +1155,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1137,11 +1169,14 @@ describe('v3beta1.TranslationServiceClient', () => { const [operation] = await client.batchTranslateDocument(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchTranslateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchTranslateDocument without error using callback', async () => { @@ -1154,15 +1189,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1192,11 +1224,14 @@ describe('v3beta1.TranslationServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchTranslateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchTranslateDocument with call error', async () => { @@ -1209,15 +1244,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchTranslateDocument = stubLongRunningCall( undefined, @@ -1227,11 +1259,14 @@ describe('v3beta1.TranslationServiceClient', () => { client.batchTranslateDocument(request), expectedError ); - assert( - (client.innerApiCalls.batchTranslateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchTranslateDocument with LRO error', async () => { @@ -1244,15 +1279,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.BatchTranslateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchTranslateDocument = stubLongRunningCall( undefined, @@ -1261,11 +1293,14 @@ describe('v3beta1.TranslationServiceClient', () => { ); const [operation] = await client.batchTranslateDocument(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.batchTranslateDocument as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchTranslateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkBatchTranslateDocumentProgress without error', async () => { @@ -1323,15 +1358,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.CreateGlossaryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1340,11 +1372,14 @@ describe('v3beta1.TranslationServiceClient', () => { const [operation] = await client.createGlossary(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createGlossary without error using callback', async () => { @@ -1357,15 +1392,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.CreateGlossaryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1395,11 +1427,14 @@ describe('v3beta1.TranslationServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createGlossary with call error', async () => { @@ -1412,26 +1447,26 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.CreateGlossaryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGlossary = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.createGlossary(request), expectedError); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createGlossary with LRO error', async () => { @@ -1444,15 +1479,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.CreateGlossaryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.CreateGlossaryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGlossary = stubLongRunningCall( undefined, @@ -1461,11 +1493,14 @@ describe('v3beta1.TranslationServiceClient', () => { ); const [operation] = await client.createGlossary(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateGlossaryProgress without error', async () => { @@ -1523,15 +1558,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.DeleteGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1540,11 +1572,14 @@ describe('v3beta1.TranslationServiceClient', () => { const [operation] = await client.deleteGlossary(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteGlossary without error using callback', async () => { @@ -1557,15 +1592,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.DeleteGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1595,11 +1627,14 @@ describe('v3beta1.TranslationServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteGlossary with call error', async () => { @@ -1612,26 +1647,26 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.DeleteGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGlossary = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.deleteGlossary(request), expectedError); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteGlossary with LRO error', async () => { @@ -1644,15 +1679,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.DeleteGlossaryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.DeleteGlossaryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGlossary = stubLongRunningCall( undefined, @@ -1661,11 +1693,14 @@ describe('v3beta1.TranslationServiceClient', () => { ); const [operation] = await client.deleteGlossary(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteGlossary as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGlossary as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteGlossaryProgress without error', async () => { @@ -1723,15 +1758,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.translation.v3beta1.Glossary() @@ -1746,11 +1778,14 @@ describe('v3beta1.TranslationServiceClient', () => { client.innerApiCalls.listGlossaries = stubSimpleCall(expectedResponse); const [response] = await client.listGlossaries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listGlossaries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGlossaries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listGlossaries without error using callback', async () => { @@ -1763,15 +1798,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.translation.v3beta1.Glossary() @@ -1802,11 +1834,14 @@ describe('v3beta1.TranslationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listGlossaries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGlossaries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listGlossaries with error', async () => { @@ -1819,26 +1854,26 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listGlossaries = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listGlossaries(request), expectedError); - assert( - (client.innerApiCalls.listGlossaries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listGlossaries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGlossaries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listGlossariesStream without error', async () => { @@ -1851,8 +1886,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.translation.v3beta1.Glossary() @@ -1890,11 +1929,12 @@ describe('v3beta1.TranslationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGlossaries, request) ); - assert.strictEqual( - ( - client.descriptors.page.listGlossaries.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1908,8 +1948,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGlossaries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1936,11 +1980,12 @@ describe('v3beta1.TranslationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGlossaries, request) ); - assert.strictEqual( - ( - client.descriptors.page.listGlossaries.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listGlossaries.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1954,8 +1999,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.translation.v3beta1.Glossary() @@ -1981,11 +2030,12 @@ describe('v3beta1.TranslationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listGlossaries.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1999,8 +2049,12 @@ describe('v3beta1.TranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.translation.v3beta1.ListGlossariesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.translation.v3beta1.ListGlossariesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGlossaries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2018,11 +2072,12 @@ describe('v3beta1.TranslationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listGlossaries.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listGlossaries.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); From f9c89856f75ba09fb83e7017de4fa07abb732d04 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 22 Sep 2022 19:38:43 +0200 Subject: [PATCH 504/513] fix(deps): update dependency @google-cloud/vision to v3 (#816) --- packages/google-cloud-translate/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index b906eaf362c..395cf1165bb 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -17,7 +17,7 @@ "@google-cloud/automl": "^3.0.0", "@google-cloud/text-to-speech": "^4.0.0", "@google-cloud/translate": "^7.0.2", - "@google-cloud/vision": "^2.0.0", + "@google-cloud/vision": "^3.0.0", "yargs": "^16.0.0" }, "devDependencies": { From 01d2dc20918648d46ea873a5e07459bc08bff0e6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 18:08:26 +0000 Subject: [PATCH 505/513] chore(main): release 7.0.3 (#817) :robot: I have created a release *beep* *boop* --- ## [7.0.3](https://github.com/googleapis/nodejs-translate/compare/v7.0.2...v7.0.3) (2022-09-22) ### Bug Fixes * Allow passing gax instance to client constructor ([#814](https://github.com/googleapis/nodejs-translate/issues/814)) ([ddc93f9](https://github.com/googleapis/nodejs-translate/commit/ddc93f97e2f312287624ef877071aa4e8f8b5309)) * **deps:** Update dependency @google-cloud/vision to v3 ([#816](https://github.com/googleapis/nodejs-translate/issues/816)) ([331c65b](https://github.com/googleapis/nodejs-translate/commit/331c65b6e91efab89f22c976fb117fb99ed0ff3d)) * Preserve default values in x-goog-request-params header ([#820](https://github.com/googleapis/nodejs-translate/issues/820)) ([913ac11](https://github.com/googleapis/nodejs-translate/commit/913ac11a735b25ae7182bc0f57f9ce0e2a1c5738)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-translate/CHANGELOG.md | 9 +++++++++ packages/google-cloud-translate/package.json | 2 +- .../v3/snippet_metadata.google.cloud.translation.v3.json | 2 +- ...nippet_metadata.google.cloud.translation.v3beta1.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index 81e99ff68a2..f11f2fda13d 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,15 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [7.0.3](https://github.com/googleapis/nodejs-translate/compare/v7.0.2...v7.0.3) (2022-09-22) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#814](https://github.com/googleapis/nodejs-translate/issues/814)) ([ddc93f9](https://github.com/googleapis/nodejs-translate/commit/ddc93f97e2f312287624ef877071aa4e8f8b5309)) +* **deps:** Update dependency @google-cloud/vision to v3 ([#816](https://github.com/googleapis/nodejs-translate/issues/816)) ([331c65b](https://github.com/googleapis/nodejs-translate/commit/331c65b6e91efab89f22c976fb117fb99ed0ff3d)) +* Preserve default values in x-goog-request-params header ([#820](https://github.com/googleapis/nodejs-translate/issues/820)) ([913ac11](https://github.com/googleapis/nodejs-translate/commit/913ac11a735b25ae7182bc0f57f9ce0e2a1c5738)) + ## [7.0.2](https://github.com/googleapis/nodejs-translate/compare/v7.0.1...v7.0.2) (2022-08-27) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index f95c8981011..cdaaafbbd7d 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "7.0.2", + "version": "7.0.3", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json index 92e5edeb902..6d9176446b1 100644 --- a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json +++ b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-translation", - "version": "7.0.2", + "version": "7.0.3", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json index 247fef2efc9..7b5396baef4 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json +++ b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-translation", - "version": "7.0.2", + "version": "7.0.3", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 395cf1165bb..248b9c5ce25 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^3.0.0", "@google-cloud/text-to-speech": "^4.0.0", - "@google-cloud/translate": "^7.0.2", + "@google-cloud/translate": "^7.0.3", "@google-cloud/vision": "^3.0.0", "yargs": "^16.0.0" }, From cd7f55f5d4a48c84e232994106208147828294b2 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 3 Nov 2022 23:50:13 -0700 Subject: [PATCH 506/513] fix(deps): use google-gax v3.5.2 (#879) * fix(deps): use google-gax v3.5.2 * fix: add comma --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index cdaaafbbd7d..aab000ecd3b 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -51,7 +51,7 @@ "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^3.3.0", + "google-gax": "^3.5.2", "is-html": "^2.0.0" }, "devDependencies": { From 7dcf3474db020ec631aad4152c48ed6013ec9428 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 16:32:17 -0800 Subject: [PATCH 507/513] fix: update proto definitions (#883) fix: update proto definitions Source-Link: https://github.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e Co-authored-by: Owl Bot --- .../google-cloud-translate/protos/protos.d.ts | 2 +- .../google-cloud-translate/protos/protos.js | 140 +++++++++++++++--- 2 files changed, 123 insertions(+), 19 deletions(-) diff --git a/packages/google-cloud-translate/protos/protos.d.ts b/packages/google-cloud-translate/protos/protos.d.ts index 89faea696f9..053bd161ebe 100644 --- a/packages/google-cloud-translate/protos/protos.d.ts +++ b/packages/google-cloud-translate/protos/protos.d.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Long = require("long"); import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-translate/protos/protos.js b/packages/google-cloud-translate/protos/protos.js index f52c063283e..a83416b519c 100644 --- a/packages/google-cloud-translate/protos/protos.js +++ b/packages/google-cloud-translate/protos/protos.js @@ -6323,6 +6323,12 @@ return object; var message = new $root.google.cloud.translation.v3.BatchTranslateMetadata(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -6416,7 +6422,7 @@ object.submitTime = null; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3.BatchTranslateMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.translation.v3.BatchTranslateMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.translation.v3.BatchTranslateMetadata.State[message.state] : message.state; if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) if (typeof message.translatedCharacters === "number") object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; @@ -9261,6 +9267,12 @@ if (object.name != null) message.name = String(object.name); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -9315,7 +9327,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3.CreateGlossaryMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.translation.v3.CreateGlossaryMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.translation.v3.CreateGlossaryMetadata.State[message.state] : message.state; if (message.submitTime != null && message.hasOwnProperty("submitTime")) object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); return object; @@ -9571,6 +9583,12 @@ if (object.name != null) message.name = String(object.name); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -9625,7 +9643,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3.DeleteGlossaryMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.translation.v3.DeleteGlossaryMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.translation.v3.DeleteGlossaryMetadata.State[message.state] : message.state; if (message.submitTime != null && message.hasOwnProperty("submitTime")) object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); return object; @@ -11773,6 +11791,12 @@ return object; var message = new $root.google.cloud.translation.v3.BatchTranslateDocumentMetadata(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -11936,7 +11960,7 @@ object.submitTime = null; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3.BatchTranslateDocumentMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.translation.v3.BatchTranslateDocumentMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.translation.v3.BatchTranslateDocumentMetadata.State[message.state] : message.state; if (message.totalPages != null && message.hasOwnProperty("totalPages")) if (typeof message.totalPages === "number") object.totalPages = options.longs === String ? String(message.totalPages) : message.totalPages; @@ -18302,6 +18326,12 @@ return object; var message = new $root.google.cloud.translation.v3beta1.BatchTranslateMetadata(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -18395,7 +18425,7 @@ object.submitTime = null; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.BatchTranslateMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.BatchTranslateMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.translation.v3beta1.BatchTranslateMetadata.State[message.state] : message.state; if (message.translatedCharacters != null && message.hasOwnProperty("translatedCharacters")) if (typeof message.translatedCharacters === "number") object.translatedCharacters = options.longs === String ? String(message.translatedCharacters) : message.translatedCharacters; @@ -21240,6 +21270,12 @@ if (object.name != null) message.name = String(object.name); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -21294,7 +21330,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.translation.v3beta1.CreateGlossaryMetadata.State[message.state] : message.state; if (message.submitTime != null && message.hasOwnProperty("submitTime")) object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); return object; @@ -21550,6 +21586,12 @@ if (object.name != null) message.name = String(object.name); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -21604,7 +21646,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State[message.state] : message.state; if (message.submitTime != null && message.hasOwnProperty("submitTime")) object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); return object; @@ -23752,6 +23794,12 @@ return object; var message = new $root.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -23915,7 +23963,7 @@ object.submitTime = null; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State[message.state] : message.state; if (message.totalPages != null && message.hasOwnProperty("totalPages")) if (typeof message.totalPages === "number") object.totalPages = options.longs === String ? String(message.totalPages) : message.totalPages; @@ -25323,6 +25371,12 @@ if (object.nameField != null) message.nameField = String(object.nameField); switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; case "HISTORY_UNSPECIFIED": case 0: message.history = 0; @@ -25347,6 +25401,10 @@ for (var i = 0; i < object.style.length; ++i) switch (object.style[i]) { default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } case "STYLE_UNSPECIFIED": case 0: message.style[i] = 0; @@ -25394,7 +25452,7 @@ if (message.nameField != null && message.hasOwnProperty("nameField")) object.nameField = message.nameField; if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; if (message.plural != null && message.hasOwnProperty("plural")) object.plural = message.plural; if (message.singular != null && message.hasOwnProperty("singular")) @@ -25402,7 +25460,7 @@ if (message.style && message.style.length) { object.style = []; for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; } return object; }; @@ -28213,6 +28271,12 @@ if (object.number != null) message.number = object.number | 0; switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; case "LABEL_OPTIONAL": case 1: message.label = 1; @@ -28227,6 +28291,12 @@ break; } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_DOUBLE": case 1: message.type = 1; @@ -28353,9 +28423,9 @@ if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; if (message.typeName != null && message.hasOwnProperty("typeName")) object.typeName = message.typeName; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) @@ -30702,6 +30772,12 @@ if (object.javaStringCheckUtf8 != null) message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; case "SPEED": case 1: message.optimizeFor = 1; @@ -30810,7 +30886,7 @@ if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) object.javaMultipleFiles = message.javaMultipleFiles; if (message.goPackage != null && message.hasOwnProperty("goPackage")) @@ -31612,6 +31688,12 @@ return object; var message = new $root.google.protobuf.FieldOptions(); switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; case "STRING": case 0: message.ctype = 0; @@ -31628,6 +31710,12 @@ if (object.packed != null) message.packed = Boolean(object.packed); switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; case "JS_NORMAL": case 0: message.jstype = 0; @@ -31666,6 +31754,10 @@ for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) switch (object[".google.api.fieldBehavior"][i]) { default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } case "FIELD_BEHAVIOR_UNSPECIFIED": case 0: message[".google.api.fieldBehavior"][i] = 0; @@ -31736,7 +31828,7 @@ object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; if (message.packed != null && message.hasOwnProperty("packed")) object.packed = message.packed; if (message.deprecated != null && message.hasOwnProperty("deprecated")) @@ -31744,7 +31836,7 @@ if (message.lazy != null && message.hasOwnProperty("lazy")) object.lazy = message.lazy; if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; if (message.weak != null && message.hasOwnProperty("weak")) object.weak = message.weak; if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) @@ -31757,7 +31849,7 @@ if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { object[".google.api.fieldBehavior"] = []; for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); @@ -33134,6 +33226,12 @@ if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; case "IDEMPOTENCY_UNKNOWN": case 0: message.idempotencyLevel = 0; @@ -33203,7 +33301,7 @@ if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -34958,6 +35056,12 @@ if (object.end != null) message.end = object.end | 0; switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; case "NONE": case 0: message.semantic = 0; @@ -35007,7 +35111,7 @@ if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; return object; }; From 4774d8151b82d8522714318f90a40f2f83ad6d59 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Nov 2022 02:01:42 +0100 Subject: [PATCH 508/513] chore(deps): update dependency jsdoc to v4 (#882) Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index aab000ecd3b..ef0eacf50f4 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -66,7 +66,7 @@ "google-auth-library": "^6.0.0", "gts": "^3.1.0", "http2spy": "^2.0.0", - "jsdoc": "^3.6.2", + "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^4.0.0", From 827f771f2c754065a0ebc2d64e2d89a06ab537e5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Nov 2022 02:26:13 +0100 Subject: [PATCH 509/513] chore(deps): update dependency @types/node to v18 (#875) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^16.0.0` -> `^18.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/16.18.3/18.11.9) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/compatibility-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/confidence-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate). --- packages/google-cloud-translate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index ef0eacf50f4..1b82941ff9d 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -57,7 +57,7 @@ "devDependencies": { "@types/extend": "^3.0.0", "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/proxyquire": "^1.3.28", "@types/request": "^2.47.1", "@types/sinon": "^10.0.0", From 5c9e1ae552a257b98b8c752f31a605144a2c0a5a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 11:23:39 -0800 Subject: [PATCH 510/513] chore(main): release 7.0.4 (#881) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 7.0.4 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-translate/CHANGELOG.md | 9 +++++++++ packages/google-cloud-translate/package.json | 2 +- .../v3/snippet_metadata.google.cloud.translation.v3.json | 2 +- ...nippet_metadata.google.cloud.translation.v3beta1.json | 2 +- packages/google-cloud-translate/samples/package.json | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-translate/CHANGELOG.md b/packages/google-cloud-translate/CHANGELOG.md index f11f2fda13d..a1a7e00d98b 100644 --- a/packages/google-cloud-translate/CHANGELOG.md +++ b/packages/google-cloud-translate/CHANGELOG.md @@ -4,6 +4,15 @@ [1]: https://www.npmjs.com/package/nodejs-translate?activeTab=versions +## [7.0.4](https://github.com/googleapis/nodejs-translate/compare/v7.0.3...v7.0.4) (2022-11-09) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#879](https://github.com/googleapis/nodejs-translate/issues/879)) ([c425c4d](https://github.com/googleapis/nodejs-translate/commit/c425c4dae9fa6dcf73d1e27381e561add26a1ffb)) +* update proto definitions ([933973b](https://github.com/googleapis/nodejs-translate/commit/933973b971c59a9a018b5b63d27f1a64da530b76)) +* Update proto definitions ([#883](https://github.com/googleapis/nodejs-translate/issues/883)) ([933973b](https://github.com/googleapis/nodejs-translate/commit/933973b971c59a9a018b5b63d27f1a64da530b76)) + ## [7.0.3](https://github.com/googleapis/nodejs-translate/compare/v7.0.2...v7.0.3) (2022-09-22) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 1b82941ff9d..848980f8672 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/translate", "description": "Cloud Translation API Client Library for Node.js", - "version": "7.0.3", + "version": "7.0.4", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json index 6d9176446b1..26f3106cae6 100644 --- a/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json +++ b/packages/google-cloud-translate/samples/generated/v3/snippet_metadata.google.cloud.translation.v3.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-translation", - "version": "7.0.3", + "version": "7.0.4", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json index 7b5396baef4..7a8f87432a3 100644 --- a/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json +++ b/packages/google-cloud-translate/samples/generated/v3beta1/snippet_metadata.google.cloud.translation.v3beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-translation", - "version": "7.0.3", + "version": "7.0.4", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-translate/samples/package.json b/packages/google-cloud-translate/samples/package.json index 248b9c5ce25..a00a6cfea65 100644 --- a/packages/google-cloud-translate/samples/package.json +++ b/packages/google-cloud-translate/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/automl": "^3.0.0", "@google-cloud/text-to-speech": "^4.0.0", - "@google-cloud/translate": "^7.0.3", + "@google-cloud/translate": "^7.0.4", "@google-cloud/vision": "^3.0.0", "yargs": "^16.0.0" }, From a19920418097a6e38abb5226ba94a41b467ac4dc Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Thu, 10 Nov 2022 13:09:51 -0800 Subject: [PATCH 511/513] build: add release-please config, fix owlbot-config --- .release-please-manifest.json | 15 ++++++------- .../{.github => }/.OwlBot.yaml | 6 ++---- .../.repo-metadata.json | 2 +- packages/google-cloud-translate/owlbot.py | 4 ++-- packages/google-cloud-translate/package.json | 13 ++++++++---- release-please-config.json | 21 ++++++++++--------- 6 files changed, 33 insertions(+), 28 deletions(-) rename packages/google-cloud-translate/{.github => }/.OwlBot.yaml (80%) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f89a1514960..04c74f12ae5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -12,10 +12,12 @@ "packages/google-cloud-bigquery-datapolicies": "0.1.2", "packages/google-cloud-bigquery-datatransfer": "3.1.5", "packages/google-cloud-bigquery-reservation": "2.0.4", - "packages/google-cloud-gkeconnect-gateway": "2.0.5", - "packages/google-cloud-deploy": "2.2.2", - "packages/google-cloud-dataplex": "2.2.2", "packages/google-cloud-certificatemanager": "0.6.2", + "packages/google-cloud-contentwarehouse": "0.1.2", + "packages/google-cloud-dataplex": "2.2.2", + "packages/google-cloud-deploy": "2.2.2", + "packages/google-cloud-discoveryengine": "0.2.0", + "packages/google-cloud-gkeconnect-gateway": "2.0.5", "packages/google-cloud-gkemulticloud": "0.1.4", "packages/google-cloud-language": "5.1.2", "packages/google-cloud-memcache": "2.1.4", @@ -27,12 +29,11 @@ "packages/google-cloud-resourcemanager": "4.1.3", "packages/google-cloud-security-publicca": "0.1.3", "packages/google-cloud-shell": "2.0.4", + "packages/google-cloud-translate": "7.0.4", "packages/google-devtools-artifactregistry": "2.0.2", "packages/google-iam": "0.2.2", + "packages/google-maps-addressvalidation": "0.1.0", "packages/google-maps-routing": "0.2.1", "packages/google-monitoring-dashboard": "2.8.0", - "packages/typeless-sample-bot": "1.1.0", - "packages/google-cloud-discoveryengine": "0.2.0", - "packages/google-cloud-contentwarehouse": "0.1.2", - "packages/google-maps-addressvalidation": "0.1.0" + "packages/typeless-sample-bot": "1.1.0" } diff --git a/packages/google-cloud-translate/.github/.OwlBot.yaml b/packages/google-cloud-translate/.OwlBot.yaml similarity index 80% rename from packages/google-cloud-translate/.github/.OwlBot.yaml rename to packages/google-cloud-translate/.OwlBot.yaml index 0bc4ec152bf..a23f55d15ff 100644 --- a/packages/google-cloud-translate/.github/.OwlBot.yaml +++ b/packages/google-cloud-translate/.OwlBot.yaml @@ -11,16 +11,14 @@ # 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. -docker: - image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest deep-remove-regex: - /owl-bot-staging deep-copy-regex: - - source: /google/cloud/translate/(v.*)/.*-nodejs/(.*) - dest: /owl-bot-staging/$1/$2 + - source: /google/cloud/translate/(v.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-translate/$1 begin-after-commit-hash: f43939eac6a0bb5998c1fa0f79063194e699230e diff --git a/packages/google-cloud-translate/.repo-metadata.json b/packages/google-cloud-translate/.repo-metadata.json index df42d3c00dc..331a181f16c 100644 --- a/packages/google-cloud-translate/.repo-metadata.json +++ b/packages/google-cloud-translate/.repo-metadata.json @@ -2,7 +2,7 @@ "distribution_name": "@google-cloud/translate", "release_level": "stable", "product_documentation": "https://cloud.google.com/translate/docs/", - "repo": "googleapis/nodejs-translate", + "repo": "googleapis/google-cloud-node", "default_version": "v3", "language": "nodejs", "requires_billing": true, diff --git a/packages/google-cloud-translate/owlbot.py b/packages/google-cloud-translate/owlbot.py index d0a0d9ac3c8..5aa32009522 100644 --- a/packages/google-cloud-translate/owlbot.py +++ b/packages/google-cloud-translate/owlbot.py @@ -14,6 +14,6 @@ """This script is used to synthesize generated parts of this library.""" -import synthtool.languages.node as node +import synthtool.languages.node_mono_repo as node -node.owlbot_main(templates_excludes=['src/index.ts']) +node.owlbot_main(relative_dir="packages/google-cloud-translate",templates_excludes=['src/index.ts']) diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 848980f8672..0f46768de59 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -7,7 +7,11 @@ "engines": { "node": ">=12.0.0" }, - "repository": "googleapis/nodejs-translate", + "repository": { + "type": "git", + "directory": "packages/google-cloud-translate", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, "main": "build/src/index.js", "types": "build/src/index.d.ts", "files": [ @@ -31,8 +35,8 @@ "docs": "jsdoc -c .jsdoc.js", "predocs": "npm run compile", "lint": "gts check", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha build/system-test --timeout 600000", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "system-test": "npm run compile && c8 mocha build/system-test", "test": "c8 mocha build/test", "compile": "tsc -p . && cp -r protos build/", "compile-protos": "compileProtos src", @@ -75,5 +79,6 @@ "proxyquire": "^2.0.1", "sinon": "^14.0.0", "typescript": "^4.6.4" - } + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-translate" } diff --git a/release-please-config.json b/release-please-config.json index 7a0625b3ae6..b0ebb3667a4 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,4 +1,5 @@ { + "initial-version": "0.1.0", "packages": { "packages/google-api-apikeys": {}, "packages/google-cloud-batch": {}, @@ -12,10 +13,12 @@ "packages/google-cloud-bigquery-datapolicies": {}, "packages/google-cloud-bigquery-datatransfer": {}, "packages/google-cloud-bigquery-reservation": {}, - "packages/google-cloud-gkeconnect-gateway": {}, - "packages/google-cloud-deploy": {}, - "packages/google-cloud-dataplex": {}, "packages/google-cloud-certificatemanager": {}, + "packages/google-cloud-contentwarehouse": {}, + "packages/google-cloud-dataplex": {}, + "packages/google-cloud-deploy": {}, + "packages/google-cloud-discoveryengine": {}, + "packages/google-cloud-gkeconnect-gateway": {}, "packages/google-cloud-gkemulticloud": {}, "packages/google-cloud-language": {}, "packages/google-cloud-memcache": {}, @@ -27,20 +30,18 @@ "packages/google-cloud-resourcemanager": {}, "packages/google-cloud-security-publicca": {}, "packages/google-cloud-shell": {}, + "packages/google-cloud-translate": {}, "packages/google-devtools-artifactregistry": {}, "packages/google-iam": {}, + "packages/google-maps-addressvalidation": {}, "packages/google-maps-routing": {}, "packages/google-monitoring-dashboard": {}, - "packages/typeless-sample-bot": {}, - "packages/google-cloud-discoveryengine": {}, - "packages/google-cloud-contentwarehouse": {}, - "packages/google-maps-addressvalidation": {} + "packages/typeless-sample-bot": {} }, "plugins": [ { "type": "sentence-case" } ], - "release-type": "node", - "initial-version": "0.1.0" -} \ No newline at end of file + "release-type": "node" +} From 712dacdfb98df2cdb7c21d1086104a162eaf45cf Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 10 Nov 2022 21:22:02 +0000 Subject: [PATCH 512/513] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= =?UTF-8?q?=20post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- packages/google-cloud-translate/.mocharc.js | 2 +- .../google-cloud-translate/.prettierrc.js | 2 +- packages/google-cloud-translate/README.md | 43 +- .../google-cloud-translate/samples/README.md | 406 +++++++++++++++--- packages/google-cloud-translate/src/index.ts | 67 +-- release-please-config.json | 2 +- 6 files changed, 382 insertions(+), 140 deletions(-) diff --git a/packages/google-cloud-translate/.mocharc.js b/packages/google-cloud-translate/.mocharc.js index 0b600509bed..cdb7b752160 100644 --- a/packages/google-cloud-translate/.mocharc.js +++ b/packages/google-cloud-translate/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/.prettierrc.js b/packages/google-cloud-translate/.prettierrc.js index d1b95106f4c..d546a4ad546 100644 --- a/packages/google-cloud-translate/.prettierrc.js +++ b/packages/google-cloud-translate/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-translate/README.md b/packages/google-cloud-translate/README.md index 9b1aeeb6d99..29695d26fd9 100644 --- a/packages/google-cloud-translate/README.md +++ b/packages/google-cloud-translate/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Cloud Translation: Node.js Client](https://github.com/googleapis/nodejs-translate) +# [Cloud Translation: Node.js Client](https://github.com/googleapis/google-cloud-node) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/translate.svg)](https://www.npmjs.org/package/@google-cloud/translate) @@ -10,19 +10,15 @@ -The [Cloud Translation API](https://cloud.google.com/translate/docs/), -can dynamically translate text between thousands -of language pairs. The Cloud Translation API lets websites and programs -integrate with the translation service programmatically. The Cloud Translation -API is part of the larger Cloud Machine Learning API family. +Cloud Translation API Client Library for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-translate/blob/main/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-translate/CHANGELOG.md). * [Cloud Translation Node.js Client API Reference][client-docs] * [Cloud Translation Documentation][product-docs] -* [github.com/googleapis/nodejs-translate](https://github.com/googleapis/nodejs-translate) +* [github.com/googleapis/google-cloud-node/packages/google-cloud-translate](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-translate) Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in [Client Libraries Explained][explained]. @@ -93,13 +89,32 @@ quickStart(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-translate/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Hybrid Glossaries | [source code](https://github.com/googleapis/nodejs-translate/blob/main/samples/hybridGlossaries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/hybridGlossaries.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/nodejs-translate/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Translate | [source code](https://github.com/googleapis/nodejs-translate/blob/main/samples/translate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/translate.js,samples/README.md) | +| Translation_service.batch_translate_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js,samples/README.md) | +| Translation_service.batch_translate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js,samples/README.md) | +| Translation_service.create_glossary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js,samples/README.md) | +| Translation_service.delete_glossary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js,samples/README.md) | +| Translation_service.detect_language | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js,samples/README.md) | +| Translation_service.get_glossary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js,samples/README.md) | +| Translation_service.get_supported_languages | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js,samples/README.md) | +| Translation_service.list_glossaries | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js,samples/README.md) | +| Translation_service.translate_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js,samples/README.md) | +| Translation_service.translate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js,samples/README.md) | +| Translation_service.batch_translate_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js,samples/README.md) | +| Translation_service.batch_translate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js,samples/README.md) | +| Translation_service.create_glossary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js,samples/README.md) | +| Translation_service.delete_glossary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js,samples/README.md) | +| Translation_service.detect_language | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js,samples/README.md) | +| Translation_service.get_glossary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js,samples/README.md) | +| Translation_service.get_supported_languages | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js,samples/README.md) | +| Translation_service.list_glossaries | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js,samples/README.md) | +| Translation_service.translate_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js,samples/README.md) | +| Translation_service.translate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/quickstart.js,samples/README.md) | +| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/test/quickstart.test.js,samples/README.md) | @@ -149,7 +164,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-translate/blob/main/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). Please note that this `README.md`, the `samples/README.md`, and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) @@ -161,7 +176,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-translate/blob/main/LICENSE) +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/translate/latest [product-docs]: https://cloud.google.com/translate/docs/ diff --git a/packages/google-cloud-translate/samples/README.md b/packages/google-cloud-translate/samples/README.md index 1bc6651dd1e..ca13a804e56 100644 --- a/packages/google-cloud-translate/samples/README.md +++ b/packages/google-cloud-translate/samples/README.md @@ -2,111 +2,387 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Cloud Translation: Node.js Samples](https://github.com/googleapis/nodejs-translate) +# [Cloud Translation: Node.js Samples](https://github.com/googleapis/google-cloud-node) [![Open in Cloud Shell][shell_img]][shell_link] -The [Cloud Translation API](https://cloud.google.com/translate/docs/), -can dynamically translate text between thousands -of language pairs. The Cloud Translation API lets websites and programs -integrate with the translation service programmatically. The Cloud Translation -API is part of the larger Cloud Machine Learning API family. + ## Table of Contents * [Before you begin](#before-you-begin) * [Samples](#samples) - * [Hybrid Glossaries](#hybrid-glossaries) + * [Translation_service.batch_translate_document](#translation_service.batch_translate_document) + * [Translation_service.batch_translate_text](#translation_service.batch_translate_text) + * [Translation_service.create_glossary](#translation_service.create_glossary) + * [Translation_service.delete_glossary](#translation_service.delete_glossary) + * [Translation_service.detect_language](#translation_service.detect_language) + * [Translation_service.get_glossary](#translation_service.get_glossary) + * [Translation_service.get_supported_languages](#translation_service.get_supported_languages) + * [Translation_service.list_glossaries](#translation_service.list_glossaries) + * [Translation_service.translate_document](#translation_service.translate_document) + * [Translation_service.translate_text](#translation_service.translate_text) + * [Translation_service.batch_translate_document](#translation_service.batch_translate_document) + * [Translation_service.batch_translate_text](#translation_service.batch_translate_text) + * [Translation_service.create_glossary](#translation_service.create_glossary) + * [Translation_service.delete_glossary](#translation_service.delete_glossary) + * [Translation_service.detect_language](#translation_service.detect_language) + * [Translation_service.get_glossary](#translation_service.get_glossary) + * [Translation_service.get_supported_languages](#translation_service.get_supported_languages) + * [Translation_service.list_glossaries](#translation_service.list_glossaries) + * [Translation_service.translate_document](#translation_service.translate_document) + * [Translation_service.translate_text](#translation_service.translate_text) * [Quickstart](#quickstart) - * [Translate](#translate) + * [Quickstart.test](#quickstart.test) ## Before you begin Before running the samples, make sure you've followed the steps outlined in -[Using the client library](https://github.com/googleapis/nodejs-translate#using-the-client-library). +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). -### Choosing between Advanced v3 and Basic v2 +`cd samples` -Basic supports language detection and text translation [Cloud Translation - Basic v2](https://cloud.google.com/translate/docs/editions#basic). +`npm install` -The advanced edition of [Cloud Translation - V3](https://cloud.google.com/translate/docs/editions#advanced) is optimized for customization and long form content use cases including glossary, batch, and model selection. +`cd ..` -### Translate V3 Beta Samples +## Samples -#### Install Dependencies -From the [root directory](https://github.com/googleapis/nodejs-translate) of the client library install the dependencies: -``` -npm install -``` +### Translation_service.batch_translate_document -Change to the samples directory, link the google-cloud/translate library from the parent, and install its dependencies: +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js). -``` -cd samples/ -npm link ../ -npm install -``` +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js,samples/README.md) -#### Run the Tests +__Usage:__ -To run the tests for the entire sample, run -``` -npm test -``` +`node packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_document.js` -To run the tests for only the translate v3 samples, run -``` -npm run test-v3 -``` +----- -To run the tests for a single translate v3 sample, run this command, substituting FILE_NAME with the name of a valid test file. -``` -./node_modules/.bin/mocha test/v3beta1/FILE_NAME -``` -For example, to test the `translate_list_language_names_beta` sample, the command would be -``` -./node_modules/.bin/mocha test/v3beta1/translate_list_language_names_beta.test.js -``` +### Translation_service.batch_translate_text -To run a sample directly, call the file with the `node` command and any required CLI arguments: +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js). -``` -node v3beta1/FILE_NAME -``` +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js,samples/README.md) -For example, to run the `translate_list_codes_beta` sample, you would run the following command, substituting your project ID in place of "your_project_id" +__Usage:__ -``` -node v3beta1/translate_list_codes_beta.js "your_project_id" -``` -`cd samples` +`node packages/google-cloud-translate/samples/generated/v3/translation_service.batch_translate_text.js` -`npm install` -`cd ..` +----- + + + + +### Translation_service.create_glossary + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3/translation_service.create_glossary.js` + + +----- + + + + +### Translation_service.delete_glossary + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3/translation_service.delete_glossary.js` + + +----- + + + + +### Translation_service.detect_language + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3/translation_service.detect_language.js` + + +----- + + + + +### Translation_service.get_glossary + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3/translation_service.get_glossary.js` + + +----- + + + + +### Translation_service.get_supported_languages + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3/translation_service.get_supported_languages.js` + + +----- + + + + +### Translation_service.list_glossaries + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3/translation_service.list_glossaries.js` + + +----- + + + + +### Translation_service.translate_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3/translation_service.translate_document.js` + + +----- + + + + +### Translation_service.translate_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3/translation_service.translate_text.js` + + +----- + + + + +### Translation_service.batch_translate_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_document.js` + + +----- + + + + +### Translation_service.batch_translate_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3beta1/translation_service.batch_translate_text.js` + + +----- + + + + +### Translation_service.create_glossary + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3beta1/translation_service.create_glossary.js` + + +----- + + + + +### Translation_service.delete_glossary + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3beta1/translation_service.delete_glossary.js` + + +----- + + + + +### Translation_service.detect_language + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3beta1/translation_service.detect_language.js` + + +----- + + + + +### Translation_service.get_glossary + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_glossary.js` + + +----- + + + + +### Translation_service.get_supported_languages + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3beta1/translation_service.get_supported_languages.js` + + +----- + + + + +### Translation_service.list_glossaries + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3beta1/translation_service.list_glossaries.js` + + +----- + + + + +### Translation_service.translate_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_document.js` + + +----- -## Samples -### Hybrid Glossaries +### Translation_service.translate_text -View the [source code](https://github.com/googleapis/nodejs-translate/blob/main/samples/hybridGlossaries.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/hybridGlossaries.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js,samples/README.md) __Usage:__ -`node samples/hybridGlossaries.js` +`node packages/google-cloud-translate/samples/generated/v3beta1/translation_service.translate_text.js` ----- @@ -116,14 +392,14 @@ __Usage:__ ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-translate/blob/main/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/quickstart.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/quickstart.js,samples/README.md) __Usage:__ -`node samples/quickstart.js` +`node packages/google-cloud-translate/samples/quickstart.js` ----- @@ -131,16 +407,16 @@ __Usage:__ -### Translate +### Quickstart.test -View the [source code](https://github.com/googleapis/nodejs-translate/blob/main/samples/translate.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/test/quickstart.test.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/translate.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-translate/samples/test/quickstart.test.js,samples/README.md) __Usage:__ -`node samples/translate.js` +`node packages/google-cloud-translate/samples/test/quickstart.test.js` @@ -148,5 +424,5 @@ __Usage:__ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-translate&page=editor&open_in_editor=samples/README.md +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md [product-docs]: https://cloud.google.com/translate/docs/ diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 1c62551b4a1..ac6281adf90 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2015 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,68 +11,19 @@ // 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. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** import * as v2 from './v2'; - -/** - * The `@google-cloud/translate` package has the following named exports: - * - * - `{@link TranslationServiceClient}` class - constructor for v3 of the Translation API. - * See {@link v3.TranslationServiceClient} for client methods. - * - `v3` - client for the v3 backend service version. It exports: - * - `TranslationServiceClient` - Reference to {@link v3.TranslationServiceClient} - * - `v3beta1` - client for the v3beta1 backend service version. It exports: - * - `TranslationServiceClient` - Reference to {@link v3beta1.TranslationServiceClient} - * - `v2` - client for the v2 backend service version. It exports: - * - `Translate` - Reference to {@link v2.Translate} - * - * @module {constructor} @google-cloud/translate - * @alias nodejs-translate - * - * @example Install the v3 client library with npm: - * ``` - * npm install --save @google-cloud/translate - * - * ``` - * @example Import the v3 client library: - * ``` - * const {TranslationServiceClient} = require('@google-cloud/translate'); - * - * ``` - * @example Create a v3 client that uses Application Default Credentials (ADC): - * ``` - * const client = new TranslationServiceClient(); - * - * ``` - * @example include:samples/quickstart.js - * region_tag:translate_quickstart - * Full quickstart example: - * - * @example Install the v3beta1 client library: - * ``` - * npm install --save @google-cloud/translate - * - * ``` - * @example Import the v3beta1 client library: - * ``` - * const {TranslationServiceClient} = - * require('@google-cloud/translate').v3beta1; - * ``` - */ -import * as v3beta1 from './v3beta1'; import * as v3 from './v3'; -export * from './v3'; +import * as v3beta1 from './v3beta1'; const TranslationServiceClient = v3.TranslationServiceClient; type TranslationServiceClient = v3.TranslationServiceClient; -export {TranslationServiceClient, v2, v3beta1, v3}; -// For compatibility with JavaScript libraries we need to provide this default export: -// tslint:disable-next-line no-default-export -export default { - v2, - v3beta1, - v3, - TranslationServiceClient, -}; + +export {v2, v3, v3beta1, TranslationServiceClient}; +export default {v2, v3, v3beta1, TranslationServiceClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/release-please-config.json b/release-please-config.json index b0ebb3667a4..c25ec57be39 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -44,4 +44,4 @@ } ], "release-type": "node" -} +} \ No newline at end of file From eaf0fb5e8b703d3243ff3f34a2492c382dc19469 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 10 Nov 2022 13:47:40 -0800 Subject: [PATCH 513/513] Delete translate.ts --- .../system-test/translate.ts | 224 ------------------ 1 file changed, 224 deletions(-) delete mode 100644 packages/google-cloud-translate/system-test/translate.ts diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts deleted file mode 100644 index 5c20f46ba10..00000000000 --- a/packages/google-cloud-translate/system-test/translate.ts +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright 2015 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 -// -// https://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. - -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -import {TranslationServiceClient} from '../src'; - -// eslint-disable-next-line @typescript-eslint/no-var-requires -const http2spy = require('http2spy'); - -describe('translate', () => { - const translate = new TranslationServiceClient(); - - describe('detecting language from input', () => { - const INPUT = [ - { - content: 'Hello!', - expectedLanguage: 'en', - }, - { - content: 'Esto es una prueba.', - expectedLanguage: 'es', - }, - ]; - - it('should detect a language', async () => { - const projectId = await translate.getProjectId(); - for (const input of INPUT) { - const [result] = await translate.detectLanguage({ - content: input.content, - parent: `projects/${projectId}`, - }); - assert.strictEqual( - result.languages![0].languageCode, - input.expectedLanguage - ); - } - }); - }); - - describe('translations', () => { - const INPUT = [ - { - content: 'Hello!', - expectedTranslation: 'Hola', - }, - { - content: 'How are you today?', - expectedTranslation: 'Cómo estás hoy', - }, - ]; - - function removeSymbols(input: string) { - // Remove the leading and trailing ! or ? symbols. The API has been known - // to switch back and forth between returning "Cómo estás hoy" and - // "¿Cómo estás hoy?", so let's just not depend on that. - return input.replace(/^\W|\W*$/g, ''); - } - - it('should translate input', async () => { - const projectId = await translate.getProjectId(); - const [results] = await translate.translateText({ - contents: INPUT.map(intput => intput.content), - sourceLanguageCode: 'en', - targetLanguageCode: 'es', - parent: `projects/${projectId}`, - }); - const translations = results.translations!.map(translation => - removeSymbols(translation.translatedText as string) - ); - assert.strictEqual(translations[0], INPUT[0].expectedTranslation); - assert.strictEqual(translations[1], INPUT[1].expectedTranslation); - }); - - it('should autodetect HTML', async () => { - const input = '' + INPUT[0].content + ''; - const projectId = await translate.getProjectId(); - const [results] = await translate.translateText({ - contents: [input], - sourceLanguageCode: 'en', - targetLanguageCode: 'es', - parent: `projects/${projectId}`, - }); - const translation = (results.translations![0].translatedText as string) - .split(/<\/*body>/g)[1] - .trim(); - assert.strictEqual( - removeSymbols(translation), - INPUT[0].expectedTranslation - ); - }); - }); - - describe('supported languages', () => { - it('should get a list of supported languages', async () => { - const projectId = await translate.getProjectId(); - const [result] = await translate.getSupportedLanguages({ - parent: `projects/${projectId}`, - }); - const englishResult = result.languages!.filter( - l => l.languageCode === 'en' - )[0]; - assert.deepStrictEqual(englishResult, { - languageCode: 'en', - displayName: '', - supportSource: true, - supportTarget: true, - }); - }); - - it('should accept displayLanguageCode, and show appropriate displayName', async () => { - const projectId = await translate.getProjectId(); - const [result] = await translate.getSupportedLanguages({ - parent: `projects/${projectId}`, - displayLanguageCode: 'es', - }); - const englishResult = result.languages!.filter( - l => l.languageCode === 'en' - )[0]; - assert.deepStrictEqual(englishResult, { - languageCode: 'en', - displayName: 'inglés', - supportSource: true, - supportTarget: true, - }); - }); - - it('should populate x-goog-user-project header, and succeed if valid project', async () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const {GoogleAuth} = require('google-auth-library'); - const auth = new GoogleAuth({ - credentials: Object.assign( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require(process.env.GOOGLE_APPLICATION_CREDENTIALS || ''), - { - quota_project_id: process.env.GCLOUD_PROJECT, - } - ), - }); - const gax = http2spy.require('google-gax'); - const translate = new TranslationServiceClient( - { - auth, - }, - gax - ); - - // We run the same test as "list of supported languages", but with an - // alternate "quota_project_id" set; Given that GCLOUD_PROJECT - // references a valid project, we expect success: - const projectId = await translate.getProjectId(); - // This should not hrow an exception: - await translate.getSupportedLanguages({ - parent: `projects/${projectId}`, - }); - // Ensure we actually populated the header: - assert.strictEqual( - process.env.GCLOUD_PROJECT, - http2spy.requests[http2spy.requests.length - 1][ - 'x-goog-user-project' - ][0] - ); - }); - - it('should populate x-goog-user-project header, and fail if invalid project', async () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const {GoogleAuth} = require('google-auth-library'); - const auth = new GoogleAuth({ - credentials: Object.assign( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require(process.env.GOOGLE_APPLICATION_CREDENTIALS || ''), - { - quota_project_id: 'my-fake-billing-project', - } - ), - }); - const gax = http2spy.require('google-gax'); - const translate = new TranslationServiceClient( - { - auth, - }, - gax - ); - - // We set a quota project "my-fake-billing-project" that does not exist, - // this should result in an error. - let err: Error | null = null; - try { - const projectId = await translate.getProjectId(); - await translate.getSupportedLanguages({ - parent: `projects/${projectId}`, - }); - } catch (_err) { - err = _err as Error; - } - assert(err); - assert( - err!.message.includes( - // make sure the error included our fake project name, we shouldn't - // be too specific about the error incase it changes upstream. - 'my-fake-billing-project' - ), - err!.message - ); - assert.strictEqual( - 'my-fake-billing-project', - http2spy.requests[http2spy.requests.length - 1][ - 'x-goog-user-project' - ][0] - ); - }); - }); -});